715{
719
721 {
722
723
724 m_EngineStartOK = "offroad_engine_start_SoundSet";
725 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
726 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
727 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
728 m_EngineStop = "offroad_engine_stop_SoundSet";
729 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
730
731 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
732 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
733 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
734 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
735
736 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
737 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
738
739 SetEnginePos("0 0.7 1.2");
740 }
741
743 {
744 super.EEInit();
745
747 {
754
757 }
758 }
759
761 {
762 super.OnEngineStart();
763
765 {
767 }
768 }
769
771 {
772 super.OnEngineStop();
773
775 {
777 }
778 }
779
781 {
783 {
785 {
787 }
788 }
789 }
790
792 {
794 }
795
797 {
798 return 3.5;
799 }
800
802 {
803 switch (posIdx)
804 {
805 case 0:
807 case 1:
809 case 2:
811 case 3:
813 }
814
815 return 0;
816
817 }
818
819
821 {
823 }
824
826 {
828 }
829
831 {
832 if (!super.CanReleaseAttachment(attachment))
833 {
834 return false;
835 }
836
838 {
839 string attType = attachment.GetType();
840 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
841 {
842 return false;
843 }
844 }
845
846 return true;
847 }
848
850 {
852 }
853
855 {
856 if (!super.CanDisplayAttachmentCategory(category_name))
857 {
858 return false;
859 }
860
862 if (category_name.
Contains(
"engine"))
863 {
865 {
866 return false;
867 }
868 }
869
870 return true;
871 }
872
874 {
875 if (!super.CanDisplayCargo())
876 {
877 return false;
878 }
879
881 {
882 return false;
883 }
884
885 return true;
886 }
887
889 {
891
892 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
893 if (!carDoor)
894 {
896 }
897
898 switch (slotType)
899 {
900 case "NivaDriverDoors":
901 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
902
903 case "NivaCoDriverDoors":
904 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
905
906 case "NivaHood":
907 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
908
909 case "NivaTrunk":
910 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
911 }
912
914 }
915
917 {
919 switch (posIdx)
920 {
921 case 0:
923 return false;
924 else if (GetAnimationPhase("SeatDriver") > 0.5)
925 return false;
926
927 return true;
928
929 case 1:
931 return false;
932 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
933 return false;
934
935 return true;
936
937 case 2:
939 return false;
940 else if (GetAnimationPhase("SeatDriver") <= 0.5)
941 return false;
942
943 return true;
944
945 case 3:
947 return false;
948 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
949 return false;
950
951 return true;
952 }
953
954 return false;
955 }
956
958 {
959 switch (posIdx)
960 {
961 case 0:
962 case 2:
963 return "doors_driver";
964 case 1:
965 case 3:
966 return "doors_codriver";
967 }
968
969 return super.GetDoorSelectionNameFromSeatPos(posIdx);
970 }
971
973 {
974 switch (posIdx)
975 {
976 case 0:
977 case 2:
978 return "NivaDriverDoors";
979 case 1:
980 case 3:
981 return "NivaCoDriverDoors";
982 }
983
984 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
985 }
986
987
988
990 {
991 float tempCap = 0.0;
992
993 switch (ctrl)
994 {
996 float newValue = 0;
998 {
999 newValue += 0.5;
1000 }
1001
1003 {
1004 newValue += 0.5;
1005 }
1006
1008 {
1009 newValue += 0.3;
1010 }
1011
1013 {
1014 newValue -= 0.6;
1015 }
1016
1018 {
1019 newValue -= 0.2;
1020 }
1021
1023 {
1024 newValue -= 0.2;
1025 }
1026
1028 break;
1029 }
1030
1031 return super.OnSound(ctrl, oldValue);
1032 }
1033
1035 {
1036 switch (selection)
1037 {
1038 case "doors_driver":
1039 return "DoorsDriver";
1040 case "doors_codriver":
1041 return "DoorsCoDriver";
1042 case "doors_hood":
1043 return "DoorsHood";
1044 case "doors_trunk":
1045 return "DoorsTrunk";
1046 case "seatback_driver":
1047 return "SeatDriver";
1048 case "seatback_codriver":
1049 return "SeatCoDriver";
1050 }
1051
1052 return "";
1053 }
1054
1056 {
1057 switch (selection)
1058 {
1059 case "seat_driver":
1060 case "seatback_driver":
1061 case "seat_cargo1":
1062 return "seat_con_1_1";
1063 case "seat_codriver":
1064 case "seatback_codriver":
1065 case "seat_cargo2":
1066 return "seat_con_2_1";
1067 }
1068
1069 return "";
1070 }
1071
1073 {
1074 switch (selection)
1075 {
1076 case "seatback_driver":
1077 return 0;
1078 case "seatback_codriver":
1079 return 1;
1080 }
1081
1082 return -1;
1083 }
1084
1086 {
1087 return false;
1088 }
1089
1091 {
1092 return false;
1093 }
1094
1096 {
1097 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1098 return false;
1099
1100 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1101 return false;
1102
1103 switch (currentSeat)
1104 {
1105 case 0:
1106 return nextSeat == 1;
1107
1108 case 1:
1109 return nextSeat == 0;
1110
1111 case 2:
1112 return nextSeat == 3;
1113
1114 case 3:
1115 return nextSeat == 2;
1116 }
1117
1118 return false;
1119 }
1120
1122 {
1123 switch (pCurrentSeat)
1124 {
1125 case 0:
1126 return pDoorsSelection == "DoorsDriver";
1127
1128 case 1:
1129 return pDoorsSelection == "DoorsCoDriver";
1130
1131 case 2:
1132 return pDoorsSelection == "DoorsDriver";
1133
1134 case 3:
1135 return pDoorsSelection == "DoorsCoDriver";
1136 }
1137
1138 return false;
1139 }
1140
1142 {
1143 switch (pDoorSelection)
1144 {
1145 case "DoorsDriver":
1146 return 0;
1147 case "DoorsCoDriver":
1148 return 1;
1149 }
1150
1151 return -1;
1152 }
1153
1155 {
1156 super.SetActions();
1157
1159 }
1160
1162 {
1163 SpawnUniversalParts();
1164 SpawnAdditionalItems();
1165 FillUpCarFluids();
1166
1167 GetInventory().CreateInInventory("HatchbackWheel");
1168 GetInventory().CreateInInventory("HatchbackWheel");
1169 GetInventory().CreateInInventory("HatchbackWheel" );
1170 GetInventory().CreateInInventory("HatchbackWheel");
1171
1172 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1173 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1174 GetInventory().CreateInInventory("HatchbackHood");
1175 GetInventory().CreateInInventory("HatchbackTrunk");
1176
1177
1178 GetInventory().CreateInInventory("HatchbackWheel");
1179 GetInventory().CreateInInventory("HatchbackWheel");
1180 }
1181}
1182
1184{
1186 {
1187 SpawnUniversalParts();
1188 SpawnAdditionalItems();
1189 FillUpCarFluids();
1190
1191 GetInventory().CreateInInventory("HatchbackWheel");
1192 GetInventory().CreateInInventory("HatchbackWheel");
1193 GetInventory().CreateInInventory("HatchbackWheel");
1194 GetInventory().CreateInInventory("HatchbackWheel");
1195
1196 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1197 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1198 GetInventory().CreateInInventory("HatchbackHood_White");
1199 GetInventory().CreateInInventory("HatchbackTrunk_White");
1200
1201
1202 GetInventory().CreateInInventory("HatchbackWheel");
1203 GetInventory().CreateInInventory("HatchbackWheel");
1204 }
1205}
1206
1208{
1210 {
1211 SpawnUniversalParts();
1212 SpawnAdditionalItems();
1213 FillUpCarFluids();
1214
1215 GetInventory().CreateInInventory("HatchbackWheel");
1216 GetInventory().CreateInInventory("HatchbackWheel");
1217 GetInventory().CreateInInventory("HatchbackWheel");
1218 GetInventory().CreateInInventory("HatchbackWheel");
1219
1220 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1221 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1222 GetInventory().CreateInInventory("HatchbackHood_Blue");
1223 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1224
1225
1226 GetInventory().CreateInInventory("HatchbackWheel");
1227 GetInventory().CreateInInventory("HatchbackWheel");
1228 }
1229}
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.