828{
832
834 {
835
836
842
847
850
851 SetEnginePos("0 0.7 1.2");
852 }
853
855 {
856 super.EEInit();
857
859 {
866
869 }
870 }
871
873 {
874 super.OnEngineStart();
875
877 {
879 }
880 }
881
883 {
884 super.OnEngineStop();
885
887 {
889 }
890 }
891
893 {
895 {
897 {
899 }
900 }
901 }
902
904 {
906 }
907
909 {
910 return 3.5;
911 }
912
914 {
915 switch (posIdx)
916 {
917 case 0:
919 case 1:
921 case 2:
923 case 3:
925 }
926
927 return 0;
928
929 }
930
931
933 {
935 }
936
938 {
940 }
941
943 {
944 if (!super.CanReleaseAttachment(attachment))
945 {
946 return false;
947 }
948
950 {
951 string attType = attachment.GetType();
952 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
953 {
954 return false;
955 }
956 }
957
958 return true;
959 }
960
962 {
964 }
965
967 {
968 if (!super.CanDisplayAttachmentCategory(category_name))
969 {
970 return false;
971 }
972
974 if (category_name.
Contains(
"engine"))
975 {
977 {
978 return false;
979 }
980 }
981
982 return true;
983 }
984
986 {
987 if (!super.CanDisplayCargo())
988 {
989 return false;
990 }
991
993 {
994 return false;
995 }
996
997 return true;
998 }
999
1001 {
1003
1004 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
1005 if (!carDoor)
1006 {
1008 }
1009
1010 switch (slotType)
1011 {
1012 case "NivaDriverDoors":
1014
1015 case "NivaCoDriverDoors":
1017
1018 case "NivaHood":
1020
1021 case "NivaTrunk":
1023 }
1024
1026 }
1027
1029 {
1031 switch (posIdx)
1032 {
1033 case 0:
1035 return false;
1036 else if (GetAnimationPhase("SeatDriver") > 0.5)
1037 return false;
1038
1039 return true;
1040
1041 case 1:
1043 return false;
1044 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1045 return false;
1046
1047 return true;
1048
1049 case 2:
1051 return false;
1052 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1053 return false;
1054
1055 return true;
1056
1057 case 3:
1059 return false;
1060 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1061 return false;
1062
1063 return true;
1064 }
1065
1066 return false;
1067 }
1068
1070 {
1071 switch (posIdx)
1072 {
1073 case 0:
1074 case 2:
1075 return "doors_driver";
1076 case 1:
1077 case 3:
1078 return "doors_codriver";
1079 }
1080
1081 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1082 }
1083
1085 {
1086 switch (posIdx)
1087 {
1088 case 0:
1089 case 2:
1090 return "NivaDriverDoors";
1091 case 1:
1092 case 3:
1093 return "NivaCoDriverDoors";
1094 }
1095
1096 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1097 }
1098
1099
1100
1102 {
1103 float tempCap = 0.0;
1104
1105 switch (ctrl)
1106 {
1108 float newValue = 0;
1110 {
1111 newValue += 0.5;
1112 }
1113
1115 {
1116 newValue += 0.5;
1117 }
1118
1120 {
1121 newValue += 0.3;
1122 }
1123
1125 {
1126 newValue -= 0.6;
1127 }
1128
1130 {
1131 newValue -= 0.2;
1132 }
1133
1135 {
1136 newValue -= 0.2;
1137 }
1138
1140 break;
1141 }
1142
1143 return super.OnSound(ctrl, oldValue);
1144 }
1145
1147 {
1148 switch (selection)
1149 {
1150 case "doors_driver":
1151 return "DoorsDriver";
1152 case "doors_codriver":
1153 return "DoorsCoDriver";
1154 case "doors_hood":
1155 return "DoorsHood";
1156 case "doors_trunk":
1157 return "DoorsTrunk";
1158 case "seatback_driver":
1159 return "SeatDriver";
1160 case "seatback_codriver":
1161 return "SeatCoDriver";
1162 }
1163
1164 return "";
1165 }
1166
1168 {
1169 switch (selection)
1170 {
1171 case "seat_driver":
1172 case "seatback_driver":
1173 case "seat_cargo1":
1174 return "seat_con_1_1";
1175 case "seat_codriver":
1176 case "seatback_codriver":
1177 case "seat_cargo2":
1178 return "seat_con_2_1";
1179 }
1180
1181 return "";
1182 }
1183
1185 {
1186 switch (selection)
1187 {
1188 case "seatback_driver":
1189 return 0;
1190 case "seatback_codriver":
1191 return 1;
1192 }
1193
1194 return -1;
1195 }
1196
1198 {
1199 return false;
1200 }
1201
1203 {
1204 return false;
1205 }
1206
1208 {
1209 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1210 return false;
1211
1212 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1213 return false;
1214
1215 switch (currentSeat)
1216 {
1217 case 0:
1218 return nextSeat == 1;
1219
1220 case 1:
1221 return nextSeat == 0;
1222
1223 case 2:
1224 return nextSeat == 3;
1225
1226 case 3:
1227 return nextSeat == 2;
1228 }
1229
1230 return false;
1231 }
1232
1234 {
1235 switch (pCurrentSeat)
1236 {
1237 case 0:
1238 return pDoorsSelection == "DoorsDriver";
1239
1240 case 1:
1241 return pDoorsSelection == "DoorsCoDriver";
1242
1243 case 2:
1244 return pDoorsSelection == "DoorsDriver";
1245
1246 case 3:
1247 return pDoorsSelection == "DoorsCoDriver";
1248 }
1249
1250 return false;
1251 }
1252
1254 {
1255 switch (pDoorSelection)
1256 {
1257 case "DoorsDriver":
1258 return 0;
1259 case "DoorsCoDriver":
1260 return 1;
1261 }
1262
1263 return -1;
1264 }
1265
1267 {
1268 super.SetActions();
1269
1271 }
1272
1274 {
1278
1279 GetInventory().CreateInInventory("HatchbackWheel");
1280 GetInventory().CreateInInventory("HatchbackWheel");
1281 GetInventory().CreateInInventory("HatchbackWheel" );
1282 GetInventory().CreateInInventory("HatchbackWheel");
1283
1284 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1285 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1286 GetInventory().CreateInInventory("HatchbackHood");
1287 GetInventory().CreateInInventory("HatchbackTrunk");
1288
1289
1290 GetInventory().CreateInInventory("HatchbackWheel");
1291 GetInventory().CreateInInventory("HatchbackWheel");
1292 }
1293}
1294
1296{
1298 {
1302
1303 GetInventory().CreateInInventory("HatchbackWheel");
1304 GetInventory().CreateInInventory("HatchbackWheel");
1305 GetInventory().CreateInInventory("HatchbackWheel");
1306 GetInventory().CreateInInventory("HatchbackWheel");
1307
1308 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1309 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1310 GetInventory().CreateInInventory("HatchbackHood_White");
1311 GetInventory().CreateInInventory("HatchbackTrunk_White");
1312
1313
1314 GetInventory().CreateInInventory("HatchbackWheel");
1315 GetInventory().CreateInInventory("HatchbackWheel");
1316 }
1317}
1318
1320{
1322 {
1326
1327 GetInventory().CreateInInventory("HatchbackWheel");
1328 GetInventory().CreateInInventory("HatchbackWheel");
1329 GetInventory().CreateInInventory("HatchbackWheel");
1330 GetInventory().CreateInInventory("HatchbackWheel");
1331
1332 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1333 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1334 GetInventory().CreateInInventory("HatchbackHood_Blue");
1335 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1336
1337
1338 GetInventory().CreateInInventory("HatchbackWheel");
1339 GetInventory().CreateInInventory("HatchbackWheel");
1340 }
1341}
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.