674{
678
680 {
681
682
683 m_EngineStartOK = "offroad_engine_start_SoundSet";
684 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
685 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
686 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
687 m_EngineStop = "offroad_engine_stop_SoundSet";
688 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
689
690 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
691 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
692 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
693 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
694
695 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
696 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
697
698 SetEnginePos("0 0.7 1.2");
699 }
700
702 {
703 super.EEInit();
704
706 {
713
716 }
717 }
718
720 {
721 super.OnEngineStart();
722
724 {
726 }
727 }
728
730 {
731 super.OnEngineStop();
732
734 {
736 }
737 }
738
740 {
742 {
744 {
746 }
747 }
748 }
749
751 {
753 }
754
756 {
757 return 3.5;
758 }
759
761 {
762 switch (posIdx)
763 {
764 case 0:
766 case 1:
768 case 2:
770 case 3:
772 }
773
774 return 0;
775
776 }
777
778
780 {
782 }
783
785 {
787 }
788
790 {
791 if (!super.CanReleaseAttachment(attachment))
792 {
793 return false;
794 }
795
797 {
798 string attType = attachment.GetType();
799 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
800 {
801 return false;
802 }
803 }
804
805 return true;
806 }
807
809 {
811 }
812
814 {
815 if (!super.CanDisplayAttachmentCategory(category_name))
816 {
817 return false;
818 }
819
821 if (category_name.
Contains(
"engine"))
822 {
824 {
825 return false;
826 }
827 }
828
829 return true;
830 }
831
833 {
834 if (!super.CanDisplayCargo())
835 {
836 return false;
837 }
838
840 {
841 return false;
842 }
843
844 return true;
845 }
846
848 {
850
851 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
852 if (!carDoor)
853 {
855 }
856
857 switch (slotType)
858 {
859 case "NivaDriverDoors":
860 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
861
862 case "NivaCoDriverDoors":
863 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
864
865 case "NivaHood":
866 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
867
868 case "NivaTrunk":
869 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
870 }
871
873 }
874
876 {
878 switch (posIdx)
879 {
880 case 0:
882 return false;
883 else if (GetAnimationPhase("SeatDriver") > 0.5)
884 return false;
885
886 return true;
887
888 case 1:
890 return false;
891 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
892 return false;
893
894 return true;
895
896 case 2:
898 return false;
899 else if (GetAnimationPhase("SeatDriver") <= 0.5)
900 return false;
901
902 return true;
903
904 case 3:
906 return false;
907 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
908 return false;
909
910 return true;
911 }
912
913 return false;
914 }
915
917 {
918 switch (posIdx)
919 {
920 case 0:
921 case 2:
922 return "doors_driver";
923 case 1:
924 case 3:
925 return "doors_codriver";
926 }
927
928 return super.GetDoorSelectionNameFromSeatPos(posIdx);
929 }
930
932 {
933 switch (posIdx)
934 {
935 case 0:
936 case 2:
937 return "NivaDriverDoors";
938 case 1:
939 case 3:
940 return "NivaCoDriverDoors";
941 }
942
943 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
944 }
945
946
947
949 {
950 float tempCap = 0.0;
951
952 switch (ctrl)
953 {
955 float newValue = 0;
957 {
958 newValue += 0.5;
959 }
960
962 {
963 newValue += 0.5;
964 }
965
967 {
968 newValue += 0.3;
969 }
970
972 {
973 newValue -= 0.6;
974 }
975
977 {
978 newValue -= 0.2;
979 }
980
982 {
983 newValue -= 0.2;
984 }
985
987 break;
988 }
989
990 return super.OnSound(ctrl, oldValue);
991 }
992
994 {
995 switch (selection)
996 {
997 case "doors_driver":
998 return "DoorsDriver";
999 case "doors_codriver":
1000 return "DoorsCoDriver";
1001 case "doors_hood":
1002 return "DoorsHood";
1003 case "doors_trunk":
1004 return "DoorsTrunk";
1005 case "seatback_driver":
1006 return "SeatDriver";
1007 case "seatback_codriver":
1008 return "SeatCoDriver";
1009 }
1010
1011 return "";
1012 }
1013
1015 {
1016 switch (selection)
1017 {
1018 case "seat_driver":
1019 case "seatback_driver":
1020 case "seat_cargo1":
1021 return "seat_con_1_1";
1022 case "seat_codriver":
1023 case "seatback_codriver":
1024 case "seat_cargo2":
1025 return "seat_con_2_1";
1026 }
1027
1028 return "";
1029 }
1030
1032 {
1033 switch (selection)
1034 {
1035 case "seatback_driver":
1036 return 0;
1037 case "seatback_codriver":
1038 return 1;
1039 }
1040
1041 return -1;
1042 }
1043
1045 {
1046 return false;
1047 }
1048
1050 {
1051 return false;
1052 }
1053
1055 {
1056 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1057 return false;
1058
1059 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1060 return false;
1061
1062 switch (currentSeat)
1063 {
1064 case 0:
1065 return nextSeat == 1;
1066
1067 case 1:
1068 return nextSeat == 0;
1069
1070 case 2:
1071 return nextSeat == 3;
1072
1073 case 3:
1074 return nextSeat == 2;
1075 }
1076
1077 return false;
1078 }
1079
1081 {
1082 switch (pCurrentSeat)
1083 {
1084 case 0:
1085 return pDoorsSelection == "DoorsDriver";
1086
1087 case 1:
1088 return pDoorsSelection == "DoorsCoDriver";
1089
1090 case 2:
1091 return pDoorsSelection == "DoorsDriver";
1092
1093 case 3:
1094 return pDoorsSelection == "DoorsCoDriver";
1095 }
1096
1097 return false;
1098 }
1099
1101 {
1102 switch (pDoorSelection)
1103 {
1104 case "DoorsDriver":
1105 return 0;
1106 case "DoorsCoDriver":
1107 return 1;
1108 }
1109
1110 return -1;
1111 }
1112
1114 {
1115 super.SetActions();
1116
1118 }
1119
1121 {
1122 SpawnUniversalParts();
1123 SpawnAdditionalItems();
1124 FillUpCarFluids();
1125
1126 GetInventory().CreateInInventory("HatchbackWheel");
1127 GetInventory().CreateInInventory("HatchbackWheel");
1128 GetInventory().CreateInInventory("HatchbackWheel" );
1129 GetInventory().CreateInInventory("HatchbackWheel");
1130
1131 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1132 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1133 GetInventory().CreateInInventory("HatchbackHood");
1134 GetInventory().CreateInInventory("HatchbackTrunk");
1135
1136
1137 GetInventory().CreateInInventory("HatchbackWheel");
1138 GetInventory().CreateInInventory("HatchbackWheel");
1139 }
1140}
1141
1143{
1145 {
1146 SpawnUniversalParts();
1147 SpawnAdditionalItems();
1148 FillUpCarFluids();
1149
1150 GetInventory().CreateInInventory("HatchbackWheel");
1151 GetInventory().CreateInInventory("HatchbackWheel");
1152 GetInventory().CreateInInventory("HatchbackWheel");
1153 GetInventory().CreateInInventory("HatchbackWheel");
1154
1155 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1156 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1157 GetInventory().CreateInInventory("HatchbackHood_White");
1158 GetInventory().CreateInInventory("HatchbackTrunk_White");
1159
1160
1161 GetInventory().CreateInInventory("HatchbackWheel");
1162 GetInventory().CreateInInventory("HatchbackWheel");
1163 }
1164}
1165
1167{
1169 {
1170 SpawnUniversalParts();
1171 SpawnAdditionalItems();
1172 FillUpCarFluids();
1173
1174 GetInventory().CreateInInventory("HatchbackWheel");
1175 GetInventory().CreateInInventory("HatchbackWheel");
1176 GetInventory().CreateInInventory("HatchbackWheel");
1177 GetInventory().CreateInInventory("HatchbackWheel");
1178
1179 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1180 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1181 GetInventory().CreateInInventory("HatchbackHood_Blue");
1182 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1183
1184
1185 GetInventory().CreateInInventory("HatchbackWheel");
1186 GetInventory().CreateInInventory("HatchbackWheel");
1187 }
1188}
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.