747{
751
753 {
754
755
756 m_EngineStartOK = "offroad_engine_start_SoundSet";
757 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
758 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
759 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
760 m_EngineStop = "offroad_engine_stop_SoundSet";
761 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
762
763 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
764 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
765 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
766 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
767
768 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
769 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
770
771 SetEnginePos("0 0.7 1.2");
772 }
773
775 {
776 super.EEInit();
777
779 {
786
789 }
790 }
791
793 {
794 super.OnEngineStart();
795
797 {
799 }
800 }
801
803 {
804 super.OnEngineStop();
805
807 {
809 }
810 }
811
813 {
815 {
817 {
819 }
820 }
821 }
822
824 {
826 }
827
829 {
830 return 3.5;
831 }
832
834 {
835 switch (posIdx)
836 {
837 case 0:
839 case 1:
841 case 2:
843 case 3:
845 }
846
847 return 0;
848
849 }
850
851
853 {
855 }
856
858 {
860 }
861
863 {
864 if (!super.CanReleaseAttachment(attachment))
865 {
866 return false;
867 }
868
870 {
871 string attType = attachment.GetType();
872 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
873 {
874 return false;
875 }
876 }
877
878 return true;
879 }
880
882 {
884 }
885
887 {
888 if (!super.CanDisplayAttachmentCategory(category_name))
889 {
890 return false;
891 }
892
894 if (category_name.
Contains(
"engine"))
895 {
897 {
898 return false;
899 }
900 }
901
902 return true;
903 }
904
906 {
907 if (!super.CanDisplayCargo())
908 {
909 return false;
910 }
911
913 {
914 return false;
915 }
916
917 return true;
918 }
919
921 {
923
924 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
925 if (!carDoor)
926 {
928 }
929
930 switch (slotType)
931 {
932 case "NivaDriverDoors":
933 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
934
935 case "NivaCoDriverDoors":
936 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
937
938 case "NivaHood":
939 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
940
941 case "NivaTrunk":
942 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
943 }
944
946 }
947
949 {
951 switch (posIdx)
952 {
953 case 0:
955 return false;
956 else if (GetAnimationPhase("SeatDriver") > 0.5)
957 return false;
958
959 return true;
960
961 case 1:
963 return false;
964 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
965 return false;
966
967 return true;
968
969 case 2:
971 return false;
972 else if (GetAnimationPhase("SeatDriver") <= 0.5)
973 return false;
974
975 return true;
976
977 case 3:
979 return false;
980 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
981 return false;
982
983 return true;
984 }
985
986 return false;
987 }
988
990 {
991 switch (posIdx)
992 {
993 case 0:
994 case 2:
995 return "doors_driver";
996 case 1:
997 case 3:
998 return "doors_codriver";
999 }
1000
1001 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1002 }
1003
1005 {
1006 switch (posIdx)
1007 {
1008 case 0:
1009 case 2:
1010 return "NivaDriverDoors";
1011 case 1:
1012 case 3:
1013 return "NivaCoDriverDoors";
1014 }
1015
1016 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1017 }
1018
1019
1020
1022 {
1023 float tempCap = 0.0;
1024
1025 switch (ctrl)
1026 {
1028 float newValue = 0;
1030 {
1031 newValue += 0.5;
1032 }
1033
1035 {
1036 newValue += 0.5;
1037 }
1038
1040 {
1041 newValue += 0.3;
1042 }
1043
1045 {
1046 newValue -= 0.6;
1047 }
1048
1050 {
1051 newValue -= 0.2;
1052 }
1053
1055 {
1056 newValue -= 0.2;
1057 }
1058
1060 break;
1061 }
1062
1063 return super.OnSound(ctrl, oldValue);
1064 }
1065
1067 {
1068 switch (selection)
1069 {
1070 case "doors_driver":
1071 return "DoorsDriver";
1072 case "doors_codriver":
1073 return "DoorsCoDriver";
1074 case "doors_hood":
1075 return "DoorsHood";
1076 case "doors_trunk":
1077 return "DoorsTrunk";
1078 case "seatback_driver":
1079 return "SeatDriver";
1080 case "seatback_codriver":
1081 return "SeatCoDriver";
1082 }
1083
1084 return "";
1085 }
1086
1088 {
1089 switch (selection)
1090 {
1091 case "seat_driver":
1092 case "seatback_driver":
1093 case "seat_cargo1":
1094 return "seat_con_1_1";
1095 case "seat_codriver":
1096 case "seatback_codriver":
1097 case "seat_cargo2":
1098 return "seat_con_2_1";
1099 }
1100
1101 return "";
1102 }
1103
1105 {
1106 switch (selection)
1107 {
1108 case "seatback_driver":
1109 return 0;
1110 case "seatback_codriver":
1111 return 1;
1112 }
1113
1114 return -1;
1115 }
1116
1118 {
1119 return false;
1120 }
1121
1123 {
1124 return false;
1125 }
1126
1128 {
1129 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1130 return false;
1131
1132 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1133 return false;
1134
1135 switch (currentSeat)
1136 {
1137 case 0:
1138 return nextSeat == 1;
1139
1140 case 1:
1141 return nextSeat == 0;
1142
1143 case 2:
1144 return nextSeat == 3;
1145
1146 case 3:
1147 return nextSeat == 2;
1148 }
1149
1150 return false;
1151 }
1152
1154 {
1155 switch (pCurrentSeat)
1156 {
1157 case 0:
1158 return pDoorsSelection == "DoorsDriver";
1159
1160 case 1:
1161 return pDoorsSelection == "DoorsCoDriver";
1162
1163 case 2:
1164 return pDoorsSelection == "DoorsDriver";
1165
1166 case 3:
1167 return pDoorsSelection == "DoorsCoDriver";
1168 }
1169
1170 return false;
1171 }
1172
1174 {
1175 switch (pDoorSelection)
1176 {
1177 case "DoorsDriver":
1178 return 0;
1179 case "DoorsCoDriver":
1180 return 1;
1181 }
1182
1183 return -1;
1184 }
1185
1187 {
1188 super.SetActions();
1189
1191 }
1192
1194 {
1195 SpawnUniversalParts();
1196 SpawnAdditionalItems();
1197 FillUpCarFluids();
1198
1199 GetInventory().CreateInInventory("HatchbackWheel");
1200 GetInventory().CreateInInventory("HatchbackWheel");
1201 GetInventory().CreateInInventory("HatchbackWheel" );
1202 GetInventory().CreateInInventory("HatchbackWheel");
1203
1204 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1205 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1206 GetInventory().CreateInInventory("HatchbackHood");
1207 GetInventory().CreateInInventory("HatchbackTrunk");
1208
1209
1210 GetInventory().CreateInInventory("HatchbackWheel");
1211 GetInventory().CreateInInventory("HatchbackWheel");
1212 }
1213}
1214
1216{
1218 {
1219 SpawnUniversalParts();
1220 SpawnAdditionalItems();
1221 FillUpCarFluids();
1222
1223 GetInventory().CreateInInventory("HatchbackWheel");
1224 GetInventory().CreateInInventory("HatchbackWheel");
1225 GetInventory().CreateInInventory("HatchbackWheel");
1226 GetInventory().CreateInInventory("HatchbackWheel");
1227
1228 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1229 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1230 GetInventory().CreateInInventory("HatchbackHood_White");
1231 GetInventory().CreateInInventory("HatchbackTrunk_White");
1232
1233
1234 GetInventory().CreateInInventory("HatchbackWheel");
1235 GetInventory().CreateInInventory("HatchbackWheel");
1236 }
1237}
1238
1240{
1242 {
1243 SpawnUniversalParts();
1244 SpawnAdditionalItems();
1245 FillUpCarFluids();
1246
1247 GetInventory().CreateInInventory("HatchbackWheel");
1248 GetInventory().CreateInInventory("HatchbackWheel");
1249 GetInventory().CreateInInventory("HatchbackWheel");
1250 GetInventory().CreateInInventory("HatchbackWheel");
1251
1252 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1253 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1254 GetInventory().CreateInInventory("HatchbackHood_Blue");
1255 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1256
1257
1258 GetInventory().CreateInInventory("HatchbackWheel");
1259 GetInventory().CreateInInventory("HatchbackWheel");
1260 }
1261}
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.