912{
916
918 {
919
920
921 m_EngineStartOK = "offroad_engine_start_SoundSet";
922 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
923 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
924 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
925 m_EngineStop = "offroad_engine_stop_SoundSet";
926 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
927
928 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
929 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
930 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
931 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
932
933 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
934 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
935
936 SetEnginePos("0 0.7 1.2");
937 }
938
940 {
941 super.EEInit();
942
944 {
951
954 }
955 }
956
958 {
959 super.OnEngineStart();
960
962 {
964 }
965 }
966
968 {
969 super.OnEngineStop();
970
972 {
974 }
975 }
976
978 {
980 {
982 {
984 }
985 }
986 }
987
989 {
991 }
992
994 {
995 return 3.5;
996 }
997
999 {
1000 switch (posIdx)
1001 {
1002 case 0:
1004 case 1:
1006 case 2:
1008 case 3:
1010 }
1011
1012 return 0;
1013
1014 }
1015
1016
1018 {
1020 }
1021
1023 {
1025 }
1026
1028 {
1029 if (!super.CanReleaseAttachment(attachment))
1030 {
1031 return false;
1032 }
1033
1035 {
1036 string attType = attachment.GetType();
1037 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
1038 {
1039 return false;
1040 }
1041 }
1042
1043 return true;
1044 }
1045
1047 {
1049 }
1050
1052 {
1053 if (!super.CanDisplayAttachmentCategory(category_name))
1054 {
1055 return false;
1056 }
1057
1059 if (category_name.
Contains(
"engine"))
1060 {
1062 {
1063 return false;
1064 }
1065 }
1066
1067 return true;
1068 }
1069
1071 {
1072 if (!super.CanDisplayCargo())
1073 {
1074 return false;
1075 }
1076
1078 {
1079 return false;
1080 }
1081
1082 return true;
1083 }
1084
1086 {
1088
1089 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
1090 if (!carDoor)
1091 {
1093 }
1094
1095 switch (slotType)
1096 {
1097 case "NivaDriverDoors":
1098 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
1099
1100 case "NivaCoDriverDoors":
1101 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
1102
1103 case "NivaHood":
1104 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
1105
1106 case "NivaTrunk":
1107 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
1108 }
1109
1111 }
1112
1114 {
1116 switch (posIdx)
1117 {
1118 case 0:
1120 return false;
1121 else if (GetAnimationPhase("SeatDriver") > 0.5)
1122 return false;
1123
1124 return true;
1125
1126 case 1:
1128 return false;
1129 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1130 return false;
1131
1132 return true;
1133
1134 case 2:
1136 return false;
1137 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1138 return false;
1139
1140 return true;
1141
1142 case 3:
1144 return false;
1145 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1146 return false;
1147
1148 return true;
1149 }
1150
1151 return false;
1152 }
1153
1155 {
1156 switch (posIdx)
1157 {
1158 case 0:
1159 case 2:
1160 return "doors_driver";
1161 case 1:
1162 case 3:
1163 return "doors_codriver";
1164 }
1165
1166 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1167 }
1168
1170 {
1171 switch (posIdx)
1172 {
1173 case 0:
1174 case 2:
1175 return "NivaDriverDoors";
1176 case 1:
1177 case 3:
1178 return "NivaCoDriverDoors";
1179 }
1180
1181 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1182 }
1183
1184
1185
1187 {
1188 float tempCap = 0.0;
1189
1190 switch (ctrl)
1191 {
1193 float newValue = 0;
1195 {
1196 newValue += 0.5;
1197 }
1198
1200 {
1201 newValue += 0.5;
1202 }
1203
1205 {
1206 newValue += 0.3;
1207 }
1208
1210 {
1211 newValue -= 0.6;
1212 }
1213
1215 {
1216 newValue -= 0.2;
1217 }
1218
1220 {
1221 newValue -= 0.2;
1222 }
1223
1225 break;
1226 }
1227
1228 return super.OnSound(ctrl, oldValue);
1229 }
1230
1232 {
1233 switch (selection)
1234 {
1235 case "doors_driver":
1236 return "DoorsDriver";
1237 case "doors_codriver":
1238 return "DoorsCoDriver";
1239 case "doors_hood":
1240 return "DoorsHood";
1241 case "doors_trunk":
1242 return "DoorsTrunk";
1243 case "seatback_driver":
1244 return "SeatDriver";
1245 case "seatback_codriver":
1246 return "SeatCoDriver";
1247 }
1248
1249 return "";
1250 }
1251
1253 {
1254 switch (selection)
1255 {
1256 case "seat_driver":
1257 case "seatback_driver":
1258 case "seat_cargo1":
1259 return "seat_con_1_1";
1260 case "seat_codriver":
1261 case "seatback_codriver":
1262 case "seat_cargo2":
1263 return "seat_con_2_1";
1264 }
1265
1266 return "";
1267 }
1268
1270 {
1271 switch (selection)
1272 {
1273 case "seatback_driver":
1274 return 0;
1275 case "seatback_codriver":
1276 return 1;
1277 }
1278
1279 return -1;
1280 }
1281
1283 {
1284 return false;
1285 }
1286
1288 {
1289 return false;
1290 }
1291
1293 {
1294 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1295 return false;
1296
1297 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1298 return false;
1299
1300 switch (currentSeat)
1301 {
1302 case 0:
1303 return nextSeat == 1;
1304
1305 case 1:
1306 return nextSeat == 0;
1307
1308 case 2:
1309 return nextSeat == 3;
1310
1311 case 3:
1312 return nextSeat == 2;
1313 }
1314
1315 return false;
1316 }
1317
1319 {
1320 switch (pCurrentSeat)
1321 {
1322 case 0:
1323 return pDoorsSelection == "DoorsDriver";
1324
1325 case 1:
1326 return pDoorsSelection == "DoorsCoDriver";
1327
1328 case 2:
1329 return pDoorsSelection == "DoorsDriver";
1330
1331 case 3:
1332 return pDoorsSelection == "DoorsCoDriver";
1333 }
1334
1335 return false;
1336 }
1337
1339 {
1340 switch (pDoorSelection)
1341 {
1342 case "DoorsDriver":
1343 return 0;
1344 case "DoorsCoDriver":
1345 return 1;
1346 }
1347
1348 return -1;
1349 }
1350
1352 {
1353 super.SetActions();
1354
1356 }
1357
1359 {
1360 SpawnUniversalParts();
1361 SpawnAdditionalItems();
1362 FillUpCarFluids();
1363
1364 GetInventory().CreateInInventory("HatchbackWheel");
1365 GetInventory().CreateInInventory("HatchbackWheel");
1366 GetInventory().CreateInInventory("HatchbackWheel" );
1367 GetInventory().CreateInInventory("HatchbackWheel");
1368
1369 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1370 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1371 GetInventory().CreateInInventory("HatchbackHood");
1372 GetInventory().CreateInInventory("HatchbackTrunk");
1373
1374
1375 GetInventory().CreateInInventory("HatchbackWheel");
1376 GetInventory().CreateInInventory("HatchbackWheel");
1377 }
1378}
1379
1381{
1383 {
1384 SpawnUniversalParts();
1385 SpawnAdditionalItems();
1386 FillUpCarFluids();
1387
1388 GetInventory().CreateInInventory("HatchbackWheel");
1389 GetInventory().CreateInInventory("HatchbackWheel");
1390 GetInventory().CreateInInventory("HatchbackWheel");
1391 GetInventory().CreateInInventory("HatchbackWheel");
1392
1393 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1394 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1395 GetInventory().CreateInInventory("HatchbackHood_White");
1396 GetInventory().CreateInInventory("HatchbackTrunk_White");
1397
1398
1399 GetInventory().CreateInInventory("HatchbackWheel");
1400 GetInventory().CreateInInventory("HatchbackWheel");
1401 }
1402}
1403
1405{
1407 {
1408 SpawnUniversalParts();
1409 SpawnAdditionalItems();
1410 FillUpCarFluids();
1411
1412 GetInventory().CreateInInventory("HatchbackWheel");
1413 GetInventory().CreateInInventory("HatchbackWheel");
1414 GetInventory().CreateInInventory("HatchbackWheel");
1415 GetInventory().CreateInInventory("HatchbackWheel");
1416
1417 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1418 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1419 GetInventory().CreateInInventory("HatchbackHood_Blue");
1420 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1421
1422
1423 GetInventory().CreateInInventory("HatchbackWheel");
1424 GetInventory().CreateInInventory("HatchbackWheel");
1425 }
1426}
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.