843{
847
849 {
850
851
852 m_EngineStartOK = "offroad_engine_start_SoundSet";
853 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
854 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
855 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
856 m_EngineStop = "offroad_engine_stop_SoundSet";
857 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
858
859 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
860 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
861 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
862 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
863
864 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
865 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
866
867 SetEnginePos("0 0.7 1.2");
868 }
869
871 {
872 super.EEInit();
873
875 {
882
885 }
886 }
887
889 {
890 super.OnEngineStart();
891
893 {
895 }
896 }
897
899 {
900 super.OnEngineStop();
901
903 {
905 }
906 }
907
909 {
911 {
913 {
915 }
916 }
917 }
918
920 {
922 }
923
925 {
926 return 3.5;
927 }
928
930 {
931 switch (posIdx)
932 {
933 case 0:
935 case 1:
937 case 2:
939 case 3:
941 }
942
943 return 0;
944
945 }
946
947
949 {
951 }
952
954 {
956 }
957
959 {
960 if (!super.CanReleaseAttachment(attachment))
961 {
962 return false;
963 }
964
966 {
967 string attType = attachment.GetType();
968 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
969 {
970 return false;
971 }
972 }
973
974 return true;
975 }
976
978 {
980 }
981
983 {
984 if (!super.CanDisplayAttachmentCategory(category_name))
985 {
986 return false;
987 }
988
990 if (category_name.
Contains(
"engine"))
991 {
993 {
994 return false;
995 }
996 }
997
998 return true;
999 }
1000
1002 {
1003 if (!super.CanDisplayCargo())
1004 {
1005 return false;
1006 }
1007
1009 {
1010 return false;
1011 }
1012
1013 return true;
1014 }
1015
1017 {
1019
1020 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
1021 if (!carDoor)
1022 {
1024 }
1025
1026 switch (slotType)
1027 {
1028 case "NivaDriverDoors":
1029 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
1030
1031 case "NivaCoDriverDoors":
1032 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
1033
1034 case "NivaHood":
1035 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
1036
1037 case "NivaTrunk":
1038 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
1039 }
1040
1042 }
1043
1045 {
1047 switch (posIdx)
1048 {
1049 case 0:
1051 return false;
1052 else if (GetAnimationPhase("SeatDriver") > 0.5)
1053 return false;
1054
1055 return true;
1056
1057 case 1:
1059 return false;
1060 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1061 return false;
1062
1063 return true;
1064
1065 case 2:
1067 return false;
1068 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1069 return false;
1070
1071 return true;
1072
1073 case 3:
1075 return false;
1076 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1077 return false;
1078
1079 return true;
1080 }
1081
1082 return false;
1083 }
1084
1086 {
1087 switch (posIdx)
1088 {
1089 case 0:
1090 case 2:
1091 return "doors_driver";
1092 case 1:
1093 case 3:
1094 return "doors_codriver";
1095 }
1096
1097 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1098 }
1099
1101 {
1102 switch (posIdx)
1103 {
1104 case 0:
1105 case 2:
1106 return "NivaDriverDoors";
1107 case 1:
1108 case 3:
1109 return "NivaCoDriverDoors";
1110 }
1111
1112 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1113 }
1114
1115
1116
1118 {
1119 float tempCap = 0.0;
1120
1121 switch (ctrl)
1122 {
1124 float newValue = 0;
1126 {
1127 newValue += 0.5;
1128 }
1129
1131 {
1132 newValue += 0.5;
1133 }
1134
1136 {
1137 newValue += 0.3;
1138 }
1139
1141 {
1142 newValue -= 0.6;
1143 }
1144
1146 {
1147 newValue -= 0.2;
1148 }
1149
1151 {
1152 newValue -= 0.2;
1153 }
1154
1156 break;
1157 }
1158
1159 return super.OnSound(ctrl, oldValue);
1160 }
1161
1163 {
1164 switch (selection)
1165 {
1166 case "doors_driver":
1167 return "DoorsDriver";
1168 case "doors_codriver":
1169 return "DoorsCoDriver";
1170 case "doors_hood":
1171 return "DoorsHood";
1172 case "doors_trunk":
1173 return "DoorsTrunk";
1174 case "seatback_driver":
1175 return "SeatDriver";
1176 case "seatback_codriver":
1177 return "SeatCoDriver";
1178 }
1179
1180 return "";
1181 }
1182
1184 {
1185 switch (selection)
1186 {
1187 case "seat_driver":
1188 case "seatback_driver":
1189 case "seat_cargo1":
1190 return "seat_con_1_1";
1191 case "seat_codriver":
1192 case "seatback_codriver":
1193 case "seat_cargo2":
1194 return "seat_con_2_1";
1195 }
1196
1197 return "";
1198 }
1199
1201 {
1202 switch (selection)
1203 {
1204 case "seatback_driver":
1205 return 0;
1206 case "seatback_codriver":
1207 return 1;
1208 }
1209
1210 return -1;
1211 }
1212
1214 {
1215 return false;
1216 }
1217
1219 {
1220 return false;
1221 }
1222
1224 {
1225 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1226 return false;
1227
1228 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1229 return false;
1230
1231 switch (currentSeat)
1232 {
1233 case 0:
1234 return nextSeat == 1;
1235
1236 case 1:
1237 return nextSeat == 0;
1238
1239 case 2:
1240 return nextSeat == 3;
1241
1242 case 3:
1243 return nextSeat == 2;
1244 }
1245
1246 return false;
1247 }
1248
1250 {
1251 switch (pCurrentSeat)
1252 {
1253 case 0:
1254 return pDoorsSelection == "DoorsDriver";
1255
1256 case 1:
1257 return pDoorsSelection == "DoorsCoDriver";
1258
1259 case 2:
1260 return pDoorsSelection == "DoorsDriver";
1261
1262 case 3:
1263 return pDoorsSelection == "DoorsCoDriver";
1264 }
1265
1266 return false;
1267 }
1268
1270 {
1271 switch (pDoorSelection)
1272 {
1273 case "DoorsDriver":
1274 return 0;
1275 case "DoorsCoDriver":
1276 return 1;
1277 }
1278
1279 return -1;
1280 }
1281
1283 {
1284 super.SetActions();
1285
1287 }
1288
1290 {
1291 SpawnUniversalParts();
1292 SpawnAdditionalItems();
1293 FillUpCarFluids();
1294
1295 GetInventory().CreateInInventory("HatchbackWheel");
1296 GetInventory().CreateInInventory("HatchbackWheel");
1297 GetInventory().CreateInInventory("HatchbackWheel" );
1298 GetInventory().CreateInInventory("HatchbackWheel");
1299
1300 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1301 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1302 GetInventory().CreateInInventory("HatchbackHood");
1303 GetInventory().CreateInInventory("HatchbackTrunk");
1304
1305
1306 GetInventory().CreateInInventory("HatchbackWheel");
1307 GetInventory().CreateInInventory("HatchbackWheel");
1308 }
1309}
1310
1312{
1314 {
1315 SpawnUniversalParts();
1316 SpawnAdditionalItems();
1317 FillUpCarFluids();
1318
1319 GetInventory().CreateInInventory("HatchbackWheel");
1320 GetInventory().CreateInInventory("HatchbackWheel");
1321 GetInventory().CreateInInventory("HatchbackWheel");
1322 GetInventory().CreateInInventory("HatchbackWheel");
1323
1324 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1325 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1326 GetInventory().CreateInInventory("HatchbackHood_White");
1327 GetInventory().CreateInInventory("HatchbackTrunk_White");
1328
1329
1330 GetInventory().CreateInInventory("HatchbackWheel");
1331 GetInventory().CreateInInventory("HatchbackWheel");
1332 }
1333}
1334
1336{
1338 {
1339 SpawnUniversalParts();
1340 SpawnAdditionalItems();
1341 FillUpCarFluids();
1342
1343 GetInventory().CreateInInventory("HatchbackWheel");
1344 GetInventory().CreateInInventory("HatchbackWheel");
1345 GetInventory().CreateInInventory("HatchbackWheel");
1346 GetInventory().CreateInInventory("HatchbackWheel");
1347
1348 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1349 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1350 GetInventory().CreateInInventory("HatchbackHood_Blue");
1351 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1352
1353
1354 GetInventory().CreateInInventory("HatchbackWheel");
1355 GetInventory().CreateInInventory("HatchbackWheel");
1356 }
1357}
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.