607{
611
613 {
614
615
616 m_EngineStartOK = "offroad_engine_start_SoundSet";
617 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
618 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
619 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
620 m_EngineStop = "offroad_engine_stop_SoundSet";
621 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
622
623 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
624 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
625 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
626 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
627
628 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
629 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
630
631 SetEnginePos("0 0.7 1.2");
632 }
633
635 {
636 super.EEInit();
637
639 {
646
649 }
650 }
651
653 {
654 super.OnEngineStart();
655
657 {
659 }
660 }
661
663 {
664 super.OnEngineStop();
665
667 {
669 }
670 }
671
673 {
675 {
677 {
679 }
680 }
681 }
682
684 {
686 }
687
689 {
690 return 3.5;
691 }
692
694 {
695 switch (posIdx)
696 {
697 case 0:
699 case 1:
701 case 2:
703 case 3:
705 }
706
707 return 0;
708
709 }
710
711
713 {
715 }
716
718 {
720 }
721
723 {
724 if (!super.CanReleaseAttachment(attachment))
725 {
726 return false;
727 }
728
730 {
731 string attType = attachment.GetType();
732 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
733 {
734 return false;
735 }
736 }
737
738 return true;
739 }
740
742 {
744 }
745
747 {
748 if (!super.CanDisplayAttachmentCategory(category_name))
749 {
750 return false;
751 }
752
754 if (category_name.
Contains(
"engine"))
755 {
757 {
758 return false;
759 }
760 }
761
762 return true;
763 }
764
766 {
767 if (!super.CanDisplayCargo())
768 {
769 return false;
770 }
771
773 {
774 return false;
775 }
776
777 return true;
778 }
779
781 {
783
784 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
785 if (!carDoor)
786 {
788 }
789
790 switch (slotType)
791 {
792 case "NivaDriverDoors":
793 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
794
795 case "NivaCoDriverDoors":
796 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
797
798 case "NivaHood":
799 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
800
801 case "NivaTrunk":
802 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
803 }
804
806 }
807
809 {
811 switch (posIdx)
812 {
813 case 0:
815 return false;
816 else if (GetAnimationPhase("SeatDriver") > 0.5)
817 return false;
818
819 return true;
820
821 case 1:
823 return false;
824 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
825 return false;
826
827 return true;
828
829 case 2:
831 return false;
832 else if (GetAnimationPhase("SeatDriver") <= 0.5)
833 return false;
834
835 return true;
836
837 case 3:
839 return false;
840 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
841 return false;
842
843 return true;
844 }
845
846 return false;
847 }
848
850 {
851 switch (posIdx)
852 {
853 case 0:
854 case 2:
855 return "doors_driver";
856 case 1:
857 case 3:
858 return "doors_codriver";
859 }
860
861 return super.GetDoorSelectionNameFromSeatPos(posIdx);
862 }
863
865 {
866 switch (posIdx)
867 {
868 case 0:
869 case 2:
870 return "NivaDriverDoors";
871 case 1:
872 case 3:
873 return "NivaCoDriverDoors";
874 }
875
876 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
877 }
878
879
880
882 {
883 float tempCap = 0.0;
884
885 switch (ctrl)
886 {
888 float newValue = 0;
890 {
891 newValue += 0.5;
892 }
893
895 {
896 newValue += 0.5;
897 }
898
900 {
901 newValue += 0.3;
902 }
903
905 {
906 newValue -= 0.6;
907 }
908
910 {
911 newValue -= 0.2;
912 }
913
915 {
916 newValue -= 0.2;
917 }
918
920 break;
921 }
922
923 return super.OnSound(ctrl, oldValue);
924 }
925
927 {
928 switch (selection)
929 {
930 case "doors_driver":
931 return "DoorsDriver";
932 case "doors_codriver":
933 return "DoorsCoDriver";
934 case "doors_hood":
935 return "DoorsHood";
936 case "doors_trunk":
937 return "DoorsTrunk";
938 case "seatback_driver":
939 return "SeatDriver";
940 case "seatback_codriver":
941 return "SeatCoDriver";
942 }
943
944 return "";
945 }
946
948 {
949 switch (selection)
950 {
951 case "seat_driver":
952 case "seatback_driver":
953 case "seat_cargo1":
954 return "seat_con_1_1";
955 case "seat_codriver":
956 case "seatback_codriver":
957 case "seat_cargo2":
958 return "seat_con_2_1";
959 }
960
961 return "";
962 }
963
965 {
966 switch (selection)
967 {
968 case "seatback_driver":
969 return 0;
970 case "seatback_codriver":
971 return 1;
972 }
973
974 return -1;
975 }
976
978 {
979 return false;
980 }
981
983 {
984 return false;
985 }
986
988 {
989 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
990 return false;
991
992 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
993 return false;
994
995 switch (currentSeat)
996 {
997 case 0:
998 return nextSeat == 1;
999
1000 case 1:
1001 return nextSeat == 0;
1002
1003 case 2:
1004 return nextSeat == 3;
1005
1006 case 3:
1007 return nextSeat == 2;
1008 }
1009
1010 return false;
1011 }
1012
1014 {
1015 switch (pCurrentSeat)
1016 {
1017 case 0:
1018 return pDoorsSelection == "DoorsDriver";
1019
1020 case 1:
1021 return pDoorsSelection == "DoorsCoDriver";
1022
1023 case 2:
1024 return pDoorsSelection == "DoorsDriver";
1025
1026 case 3:
1027 return pDoorsSelection == "DoorsCoDriver";
1028 }
1029
1030 return false;
1031 }
1032
1034 {
1035 switch (pDoorSelection)
1036 {
1037 case "DoorsDriver":
1038 return 0;
1039 case "DoorsCoDriver":
1040 return 1;
1041 }
1042
1043 return -1;
1044 }
1045
1047 {
1048 super.SetActions();
1049
1051 }
1052
1054 {
1055 SpawnUniversalParts();
1056 SpawnAdditionalItems();
1057 FillUpCarFluids();
1058
1059 GetInventory().CreateInInventory("HatchbackWheel");
1060 GetInventory().CreateInInventory("HatchbackWheel");
1061 GetInventory().CreateInInventory("HatchbackWheel" );
1062 GetInventory().CreateInInventory("HatchbackWheel");
1063
1064 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1065 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1066 GetInventory().CreateInInventory("HatchbackHood");
1067 GetInventory().CreateInInventory("HatchbackTrunk");
1068
1069
1070 GetInventory().CreateInInventory("HatchbackWheel");
1071 GetInventory().CreateInInventory("HatchbackWheel");
1072 }
1073}
1074
1076{
1078 {
1079 SpawnUniversalParts();
1080 SpawnAdditionalItems();
1081 FillUpCarFluids();
1082
1083 GetInventory().CreateInInventory("HatchbackWheel");
1084 GetInventory().CreateInInventory("HatchbackWheel");
1085 GetInventory().CreateInInventory("HatchbackWheel");
1086 GetInventory().CreateInInventory("HatchbackWheel");
1087
1088 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1089 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1090 GetInventory().CreateInInventory("HatchbackHood_White");
1091 GetInventory().CreateInInventory("HatchbackTrunk_White");
1092
1093
1094 GetInventory().CreateInInventory("HatchbackWheel");
1095 GetInventory().CreateInInventory("HatchbackWheel");
1096 }
1097}
1098
1100{
1102 {
1103 SpawnUniversalParts();
1104 SpawnAdditionalItems();
1105 FillUpCarFluids();
1106
1107 GetInventory().CreateInInventory("HatchbackWheel");
1108 GetInventory().CreateInInventory("HatchbackWheel");
1109 GetInventory().CreateInInventory("HatchbackWheel");
1110 GetInventory().CreateInInventory("HatchbackWheel");
1111
1112 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1113 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1114 GetInventory().CreateInInventory("HatchbackHood_Blue");
1115 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1116
1117
1118 GetInventory().CreateInInventory("HatchbackWheel");
1119 GetInventory().CreateInInventory("HatchbackWheel");
1120 }
1121}
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.