899{
903
905 {
906
907
908 m_EngineStartOK = "offroad_engine_start_SoundSet";
909 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
910 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
911 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
912 m_EngineStop = "offroad_engine_stop_SoundSet";
913 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
914
915 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
916 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
917 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
918 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
919
920 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
921 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
922
923 SetEnginePos("0 0.7 1.2");
924 }
925
927 {
928 super.EEInit();
929
931 {
938
941 }
942 }
943
945 {
946 super.OnEngineStart();
947
949 {
951 }
952 }
953
955 {
956 super.OnEngineStop();
957
959 {
961 }
962 }
963
965 {
967 {
969 {
971 }
972 }
973 }
974
976 {
978 }
979
981 {
982 return 3.5;
983 }
984
986 {
987 switch (posIdx)
988 {
989 case 0:
991 case 1:
993 case 2:
995 case 3:
997 }
998
999 return 0;
1000
1001 }
1002
1003
1005 {
1007 }
1008
1010 {
1012 }
1013
1015 {
1016 if (!super.CanReleaseAttachment(attachment))
1017 {
1018 return false;
1019 }
1020
1022 {
1023 string attType = attachment.GetType();
1024 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
1025 {
1026 return false;
1027 }
1028 }
1029
1030 return true;
1031 }
1032
1034 {
1036 }
1037
1039 {
1040 if (!super.CanDisplayAttachmentCategory(category_name))
1041 {
1042 return false;
1043 }
1044
1046 if (category_name.
Contains(
"engine"))
1047 {
1049 {
1050 return false;
1051 }
1052 }
1053
1054 return true;
1055 }
1056
1058 {
1059 if (!super.CanDisplayCargo())
1060 {
1061 return false;
1062 }
1063
1065 {
1066 return false;
1067 }
1068
1069 return true;
1070 }
1071
1073 {
1075
1076 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
1077 if (!carDoor)
1078 {
1080 }
1081
1082 switch (slotType)
1083 {
1084 case "NivaDriverDoors":
1085 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
1086
1087 case "NivaCoDriverDoors":
1088 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
1089
1090 case "NivaHood":
1091 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
1092
1093 case "NivaTrunk":
1094 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
1095 }
1096
1098 }
1099
1101 {
1103 switch (posIdx)
1104 {
1105 case 0:
1107 return false;
1108 else if (GetAnimationPhase("SeatDriver") > 0.5)
1109 return false;
1110
1111 return true;
1112
1113 case 1:
1115 return false;
1116 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1117 return false;
1118
1119 return true;
1120
1121 case 2:
1123 return false;
1124 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1125 return false;
1126
1127 return true;
1128
1129 case 3:
1131 return false;
1132 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1133 return false;
1134
1135 return true;
1136 }
1137
1138 return false;
1139 }
1140
1142 {
1143 switch (posIdx)
1144 {
1145 case 0:
1146 case 2:
1147 return "doors_driver";
1148 case 1:
1149 case 3:
1150 return "doors_codriver";
1151 }
1152
1153 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1154 }
1155
1157 {
1158 switch (posIdx)
1159 {
1160 case 0:
1161 case 2:
1162 return "NivaDriverDoors";
1163 case 1:
1164 case 3:
1165 return "NivaCoDriverDoors";
1166 }
1167
1168 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1169 }
1170
1171
1172
1174 {
1175 float tempCap = 0.0;
1176
1177 switch (ctrl)
1178 {
1180 float newValue = 0;
1182 {
1183 newValue += 0.5;
1184 }
1185
1187 {
1188 newValue += 0.5;
1189 }
1190
1192 {
1193 newValue += 0.3;
1194 }
1195
1197 {
1198 newValue -= 0.6;
1199 }
1200
1202 {
1203 newValue -= 0.2;
1204 }
1205
1207 {
1208 newValue -= 0.2;
1209 }
1210
1212 break;
1213 }
1214
1215 return super.OnSound(ctrl, oldValue);
1216 }
1217
1219 {
1220 switch (selection)
1221 {
1222 case "doors_driver":
1223 return "DoorsDriver";
1224 case "doors_codriver":
1225 return "DoorsCoDriver";
1226 case "doors_hood":
1227 return "DoorsHood";
1228 case "doors_trunk":
1229 return "DoorsTrunk";
1230 case "seatback_driver":
1231 return "SeatDriver";
1232 case "seatback_codriver":
1233 return "SeatCoDriver";
1234 }
1235
1236 return "";
1237 }
1238
1240 {
1241 switch (selection)
1242 {
1243 case "seat_driver":
1244 case "seatback_driver":
1245 case "seat_cargo1":
1246 return "seat_con_1_1";
1247 case "seat_codriver":
1248 case "seatback_codriver":
1249 case "seat_cargo2":
1250 return "seat_con_2_1";
1251 }
1252
1253 return "";
1254 }
1255
1257 {
1258 switch (selection)
1259 {
1260 case "seatback_driver":
1261 return 0;
1262 case "seatback_codriver":
1263 return 1;
1264 }
1265
1266 return -1;
1267 }
1268
1270 {
1271 return false;
1272 }
1273
1275 {
1276 return false;
1277 }
1278
1280 {
1281 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1282 return false;
1283
1284 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1285 return false;
1286
1287 switch (currentSeat)
1288 {
1289 case 0:
1290 return nextSeat == 1;
1291
1292 case 1:
1293 return nextSeat == 0;
1294
1295 case 2:
1296 return nextSeat == 3;
1297
1298 case 3:
1299 return nextSeat == 2;
1300 }
1301
1302 return false;
1303 }
1304
1306 {
1307 switch (pCurrentSeat)
1308 {
1309 case 0:
1310 return pDoorsSelection == "DoorsDriver";
1311
1312 case 1:
1313 return pDoorsSelection == "DoorsCoDriver";
1314
1315 case 2:
1316 return pDoorsSelection == "DoorsDriver";
1317
1318 case 3:
1319 return pDoorsSelection == "DoorsCoDriver";
1320 }
1321
1322 return false;
1323 }
1324
1326 {
1327 switch (pDoorSelection)
1328 {
1329 case "DoorsDriver":
1330 return 0;
1331 case "DoorsCoDriver":
1332 return 1;
1333 }
1334
1335 return -1;
1336 }
1337
1339 {
1340 super.SetActions();
1341
1343 }
1344
1346 {
1347 SpawnUniversalParts();
1348 SpawnAdditionalItems();
1349 FillUpCarFluids();
1350
1351 GetInventory().CreateInInventory("HatchbackWheel");
1352 GetInventory().CreateInInventory("HatchbackWheel");
1353 GetInventory().CreateInInventory("HatchbackWheel" );
1354 GetInventory().CreateInInventory("HatchbackWheel");
1355
1356 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1357 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1358 GetInventory().CreateInInventory("HatchbackHood");
1359 GetInventory().CreateInInventory("HatchbackTrunk");
1360
1361
1362 GetInventory().CreateInInventory("HatchbackWheel");
1363 GetInventory().CreateInInventory("HatchbackWheel");
1364 }
1365}
1366
1368{
1370 {
1371 SpawnUniversalParts();
1372 SpawnAdditionalItems();
1373 FillUpCarFluids();
1374
1375 GetInventory().CreateInInventory("HatchbackWheel");
1376 GetInventory().CreateInInventory("HatchbackWheel");
1377 GetInventory().CreateInInventory("HatchbackWheel");
1378 GetInventory().CreateInInventory("HatchbackWheel");
1379
1380 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1381 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1382 GetInventory().CreateInInventory("HatchbackHood_White");
1383 GetInventory().CreateInInventory("HatchbackTrunk_White");
1384
1385
1386 GetInventory().CreateInInventory("HatchbackWheel");
1387 GetInventory().CreateInInventory("HatchbackWheel");
1388 }
1389}
1390
1392{
1394 {
1395 SpawnUniversalParts();
1396 SpawnAdditionalItems();
1397 FillUpCarFluids();
1398
1399 GetInventory().CreateInInventory("HatchbackWheel");
1400 GetInventory().CreateInInventory("HatchbackWheel");
1401 GetInventory().CreateInInventory("HatchbackWheel");
1402 GetInventory().CreateInInventory("HatchbackWheel");
1403
1404 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1405 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1406 GetInventory().CreateInInventory("HatchbackHood_Blue");
1407 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1408
1409
1410 GetInventory().CreateInInventory("HatchbackWheel");
1411 GetInventory().CreateInInventory("HatchbackWheel");
1412 }
1413}
void AddAction(typename actionName)
CarSoundCtrl
Car's sound controller list. (native, do not change or extend)
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.