536{
540
542 {
543
544
550
555
558
559 SetEnginePos("0 0.7 1.2");
560 }
561
563 {
564 super.EEInit();
565
567 {
574
577 }
578 }
579
581 {
582 super.OnEngineStart();
583
585 {
587 }
588 }
589
591 {
592 super.OnEngineStop();
593
595 {
597 }
598 }
599
601 {
603 {
605 {
607 }
608 }
609 }
610
612 {
614 }
615
617 {
618 return 3.5;
619 }
620
622 {
623 switch (posIdx)
624 {
625 case 0:
627 case 1:
629 case 2:
631 case 3:
633 }
634
635 return 0;
636
637 }
638
639
641 {
643 }
644
646 {
648 }
649
651 {
652 if (!super.CanReleaseAttachment(attachment))
653 {
654 return false;
655 }
656
658 {
659 string attType = attachment.GetType();
660 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
661 {
662 return false;
663 }
664 }
665
666 return true;
667 }
668
670 {
672 }
673
675 {
676 if (!super.CanDisplayAttachmentCategory(category_name))
677 {
678 return false;
679 }
680
682 if (category_name.
Contains(
"engine"))
683 {
685 {
686 return false;
687 }
688 }
689
690 return true;
691 }
692
694 {
695 if (!super.CanDisplayCargo())
696 {
697 return false;
698 }
699
701 {
702 return false;
703 }
704
705 return true;
706 }
707
709 {
711
712 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
713 if (!carDoor)
714 {
716 }
717
718 switch (slotType)
719 {
720 case "NivaDriverDoors":
722
723 case "NivaCoDriverDoors":
725
726 case "NivaHood":
728
729 case "NivaTrunk":
731 }
732
734 }
735
737 {
739 switch (posIdx)
740 {
741 case 0:
743 return false;
744 else if (GetAnimationPhase("SeatDriver") > 0.5)
745 return false;
746
747 return true;
748
749 case 1:
751 return false;
752 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
753 return false;
754
755 return true;
756
757 case 2:
759 return false;
760 else if (GetAnimationPhase("SeatDriver") <= 0.5)
761 return false;
762
763 return true;
764
765 case 3:
767 return false;
768 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
769 return false;
770
771 return true;
772 }
773
774 return false;
775 }
776
778 {
779 switch (posIdx)
780 {
781 case 0:
782 case 2:
783 return "doors_driver";
784 case 1:
785 case 3:
786 return "doors_codriver";
787 }
788
789 return super.GetDoorSelectionNameFromSeatPos(posIdx);
790 }
791
793 {
794 switch (posIdx)
795 {
796 case 0:
797 case 2:
798 return "NivaDriverDoors";
799 case 1:
800 case 3:
801 return "NivaCoDriverDoors";
802 }
803
804 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
805 }
806
807
808
810 {
811 float tempCap = 0.0;
812
813 switch (ctrl)
814 {
816 float newValue = 0;
818 {
819 newValue += 0.5;
820 }
821
823 {
824 newValue += 0.5;
825 }
826
828 {
829 newValue += 0.3;
830 }
831
833 {
834 newValue -= 0.6;
835 }
836
838 {
839 newValue -= 0.2;
840 }
841
843 {
844 newValue -= 0.2;
845 }
846
848 break;
849 }
850
851 return super.OnSound(ctrl, oldValue);
852 }
853
855 {
856 switch (selection)
857 {
858 case "doors_driver":
859 return "DoorsDriver";
860 case "doors_codriver":
861 return "DoorsCoDriver";
862 case "doors_hood":
863 return "DoorsHood";
864 case "doors_trunk":
865 return "DoorsTrunk";
866 case "seatback_driver":
867 return "SeatDriver";
868 case "seatback_codriver":
869 return "SeatCoDriver";
870 }
871
872 return "";
873 }
874
876 {
877 switch (selection)
878 {
879 case "seat_driver":
880 case "seatback_driver":
881 case "seat_cargo1":
882 return "seat_con_1_1";
883 case "seat_codriver":
884 case "seatback_codriver":
885 case "seat_cargo2":
886 return "seat_con_2_1";
887 }
888
889 return "";
890 }
891
893 {
894 switch (selection)
895 {
896 case "seatback_driver":
897 return 0;
898 case "seatback_codriver":
899 return 1;
900 }
901
902 return -1;
903 }
904
906 {
907 return false;
908 }
909
911 {
912 return false;
913 }
914
916 {
917 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
918 return false;
919
920 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
921 return false;
922
923 switch (currentSeat)
924 {
925 case 0:
926 return nextSeat == 1;
927
928 case 1:
929 return nextSeat == 0;
930
931 case 2:
932 return nextSeat == 3;
933
934 case 3:
935 return nextSeat == 2;
936 }
937
938 return false;
939 }
940
942 {
943 switch (pCurrentSeat)
944 {
945 case 0:
946 return pDoorsSelection == "DoorsDriver";
947
948 case 1:
949 return pDoorsSelection == "DoorsCoDriver";
950
951 case 2:
952 return pDoorsSelection == "DoorsDriver";
953
954 case 3:
955 return pDoorsSelection == "DoorsCoDriver";
956 }
957
958 return false;
959 }
960
962 {
963 switch (pDoorSelection)
964 {
965 case "DoorsDriver":
966 return 0;
967 case "DoorsCoDriver":
968 return 1;
969 }
970
971 return -1;
972 }
973
975 {
976 super.SetActions();
977
979 }
980
982 {
986
987 GetInventory().CreateInInventory("HatchbackWheel");
988 GetInventory().CreateInInventory("HatchbackWheel");
989 GetInventory().CreateInInventory("HatchbackWheel" );
990 GetInventory().CreateInInventory("HatchbackWheel");
991
992 GetInventory().CreateInInventory("HatchbackDoors_Driver");
993 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
994 GetInventory().CreateInInventory("HatchbackHood");
995 GetInventory().CreateInInventory("HatchbackTrunk");
996
997
998 GetInventory().CreateInInventory("HatchbackWheel");
999 GetInventory().CreateInInventory("HatchbackWheel");
1000 }
1001}
1002
1004{
1006 {
1010
1011 GetInventory().CreateInInventory("HatchbackWheel");
1012 GetInventory().CreateInInventory("HatchbackWheel");
1013 GetInventory().CreateInInventory("HatchbackWheel");
1014 GetInventory().CreateInInventory("HatchbackWheel");
1015
1016 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1017 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1018 GetInventory().CreateInInventory("HatchbackHood_White");
1019 GetInventory().CreateInInventory("HatchbackTrunk_White");
1020
1021
1022 GetInventory().CreateInInventory("HatchbackWheel");
1023 GetInventory().CreateInInventory("HatchbackWheel");
1024 }
1025}
1026
1028{
1030 {
1034
1035 GetInventory().CreateInInventory("HatchbackWheel");
1036 GetInventory().CreateInInventory("HatchbackWheel");
1037 GetInventory().CreateInInventory("HatchbackWheel");
1038 GetInventory().CreateInInventory("HatchbackWheel");
1039
1040 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1041 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1042 GetInventory().CreateInInventory("HatchbackHood_Blue");
1043 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1044
1045
1046 GetInventory().CreateInInventory("HatchbackWheel");
1047 GetInventory().CreateInInventory("HatchbackWheel");
1048 }
1049}
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.