672{
676
678 {
679
680
686
691
694
695 SetEnginePos("0 0.7 1.2");
696 }
697
699 {
700 super.EEInit();
701
703 {
710
713 }
714 }
715
717 {
718 super.OnEngineStart();
719
721 {
723 }
724 }
725
727 {
728 super.OnEngineStop();
729
731 {
733 }
734 }
735
737 {
739 {
741 {
743 }
744 }
745 }
746
748 {
750 }
751
753 {
754 return 3.5;
755 }
756
758 {
759 switch (posIdx)
760 {
761 case 0:
763 case 1:
765 case 2:
767 case 3:
769 }
770
771 return 0;
772
773 }
774
775
777 {
779 }
780
782 {
784 }
785
787 {
788 if (!super.CanReleaseAttachment(attachment))
789 {
790 return false;
791 }
792
794 {
795 string attType = attachment.GetType();
796 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
797 {
798 return false;
799 }
800 }
801
802 return true;
803 }
804
806 {
808 }
809
811 {
812 if (!super.CanDisplayAttachmentCategory(category_name))
813 {
814 return false;
815 }
816
818 if (category_name.
Contains(
"engine"))
819 {
821 {
822 return false;
823 }
824 }
825
826 return true;
827 }
828
830 {
831 if (!super.CanDisplayCargo())
832 {
833 return false;
834 }
835
837 {
838 return false;
839 }
840
841 return true;
842 }
843
845 {
847
848 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
849 if (!carDoor)
850 {
852 }
853
854 switch (slotType)
855 {
856 case "NivaDriverDoors":
858
859 case "NivaCoDriverDoors":
861
862 case "NivaHood":
864
865 case "NivaTrunk":
867 }
868
870 }
871
873 {
875 switch (posIdx)
876 {
877 case 0:
879 return false;
880 else if (GetAnimationPhase("SeatDriver") > 0.5)
881 return false;
882
883 return true;
884
885 case 1:
887 return false;
888 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
889 return false;
890
891 return true;
892
893 case 2:
895 return false;
896 else if (GetAnimationPhase("SeatDriver") <= 0.5)
897 return false;
898
899 return true;
900
901 case 3:
903 return false;
904 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
905 return false;
906
907 return true;
908 }
909
910 return false;
911 }
912
914 {
915 switch (posIdx)
916 {
917 case 0:
918 case 2:
919 return "doors_driver";
920 case 1:
921 case 3:
922 return "doors_codriver";
923 }
924
925 return super.GetDoorSelectionNameFromSeatPos(posIdx);
926 }
927
929 {
930 switch (posIdx)
931 {
932 case 0:
933 case 2:
934 return "NivaDriverDoors";
935 case 1:
936 case 3:
937 return "NivaCoDriverDoors";
938 }
939
940 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
941 }
942
943
944
946 {
947 float tempCap = 0.0;
948
949 switch (ctrl)
950 {
952 float newValue = 0;
954 {
955 newValue += 0.5;
956 }
957
959 {
960 newValue += 0.5;
961 }
962
964 {
965 newValue += 0.3;
966 }
967
969 {
970 newValue -= 0.6;
971 }
972
974 {
975 newValue -= 0.2;
976 }
977
979 {
980 newValue -= 0.2;
981 }
982
984 break;
985 }
986
987 return super.OnSound(ctrl, oldValue);
988 }
989
991 {
992 switch (selection)
993 {
994 case "doors_driver":
995 return "DoorsDriver";
996 case "doors_codriver":
997 return "DoorsCoDriver";
998 case "doors_hood":
999 return "DoorsHood";
1000 case "doors_trunk":
1001 return "DoorsTrunk";
1002 case "seatback_driver":
1003 return "SeatDriver";
1004 case "seatback_codriver":
1005 return "SeatCoDriver";
1006 }
1007
1008 return "";
1009 }
1010
1012 {
1013 switch (selection)
1014 {
1015 case "seat_driver":
1016 case "seatback_driver":
1017 case "seat_cargo1":
1018 return "seat_con_1_1";
1019 case "seat_codriver":
1020 case "seatback_codriver":
1021 case "seat_cargo2":
1022 return "seat_con_2_1";
1023 }
1024
1025 return "";
1026 }
1027
1029 {
1030 switch (selection)
1031 {
1032 case "seatback_driver":
1033 return 0;
1034 case "seatback_codriver":
1035 return 1;
1036 }
1037
1038 return -1;
1039 }
1040
1042 {
1043 return false;
1044 }
1045
1047 {
1048 return false;
1049 }
1050
1052 {
1053 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1054 return false;
1055
1056 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1057 return false;
1058
1059 switch (currentSeat)
1060 {
1061 case 0:
1062 return nextSeat == 1;
1063
1064 case 1:
1065 return nextSeat == 0;
1066
1067 case 2:
1068 return nextSeat == 3;
1069
1070 case 3:
1071 return nextSeat == 2;
1072 }
1073
1074 return false;
1075 }
1076
1078 {
1079 switch (pCurrentSeat)
1080 {
1081 case 0:
1082 return pDoorsSelection == "DoorsDriver";
1083
1084 case 1:
1085 return pDoorsSelection == "DoorsCoDriver";
1086
1087 case 2:
1088 return pDoorsSelection == "DoorsDriver";
1089
1090 case 3:
1091 return pDoorsSelection == "DoorsCoDriver";
1092 }
1093
1094 return false;
1095 }
1096
1098 {
1099 switch (pDoorSelection)
1100 {
1101 case "DoorsDriver":
1102 return 0;
1103 case "DoorsCoDriver":
1104 return 1;
1105 }
1106
1107 return -1;
1108 }
1109
1111 {
1112 super.SetActions();
1113
1115 }
1116
1118 {
1122
1123 GetInventory().CreateInInventory("HatchbackWheel");
1124 GetInventory().CreateInInventory("HatchbackWheel");
1125 GetInventory().CreateInInventory("HatchbackWheel" );
1126 GetInventory().CreateInInventory("HatchbackWheel");
1127
1128 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1129 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1130 GetInventory().CreateInInventory("HatchbackHood");
1131 GetInventory().CreateInInventory("HatchbackTrunk");
1132
1133
1134 GetInventory().CreateInInventory("HatchbackWheel");
1135 GetInventory().CreateInInventory("HatchbackWheel");
1136 }
1137}
1138
1140{
1142 {
1146
1147 GetInventory().CreateInInventory("HatchbackWheel");
1148 GetInventory().CreateInInventory("HatchbackWheel");
1149 GetInventory().CreateInInventory("HatchbackWheel");
1150 GetInventory().CreateInInventory("HatchbackWheel");
1151
1152 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1153 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1154 GetInventory().CreateInInventory("HatchbackHood_White");
1155 GetInventory().CreateInInventory("HatchbackTrunk_White");
1156
1157
1158 GetInventory().CreateInInventory("HatchbackWheel");
1159 GetInventory().CreateInInventory("HatchbackWheel");
1160 }
1161}
1162
1164{
1166 {
1170
1171 GetInventory().CreateInInventory("HatchbackWheel");
1172 GetInventory().CreateInInventory("HatchbackWheel");
1173 GetInventory().CreateInInventory("HatchbackWheel");
1174 GetInventory().CreateInInventory("HatchbackWheel");
1175
1176 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1177 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1178 GetInventory().CreateInInventory("HatchbackHood_Blue");
1179 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1180
1181
1182 GetInventory().CreateInInventory("HatchbackWheel");
1183 GetInventory().CreateInInventory("HatchbackWheel");
1184 }
1185}
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.