730{
734
736 {
737
738
739 m_EngineStartOK = "offroad_engine_start_SoundSet";
740 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
741 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
742 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
743 m_EngineStop = "offroad_engine_stop_SoundSet";
744 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
745
746 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
747 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
748 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
749 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
750
751 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
752 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
753
754 SetEnginePos("0 0.7 1.2");
755 }
756
758 {
759 super.EEInit();
760
762 {
769
772 }
773 }
774
776 {
777 super.OnEngineStart();
778
780 {
782 }
783 }
784
786 {
787 super.OnEngineStop();
788
790 {
792 }
793 }
794
796 {
798 {
800 {
802 }
803 }
804 }
805
807 {
809 }
810
812 {
813 return 3.5;
814 }
815
817 {
818 switch (posIdx)
819 {
820 case 0:
822 case 1:
824 case 2:
826 case 3:
828 }
829
830 return 0;
831
832 }
833
834
836 {
838 }
839
841 {
843 }
844
846 {
847 if (!super.CanReleaseAttachment(attachment))
848 {
849 return false;
850 }
851
853 {
854 string attType = attachment.GetType();
855 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
856 {
857 return false;
858 }
859 }
860
861 return true;
862 }
863
865 {
867 }
868
870 {
871 if (!super.CanDisplayAttachmentCategory(category_name))
872 {
873 return false;
874 }
875
877 if (category_name.
Contains(
"engine"))
878 {
880 {
881 return false;
882 }
883 }
884
885 return true;
886 }
887
889 {
890 if (!super.CanDisplayCargo())
891 {
892 return false;
893 }
894
896 {
897 return false;
898 }
899
900 return true;
901 }
902
904 {
906
907 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
908 if (!carDoor)
909 {
911 }
912
913 switch (slotType)
914 {
915 case "NivaDriverDoors":
916 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
917
918 case "NivaCoDriverDoors":
919 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
920
921 case "NivaHood":
922 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
923
924 case "NivaTrunk":
925 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
926 }
927
929 }
930
932 {
934 switch (posIdx)
935 {
936 case 0:
938 return false;
939 else if (GetAnimationPhase("SeatDriver") > 0.5)
940 return false;
941
942 return true;
943
944 case 1:
946 return false;
947 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
948 return false;
949
950 return true;
951
952 case 2:
954 return false;
955 else if (GetAnimationPhase("SeatDriver") <= 0.5)
956 return false;
957
958 return true;
959
960 case 3:
962 return false;
963 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
964 return false;
965
966 return true;
967 }
968
969 return false;
970 }
971
973 {
974 switch (posIdx)
975 {
976 case 0:
977 case 2:
978 return "doors_driver";
979 case 1:
980 case 3:
981 return "doors_codriver";
982 }
983
984 return super.GetDoorSelectionNameFromSeatPos(posIdx);
985 }
986
988 {
989 switch (posIdx)
990 {
991 case 0:
992 case 2:
993 return "NivaDriverDoors";
994 case 1:
995 case 3:
996 return "NivaCoDriverDoors";
997 }
998
999 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1000 }
1001
1002
1003
1005 {
1006 float tempCap = 0.0;
1007
1008 switch (ctrl)
1009 {
1011 float newValue = 0;
1013 {
1014 newValue += 0.5;
1015 }
1016
1018 {
1019 newValue += 0.5;
1020 }
1021
1023 {
1024 newValue += 0.3;
1025 }
1026
1028 {
1029 newValue -= 0.6;
1030 }
1031
1033 {
1034 newValue -= 0.2;
1035 }
1036
1038 {
1039 newValue -= 0.2;
1040 }
1041
1043 break;
1044 }
1045
1046 return super.OnSound(ctrl, oldValue);
1047 }
1048
1050 {
1051 switch (selection)
1052 {
1053 case "doors_driver":
1054 return "DoorsDriver";
1055 case "doors_codriver":
1056 return "DoorsCoDriver";
1057 case "doors_hood":
1058 return "DoorsHood";
1059 case "doors_trunk":
1060 return "DoorsTrunk";
1061 case "seatback_driver":
1062 return "SeatDriver";
1063 case "seatback_codriver":
1064 return "SeatCoDriver";
1065 }
1066
1067 return "";
1068 }
1069
1071 {
1072 switch (selection)
1073 {
1074 case "seat_driver":
1075 case "seatback_driver":
1076 case "seat_cargo1":
1077 return "seat_con_1_1";
1078 case "seat_codriver":
1079 case "seatback_codriver":
1080 case "seat_cargo2":
1081 return "seat_con_2_1";
1082 }
1083
1084 return "";
1085 }
1086
1088 {
1089 switch (selection)
1090 {
1091 case "seatback_driver":
1092 return 0;
1093 case "seatback_codriver":
1094 return 1;
1095 }
1096
1097 return -1;
1098 }
1099
1101 {
1102 return false;
1103 }
1104
1106 {
1107 return false;
1108 }
1109
1111 {
1112 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1113 return false;
1114
1115 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1116 return false;
1117
1118 switch (currentSeat)
1119 {
1120 case 0:
1121 return nextSeat == 1;
1122
1123 case 1:
1124 return nextSeat == 0;
1125
1126 case 2:
1127 return nextSeat == 3;
1128
1129 case 3:
1130 return nextSeat == 2;
1131 }
1132
1133 return false;
1134 }
1135
1137 {
1138 switch (pCurrentSeat)
1139 {
1140 case 0:
1141 return pDoorsSelection == "DoorsDriver";
1142
1143 case 1:
1144 return pDoorsSelection == "DoorsCoDriver";
1145
1146 case 2:
1147 return pDoorsSelection == "DoorsDriver";
1148
1149 case 3:
1150 return pDoorsSelection == "DoorsCoDriver";
1151 }
1152
1153 return false;
1154 }
1155
1157 {
1158 switch (pDoorSelection)
1159 {
1160 case "DoorsDriver":
1161 return 0;
1162 case "DoorsCoDriver":
1163 return 1;
1164 }
1165
1166 return -1;
1167 }
1168
1170 {
1171 super.SetActions();
1172
1174 }
1175
1177 {
1178 SpawnUniversalParts();
1179 SpawnAdditionalItems();
1180 FillUpCarFluids();
1181
1182 GetInventory().CreateInInventory("HatchbackWheel");
1183 GetInventory().CreateInInventory("HatchbackWheel");
1184 GetInventory().CreateInInventory("HatchbackWheel" );
1185 GetInventory().CreateInInventory("HatchbackWheel");
1186
1187 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1188 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1189 GetInventory().CreateInInventory("HatchbackHood");
1190 GetInventory().CreateInInventory("HatchbackTrunk");
1191
1192
1193 GetInventory().CreateInInventory("HatchbackWheel");
1194 GetInventory().CreateInInventory("HatchbackWheel");
1195 }
1196}
1197
1199{
1201 {
1202 SpawnUniversalParts();
1203 SpawnAdditionalItems();
1204 FillUpCarFluids();
1205
1206 GetInventory().CreateInInventory("HatchbackWheel");
1207 GetInventory().CreateInInventory("HatchbackWheel");
1208 GetInventory().CreateInInventory("HatchbackWheel");
1209 GetInventory().CreateInInventory("HatchbackWheel");
1210
1211 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1212 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1213 GetInventory().CreateInInventory("HatchbackHood_White");
1214 GetInventory().CreateInInventory("HatchbackTrunk_White");
1215
1216
1217 GetInventory().CreateInInventory("HatchbackWheel");
1218 GetInventory().CreateInInventory("HatchbackWheel");
1219 }
1220}
1221
1223{
1225 {
1226 SpawnUniversalParts();
1227 SpawnAdditionalItems();
1228 FillUpCarFluids();
1229
1230 GetInventory().CreateInInventory("HatchbackWheel");
1231 GetInventory().CreateInInventory("HatchbackWheel");
1232 GetInventory().CreateInInventory("HatchbackWheel");
1233 GetInventory().CreateInInventory("HatchbackWheel");
1234
1235 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1236 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1237 GetInventory().CreateInInventory("HatchbackHood_Blue");
1238 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1239
1240
1241 GetInventory().CreateInInventory("HatchbackWheel");
1242 GetInventory().CreateInInventory("HatchbackWheel");
1243 }
1244}
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.