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

◆ CanDisplayCargo()

override bool OnDebugSpawn::CanDisplayCargo ( )
protected

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

582{
586
587 void CivilianSedan()
588 {
589 //m_dmgContactCoef = 0.065;
590
591 m_EngineStartOK = "CivilianSedan_engine_start_SoundSet";
592 m_EngineStartBattery = "CivilianSedan_engine_failed_start_battery_SoundSet";
593 m_EngineStartPlug = "CivilianSedan_engine_failed_start_sparkplugs_SoundSet";
594 m_EngineStartFuel = "CivilianSedan_engine_failed_start_fuel_SoundSet";
595 m_EngineStop = "CivilianSedan_engine_stop_SoundSet";
596 m_EngineStopFuel = "CivilianSedan_engine_stop_fuel_SoundSet";
597
598 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
599 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
600
601 m_CarHornShortSoundName = "CivilianSedan_Horn_Short_SoundSet";
602 m_CarHornLongSoundName = "CivilianSedan_Horn_SoundSet";
603
604 SetEnginePos("0 0.7 1.6");
605 }
606
607 override void EEInit()
608 {
609 super.EEInit();
610
611 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
612 {
614 m_UTSSettings.m_ManualUpdate = true;
616 m_UTSSettings.m_TemperatureCap = 0;
617 m_UTSSettings.m_RangeFull = 0.5;
618 m_UTSSettings.m_RangeMax = 2;
619
622 }
623 }
624
625 override void OnEngineStart()
626 {
627 super.OnEngineStart();
628
629 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
630 {
631 m_UTSource.SetDefferedActive(true, 20.0);
632 }
633 }
634
635 override void OnEngineStop()
636 {
637 super.OnEngineStop();
638
639 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
640 {
641 m_UTSource.SetDefferedActive(false, 10.0);
642 }
643 }
644
645 override void EOnPostSimulate(IEntity other, float timeSlice)
646 {
647 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
648 {
649 if (m_UTSource.IsActive())
650 {
652 }
653 }
654 }
655
656 override int GetAnimInstance()
657 {
658 return VehicleAnimInstances.SEDAN;
659 }
660
661 override float GetTransportCameraDistance()
662 {
663 return 4.5;
664 }
665
666 override int GetSeatAnimationType(int posIdx)
667 {
668 switch (posIdx)
669 {
670 case 0:
671 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
672 case 1:
673 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
674 case 2:
675 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
676 case 3:
677 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
678 }
679
680 return 0;
681 }
682
683 // Override for car-specific light type
685 {
686 return CarLightBase.Cast( ScriptedLightBase.CreateLight(CivilianSedanFrontLight) );
687 }
688
689 // Override for car-specific light type
691 {
692 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(CivilianSedanRearLight) );
693 }
694
695 override bool CanReleaseAttachment( EntityAI attachment )
696 {
697 if( !super.CanReleaseAttachment( attachment ) )
698 return false;
699
700 string attType = attachment.GetType();
701
702 if ( EngineIsOn() || GetCarDoorsState("CivSedanHood") == CarDoorState.DOORS_CLOSED )
703 {
704 if ( attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
705 return false;
706 }
707
708 return true;
709 }
710
711 override protected bool CanManipulateSpareWheel(string slotSelectionName)
712 {
713 return GetCarDoorsState("CivSedanTrunk") != CarDoorState.DOORS_CLOSED;
714 }
715
716 override bool CanDisplayAttachmentCategory(string category_name)
717 {
718 //super
719 if (!super.CanDisplayAttachmentCategory(category_name))
720 return false;
721 //
722
723 category_name.ToLower();
724 if (category_name.Contains("engine"))
725 {
726 if (GetCarDoorsState("CivSedanHood") == CarDoorState.DOORS_CLOSED)
727 return false;
728 }
729
730 return true;
731 }
732
733 override bool CanDisplayCargo()
734 {
735 if ( !super.CanDisplayCargo() )
736 return false;
737
738 if ( GetCarDoorsState("CivSedanTrunk") == CarDoorState.DOORS_CLOSED )
739 return false;
740
741 return true;
742 }
743
744 override int GetCarDoorsState( string slotType )
745 {
746 CarDoor carDoor;
747
748 Class.CastTo( carDoor, FindAttachmentBySlotName( slotType ) );
749 if (!carDoor)
750 {
751 return CarDoorState.DOORS_MISSING;
752 }
753
754 switch (slotType)
755 {
756 case "CivSedanDriverDoors":
757 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
758 break;
759
760 case "CivSedanCoDriverDoors":
761 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
762 break;
763
764 case "CivSedanCargo1Doors":
765 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
766 break;
767
768 case "CivSedanCargo2Doors":
769 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
770 break;
771
772 case "CivSedanTrunk":
773 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
774 break;
775
776 case "CivSedanHood":
777 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
778 break;
779 }
780
781 return CarDoorState.DOORS_MISSING;
782 }
783
784
785 override bool CrewCanGetThrough( int posIdx )
786 {
787 switch( posIdx )
788 {
789 case 0:
790 if ( GetCarDoorsState("CivSedanDriverDoors") == CarDoorState.DOORS_CLOSED )
791 return false;
792
793 return true;
794 break;
795
796 case 1:
797 if ( GetCarDoorsState("CivSedanCoDriverDoors") == CarDoorState.DOORS_CLOSED )
798 return false;
799
800 return true;
801 break;
802
803 case 2:
804 if ( GetCarDoorsState("CivSedanCargo1Doors") == CarDoorState.DOORS_CLOSED )
805 return false;
806
807 return true;
808 break;
809
810 case 3:
811 if ( GetCarDoorsState("CivSedanCargo2Doors") == CarDoorState.DOORS_CLOSED )
812 return false;
813
814 return true;
815 break;
816 }
817
818 return false;
819 }
820
821 override string GetDoorSelectionNameFromSeatPos(int posIdx)
822 {
823 switch( posIdx )
824 {
825 case 0:
826 return "doors_driver";
827 break;
828 case 1:
829 return "doors_codriver";
830 break;
831 case 2:
832 return "doors_cargo1";
833 break;
834 case 3:
835 return "doors_cargo2";
836 break;
837 }
838
839 return super.GetDoorSelectionNameFromSeatPos(posIdx);
840 }
841
842 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
843 {
844 switch( posIdx )
845 {
846 case 0:
847 return "CivSedanDriverDoors";
848 break;
849 case 1:
850 return "CivSedanCoDriverDoors";
851 break;
852 case 2:
853 return "CivSedanCargo1Doors";
854 break;
855 case 3:
856 return "CivSedanCargo2Doors";
857 break;
858 }
859
860 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
861 }
862
863 // 0 full ambient and engine sound
864 // 1 zero ambient and engine sound
865 override float OnSound(CarSoundCtrl ctrl, float oldValue)
866 {
867 switch (ctrl)
868 {
869 case CarSoundCtrl.DOORS:
870 float newValue = 0;
871 if (GetCarDoorsState("CivSedanDriverDoors") == CarDoorState.DOORS_CLOSED)
872 {
873 newValue += 0.25;
874 }
875
876 if (GetCarDoorsState("CivSedanCoDriverDoors") == CarDoorState.DOORS_CLOSED)
877 {
878 newValue += 0.25;
879 }
880
881 if (GetCarDoorsState("CivSedanCargo1Doors") == CarDoorState.DOORS_CLOSED)
882 {
883 newValue += 0.25;
884 }
885
886 if (GetCarDoorsState("CivSedanCargo2Doors") == CarDoorState.DOORS_CLOSED)
887 {
888 newValue += 0.25;
889 }
890
891 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
892 {
893 newValue -= 0.6;
894 }
895
896 if (GetHealthLevel("WindowBack") == GameConstants.STATE_RUINED)
897 {
898 newValue -= 0.6;
899 }
900
901 return Math.Clamp(newValue, 0, 1);
902 break;
903 }
904
905 return super.OnSound(ctrl, oldValue);
906 }
907
908 override string GetAnimSourceFromSelection(string selection)
909 {
910 switch (selection)
911 {
912 case "doors_driver":
913 return "DoorsDriver";
914 case "doors_codriver":
915 return "DoorsCoDriver";
916 case "doors_cargo1":
917 return "DoorsCargo1";
918 case "doors_cargo2":
919 return "DoorsCargo2";
920 case "doors_hood":
921 return "DoorsHood";
922 case "doors_trunk":
923 return "DoorsTrunk";
924 }
925
926 return "";
927 }
928
929 override bool IsVitalTruckBattery()
930 {
931 return false;
932 }
933
934 override bool IsVitalGlowPlug()
935 {
936 return false;
937 }
938
939 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
940 {
941 switch (currentSeat)
942 {
943 case 0:
944 return nextSeat == 1;
945
946 case 1:
947 return nextSeat == 0;
948
949 case 2:
950 return nextSeat == 3;
951
952 case 3:
953 return nextSeat == 2;
954 }
955
956 return false;
957 }
958
959 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
960 {
961 switch (pCurrentSeat)
962 {
963 case 0:
964 return pDoorsSelection == "DoorsDriver";
965
966 case 1:
967 return pDoorsSelection == "DoorsCoDriver";
968
969 case 2:
970 return pDoorsSelection == "DoorsCargo1";
971
972 case 3:
973 return pDoorsSelection == "DoorsCargo2";
974 }
975
976 return false;
977 }
978
979 override void OnDebugSpawn()
980 {
981 SpawnUniversalParts();
982 SpawnAdditionalItems();
983 FillUpCarFluids();
984
985 GetInventory().CreateInInventory("CivSedanWheel");
986 GetInventory().CreateInInventory("CivSedanWheel");
987 GetInventory().CreateInInventory("CivSedanWheel");
988 GetInventory().CreateInInventory("CivSedanWheel");
989
990 GetInventory().CreateInInventory("CivSedanDoors_Driver");
991 GetInventory().CreateInInventory("CivSedanDoors_CoDriver");
992 GetInventory().CreateInInventory("CivSedanDoors_BackLeft");
993 GetInventory().CreateInInventory("CivSedanDoors_BackRight");
994 GetInventory().CreateInInventory("CivSedanHood");
995 GetInventory().CreateInInventory("CivSedanTrunk");
996
997 //-----IN CAR CARGO
998 GetInventory().CreateInInventory("CivSedanWheel");
999 GetInventory().CreateInInventory("CivSedanWheel");
1000 }
1001
1002 override float GetPushForceCoefficientMultiplier()
1003 {
1004 return 1.5;
1005 }
1006}
1007
1008class CivilianSedan_Wine extends CivilianSedan
1009{
1010 override void OnDebugSpawn()
1011 {
1012 SpawnUniversalParts();
1013 SpawnAdditionalItems();
1014 FillUpCarFluids();
1015
1016 GetInventory().CreateInInventory("CivSedanWheel");
1017 GetInventory().CreateInInventory("CivSedanWheel");
1018 GetInventory().CreateInInventory("CivSedanWheel");
1019 GetInventory().CreateInInventory("CivSedanWheel");
1020
1021 GetInventory().CreateInInventory("CivSedanDoors_Driver_Wine");
1022 GetInventory().CreateInInventory("CivSedanDoors_CoDriver_Wine");
1023 GetInventory().CreateInInventory("CivSedanDoors_BackLeft_Wine");
1024 GetInventory().CreateInInventory("CivSedanDoors_BackRight_Wine");
1025 GetInventory().CreateInInventory("CivSedanHood_Wine");
1026 GetInventory().CreateInInventory("CivSedanTrunk_Wine");
1027
1028 //-----IN CAR CARGO
1029 GetInventory().CreateInInventory("CivSedanWheel");
1030 GetInventory().CreateInInventory("CivSedanWheel");
1031 }
1032}
1033
1034class CivilianSedan_Black extends CivilianSedan
1035{
1036 override void OnDebugSpawn()
1037 {
1038 SpawnUniversalParts();
1039 SpawnAdditionalItems();
1040 FillUpCarFluids();
1041
1042 GetInventory().CreateInInventory("CivSedanWheel");
1043 GetInventory().CreateInInventory("CivSedanWheel");
1044 GetInventory().CreateInInventory("CivSedanWheel");
1045 GetInventory().CreateInInventory("CivSedanWheel");
1046
1047 GetInventory().CreateInInventory("CivSedanDoors_Driver_Black");
1048 GetInventory().CreateInInventory("CivSedanDoors_CoDriver_Black");
1049 GetInventory().CreateInInventory("CivSedanDoors_BackLeft_Black");
1050 GetInventory().CreateInInventory("CivSedanDoors_BackRight_Black");
1051 GetInventory().CreateInInventory("CivSedanHood_Black");
1052 GetInventory().CreateInInventory("CivSedanTrunk_Black");
1053
1054 //-----IN CAR CARGO
1055 GetInventory().CreateInInventory("CivSedanWheel");
1056 GetInventory().CreateInInventory("CivSedanWheel");
1057 }
1058}
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.