879{
883
885 {
886
887
888 m_EngineStartOK = "offroad_engine_start_SoundSet";
889 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
890 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
891 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
892 m_EngineStop = "offroad_engine_stop_SoundSet";
893 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
894
895 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
896 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
897 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
898 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
899
900 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
901 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
902
903 SetEnginePos("0 0.7 1.2");
904 }
905
907 {
908 super.EEInit();
909
911 {
918
921 }
922 }
923
925 {
926 super.OnEngineStart();
927
929 {
931 }
932 }
933
935 {
936 super.OnEngineStop();
937
939 {
941 }
942 }
943
945 {
947 {
949 {
951 }
952 }
953 }
954
956 {
958 }
959
961 {
962 return 3.5;
963 }
964
966 {
967 switch (posIdx)
968 {
969 case 0:
971 case 1:
973 case 2:
975 case 3:
977 }
978
979 return 0;
980
981 }
982
983
985 {
987 }
988
990 {
992 }
993
995 {
996 if (!super.CanReleaseAttachment(attachment))
997 {
998 return false;
999 }
1000
1002 {
1003 string attType = attachment.GetType();
1004 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
1005 {
1006 return false;
1007 }
1008 }
1009
1010 return true;
1011 }
1012
1014 {
1016 }
1017
1019 {
1020 if (!super.CanDisplayAttachmentCategory(category_name))
1021 {
1022 return false;
1023 }
1024
1026 if (category_name.
Contains(
"engine"))
1027 {
1029 {
1030 return false;
1031 }
1032 }
1033
1034 return true;
1035 }
1036
1038 {
1039 if (!super.CanDisplayCargo())
1040 {
1041 return false;
1042 }
1043
1045 {
1046 return false;
1047 }
1048
1049 return true;
1050 }
1051
1053 {
1055
1056 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
1057 if (!carDoor)
1058 {
1060 }
1061
1062 switch (slotType)
1063 {
1064 case "NivaDriverDoors":
1065 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
1066
1067 case "NivaCoDriverDoors":
1068 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
1069
1070 case "NivaHood":
1071 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
1072
1073 case "NivaTrunk":
1074 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
1075 }
1076
1078 }
1079
1081 {
1083 switch (posIdx)
1084 {
1085 case 0:
1087 return false;
1088 else if (GetAnimationPhase("SeatDriver") > 0.5)
1089 return false;
1090
1091 return true;
1092
1093 case 1:
1095 return false;
1096 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1097 return false;
1098
1099 return true;
1100
1101 case 2:
1103 return false;
1104 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1105 return false;
1106
1107 return true;
1108
1109 case 3:
1111 return false;
1112 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1113 return false;
1114
1115 return true;
1116 }
1117
1118 return false;
1119 }
1120
1122 {
1123 switch (posIdx)
1124 {
1125 case 0:
1126 case 2:
1127 return "doors_driver";
1128 case 1:
1129 case 3:
1130 return "doors_codriver";
1131 }
1132
1133 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1134 }
1135
1137 {
1138 switch (posIdx)
1139 {
1140 case 0:
1141 case 2:
1142 return "NivaDriverDoors";
1143 case 1:
1144 case 3:
1145 return "NivaCoDriverDoors";
1146 }
1147
1148 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1149 }
1150
1151
1152
1154 {
1155 float tempCap = 0.0;
1156
1157 switch (ctrl)
1158 {
1160 float newValue = 0;
1162 {
1163 newValue += 0.5;
1164 }
1165
1167 {
1168 newValue += 0.5;
1169 }
1170
1172 {
1173 newValue += 0.3;
1174 }
1175
1177 {
1178 newValue -= 0.6;
1179 }
1180
1182 {
1183 newValue -= 0.2;
1184 }
1185
1187 {
1188 newValue -= 0.2;
1189 }
1190
1192 break;
1193 }
1194
1195 return super.OnSound(ctrl, oldValue);
1196 }
1197
1199 {
1200 switch (selection)
1201 {
1202 case "doors_driver":
1203 return "DoorsDriver";
1204 case "doors_codriver":
1205 return "DoorsCoDriver";
1206 case "doors_hood":
1207 return "DoorsHood";
1208 case "doors_trunk":
1209 return "DoorsTrunk";
1210 case "seatback_driver":
1211 return "SeatDriver";
1212 case "seatback_codriver":
1213 return "SeatCoDriver";
1214 }
1215
1216 return "";
1217 }
1218
1220 {
1221 switch (selection)
1222 {
1223 case "seat_driver":
1224 case "seatback_driver":
1225 case "seat_cargo1":
1226 return "seat_con_1_1";
1227 case "seat_codriver":
1228 case "seatback_codriver":
1229 case "seat_cargo2":
1230 return "seat_con_2_1";
1231 }
1232
1233 return "";
1234 }
1235
1237 {
1238 switch (selection)
1239 {
1240 case "seatback_driver":
1241 return 0;
1242 case "seatback_codriver":
1243 return 1;
1244 }
1245
1246 return -1;
1247 }
1248
1250 {
1251 return false;
1252 }
1253
1255 {
1256 return false;
1257 }
1258
1260 {
1261 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1262 return false;
1263
1264 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1265 return false;
1266
1267 switch (currentSeat)
1268 {
1269 case 0:
1270 return nextSeat == 1;
1271
1272 case 1:
1273 return nextSeat == 0;
1274
1275 case 2:
1276 return nextSeat == 3;
1277
1278 case 3:
1279 return nextSeat == 2;
1280 }
1281
1282 return false;
1283 }
1284
1286 {
1287 switch (pCurrentSeat)
1288 {
1289 case 0:
1290 return pDoorsSelection == "DoorsDriver";
1291
1292 case 1:
1293 return pDoorsSelection == "DoorsCoDriver";
1294
1295 case 2:
1296 return pDoorsSelection == "DoorsDriver";
1297
1298 case 3:
1299 return pDoorsSelection == "DoorsCoDriver";
1300 }
1301
1302 return false;
1303 }
1304
1306 {
1307 switch (pDoorSelection)
1308 {
1309 case "DoorsDriver":
1310 return 0;
1311 case "DoorsCoDriver":
1312 return 1;
1313 }
1314
1315 return -1;
1316 }
1317
1319 {
1320 super.SetActions();
1321
1323 }
1324
1326 {
1327 SpawnUniversalParts();
1328 SpawnAdditionalItems();
1329 FillUpCarFluids();
1330
1331 GetInventory().CreateInInventory("HatchbackWheel");
1332 GetInventory().CreateInInventory("HatchbackWheel");
1333 GetInventory().CreateInInventory("HatchbackWheel" );
1334 GetInventory().CreateInInventory("HatchbackWheel");
1335
1336 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1337 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1338 GetInventory().CreateInInventory("HatchbackHood");
1339 GetInventory().CreateInInventory("HatchbackTrunk");
1340
1341
1342 GetInventory().CreateInInventory("HatchbackWheel");
1343 GetInventory().CreateInInventory("HatchbackWheel");
1344 }
1345}
1346
1348{
1350 {
1351 SpawnUniversalParts();
1352 SpawnAdditionalItems();
1353 FillUpCarFluids();
1354
1355 GetInventory().CreateInInventory("HatchbackWheel");
1356 GetInventory().CreateInInventory("HatchbackWheel");
1357 GetInventory().CreateInInventory("HatchbackWheel");
1358 GetInventory().CreateInInventory("HatchbackWheel");
1359
1360 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1361 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1362 GetInventory().CreateInInventory("HatchbackHood_White");
1363 GetInventory().CreateInInventory("HatchbackTrunk_White");
1364
1365
1366 GetInventory().CreateInInventory("HatchbackWheel");
1367 GetInventory().CreateInInventory("HatchbackWheel");
1368 }
1369}
1370
1372{
1374 {
1375 SpawnUniversalParts();
1376 SpawnAdditionalItems();
1377 FillUpCarFluids();
1378
1379 GetInventory().CreateInInventory("HatchbackWheel");
1380 GetInventory().CreateInInventory("HatchbackWheel");
1381 GetInventory().CreateInInventory("HatchbackWheel");
1382 GetInventory().CreateInInventory("HatchbackWheel");
1383
1384 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1385 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1386 GetInventory().CreateInInventory("HatchbackHood_Blue");
1387 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1388
1389
1390 GetInventory().CreateInInventory("HatchbackWheel");
1391 GetInventory().CreateInInventory("HatchbackWheel");
1392 }
1393}
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.