610{
614
616 {
617
618
624
629
632
633 SetEnginePos("0 0.7 1.2");
634 }
635
637 {
638 super.EEInit();
639
641 {
648
651 }
652 }
653
655 {
656 super.OnEngineStart();
657
659 {
661 }
662 }
663
665 {
666 super.OnEngineStop();
667
669 {
671 }
672 }
673
675 {
677 {
679 {
681 }
682 }
683 }
684
686 {
688 }
689
691 {
692 return 3.5;
693 }
694
696 {
697 switch (posIdx)
698 {
699 case 0:
701 case 1:
703 case 2:
705 case 3:
707 }
708
709 return 0;
710
711 }
712
713
715 {
717 }
718
720 {
722 }
723
725 {
726 if (!super.CanReleaseAttachment(attachment))
727 {
728 return false;
729 }
730
732 {
733 string attType = attachment.GetType();
734 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
735 {
736 return false;
737 }
738 }
739
740 return true;
741 }
742
744 {
746 }
747
749 {
750 if (!super.CanDisplayAttachmentCategory(category_name))
751 {
752 return false;
753 }
754
756 if (category_name.
Contains(
"engine"))
757 {
759 {
760 return false;
761 }
762 }
763
764 return true;
765 }
766
768 {
769 if (!super.CanDisplayCargo())
770 {
771 return false;
772 }
773
775 {
776 return false;
777 }
778
779 return true;
780 }
781
783 {
785
786 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
787 if (!carDoor)
788 {
790 }
791
792 switch (slotType)
793 {
794 case "NivaDriverDoors":
796
797 case "NivaCoDriverDoors":
799
800 case "NivaHood":
802
803 case "NivaTrunk":
805 }
806
808 }
809
811 {
813 switch (posIdx)
814 {
815 case 0:
817 return false;
818 else if (GetAnimationPhase("SeatDriver") > 0.5)
819 return false;
820
821 return true;
822
823 case 1:
825 return false;
826 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
827 return false;
828
829 return true;
830
831 case 2:
833 return false;
834 else if (GetAnimationPhase("SeatDriver") <= 0.5)
835 return false;
836
837 return true;
838
839 case 3:
841 return false;
842 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
843 return false;
844
845 return true;
846 }
847
848 return false;
849 }
850
852 {
853 switch (posIdx)
854 {
855 case 0:
856 case 2:
857 return "doors_driver";
858 case 1:
859 case 3:
860 return "doors_codriver";
861 }
862
863 return super.GetDoorSelectionNameFromSeatPos(posIdx);
864 }
865
867 {
868 switch (posIdx)
869 {
870 case 0:
871 case 2:
872 return "NivaDriverDoors";
873 case 1:
874 case 3:
875 return "NivaCoDriverDoors";
876 }
877
878 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
879 }
880
881
882
884 {
885 float tempCap = 0.0;
886
887 switch (ctrl)
888 {
890 float newValue = 0;
892 {
893 newValue += 0.5;
894 }
895
897 {
898 newValue += 0.5;
899 }
900
902 {
903 newValue += 0.3;
904 }
905
907 {
908 newValue -= 0.6;
909 }
910
912 {
913 newValue -= 0.2;
914 }
915
917 {
918 newValue -= 0.2;
919 }
920
922 break;
923 }
924
925 return super.OnSound(ctrl, oldValue);
926 }
927
929 {
930 switch (selection)
931 {
932 case "doors_driver":
933 return "DoorsDriver";
934 case "doors_codriver":
935 return "DoorsCoDriver";
936 case "doors_hood":
937 return "DoorsHood";
938 case "doors_trunk":
939 return "DoorsTrunk";
940 case "seatback_driver":
941 return "SeatDriver";
942 case "seatback_codriver":
943 return "SeatCoDriver";
944 }
945
946 return "";
947 }
948
950 {
951 switch (selection)
952 {
953 case "seat_driver":
954 case "seatback_driver":
955 case "seat_cargo1":
956 return "seat_con_1_1";
957 case "seat_codriver":
958 case "seatback_codriver":
959 case "seat_cargo2":
960 return "seat_con_2_1";
961 }
962
963 return "";
964 }
965
967 {
968 switch (selection)
969 {
970 case "seatback_driver":
971 return 0;
972 case "seatback_codriver":
973 return 1;
974 }
975
976 return -1;
977 }
978
980 {
981 return false;
982 }
983
985 {
986 return false;
987 }
988
990 {
991 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
992 return false;
993
994 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
995 return false;
996
997 switch (currentSeat)
998 {
999 case 0:
1000 return nextSeat == 1;
1001
1002 case 1:
1003 return nextSeat == 0;
1004
1005 case 2:
1006 return nextSeat == 3;
1007
1008 case 3:
1009 return nextSeat == 2;
1010 }
1011
1012 return false;
1013 }
1014
1016 {
1017 switch (pCurrentSeat)
1018 {
1019 case 0:
1020 return pDoorsSelection == "DoorsDriver";
1021
1022 case 1:
1023 return pDoorsSelection == "DoorsCoDriver";
1024
1025 case 2:
1026 return pDoorsSelection == "DoorsDriver";
1027
1028 case 3:
1029 return pDoorsSelection == "DoorsCoDriver";
1030 }
1031
1032 return false;
1033 }
1034
1036 {
1037 switch (pDoorSelection)
1038 {
1039 case "DoorsDriver":
1040 return 0;
1041 case "DoorsCoDriver":
1042 return 1;
1043 }
1044
1045 return -1;
1046 }
1047
1049 {
1050 super.SetActions();
1051
1053 }
1054
1056 {
1060
1061 GetInventory().CreateInInventory("HatchbackWheel");
1062 GetInventory().CreateInInventory("HatchbackWheel");
1063 GetInventory().CreateInInventory("HatchbackWheel" );
1064 GetInventory().CreateInInventory("HatchbackWheel");
1065
1066 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1067 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1068 GetInventory().CreateInInventory("HatchbackHood");
1069 GetInventory().CreateInInventory("HatchbackTrunk");
1070
1071
1072 GetInventory().CreateInInventory("HatchbackWheel");
1073 GetInventory().CreateInInventory("HatchbackWheel");
1074 }
1075}
1076
1078{
1080 {
1084
1085 GetInventory().CreateInInventory("HatchbackWheel");
1086 GetInventory().CreateInInventory("HatchbackWheel");
1087 GetInventory().CreateInInventory("HatchbackWheel");
1088 GetInventory().CreateInInventory("HatchbackWheel");
1089
1090 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1091 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1092 GetInventory().CreateInInventory("HatchbackHood_White");
1093 GetInventory().CreateInInventory("HatchbackTrunk_White");
1094
1095
1096 GetInventory().CreateInInventory("HatchbackWheel");
1097 GetInventory().CreateInInventory("HatchbackWheel");
1098 }
1099}
1100
1102{
1104 {
1108
1109 GetInventory().CreateInInventory("HatchbackWheel");
1110 GetInventory().CreateInInventory("HatchbackWheel");
1111 GetInventory().CreateInInventory("HatchbackWheel");
1112 GetInventory().CreateInInventory("HatchbackWheel");
1113
1114 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1115 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1116 GetInventory().CreateInInventory("HatchbackHood_Blue");
1117 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1118
1119
1120 GetInventory().CreateInInventory("HatchbackWheel");
1121 GetInventory().CreateInInventory("HatchbackWheel");
1122 }
1123}
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.