897{
901
903 {
904
905
911
916
919
920 SetEnginePos("0 0.7 1.2");
921 }
922
924 {
925 super.EEInit();
926
928 {
935
938 }
939 }
940
942 {
943 super.OnEngineStart();
944
946 {
948 }
949 }
950
952 {
953 super.OnEngineStop();
954
956 {
958 }
959 }
960
962 {
964 {
966 {
968 }
969 }
970 }
971
973 {
975 }
976
978 {
979 return 3.5;
980 }
981
983 {
984 switch (posIdx)
985 {
986 case 0:
988 case 1:
990 case 2:
992 case 3:
994 }
995
996 return 0;
997
998 }
999
1000
1002 {
1004 }
1005
1007 {
1009 }
1010
1012 {
1013 if (!super.CanReleaseAttachment(attachment))
1014 {
1015 return false;
1016 }
1017
1019 {
1020 string attType = attachment.GetType();
1021 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
1022 {
1023 return false;
1024 }
1025 }
1026
1027 return true;
1028 }
1029
1031 {
1033 }
1034
1036 {
1037 if (!super.CanDisplayAttachmentCategory(category_name))
1038 {
1039 return false;
1040 }
1041
1043 if (category_name.
Contains(
"engine"))
1044 {
1046 {
1047 return false;
1048 }
1049 }
1050
1051 return true;
1052 }
1053
1055 {
1056 if (!super.CanDisplayCargo())
1057 {
1058 return false;
1059 }
1060
1062 {
1063 return false;
1064 }
1065
1066 return true;
1067 }
1068
1070 {
1072
1073 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
1074 if (!carDoor)
1075 {
1077 }
1078
1079 switch (slotType)
1080 {
1081 case "NivaDriverDoors":
1083
1084 case "NivaCoDriverDoors":
1086
1087 case "NivaHood":
1089
1090 case "NivaTrunk":
1092 }
1093
1095 }
1096
1098 {
1100 switch (posIdx)
1101 {
1102 case 0:
1104 return false;
1105 else if (GetAnimationPhase("SeatDriver") > 0.5)
1106 return false;
1107
1108 return true;
1109
1110 case 1:
1112 return false;
1113 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1114 return false;
1115
1116 return true;
1117
1118 case 2:
1120 return false;
1121 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1122 return false;
1123
1124 return true;
1125
1126 case 3:
1128 return false;
1129 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1130 return false;
1131
1132 return true;
1133 }
1134
1135 return false;
1136 }
1137
1139 {
1140 switch (posIdx)
1141 {
1142 case 0:
1143 case 2:
1144 return "doors_driver";
1145 case 1:
1146 case 3:
1147 return "doors_codriver";
1148 }
1149
1150 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1151 }
1152
1154 {
1155 switch (posIdx)
1156 {
1157 case 0:
1158 case 2:
1159 return "NivaDriverDoors";
1160 case 1:
1161 case 3:
1162 return "NivaCoDriverDoors";
1163 }
1164
1165 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1166 }
1167
1168
1169
1171 {
1172 float tempCap = 0.0;
1173
1174 switch (ctrl)
1175 {
1177 float newValue = 0;
1179 {
1180 newValue += 0.5;
1181 }
1182
1184 {
1185 newValue += 0.5;
1186 }
1187
1189 {
1190 newValue += 0.3;
1191 }
1192
1194 {
1195 newValue -= 0.6;
1196 }
1197
1199 {
1200 newValue -= 0.2;
1201 }
1202
1204 {
1205 newValue -= 0.2;
1206 }
1207
1209 break;
1210 }
1211
1212 return super.OnSound(ctrl, oldValue);
1213 }
1214
1216 {
1217 switch (selection)
1218 {
1219 case "doors_driver":
1220 return "DoorsDriver";
1221 case "doors_codriver":
1222 return "DoorsCoDriver";
1223 case "doors_hood":
1224 return "DoorsHood";
1225 case "doors_trunk":
1226 return "DoorsTrunk";
1227 case "seatback_driver":
1228 return "SeatDriver";
1229 case "seatback_codriver":
1230 return "SeatCoDriver";
1231 }
1232
1233 return "";
1234 }
1235
1237 {
1238 switch (selection)
1239 {
1240 case "seat_driver":
1241 case "seatback_driver":
1242 case "seat_cargo1":
1243 return "seat_con_1_1";
1244 case "seat_codriver":
1245 case "seatback_codriver":
1246 case "seat_cargo2":
1247 return "seat_con_2_1";
1248 }
1249
1250 return "";
1251 }
1252
1254 {
1255 switch (selection)
1256 {
1257 case "seatback_driver":
1258 return 0;
1259 case "seatback_codriver":
1260 return 1;
1261 }
1262
1263 return -1;
1264 }
1265
1267 {
1268 return false;
1269 }
1270
1272 {
1273 return false;
1274 }
1275
1277 {
1278 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1279 return false;
1280
1281 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1282 return false;
1283
1284 switch (currentSeat)
1285 {
1286 case 0:
1287 return nextSeat == 1;
1288
1289 case 1:
1290 return nextSeat == 0;
1291
1292 case 2:
1293 return nextSeat == 3;
1294
1295 case 3:
1296 return nextSeat == 2;
1297 }
1298
1299 return false;
1300 }
1301
1303 {
1304 switch (pCurrentSeat)
1305 {
1306 case 0:
1307 return pDoorsSelection == "DoorsDriver";
1308
1309 case 1:
1310 return pDoorsSelection == "DoorsCoDriver";
1311
1312 case 2:
1313 return pDoorsSelection == "DoorsDriver";
1314
1315 case 3:
1316 return pDoorsSelection == "DoorsCoDriver";
1317 }
1318
1319 return false;
1320 }
1321
1323 {
1324 switch (pDoorSelection)
1325 {
1326 case "DoorsDriver":
1327 return 0;
1328 case "DoorsCoDriver":
1329 return 1;
1330 }
1331
1332 return -1;
1333 }
1334
1336 {
1337 super.SetActions();
1338
1340 }
1341
1343 {
1347
1348 GetInventory().CreateInInventory("HatchbackWheel");
1349 GetInventory().CreateInInventory("HatchbackWheel");
1350 GetInventory().CreateInInventory("HatchbackWheel" );
1351 GetInventory().CreateInInventory("HatchbackWheel");
1352
1353 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1354 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1355 GetInventory().CreateInInventory("HatchbackHood");
1356 GetInventory().CreateInInventory("HatchbackTrunk");
1357
1358
1359 GetInventory().CreateInInventory("HatchbackWheel");
1360 GetInventory().CreateInInventory("HatchbackWheel");
1361 }
1362}
1363
1365{
1367 {
1371
1372 GetInventory().CreateInInventory("HatchbackWheel");
1373 GetInventory().CreateInInventory("HatchbackWheel");
1374 GetInventory().CreateInInventory("HatchbackWheel");
1375 GetInventory().CreateInInventory("HatchbackWheel");
1376
1377 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1378 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1379 GetInventory().CreateInInventory("HatchbackHood_White");
1380 GetInventory().CreateInInventory("HatchbackTrunk_White");
1381
1382
1383 GetInventory().CreateInInventory("HatchbackWheel");
1384 GetInventory().CreateInInventory("HatchbackWheel");
1385 }
1386}
1387
1389{
1391 {
1395
1396 GetInventory().CreateInInventory("HatchbackWheel");
1397 GetInventory().CreateInInventory("HatchbackWheel");
1398 GetInventory().CreateInInventory("HatchbackWheel");
1399 GetInventory().CreateInInventory("HatchbackWheel");
1400
1401 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1402 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1403 GetInventory().CreateInInventory("HatchbackHood_Blue");
1404 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1405
1406
1407 GetInventory().CreateInInventory("HatchbackWheel");
1408 GetInventory().CreateInInventory("HatchbackWheel");
1409 }
1410}
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.