DayZ 1.28
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ CrewCanGetThrough()

override bool OnDebugSpawn::CrewCanGetThrough ( int posIdx)
protected

См. определение в файле CivilianSedan.c строка 633

634{
638
639 void CivilianSedan()
640 {
641 //m_dmgContactCoef = 0.065;
642
643 m_EngineStartOK = "CivilianSedan_engine_start_SoundSet";
644 m_EngineStartBattery = "CivilianSedan_engine_failed_start_battery_SoundSet";
645 m_EngineStartPlug = "CivilianSedan_engine_failed_start_sparkplugs_SoundSet";
646 m_EngineStartFuel = "CivilianSedan_engine_failed_start_fuel_SoundSet";
647 m_EngineStop = "CivilianSedan_engine_stop_SoundSet";
648 m_EngineStopFuel = "CivilianSedan_engine_stop_fuel_SoundSet";
649
650 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
651 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
652
653 m_CarHornShortSoundName = "CivilianSedan_Horn_Short_SoundSet";
654 m_CarHornLongSoundName = "CivilianSedan_Horn_SoundSet";
655
656 SetEnginePos("0 0.7 1.6");
657 }
658
659 override void EEInit()
660 {
661 super.EEInit();
662
663 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
664 {
666 m_UTSSettings.m_ManualUpdate = true;
668 m_UTSSettings.m_TemperatureCap = 0;
669 m_UTSSettings.m_RangeFull = 0.5;
670 m_UTSSettings.m_RangeMax = 2;
671
674 }
675 }
676
677 override void OnEngineStart()
678 {
679 super.OnEngineStart();
680
681 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
682 {
683 m_UTSource.SetDefferedActive(true, 20.0);
684 }
685 }
686
687 override void OnEngineStop()
688 {
689 super.OnEngineStop();
690
691 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
692 {
693 m_UTSource.SetDefferedActive(false, 10.0);
694 }
695 }
696
697 override void EOnPostSimulate(IEntity other, float timeSlice)
698 {
699 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
700 {
701 if (m_UTSource.IsActive())
702 {
704 }
705 }
706 }
707
708 override int GetAnimInstance()
709 {
710 return VehicleAnimInstances.SEDAN;
711 }
712
713 override float GetTransportCameraDistance()
714 {
715 return 4.5;
716 }
717
718 override int GetSeatAnimationType(int posIdx)
719 {
720 switch (posIdx)
721 {
722 case 0:
723 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
724 case 1:
725 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
726 case 2:
727 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
728 case 3:
729 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
730 }
731
732 return 0;
733 }
734
735 // Override for car-specific light type
737 {
738 return CarLightBase.Cast( ScriptedLightBase.CreateLight(CivilianSedanFrontLight) );
739 }
740
741 // Override for car-specific light type
743 {
744 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(CivilianSedanRearLight) );
745 }
746
747 override bool CanReleaseAttachment( EntityAI attachment )
748 {
749 if( !super.CanReleaseAttachment( attachment ) )
750 return false;
751
752 string attType = attachment.GetType();
753
754 if ( EngineIsOn() || GetCarDoorsState("CivSedanHood") == CarDoorState.DOORS_CLOSED )
755 {
756 if ( attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
757 return false;
758 }
759
760 return true;
761 }
762
763 override protected bool CanManipulateSpareWheel(string slotSelectionName)
764 {
765 return GetCarDoorsState("CivSedanTrunk") != CarDoorState.DOORS_CLOSED;
766 }
767
768 override bool CanDisplayAttachmentCategory(string category_name)
769 {
770 //super
771 if (!super.CanDisplayAttachmentCategory(category_name))
772 return false;
773 //
774
775 category_name.ToLower();
776 if (category_name.Contains("engine"))
777 {
778 if (GetCarDoorsState("CivSedanHood") == CarDoorState.DOORS_CLOSED)
779 return false;
780 }
781
782 return true;
783 }
784
785 override bool CanDisplayCargo()
786 {
787 if ( !super.CanDisplayCargo() )
788 return false;
789
790 if ( GetCarDoorsState("CivSedanTrunk") == CarDoorState.DOORS_CLOSED )
791 return false;
792
793 return true;
794 }
795
796 override int GetCarDoorsState( string slotType )
797 {
798 CarDoor carDoor;
799
800 Class.CastTo( carDoor, FindAttachmentBySlotName( slotType ) );
801 if (!carDoor)
802 {
803 return CarDoorState.DOORS_MISSING;
804 }
805
806 switch (slotType)
807 {
808 case "CivSedanDriverDoors":
809 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
810 break;
811
812 case "CivSedanCoDriverDoors":
813 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
814 break;
815
816 case "CivSedanCargo1Doors":
817 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
818 break;
819
820 case "CivSedanCargo2Doors":
821 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
822 break;
823
824 case "CivSedanTrunk":
825 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
826 break;
827
828 case "CivSedanHood":
829 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
830 break;
831 }
832
833 return CarDoorState.DOORS_MISSING;
834 }
835
836
837 override bool CrewCanGetThrough( int posIdx )
838 {
839 switch( posIdx )
840 {
841 case 0:
842 if ( GetCarDoorsState("CivSedanDriverDoors") == CarDoorState.DOORS_CLOSED )
843 return false;
844
845 return true;
846 break;
847
848 case 1:
849 if ( GetCarDoorsState("CivSedanCoDriverDoors") == CarDoorState.DOORS_CLOSED )
850 return false;
851
852 return true;
853 break;
854
855 case 2:
856 if ( GetCarDoorsState("CivSedanCargo1Doors") == CarDoorState.DOORS_CLOSED )
857 return false;
858
859 return true;
860 break;
861
862 case 3:
863 if ( GetCarDoorsState("CivSedanCargo2Doors") == CarDoorState.DOORS_CLOSED )
864 return false;
865
866 return true;
867 break;
868 }
869
870 return false;
871 }
872
873 override string GetDoorSelectionNameFromSeatPos(int posIdx)
874 {
875 switch( posIdx )
876 {
877 case 0:
878 return "doors_driver";
879 break;
880 case 1:
881 return "doors_codriver";
882 break;
883 case 2:
884 return "doors_cargo1";
885 break;
886 case 3:
887 return "doors_cargo2";
888 break;
889 }
890
891 return super.GetDoorSelectionNameFromSeatPos(posIdx);
892 }
893
894 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
895 {
896 switch( posIdx )
897 {
898 case 0:
899 return "CivSedanDriverDoors";
900 break;
901 case 1:
902 return "CivSedanCoDriverDoors";
903 break;
904 case 2:
905 return "CivSedanCargo1Doors";
906 break;
907 case 3:
908 return "CivSedanCargo2Doors";
909 break;
910 }
911
912 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
913 }
914
915 // 0 full ambient and engine sound
916 // 1 zero ambient and engine sound
917 override float OnSound(CarSoundCtrl ctrl, float oldValue)
918 {
919 switch (ctrl)
920 {
921 case CarSoundCtrl.DOORS:
922 float newValue = 0;
923 if (GetCarDoorsState("CivSedanDriverDoors") == CarDoorState.DOORS_CLOSED)
924 {
925 newValue += 0.25;
926 }
927
928 if (GetCarDoorsState("CivSedanCoDriverDoors") == CarDoorState.DOORS_CLOSED)
929 {
930 newValue += 0.25;
931 }
932
933 if (GetCarDoorsState("CivSedanCargo1Doors") == CarDoorState.DOORS_CLOSED)
934 {
935 newValue += 0.25;
936 }
937
938 if (GetCarDoorsState("CivSedanCargo2Doors") == CarDoorState.DOORS_CLOSED)
939 {
940 newValue += 0.25;
941 }
942
943 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
944 {
945 newValue -= 0.6;
946 }
947
948 if (GetHealthLevel("WindowBack") == GameConstants.STATE_RUINED)
949 {
950 newValue -= 0.6;
951 }
952
953 return Math.Clamp(newValue, 0, 1);
954 break;
955 }
956
957 return super.OnSound(ctrl, oldValue);
958 }
959
960 override string GetAnimSourceFromSelection(string selection)
961 {
962 switch (selection)
963 {
964 case "doors_driver":
965 return "DoorsDriver";
966 case "doors_codriver":
967 return "DoorsCoDriver";
968 case "doors_cargo1":
969 return "DoorsCargo1";
970 case "doors_cargo2":
971 return "DoorsCargo2";
972 case "doors_hood":
973 return "DoorsHood";
974 case "doors_trunk":
975 return "DoorsTrunk";
976 }
977
978 return "";
979 }
980
981 override bool IsVitalTruckBattery()
982 {
983 return false;
984 }
985
986 override bool IsVitalGlowPlug()
987 {
988 return false;
989 }
990
991 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
992 {
993 switch (currentSeat)
994 {
995 case 0:
996 return nextSeat == 1;
997
998 case 1:
999 return nextSeat == 0;
1000
1001 case 2:
1002 return nextSeat == 3;
1003
1004 case 3:
1005 return nextSeat == 2;
1006 }
1007
1008 return false;
1009 }
1010
1011 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
1012 {
1013 switch (pCurrentSeat)
1014 {
1015 case 0:
1016 return pDoorsSelection == "DoorsDriver";
1017
1018 case 1:
1019 return pDoorsSelection == "DoorsCoDriver";
1020
1021 case 2:
1022 return pDoorsSelection == "DoorsCargo1";
1023
1024 case 3:
1025 return pDoorsSelection == "DoorsCargo2";
1026 }
1027
1028 return false;
1029 }
1030
1031 override void OnDebugSpawn()
1032 {
1033 SpawnUniversalParts();
1034 SpawnAdditionalItems();
1035 FillUpCarFluids();
1036
1037 GetInventory().CreateInInventory("CivSedanWheel");
1038 GetInventory().CreateInInventory("CivSedanWheel");
1039 GetInventory().CreateInInventory("CivSedanWheel");
1040 GetInventory().CreateInInventory("CivSedanWheel");
1041
1042 GetInventory().CreateInInventory("CivSedanDoors_Driver");
1043 GetInventory().CreateInInventory("CivSedanDoors_CoDriver");
1044 GetInventory().CreateInInventory("CivSedanDoors_BackLeft");
1045 GetInventory().CreateInInventory("CivSedanDoors_BackRight");
1046 GetInventory().CreateInInventory("CivSedanHood");
1047 GetInventory().CreateInInventory("CivSedanTrunk");
1048
1049 //-----IN CAR CARGO
1050 GetInventory().CreateInInventory("CivSedanWheel");
1051 GetInventory().CreateInInventory("CivSedanWheel");
1052 }
1053
1054 override float GetPushForceCoefficientMultiplier()
1055 {
1056 return 1.5;
1057 }
1058}
1059
1060class CivilianSedan_Wine extends CivilianSedan
1061{
1062 override void OnDebugSpawn()
1063 {
1064 SpawnUniversalParts();
1065 SpawnAdditionalItems();
1066 FillUpCarFluids();
1067
1068 GetInventory().CreateInInventory("CivSedanWheel");
1069 GetInventory().CreateInInventory("CivSedanWheel");
1070 GetInventory().CreateInInventory("CivSedanWheel");
1071 GetInventory().CreateInInventory("CivSedanWheel");
1072
1073 GetInventory().CreateInInventory("CivSedanDoors_Driver_Wine");
1074 GetInventory().CreateInInventory("CivSedanDoors_CoDriver_Wine");
1075 GetInventory().CreateInInventory("CivSedanDoors_BackLeft_Wine");
1076 GetInventory().CreateInInventory("CivSedanDoors_BackRight_Wine");
1077 GetInventory().CreateInInventory("CivSedanHood_Wine");
1078 GetInventory().CreateInInventory("CivSedanTrunk_Wine");
1079
1080 //-----IN CAR CARGO
1081 GetInventory().CreateInInventory("CivSedanWheel");
1082 GetInventory().CreateInInventory("CivSedanWheel");
1083 }
1084}
1085
1086class CivilianSedan_Black extends CivilianSedan
1087{
1088 override void OnDebugSpawn()
1089 {
1090 SpawnUniversalParts();
1091 SpawnAdditionalItems();
1092 FillUpCarFluids();
1093
1094 GetInventory().CreateInInventory("CivSedanWheel");
1095 GetInventory().CreateInInventory("CivSedanWheel");
1096 GetInventory().CreateInInventory("CivSedanWheel");
1097 GetInventory().CreateInInventory("CivSedanWheel");
1098
1099 GetInventory().CreateInInventory("CivSedanDoors_Driver_Black");
1100 GetInventory().CreateInInventory("CivSedanDoors_CoDriver_Black");
1101 GetInventory().CreateInInventory("CivSedanDoors_BackLeft_Black");
1102 GetInventory().CreateInInventory("CivSedanDoors_BackRight_Black");
1103 GetInventory().CreateInInventory("CivSedanHood_Black");
1104 GetInventory().CreateInInventory("CivSedanTrunk_Black");
1105
1106 //-----IN CAR CARGO
1107 GetInventory().CreateInInventory("CivSedanWheel");
1108 GetInventory().CreateInInventory("CivSedanWheel");
1109 }
1110}
CarSoundCtrl
Car's sound controller list. (native, do not change or extend)
Определения Car.c:4
CarDoorState
Определения CarScript.c:2
override float GetPushForceCoefficientMultiplier()
Определения CivilianSedan.c:850
class CivilianSedan extends CarScript OnDebugSpawn()
Определения CivilianSedan.c:430
override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
Определения CivilianSedan.c:787
override string GetAnimSourceFromSelection(string selection)
Определения CivilianSedan.c:756
override int GetSeatAnimationType(int posIdx)
Определения CivilianSedan.c:514
override float OnSound(CarSoundCtrl ctrl, float oldValue)
Определения CivilianSedan.c:713
override string GetDoorInvSlotNameFromSeatPos(int posIdx)
Определения CivilianSedan.c:690
override void EOnPostSimulate(IEntity other, float timeSlice)
Определения CivilianSedan.c:493
override void OnEngineStop()
Определения CivilianSedan.c:483
void CivilianSedan()
Определения CivilianSedan.c:435
ref UniversalTemperatureSourceLambdaEngine m_UTSLEngine
Определения CivilianSedan.c:433
override float GetTransportCameraDistance()
Определения CivilianSedan.c:509
override void EEInit()
Определения CivilianSedan.c:455
override bool CanReleaseAttachment(EntityAI attachment)
Определения CivilianSedan.c:543
override bool CanDisplayCargo()
Определения CivilianSedan.c:581
override void OnEngineStart()
Определения CivilianSedan.c:473
override CarLightBase CreateFrontLight()
Определения CivilianSedan.c:532
override int GetAnimInstance()
Определения CivilianSedan.c:504
override bool CrewCanGetThrough(int posIdx)
Определения CivilianSedan.c:633
override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
Определения CivilianSedan.c:807
bool CanManipulateSpareWheel(string slotSelectionName)
Определения CivilianSedan.c:559
override bool IsVitalGlowPlug()
Определения CivilianSedan.c:782
override CarRearLightBase CreateRearLight()
Определения CivilianSedan.c:538
override bool IsVitalTruckBattery()
Определения CivilianSedan.c:777
override string GetDoorSelectionNameFromSeatPos(int posIdx)
Определения CivilianSedan.c:669
override int GetCarDoorsState(string slotType)
Определения CivilianSedan.c:592
override bool CanDisplayAttachmentCategory(string category_name)
Определения CivilianSedan.c:564
ref UniversalTemperatureSourceSettings m_UTSSettings
Определения FireplaceBase.c:220
ref UniversalTemperatureSource m_UTSource
Определения FireplaceBase.c:219
UniversalTemperatureSourceLambdaBaseImpl UniversalTemperatureSourceLambdaBase UniversalTemperatureSourceLambdaEngine()
VehicleAnimInstances
Определения VehicleAnimInstances.c:2
Определения CarRearLightBase.c:2
override void OnDebugSpawn()
Определения CivilianSedan.c:456
Определения CivilianSedan.c:455
Super root of all classes in Enforce script.
Определения EnScript.c:11
Определения EnEntity.c:165
Определения EnMath.c:7
original Timer deletes m_params which is unwanted
Определения UniversalTemperatureSource.c:38
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
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
Определения 3_Game/constants.c:808
const int STATE_RUINED
Определения 3_Game/constants.c:848
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.
Определения EnString.c:286
proto int ToLower()
Changes string to lowercase. Returns length.