830{
834
836 {
837
838
839 m_EngineStartOK = "offroad_engine_start_SoundSet";
840 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
841 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
842 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
843 m_EngineStop = "offroad_engine_stop_SoundSet";
844 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
845
846 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
847 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
848 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
849 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
850
851 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
852 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
853
854 SetEnginePos("0 0.7 1.2");
855 }
856
858 {
859 super.EEInit();
860
862 {
869
872 }
873 }
874
876 {
877 super.OnEngineStart();
878
880 {
882 }
883 }
884
886 {
887 super.OnEngineStop();
888
890 {
892 }
893 }
894
896 {
898 {
900 {
902 }
903 }
904 }
905
907 {
909 }
910
912 {
913 return 3.5;
914 }
915
917 {
918 switch (posIdx)
919 {
920 case 0:
922 case 1:
924 case 2:
926 case 3:
928 }
929
930 return 0;
931
932 }
933
934
936 {
938 }
939
941 {
943 }
944
946 {
947 if (!super.CanReleaseAttachment(attachment))
948 {
949 return false;
950 }
951
953 {
954 string attType = attachment.GetType();
955 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
956 {
957 return false;
958 }
959 }
960
961 return true;
962 }
963
965 {
967 }
968
970 {
971 if (!super.CanDisplayAttachmentCategory(category_name))
972 {
973 return false;
974 }
975
977 if (category_name.
Contains(
"engine"))
978 {
980 {
981 return false;
982 }
983 }
984
985 return true;
986 }
987
989 {
990 if (!super.CanDisplayCargo())
991 {
992 return false;
993 }
994
996 {
997 return false;
998 }
999
1000 return true;
1001 }
1002
1004 {
1006
1007 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
1008 if (!carDoor)
1009 {
1011 }
1012
1013 switch (slotType)
1014 {
1015 case "NivaDriverDoors":
1016 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
1017
1018 case "NivaCoDriverDoors":
1019 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
1020
1021 case "NivaHood":
1022 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
1023
1024 case "NivaTrunk":
1025 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
1026 }
1027
1029 }
1030
1032 {
1034 switch (posIdx)
1035 {
1036 case 0:
1038 return false;
1039 else if (GetAnimationPhase("SeatDriver") > 0.5)
1040 return false;
1041
1042 return true;
1043
1044 case 1:
1046 return false;
1047 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1048 return false;
1049
1050 return true;
1051
1052 case 2:
1054 return false;
1055 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1056 return false;
1057
1058 return true;
1059
1060 case 3:
1062 return false;
1063 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1064 return false;
1065
1066 return true;
1067 }
1068
1069 return false;
1070 }
1071
1073 {
1074 switch (posIdx)
1075 {
1076 case 0:
1077 case 2:
1078 return "doors_driver";
1079 case 1:
1080 case 3:
1081 return "doors_codriver";
1082 }
1083
1084 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1085 }
1086
1088 {
1089 switch (posIdx)
1090 {
1091 case 0:
1092 case 2:
1093 return "NivaDriverDoors";
1094 case 1:
1095 case 3:
1096 return "NivaCoDriverDoors";
1097 }
1098
1099 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1100 }
1101
1102
1103
1105 {
1106 float tempCap = 0.0;
1107
1108 switch (ctrl)
1109 {
1111 float newValue = 0;
1113 {
1114 newValue += 0.5;
1115 }
1116
1118 {
1119 newValue += 0.5;
1120 }
1121
1123 {
1124 newValue += 0.3;
1125 }
1126
1128 {
1129 newValue -= 0.6;
1130 }
1131
1133 {
1134 newValue -= 0.2;
1135 }
1136
1138 {
1139 newValue -= 0.2;
1140 }
1141
1143 break;
1144 }
1145
1146 return super.OnSound(ctrl, oldValue);
1147 }
1148
1150 {
1151 switch (selection)
1152 {
1153 case "doors_driver":
1154 return "DoorsDriver";
1155 case "doors_codriver":
1156 return "DoorsCoDriver";
1157 case "doors_hood":
1158 return "DoorsHood";
1159 case "doors_trunk":
1160 return "DoorsTrunk";
1161 case "seatback_driver":
1162 return "SeatDriver";
1163 case "seatback_codriver":
1164 return "SeatCoDriver";
1165 }
1166
1167 return "";
1168 }
1169
1171 {
1172 switch (selection)
1173 {
1174 case "seat_driver":
1175 case "seatback_driver":
1176 case "seat_cargo1":
1177 return "seat_con_1_1";
1178 case "seat_codriver":
1179 case "seatback_codriver":
1180 case "seat_cargo2":
1181 return "seat_con_2_1";
1182 }
1183
1184 return "";
1185 }
1186
1188 {
1189 switch (selection)
1190 {
1191 case "seatback_driver":
1192 return 0;
1193 case "seatback_codriver":
1194 return 1;
1195 }
1196
1197 return -1;
1198 }
1199
1201 {
1202 return false;
1203 }
1204
1206 {
1207 return false;
1208 }
1209
1211 {
1212 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1213 return false;
1214
1215 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1216 return false;
1217
1218 switch (currentSeat)
1219 {
1220 case 0:
1221 return nextSeat == 1;
1222
1223 case 1:
1224 return nextSeat == 0;
1225
1226 case 2:
1227 return nextSeat == 3;
1228
1229 case 3:
1230 return nextSeat == 2;
1231 }
1232
1233 return false;
1234 }
1235
1237 {
1238 switch (pCurrentSeat)
1239 {
1240 case 0:
1241 return pDoorsSelection == "DoorsDriver";
1242
1243 case 1:
1244 return pDoorsSelection == "DoorsCoDriver";
1245
1246 case 2:
1247 return pDoorsSelection == "DoorsDriver";
1248
1249 case 3:
1250 return pDoorsSelection == "DoorsCoDriver";
1251 }
1252
1253 return false;
1254 }
1255
1257 {
1258 switch (pDoorSelection)
1259 {
1260 case "DoorsDriver":
1261 return 0;
1262 case "DoorsCoDriver":
1263 return 1;
1264 }
1265
1266 return -1;
1267 }
1268
1270 {
1271 super.SetActions();
1272
1274 }
1275
1277 {
1278 SpawnUniversalParts();
1279 SpawnAdditionalItems();
1280 FillUpCarFluids();
1281
1282 GetInventory().CreateInInventory("HatchbackWheel");
1283 GetInventory().CreateInInventory("HatchbackWheel");
1284 GetInventory().CreateInInventory("HatchbackWheel" );
1285 GetInventory().CreateInInventory("HatchbackWheel");
1286
1287 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1288 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1289 GetInventory().CreateInInventory("HatchbackHood");
1290 GetInventory().CreateInInventory("HatchbackTrunk");
1291
1292
1293 GetInventory().CreateInInventory("HatchbackWheel");
1294 GetInventory().CreateInInventory("HatchbackWheel");
1295 }
1296}
1297
1299{
1301 {
1302 SpawnUniversalParts();
1303 SpawnAdditionalItems();
1304 FillUpCarFluids();
1305
1306 GetInventory().CreateInInventory("HatchbackWheel");
1307 GetInventory().CreateInInventory("HatchbackWheel");
1308 GetInventory().CreateInInventory("HatchbackWheel");
1309 GetInventory().CreateInInventory("HatchbackWheel");
1310
1311 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1312 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1313 GetInventory().CreateInInventory("HatchbackHood_White");
1314 GetInventory().CreateInInventory("HatchbackTrunk_White");
1315
1316
1317 GetInventory().CreateInInventory("HatchbackWheel");
1318 GetInventory().CreateInInventory("HatchbackWheel");
1319 }
1320}
1321
1323{
1325 {
1326 SpawnUniversalParts();
1327 SpawnAdditionalItems();
1328 FillUpCarFluids();
1329
1330 GetInventory().CreateInInventory("HatchbackWheel");
1331 GetInventory().CreateInInventory("HatchbackWheel");
1332 GetInventory().CreateInInventory("HatchbackWheel");
1333 GetInventory().CreateInInventory("HatchbackWheel");
1334
1335 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1336 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1337 GetInventory().CreateInInventory("HatchbackHood_Blue");
1338 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1339
1340
1341 GetInventory().CreateInInventory("HatchbackWheel");
1342 GetInventory().CreateInInventory("HatchbackWheel");
1343 }
1344}
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.