559{
563
565 {
566
567
568 m_EngineStartOK = "offroad_engine_start_SoundSet";
569 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
570 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
571 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
572 m_EngineStop = "offroad_engine_stop_SoundSet";
573 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
574
575 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
576 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
577 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
578 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
579
580 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
581 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
582
583 SetEnginePos("0 0.7 1.2");
584 }
585
587 {
588 super.EEInit();
589
591 {
598
601 }
602 }
603
605 {
606 super.OnEngineStart();
607
609 {
611 }
612 }
613
615 {
616 super.OnEngineStop();
617
619 {
621 }
622 }
623
625 {
627 {
629 {
631 }
632 }
633 }
634
636 {
638 }
639
641 {
642 return 3.5;
643 }
644
646 {
647 switch (posIdx)
648 {
649 case 0:
651 case 1:
653 case 2:
655 case 3:
657 }
658
659 return 0;
660
661 }
662
663
665 {
667 }
668
670 {
672 }
673
675 {
676 if (!super.CanReleaseAttachment(attachment))
677 {
678 return false;
679 }
680
682 {
683 string attType = attachment.GetType();
684 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
685 {
686 return false;
687 }
688 }
689
690 return true;
691 }
692
694 {
696 }
697
699 {
700 if (!super.CanDisplayAttachmentCategory(category_name))
701 {
702 return false;
703 }
704
706 if (category_name.
Contains(
"engine"))
707 {
709 {
710 return false;
711 }
712 }
713
714 return true;
715 }
716
718 {
719 if (!super.CanDisplayCargo())
720 {
721 return false;
722 }
723
725 {
726 return false;
727 }
728
729 return true;
730 }
731
733 {
735
736 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
737 if (!carDoor)
738 {
740 }
741
742 switch (slotType)
743 {
744 case "NivaDriverDoors":
745 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
746
747 case "NivaCoDriverDoors":
748 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
749
750 case "NivaHood":
751 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
752
753 case "NivaTrunk":
754 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
755 }
756
758 }
759
761 {
763 switch (posIdx)
764 {
765 case 0:
767 return false;
768 else if (GetAnimationPhase("SeatDriver") > 0.5)
769 return false;
770
771 return true;
772
773 case 1:
775 return false;
776 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
777 return false;
778
779 return true;
780
781 case 2:
783 return false;
784 else if (GetAnimationPhase("SeatDriver") <= 0.5)
785 return false;
786
787 return true;
788
789 case 3:
791 return false;
792 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
793 return false;
794
795 return true;
796 }
797
798 return false;
799 }
800
802 {
803 switch (posIdx)
804 {
805 case 0:
806 case 2:
807 return "doors_driver";
808 case 1:
809 case 3:
810 return "doors_codriver";
811 }
812
813 return super.GetDoorSelectionNameFromSeatPos(posIdx);
814 }
815
817 {
818 switch (posIdx)
819 {
820 case 0:
821 case 2:
822 return "NivaDriverDoors";
823 case 1:
824 case 3:
825 return "NivaCoDriverDoors";
826 }
827
828 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
829 }
830
831
832
834 {
835 float tempCap = 0.0;
836
837 switch (ctrl)
838 {
840 float newValue = 0;
842 {
843 newValue += 0.5;
844 }
845
847 {
848 newValue += 0.5;
849 }
850
852 {
853 newValue += 0.3;
854 }
855
857 {
858 newValue -= 0.6;
859 }
860
862 {
863 newValue -= 0.2;
864 }
865
867 {
868 newValue -= 0.2;
869 }
870
872 break;
873 }
874
875 return super.OnSound(ctrl, oldValue);
876 }
877
879 {
880 switch (selection)
881 {
882 case "doors_driver":
883 return "DoorsDriver";
884 case "doors_codriver":
885 return "DoorsCoDriver";
886 case "doors_hood":
887 return "DoorsHood";
888 case "doors_trunk":
889 return "DoorsTrunk";
890 case "seatback_driver":
891 return "SeatDriver";
892 case "seatback_codriver":
893 return "SeatCoDriver";
894 }
895
896 return "";
897 }
898
900 {
901 switch (selection)
902 {
903 case "seat_driver":
904 case "seatback_driver":
905 case "seat_cargo1":
906 return "seat_con_1_1";
907 case "seat_codriver":
908 case "seatback_codriver":
909 case "seat_cargo2":
910 return "seat_con_2_1";
911 }
912
913 return "";
914 }
915
917 {
918 switch (selection)
919 {
920 case "seatback_driver":
921 return 0;
922 case "seatback_codriver":
923 return 1;
924 }
925
926 return -1;
927 }
928
930 {
931 return false;
932 }
933
935 {
936 return false;
937 }
938
940 {
941 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
942 return false;
943
944 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
945 return false;
946
947 switch (currentSeat)
948 {
949 case 0:
950 return nextSeat == 1;
951
952 case 1:
953 return nextSeat == 0;
954
955 case 2:
956 return nextSeat == 3;
957
958 case 3:
959 return nextSeat == 2;
960 }
961
962 return false;
963 }
964
966 {
967 switch (pCurrentSeat)
968 {
969 case 0:
970 return pDoorsSelection == "DoorsDriver";
971
972 case 1:
973 return pDoorsSelection == "DoorsCoDriver";
974
975 case 2:
976 return pDoorsSelection == "DoorsDriver";
977
978 case 3:
979 return pDoorsSelection == "DoorsCoDriver";
980 }
981
982 return false;
983 }
984
986 {
987 switch (pDoorSelection)
988 {
989 case "DoorsDriver":
990 return 0;
991 case "DoorsCoDriver":
992 return 1;
993 }
994
995 return -1;
996 }
997
999 {
1000 super.SetActions();
1001
1003 }
1004
1006 {
1007 SpawnUniversalParts();
1008 SpawnAdditionalItems();
1009 FillUpCarFluids();
1010
1011 GetInventory().CreateInInventory("HatchbackWheel");
1012 GetInventory().CreateInInventory("HatchbackWheel");
1013 GetInventory().CreateInInventory("HatchbackWheel" );
1014 GetInventory().CreateInInventory("HatchbackWheel");
1015
1016 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1017 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1018 GetInventory().CreateInInventory("HatchbackHood");
1019 GetInventory().CreateInInventory("HatchbackTrunk");
1020
1021
1022 GetInventory().CreateInInventory("HatchbackWheel");
1023 GetInventory().CreateInInventory("HatchbackWheel");
1024 }
1025}
1026
1028{
1030 {
1031 SpawnUniversalParts();
1032 SpawnAdditionalItems();
1033 FillUpCarFluids();
1034
1035 GetInventory().CreateInInventory("HatchbackWheel");
1036 GetInventory().CreateInInventory("HatchbackWheel");
1037 GetInventory().CreateInInventory("HatchbackWheel");
1038 GetInventory().CreateInInventory("HatchbackWheel");
1039
1040 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1041 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1042 GetInventory().CreateInInventory("HatchbackHood_White");
1043 GetInventory().CreateInInventory("HatchbackTrunk_White");
1044
1045
1046 GetInventory().CreateInInventory("HatchbackWheel");
1047 GetInventory().CreateInInventory("HatchbackWheel");
1048 }
1049}
1050
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_Blue");
1065 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1066 GetInventory().CreateInInventory("HatchbackHood_Blue");
1067 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1068
1069
1070 GetInventory().CreateInInventory("HatchbackWheel");
1071 GetInventory().CreateInInventory("HatchbackWheel");
1072 }
1073}
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.