792{
796
798 {
799
800
801 m_EngineStartOK = "offroad_engine_start_SoundSet";
802 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
803 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
804 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
805 m_EngineStop = "offroad_engine_stop_SoundSet";
806 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
807
808 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
809 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
810 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
811 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
812
813 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
814 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
815
816 SetEnginePos("0 0.7 1.2");
817 }
818
820 {
821 super.EEInit();
822
824 {
831
834 }
835 }
836
838 {
839 super.OnEngineStart();
840
842 {
844 }
845 }
846
848 {
849 super.OnEngineStop();
850
852 {
854 }
855 }
856
858 {
860 {
862 {
864 }
865 }
866 }
867
869 {
871 }
872
874 {
875 return 3.5;
876 }
877
879 {
880 switch (posIdx)
881 {
882 case 0:
884 case 1:
886 case 2:
888 case 3:
890 }
891
892 return 0;
893
894 }
895
896
898 {
900 }
901
903 {
905 }
906
908 {
909 if (!super.CanReleaseAttachment(attachment))
910 {
911 return false;
912 }
913
915 {
916 string attType = attachment.GetType();
917 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
918 {
919 return false;
920 }
921 }
922
923 return true;
924 }
925
927 {
929 }
930
932 {
933 if (!super.CanDisplayAttachmentCategory(category_name))
934 {
935 return false;
936 }
937
939 if (category_name.
Contains(
"engine"))
940 {
942 {
943 return false;
944 }
945 }
946
947 return true;
948 }
949
951 {
952 if (!super.CanDisplayCargo())
953 {
954 return false;
955 }
956
958 {
959 return false;
960 }
961
962 return true;
963 }
964
966 {
968
969 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
970 if (!carDoor)
971 {
973 }
974
975 switch (slotType)
976 {
977 case "NivaDriverDoors":
978 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
979
980 case "NivaCoDriverDoors":
981 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
982
983 case "NivaHood":
984 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
985
986 case "NivaTrunk":
987 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
988 }
989
991 }
992
994 {
996 switch (posIdx)
997 {
998 case 0:
1000 return false;
1001 else if (GetAnimationPhase("SeatDriver") > 0.5)
1002 return false;
1003
1004 return true;
1005
1006 case 1:
1008 return false;
1009 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1010 return false;
1011
1012 return true;
1013
1014 case 2:
1016 return false;
1017 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1018 return false;
1019
1020 return true;
1021
1022 case 3:
1024 return false;
1025 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1026 return false;
1027
1028 return true;
1029 }
1030
1031 return false;
1032 }
1033
1035 {
1036 switch (posIdx)
1037 {
1038 case 0:
1039 case 2:
1040 return "doors_driver";
1041 case 1:
1042 case 3:
1043 return "doors_codriver";
1044 }
1045
1046 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1047 }
1048
1050 {
1051 switch (posIdx)
1052 {
1053 case 0:
1054 case 2:
1055 return "NivaDriverDoors";
1056 case 1:
1057 case 3:
1058 return "NivaCoDriverDoors";
1059 }
1060
1061 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1062 }
1063
1064
1065
1067 {
1068 float tempCap = 0.0;
1069
1070 switch (ctrl)
1071 {
1073 float newValue = 0;
1075 {
1076 newValue += 0.5;
1077 }
1078
1080 {
1081 newValue += 0.5;
1082 }
1083
1085 {
1086 newValue += 0.3;
1087 }
1088
1090 {
1091 newValue -= 0.6;
1092 }
1093
1095 {
1096 newValue -= 0.2;
1097 }
1098
1100 {
1101 newValue -= 0.2;
1102 }
1103
1105 break;
1106 }
1107
1108 return super.OnSound(ctrl, oldValue);
1109 }
1110
1112 {
1113 switch (selection)
1114 {
1115 case "doors_driver":
1116 return "DoorsDriver";
1117 case "doors_codriver":
1118 return "DoorsCoDriver";
1119 case "doors_hood":
1120 return "DoorsHood";
1121 case "doors_trunk":
1122 return "DoorsTrunk";
1123 case "seatback_driver":
1124 return "SeatDriver";
1125 case "seatback_codriver":
1126 return "SeatCoDriver";
1127 }
1128
1129 return "";
1130 }
1131
1133 {
1134 switch (selection)
1135 {
1136 case "seat_driver":
1137 case "seatback_driver":
1138 case "seat_cargo1":
1139 return "seat_con_1_1";
1140 case "seat_codriver":
1141 case "seatback_codriver":
1142 case "seat_cargo2":
1143 return "seat_con_2_1";
1144 }
1145
1146 return "";
1147 }
1148
1150 {
1151 switch (selection)
1152 {
1153 case "seatback_driver":
1154 return 0;
1155 case "seatback_codriver":
1156 return 1;
1157 }
1158
1159 return -1;
1160 }
1161
1163 {
1164 return false;
1165 }
1166
1168 {
1169 return false;
1170 }
1171
1173 {
1174 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1175 return false;
1176
1177 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1178 return false;
1179
1180 switch (currentSeat)
1181 {
1182 case 0:
1183 return nextSeat == 1;
1184
1185 case 1:
1186 return nextSeat == 0;
1187
1188 case 2:
1189 return nextSeat == 3;
1190
1191 case 3:
1192 return nextSeat == 2;
1193 }
1194
1195 return false;
1196 }
1197
1199 {
1200 switch (pCurrentSeat)
1201 {
1202 case 0:
1203 return pDoorsSelection == "DoorsDriver";
1204
1205 case 1:
1206 return pDoorsSelection == "DoorsCoDriver";
1207
1208 case 2:
1209 return pDoorsSelection == "DoorsDriver";
1210
1211 case 3:
1212 return pDoorsSelection == "DoorsCoDriver";
1213 }
1214
1215 return false;
1216 }
1217
1219 {
1220 switch (pDoorSelection)
1221 {
1222 case "DoorsDriver":
1223 return 0;
1224 case "DoorsCoDriver":
1225 return 1;
1226 }
1227
1228 return -1;
1229 }
1230
1232 {
1233 super.SetActions();
1234
1236 }
1237
1239 {
1240 SpawnUniversalParts();
1241 SpawnAdditionalItems();
1242 FillUpCarFluids();
1243
1244 GetInventory().CreateInInventory("HatchbackWheel");
1245 GetInventory().CreateInInventory("HatchbackWheel");
1246 GetInventory().CreateInInventory("HatchbackWheel" );
1247 GetInventory().CreateInInventory("HatchbackWheel");
1248
1249 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1250 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1251 GetInventory().CreateInInventory("HatchbackHood");
1252 GetInventory().CreateInInventory("HatchbackTrunk");
1253
1254
1255 GetInventory().CreateInInventory("HatchbackWheel");
1256 GetInventory().CreateInInventory("HatchbackWheel");
1257 }
1258}
1259
1261{
1263 {
1264 SpawnUniversalParts();
1265 SpawnAdditionalItems();
1266 FillUpCarFluids();
1267
1268 GetInventory().CreateInInventory("HatchbackWheel");
1269 GetInventory().CreateInInventory("HatchbackWheel");
1270 GetInventory().CreateInInventory("HatchbackWheel");
1271 GetInventory().CreateInInventory("HatchbackWheel");
1272
1273 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1274 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1275 GetInventory().CreateInInventory("HatchbackHood_White");
1276 GetInventory().CreateInInventory("HatchbackTrunk_White");
1277
1278
1279 GetInventory().CreateInInventory("HatchbackWheel");
1280 GetInventory().CreateInInventory("HatchbackWheel");
1281 }
1282}
1283
1285{
1287 {
1288 SpawnUniversalParts();
1289 SpawnAdditionalItems();
1290 FillUpCarFluids();
1291
1292 GetInventory().CreateInInventory("HatchbackWheel");
1293 GetInventory().CreateInInventory("HatchbackWheel");
1294 GetInventory().CreateInInventory("HatchbackWheel");
1295 GetInventory().CreateInInventory("HatchbackWheel");
1296
1297 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1298 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1299 GetInventory().CreateInInventory("HatchbackHood_Blue");
1300 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1301
1302
1303 GetInventory().CreateInInventory("HatchbackWheel");
1304 GetInventory().CreateInInventory("HatchbackWheel");
1305 }
1306}
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.