813{
817
819 {
820
821
822 m_EngineStartOK = "offroad_engine_start_SoundSet";
823 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
824 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
825 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
826 m_EngineStop = "offroad_engine_stop_SoundSet";
827 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
828
829 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
830 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
831 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
832 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
833
834 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
835 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
836
837 SetEnginePos("0 0.7 1.2");
838 }
839
841 {
842 super.EEInit();
843
845 {
852
855 }
856 }
857
859 {
860 super.OnEngineStart();
861
863 {
865 }
866 }
867
869 {
870 super.OnEngineStop();
871
873 {
875 }
876 }
877
879 {
881 {
883 {
885 }
886 }
887 }
888
890 {
892 }
893
895 {
896 return 3.5;
897 }
898
900 {
901 switch (posIdx)
902 {
903 case 0:
905 case 1:
907 case 2:
909 case 3:
911 }
912
913 return 0;
914
915 }
916
917
919 {
921 }
922
924 {
926 }
927
929 {
930 if (!super.CanReleaseAttachment(attachment))
931 {
932 return false;
933 }
934
936 {
937 string attType = attachment.GetType();
938 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
939 {
940 return false;
941 }
942 }
943
944 return true;
945 }
946
948 {
950 }
951
953 {
954 if (!super.CanDisplayAttachmentCategory(category_name))
955 {
956 return false;
957 }
958
960 if (category_name.
Contains(
"engine"))
961 {
963 {
964 return false;
965 }
966 }
967
968 return true;
969 }
970
972 {
973 if (!super.CanDisplayCargo())
974 {
975 return false;
976 }
977
979 {
980 return false;
981 }
982
983 return true;
984 }
985
987 {
989
990 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
991 if (!carDoor)
992 {
994 }
995
996 switch (slotType)
997 {
998 case "NivaDriverDoors":
999 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
1000
1001 case "NivaCoDriverDoors":
1002 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
1003
1004 case "NivaHood":
1005 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
1006
1007 case "NivaTrunk":
1008 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
1009 }
1010
1012 }
1013
1015 {
1017 switch (posIdx)
1018 {
1019 case 0:
1021 return false;
1022 else if (GetAnimationPhase("SeatDriver") > 0.5)
1023 return false;
1024
1025 return true;
1026
1027 case 1:
1029 return false;
1030 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1031 return false;
1032
1033 return true;
1034
1035 case 2:
1037 return false;
1038 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1039 return false;
1040
1041 return true;
1042
1043 case 3:
1045 return false;
1046 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1047 return false;
1048
1049 return true;
1050 }
1051
1052 return false;
1053 }
1054
1056 {
1057 switch (posIdx)
1058 {
1059 case 0:
1060 case 2:
1061 return "doors_driver";
1062 case 1:
1063 case 3:
1064 return "doors_codriver";
1065 }
1066
1067 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1068 }
1069
1071 {
1072 switch (posIdx)
1073 {
1074 case 0:
1075 case 2:
1076 return "NivaDriverDoors";
1077 case 1:
1078 case 3:
1079 return "NivaCoDriverDoors";
1080 }
1081
1082 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1083 }
1084
1085
1086
1088 {
1089 float tempCap = 0.0;
1090
1091 switch (ctrl)
1092 {
1094 float newValue = 0;
1096 {
1097 newValue += 0.5;
1098 }
1099
1101 {
1102 newValue += 0.5;
1103 }
1104
1106 {
1107 newValue += 0.3;
1108 }
1109
1111 {
1112 newValue -= 0.6;
1113 }
1114
1116 {
1117 newValue -= 0.2;
1118 }
1119
1121 {
1122 newValue -= 0.2;
1123 }
1124
1126 break;
1127 }
1128
1129 return super.OnSound(ctrl, oldValue);
1130 }
1131
1133 {
1134 switch (selection)
1135 {
1136 case "doors_driver":
1137 return "DoorsDriver";
1138 case "doors_codriver":
1139 return "DoorsCoDriver";
1140 case "doors_hood":
1141 return "DoorsHood";
1142 case "doors_trunk":
1143 return "DoorsTrunk";
1144 case "seatback_driver":
1145 return "SeatDriver";
1146 case "seatback_codriver":
1147 return "SeatCoDriver";
1148 }
1149
1150 return "";
1151 }
1152
1154 {
1155 switch (selection)
1156 {
1157 case "seat_driver":
1158 case "seatback_driver":
1159 case "seat_cargo1":
1160 return "seat_con_1_1";
1161 case "seat_codriver":
1162 case "seatback_codriver":
1163 case "seat_cargo2":
1164 return "seat_con_2_1";
1165 }
1166
1167 return "";
1168 }
1169
1171 {
1172 switch (selection)
1173 {
1174 case "seatback_driver":
1175 return 0;
1176 case "seatback_codriver":
1177 return 1;
1178 }
1179
1180 return -1;
1181 }
1182
1184 {
1185 return false;
1186 }
1187
1189 {
1190 return false;
1191 }
1192
1194 {
1195 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1196 return false;
1197
1198 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1199 return false;
1200
1201 switch (currentSeat)
1202 {
1203 case 0:
1204 return nextSeat == 1;
1205
1206 case 1:
1207 return nextSeat == 0;
1208
1209 case 2:
1210 return nextSeat == 3;
1211
1212 case 3:
1213 return nextSeat == 2;
1214 }
1215
1216 return false;
1217 }
1218
1220 {
1221 switch (pCurrentSeat)
1222 {
1223 case 0:
1224 return pDoorsSelection == "DoorsDriver";
1225
1226 case 1:
1227 return pDoorsSelection == "DoorsCoDriver";
1228
1229 case 2:
1230 return pDoorsSelection == "DoorsDriver";
1231
1232 case 3:
1233 return pDoorsSelection == "DoorsCoDriver";
1234 }
1235
1236 return false;
1237 }
1238
1240 {
1241 switch (pDoorSelection)
1242 {
1243 case "DoorsDriver":
1244 return 0;
1245 case "DoorsCoDriver":
1246 return 1;
1247 }
1248
1249 return -1;
1250 }
1251
1253 {
1254 super.SetActions();
1255
1257 }
1258
1260 {
1261 SpawnUniversalParts();
1262 SpawnAdditionalItems();
1263 FillUpCarFluids();
1264
1265 GetInventory().CreateInInventory("HatchbackWheel");
1266 GetInventory().CreateInInventory("HatchbackWheel");
1267 GetInventory().CreateInInventory("HatchbackWheel" );
1268 GetInventory().CreateInInventory("HatchbackWheel");
1269
1270 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1271 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1272 GetInventory().CreateInInventory("HatchbackHood");
1273 GetInventory().CreateInInventory("HatchbackTrunk");
1274
1275
1276 GetInventory().CreateInInventory("HatchbackWheel");
1277 GetInventory().CreateInInventory("HatchbackWheel");
1278 }
1279}
1280
1282{
1284 {
1285 SpawnUniversalParts();
1286 SpawnAdditionalItems();
1287 FillUpCarFluids();
1288
1289 GetInventory().CreateInInventory("HatchbackWheel");
1290 GetInventory().CreateInInventory("HatchbackWheel");
1291 GetInventory().CreateInInventory("HatchbackWheel");
1292 GetInventory().CreateInInventory("HatchbackWheel");
1293
1294 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1295 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1296 GetInventory().CreateInInventory("HatchbackHood_White");
1297 GetInventory().CreateInInventory("HatchbackTrunk_White");
1298
1299
1300 GetInventory().CreateInInventory("HatchbackWheel");
1301 GetInventory().CreateInInventory("HatchbackWheel");
1302 }
1303}
1304
1306{
1308 {
1309 SpawnUniversalParts();
1310 SpawnAdditionalItems();
1311 FillUpCarFluids();
1312
1313 GetInventory().CreateInInventory("HatchbackWheel");
1314 GetInventory().CreateInInventory("HatchbackWheel");
1315 GetInventory().CreateInInventory("HatchbackWheel");
1316 GetInventory().CreateInInventory("HatchbackWheel");
1317
1318 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1319 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1320 GetInventory().CreateInInventory("HatchbackHood_Blue");
1321 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1322
1323
1324 GetInventory().CreateInInventory("HatchbackWheel");
1325 GetInventory().CreateInInventory("HatchbackWheel");
1326 }
1327}
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.