841{
845
847 {
848
849
855
860
863
864 SetEnginePos("0 0.7 1.2");
865 }
866
868 {
869 super.EEInit();
870
872 {
879
882 }
883 }
884
886 {
887 super.OnEngineStart();
888
890 {
892 }
893 }
894
896 {
897 super.OnEngineStop();
898
900 {
902 }
903 }
904
906 {
908 {
910 {
912 }
913 }
914 }
915
917 {
919 }
920
922 {
923 return 3.5;
924 }
925
927 {
928 switch (posIdx)
929 {
930 case 0:
932 case 1:
934 case 2:
936 case 3:
938 }
939
940 return 0;
941
942 }
943
944
946 {
948 }
949
951 {
953 }
954
956 {
957 if (!super.CanReleaseAttachment(attachment))
958 {
959 return false;
960 }
961
963 {
964 string attType = attachment.GetType();
965 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
966 {
967 return false;
968 }
969 }
970
971 return true;
972 }
973
975 {
977 }
978
980 {
981 if (!super.CanDisplayAttachmentCategory(category_name))
982 {
983 return false;
984 }
985
987 if (category_name.
Contains(
"engine"))
988 {
990 {
991 return false;
992 }
993 }
994
995 return true;
996 }
997
999 {
1000 if (!super.CanDisplayCargo())
1001 {
1002 return false;
1003 }
1004
1006 {
1007 return false;
1008 }
1009
1010 return true;
1011 }
1012
1014 {
1016
1017 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
1018 if (!carDoor)
1019 {
1021 }
1022
1023 switch (slotType)
1024 {
1025 case "NivaDriverDoors":
1027
1028 case "NivaCoDriverDoors":
1030
1031 case "NivaHood":
1033
1034 case "NivaTrunk":
1036 }
1037
1039 }
1040
1042 {
1044 switch (posIdx)
1045 {
1046 case 0:
1048 return false;
1049 else if (GetAnimationPhase("SeatDriver") > 0.5)
1050 return false;
1051
1052 return true;
1053
1054 case 1:
1056 return false;
1057 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1058 return false;
1059
1060 return true;
1061
1062 case 2:
1064 return false;
1065 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1066 return false;
1067
1068 return true;
1069
1070 case 3:
1072 return false;
1073 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1074 return false;
1075
1076 return true;
1077 }
1078
1079 return false;
1080 }
1081
1083 {
1084 switch (posIdx)
1085 {
1086 case 0:
1087 case 2:
1088 return "doors_driver";
1089 case 1:
1090 case 3:
1091 return "doors_codriver";
1092 }
1093
1094 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1095 }
1096
1098 {
1099 switch (posIdx)
1100 {
1101 case 0:
1102 case 2:
1103 return "NivaDriverDoors";
1104 case 1:
1105 case 3:
1106 return "NivaCoDriverDoors";
1107 }
1108
1109 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1110 }
1111
1112
1113
1115 {
1116 float tempCap = 0.0;
1117
1118 switch (ctrl)
1119 {
1121 float newValue = 0;
1123 {
1124 newValue += 0.5;
1125 }
1126
1128 {
1129 newValue += 0.5;
1130 }
1131
1133 {
1134 newValue += 0.3;
1135 }
1136
1138 {
1139 newValue -= 0.6;
1140 }
1141
1143 {
1144 newValue -= 0.2;
1145 }
1146
1148 {
1149 newValue -= 0.2;
1150 }
1151
1153 break;
1154 }
1155
1156 return super.OnSound(ctrl, oldValue);
1157 }
1158
1160 {
1161 switch (selection)
1162 {
1163 case "doors_driver":
1164 return "DoorsDriver";
1165 case "doors_codriver":
1166 return "DoorsCoDriver";
1167 case "doors_hood":
1168 return "DoorsHood";
1169 case "doors_trunk":
1170 return "DoorsTrunk";
1171 case "seatback_driver":
1172 return "SeatDriver";
1173 case "seatback_codriver":
1174 return "SeatCoDriver";
1175 }
1176
1177 return "";
1178 }
1179
1181 {
1182 switch (selection)
1183 {
1184 case "seat_driver":
1185 case "seatback_driver":
1186 case "seat_cargo1":
1187 return "seat_con_1_1";
1188 case "seat_codriver":
1189 case "seatback_codriver":
1190 case "seat_cargo2":
1191 return "seat_con_2_1";
1192 }
1193
1194 return "";
1195 }
1196
1198 {
1199 switch (selection)
1200 {
1201 case "seatback_driver":
1202 return 0;
1203 case "seatback_codriver":
1204 return 1;
1205 }
1206
1207 return -1;
1208 }
1209
1211 {
1212 return false;
1213 }
1214
1216 {
1217 return false;
1218 }
1219
1221 {
1222 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1223 return false;
1224
1225 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1226 return false;
1227
1228 switch (currentSeat)
1229 {
1230 case 0:
1231 return nextSeat == 1;
1232
1233 case 1:
1234 return nextSeat == 0;
1235
1236 case 2:
1237 return nextSeat == 3;
1238
1239 case 3:
1240 return nextSeat == 2;
1241 }
1242
1243 return false;
1244 }
1245
1247 {
1248 switch (pCurrentSeat)
1249 {
1250 case 0:
1251 return pDoorsSelection == "DoorsDriver";
1252
1253 case 1:
1254 return pDoorsSelection == "DoorsCoDriver";
1255
1256 case 2:
1257 return pDoorsSelection == "DoorsDriver";
1258
1259 case 3:
1260 return pDoorsSelection == "DoorsCoDriver";
1261 }
1262
1263 return false;
1264 }
1265
1267 {
1268 switch (pDoorSelection)
1269 {
1270 case "DoorsDriver":
1271 return 0;
1272 case "DoorsCoDriver":
1273 return 1;
1274 }
1275
1276 return -1;
1277 }
1278
1280 {
1281 super.SetActions();
1282
1284 }
1285
1287 {
1291
1292 GetInventory().CreateInInventory("HatchbackWheel");
1293 GetInventory().CreateInInventory("HatchbackWheel");
1294 GetInventory().CreateInInventory("HatchbackWheel" );
1295 GetInventory().CreateInInventory("HatchbackWheel");
1296
1297 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1298 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1299 GetInventory().CreateInInventory("HatchbackHood");
1300 GetInventory().CreateInInventory("HatchbackTrunk");
1301
1302
1303 GetInventory().CreateInInventory("HatchbackWheel");
1304 GetInventory().CreateInInventory("HatchbackWheel");
1305 }
1306}
1307
1309{
1311 {
1315
1316 GetInventory().CreateInInventory("HatchbackWheel");
1317 GetInventory().CreateInInventory("HatchbackWheel");
1318 GetInventory().CreateInInventory("HatchbackWheel");
1319 GetInventory().CreateInInventory("HatchbackWheel");
1320
1321 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1322 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1323 GetInventory().CreateInInventory("HatchbackHood_White");
1324 GetInventory().CreateInInventory("HatchbackTrunk_White");
1325
1326
1327 GetInventory().CreateInInventory("HatchbackWheel");
1328 GetInventory().CreateInInventory("HatchbackWheel");
1329 }
1330}
1331
1333{
1335 {
1339
1340 GetInventory().CreateInInventory("HatchbackWheel");
1341 GetInventory().CreateInInventory("HatchbackWheel");
1342 GetInventory().CreateInInventory("HatchbackWheel");
1343 GetInventory().CreateInInventory("HatchbackWheel");
1344
1345 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1346 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1347 GetInventory().CreateInInventory("HatchbackHood_Blue");
1348 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1349
1350
1351 GetInventory().CreateInInventory("HatchbackWheel");
1352 GetInventory().CreateInInventory("HatchbackWheel");
1353 }
1354}
void AddAction(typename actionName)
CarSoundCtrl
Car's sound controller list. (native, do not change or extend)
void SpawnUniversalParts()
string m_CarSeatShiftInSound
CarDoorState TranslateAnimationPhaseToCarDoorState(string animation)
void SpawnAdditionalItems()
string m_EngineStartOK
Sounds.
string m_CarDoorCloseSound
string m_EngineStartBattery
string m_CarHornShortSoundName
string m_CarHornLongSoundName
string m_CarSeatShiftOutSound
string m_CarDoorOpenSound
ref UniversalTemperatureSourceLambdaEngine m_UTSLEngine
ref UniversalTemperatureSourceSettings m_UTSSettings
ref UniversalTemperatureSource m_UTSource
override void SetActions()
override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
override string GetAnimSourceFromSelection(string selection)
override int GetSeatAnimationType(int posIdx)
override string GetDoorConditionPointFromSelection(string selection)
override float OnSound(CarSoundCtrl ctrl, float oldValue)
override string GetDoorInvSlotNameFromSeatPos(int posIdx)
override void EOnPostSimulate(IEntity other, float timeSlice)
override void OnEngineStop()
override float GetTransportCameraDistance()
override bool CanReleaseAttachment(EntityAI attachment)
override bool CanDisplayCargo()
override void OnEngineStart()
override CarLightBase CreateFrontLight()
override int GetAnimInstance()
override bool CrewCanGetThrough(int posIdx)
override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
bool CanManipulateSpareWheel(string slotSelectionName)
override bool IsVitalGlowPlug()
override CarRearLightBase CreateRearLight()
class OffroadHatchback extends CarScript OnDebugSpawn()
override int GetSeatIndexFromDoor(string pDoorSelection)
override bool IsVitalTruckBattery()
override string GetDoorSelectionNameFromSeatPos(int posIdx)
override int GetCarDoorsState(string slotType)
override int GetCrewIndex(string selection)
override bool CanDisplayAttachmentCategory(string category_name)
UniversalTemperatureSourceLambdaBaseImpl UniversalTemperatureSourceLambdaBase UniversalTemperatureSourceLambdaEngine()
Super root of all classes in Enforce script.
override void OnDebugSpawn()
original Timer deletes m_params which is unwanted
DayZPlayerConstants
defined in C++
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
bool Contains(string sample)
Returns true if sample is substring of string.
proto int ToLower()
Changes string to lowercase. Returns length.