877{
881
883 {
884
885
891
896
899
900 SetEnginePos("0 0.7 1.2");
901 }
902
904 {
905 super.EEInit();
906
908 {
915
918 }
919 }
920
922 {
923 super.OnEngineStart();
924
926 {
928 }
929 }
930
932 {
933 super.OnEngineStop();
934
936 {
938 }
939 }
940
942 {
944 {
946 {
948 }
949 }
950 }
951
953 {
955 }
956
958 {
959 return 3.5;
960 }
961
963 {
964 switch (posIdx)
965 {
966 case 0:
968 case 1:
970 case 2:
972 case 3:
974 }
975
976 return 0;
977
978 }
979
980
982 {
984 }
985
987 {
989 }
990
992 {
993 if (!super.CanReleaseAttachment(attachment))
994 {
995 return false;
996 }
997
999 {
1000 string attType = attachment.GetType();
1001 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
1002 {
1003 return false;
1004 }
1005 }
1006
1007 return true;
1008 }
1009
1011 {
1013 }
1014
1016 {
1017 if (!super.CanDisplayAttachmentCategory(category_name))
1018 {
1019 return false;
1020 }
1021
1023 if (category_name.
Contains(
"engine"))
1024 {
1026 {
1027 return false;
1028 }
1029 }
1030
1031 return true;
1032 }
1033
1035 {
1036 if (!super.CanDisplayCargo())
1037 {
1038 return false;
1039 }
1040
1042 {
1043 return false;
1044 }
1045
1046 return true;
1047 }
1048
1050 {
1052
1053 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
1054 if (!carDoor)
1055 {
1057 }
1058
1059 switch (slotType)
1060 {
1061 case "NivaDriverDoors":
1063
1064 case "NivaCoDriverDoors":
1066
1067 case "NivaHood":
1069
1070 case "NivaTrunk":
1072 }
1073
1075 }
1076
1078 {
1080 switch (posIdx)
1081 {
1082 case 0:
1084 return false;
1085 else if (GetAnimationPhase("SeatDriver") > 0.5)
1086 return false;
1087
1088 return true;
1089
1090 case 1:
1092 return false;
1093 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1094 return false;
1095
1096 return true;
1097
1098 case 2:
1100 return false;
1101 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1102 return false;
1103
1104 return true;
1105
1106 case 3:
1108 return false;
1109 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1110 return false;
1111
1112 return true;
1113 }
1114
1115 return false;
1116 }
1117
1119 {
1120 switch (posIdx)
1121 {
1122 case 0:
1123 case 2:
1124 return "doors_driver";
1125 case 1:
1126 case 3:
1127 return "doors_codriver";
1128 }
1129
1130 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1131 }
1132
1134 {
1135 switch (posIdx)
1136 {
1137 case 0:
1138 case 2:
1139 return "NivaDriverDoors";
1140 case 1:
1141 case 3:
1142 return "NivaCoDriverDoors";
1143 }
1144
1145 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1146 }
1147
1148
1149
1151 {
1152 float tempCap = 0.0;
1153
1154 switch (ctrl)
1155 {
1157 float newValue = 0;
1159 {
1160 newValue += 0.5;
1161 }
1162
1164 {
1165 newValue += 0.5;
1166 }
1167
1169 {
1170 newValue += 0.3;
1171 }
1172
1174 {
1175 newValue -= 0.6;
1176 }
1177
1179 {
1180 newValue -= 0.2;
1181 }
1182
1184 {
1185 newValue -= 0.2;
1186 }
1187
1189 break;
1190 }
1191
1192 return super.OnSound(ctrl, oldValue);
1193 }
1194
1196 {
1197 switch (selection)
1198 {
1199 case "doors_driver":
1200 return "DoorsDriver";
1201 case "doors_codriver":
1202 return "DoorsCoDriver";
1203 case "doors_hood":
1204 return "DoorsHood";
1205 case "doors_trunk":
1206 return "DoorsTrunk";
1207 case "seatback_driver":
1208 return "SeatDriver";
1209 case "seatback_codriver":
1210 return "SeatCoDriver";
1211 }
1212
1213 return "";
1214 }
1215
1217 {
1218 switch (selection)
1219 {
1220 case "seat_driver":
1221 case "seatback_driver":
1222 case "seat_cargo1":
1223 return "seat_con_1_1";
1224 case "seat_codriver":
1225 case "seatback_codriver":
1226 case "seat_cargo2":
1227 return "seat_con_2_1";
1228 }
1229
1230 return "";
1231 }
1232
1234 {
1235 switch (selection)
1236 {
1237 case "seatback_driver":
1238 return 0;
1239 case "seatback_codriver":
1240 return 1;
1241 }
1242
1243 return -1;
1244 }
1245
1247 {
1248 return false;
1249 }
1250
1252 {
1253 return false;
1254 }
1255
1257 {
1258 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1259 return false;
1260
1261 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1262 return false;
1263
1264 switch (currentSeat)
1265 {
1266 case 0:
1267 return nextSeat == 1;
1268
1269 case 1:
1270 return nextSeat == 0;
1271
1272 case 2:
1273 return nextSeat == 3;
1274
1275 case 3:
1276 return nextSeat == 2;
1277 }
1278
1279 return false;
1280 }
1281
1283 {
1284 switch (pCurrentSeat)
1285 {
1286 case 0:
1287 return pDoorsSelection == "DoorsDriver";
1288
1289 case 1:
1290 return pDoorsSelection == "DoorsCoDriver";
1291
1292 case 2:
1293 return pDoorsSelection == "DoorsDriver";
1294
1295 case 3:
1296 return pDoorsSelection == "DoorsCoDriver";
1297 }
1298
1299 return false;
1300 }
1301
1303 {
1304 switch (pDoorSelection)
1305 {
1306 case "DoorsDriver":
1307 return 0;
1308 case "DoorsCoDriver":
1309 return 1;
1310 }
1311
1312 return -1;
1313 }
1314
1316 {
1317 super.SetActions();
1318
1320 }
1321
1323 {
1327
1328 GetInventory().CreateInInventory("HatchbackWheel");
1329 GetInventory().CreateInInventory("HatchbackWheel");
1330 GetInventory().CreateInInventory("HatchbackWheel" );
1331 GetInventory().CreateInInventory("HatchbackWheel");
1332
1333 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1334 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1335 GetInventory().CreateInInventory("HatchbackHood");
1336 GetInventory().CreateInInventory("HatchbackTrunk");
1337
1338
1339 GetInventory().CreateInInventory("HatchbackWheel");
1340 GetInventory().CreateInInventory("HatchbackWheel");
1341 }
1342}
1343
1345{
1347 {
1351
1352 GetInventory().CreateInInventory("HatchbackWheel");
1353 GetInventory().CreateInInventory("HatchbackWheel");
1354 GetInventory().CreateInInventory("HatchbackWheel");
1355 GetInventory().CreateInInventory("HatchbackWheel");
1356
1357 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1358 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1359 GetInventory().CreateInInventory("HatchbackHood_White");
1360 GetInventory().CreateInInventory("HatchbackTrunk_White");
1361
1362
1363 GetInventory().CreateInInventory("HatchbackWheel");
1364 GetInventory().CreateInInventory("HatchbackWheel");
1365 }
1366}
1367
1369{
1371 {
1375
1376 GetInventory().CreateInInventory("HatchbackWheel");
1377 GetInventory().CreateInInventory("HatchbackWheel");
1378 GetInventory().CreateInInventory("HatchbackWheel");
1379 GetInventory().CreateInInventory("HatchbackWheel");
1380
1381 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1382 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1383 GetInventory().CreateInInventory("HatchbackHood_Blue");
1384 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1385
1386
1387 GetInventory().CreateInInventory("HatchbackWheel");
1388 GetInventory().CreateInInventory("HatchbackWheel");
1389 }
1390}
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.