811{
815
817 {
818
819
825
830
833
834 SetEnginePos("0 0.7 1.2");
835 }
836
838 {
839 super.EEInit();
840
842 {
849
852 }
853 }
854
856 {
857 super.OnEngineStart();
858
860 {
862 }
863 }
864
866 {
867 super.OnEngineStop();
868
870 {
872 }
873 }
874
876 {
878 {
880 {
882 }
883 }
884 }
885
887 {
889 }
890
892 {
893 return 3.5;
894 }
895
897 {
898 switch (posIdx)
899 {
900 case 0:
902 case 1:
904 case 2:
906 case 3:
908 }
909
910 return 0;
911
912 }
913
914
916 {
918 }
919
921 {
923 }
924
926 {
927 if (!super.CanReleaseAttachment(attachment))
928 {
929 return false;
930 }
931
933 {
934 string attType = attachment.GetType();
935 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
936 {
937 return false;
938 }
939 }
940
941 return true;
942 }
943
945 {
947 }
948
950 {
951 if (!super.CanDisplayAttachmentCategory(category_name))
952 {
953 return false;
954 }
955
957 if (category_name.
Contains(
"engine"))
958 {
960 {
961 return false;
962 }
963 }
964
965 return true;
966 }
967
969 {
970 if (!super.CanDisplayCargo())
971 {
972 return false;
973 }
974
976 {
977 return false;
978 }
979
980 return true;
981 }
982
984 {
986
987 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
988 if (!carDoor)
989 {
991 }
992
993 switch (slotType)
994 {
995 case "NivaDriverDoors":
997
998 case "NivaCoDriverDoors":
1000
1001 case "NivaHood":
1003
1004 case "NivaTrunk":
1006 }
1007
1009 }
1010
1012 {
1014 switch (posIdx)
1015 {
1016 case 0:
1018 return false;
1019 else if (GetAnimationPhase("SeatDriver") > 0.5)
1020 return false;
1021
1022 return true;
1023
1024 case 1:
1026 return false;
1027 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1028 return false;
1029
1030 return true;
1031
1032 case 2:
1034 return false;
1035 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1036 return false;
1037
1038 return true;
1039
1040 case 3:
1042 return false;
1043 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1044 return false;
1045
1046 return true;
1047 }
1048
1049 return false;
1050 }
1051
1053 {
1054 switch (posIdx)
1055 {
1056 case 0:
1057 case 2:
1058 return "doors_driver";
1059 case 1:
1060 case 3:
1061 return "doors_codriver";
1062 }
1063
1064 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1065 }
1066
1068 {
1069 switch (posIdx)
1070 {
1071 case 0:
1072 case 2:
1073 return "NivaDriverDoors";
1074 case 1:
1075 case 3:
1076 return "NivaCoDriverDoors";
1077 }
1078
1079 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1080 }
1081
1082
1083
1085 {
1086 float tempCap = 0.0;
1087
1088 switch (ctrl)
1089 {
1091 float newValue = 0;
1093 {
1094 newValue += 0.5;
1095 }
1096
1098 {
1099 newValue += 0.5;
1100 }
1101
1103 {
1104 newValue += 0.3;
1105 }
1106
1108 {
1109 newValue -= 0.6;
1110 }
1111
1113 {
1114 newValue -= 0.2;
1115 }
1116
1118 {
1119 newValue -= 0.2;
1120 }
1121
1123 break;
1124 }
1125
1126 return super.OnSound(ctrl, oldValue);
1127 }
1128
1130 {
1131 switch (selection)
1132 {
1133 case "doors_driver":
1134 return "DoorsDriver";
1135 case "doors_codriver":
1136 return "DoorsCoDriver";
1137 case "doors_hood":
1138 return "DoorsHood";
1139 case "doors_trunk":
1140 return "DoorsTrunk";
1141 case "seatback_driver":
1142 return "SeatDriver";
1143 case "seatback_codriver":
1144 return "SeatCoDriver";
1145 }
1146
1147 return "";
1148 }
1149
1151 {
1152 switch (selection)
1153 {
1154 case "seat_driver":
1155 case "seatback_driver":
1156 case "seat_cargo1":
1157 return "seat_con_1_1";
1158 case "seat_codriver":
1159 case "seatback_codriver":
1160 case "seat_cargo2":
1161 return "seat_con_2_1";
1162 }
1163
1164 return "";
1165 }
1166
1168 {
1169 switch (selection)
1170 {
1171 case "seatback_driver":
1172 return 0;
1173 case "seatback_codriver":
1174 return 1;
1175 }
1176
1177 return -1;
1178 }
1179
1181 {
1182 return false;
1183 }
1184
1186 {
1187 return false;
1188 }
1189
1191 {
1192 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1193 return false;
1194
1195 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1196 return false;
1197
1198 switch (currentSeat)
1199 {
1200 case 0:
1201 return nextSeat == 1;
1202
1203 case 1:
1204 return nextSeat == 0;
1205
1206 case 2:
1207 return nextSeat == 3;
1208
1209 case 3:
1210 return nextSeat == 2;
1211 }
1212
1213 return false;
1214 }
1215
1217 {
1218 switch (pCurrentSeat)
1219 {
1220 case 0:
1221 return pDoorsSelection == "DoorsDriver";
1222
1223 case 1:
1224 return pDoorsSelection == "DoorsCoDriver";
1225
1226 case 2:
1227 return pDoorsSelection == "DoorsDriver";
1228
1229 case 3:
1230 return pDoorsSelection == "DoorsCoDriver";
1231 }
1232
1233 return false;
1234 }
1235
1237 {
1238 switch (pDoorSelection)
1239 {
1240 case "DoorsDriver":
1241 return 0;
1242 case "DoorsCoDriver":
1243 return 1;
1244 }
1245
1246 return -1;
1247 }
1248
1250 {
1251 super.SetActions();
1252
1254 }
1255
1257 {
1261
1262 GetInventory().CreateInInventory("HatchbackWheel");
1263 GetInventory().CreateInInventory("HatchbackWheel");
1264 GetInventory().CreateInInventory("HatchbackWheel" );
1265 GetInventory().CreateInInventory("HatchbackWheel");
1266
1267 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1268 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1269 GetInventory().CreateInInventory("HatchbackHood");
1270 GetInventory().CreateInInventory("HatchbackTrunk");
1271
1272
1273 GetInventory().CreateInInventory("HatchbackWheel");
1274 GetInventory().CreateInInventory("HatchbackWheel");
1275 }
1276}
1277
1279{
1281 {
1285
1286 GetInventory().CreateInInventory("HatchbackWheel");
1287 GetInventory().CreateInInventory("HatchbackWheel");
1288 GetInventory().CreateInInventory("HatchbackWheel");
1289 GetInventory().CreateInInventory("HatchbackWheel");
1290
1291 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1292 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1293 GetInventory().CreateInInventory("HatchbackHood_White");
1294 GetInventory().CreateInInventory("HatchbackTrunk_White");
1295
1296
1297 GetInventory().CreateInInventory("HatchbackWheel");
1298 GetInventory().CreateInInventory("HatchbackWheel");
1299 }
1300}
1301
1303{
1305 {
1309
1310 GetInventory().CreateInInventory("HatchbackWheel");
1311 GetInventory().CreateInInventory("HatchbackWheel");
1312 GetInventory().CreateInInventory("HatchbackWheel");
1313 GetInventory().CreateInInventory("HatchbackWheel");
1314
1315 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1316 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1317 GetInventory().CreateInInventory("HatchbackHood_Blue");
1318 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1319
1320
1321 GetInventory().CreateInInventory("HatchbackWheel");
1322 GetInventory().CreateInInventory("HatchbackWheel");
1323 }
1324}
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.