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

◆ GetDoorInvSlotNameFromSeatPos()

override string OnDebugSpawn::GetDoorInvSlotNameFromSeatPos ( int posIdx)
protected

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

691{
695
696 void CivilianSedan()
697 {
698 //m_dmgContactCoef = 0.065;
699
700 m_EngineStartOK = "CivilianSedan_engine_start_SoundSet";
701 m_EngineStartBattery = "CivilianSedan_engine_failed_start_battery_SoundSet";
702 m_EngineStartPlug = "CivilianSedan_engine_failed_start_sparkplugs_SoundSet";
703 m_EngineStartFuel = "CivilianSedan_engine_failed_start_fuel_SoundSet";
704 m_EngineStop = "CivilianSedan_engine_stop_SoundSet";
705 m_EngineStopFuel = "CivilianSedan_engine_stop_fuel_SoundSet";
706
707 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
708 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
709
710 m_CarHornShortSoundName = "CivilianSedan_Horn_Short_SoundSet";
711 m_CarHornLongSoundName = "CivilianSedan_Horn_SoundSet";
712
713 SetEnginePos("0 0.7 1.6");
714 }
715
716 override void EEInit()
717 {
718 super.EEInit();
719
720 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
721 {
723 m_UTSSettings.m_ManualUpdate = true;
725 m_UTSSettings.m_TemperatureCap = 0;
726 m_UTSSettings.m_RangeFull = 0.5;
727 m_UTSSettings.m_RangeMax = 2;
728
731 }
732 }
733
734 override void OnEngineStart()
735 {
736 super.OnEngineStart();
737
738 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
739 {
740 m_UTSource.SetDefferedActive(true, 20.0);
741 }
742 }
743
744 override void OnEngineStop()
745 {
746 super.OnEngineStop();
747
748 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
749 {
750 m_UTSource.SetDefferedActive(false, 10.0);
751 }
752 }
753
754 override void EOnPostSimulate(IEntity other, float timeSlice)
755 {
756 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
757 {
758 if (m_UTSource.IsActive())
759 {
761 }
762 }
763 }
764
765 override int GetAnimInstance()
766 {
767 return VehicleAnimInstances.SEDAN;
768 }
769
770 override float GetTransportCameraDistance()
771 {
772 return 4.5;
773 }
774
775 override int GetSeatAnimationType(int posIdx)
776 {
777 switch (posIdx)
778 {
779 case 0:
780 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
781 case 1:
782 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
783 case 2:
784 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
785 case 3:
786 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
787 }
788
789 return 0;
790 }
791
792 // Override for car-specific light type
794 {
795 return CarLightBase.Cast( ScriptedLightBase.CreateLight(CivilianSedanFrontLight) );
796 }
797
798 // Override for car-specific light type
800 {
801 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(CivilianSedanRearLight) );
802 }
803
804 override bool CanReleaseAttachment( EntityAI attachment )
805 {
806 if( !super.CanReleaseAttachment( attachment ) )
807 return false;
808
809 string attType = attachment.GetType();
810
811 if ( EngineIsOn() || GetCarDoorsState("CivSedanHood") == CarDoorState.DOORS_CLOSED )
812 {
813 if ( attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
814 return false;
815 }
816
817 return true;
818 }
819
820 override protected bool CanManipulateSpareWheel(string slotSelectionName)
821 {
822 return GetCarDoorsState("CivSedanTrunk") != CarDoorState.DOORS_CLOSED;
823 }
824
825 override bool CanDisplayAttachmentCategory(string category_name)
826 {
827 //super
828 if (!super.CanDisplayAttachmentCategory(category_name))
829 return false;
830 //
831
832 category_name.ToLower();
833 if (category_name.Contains("engine"))
834 {
835 if (GetCarDoorsState("CivSedanHood") == CarDoorState.DOORS_CLOSED)
836 return false;
837 }
838
839 return true;
840 }
841
842 override bool CanDisplayCargo()
843 {
844 if ( !super.CanDisplayCargo() )
845 return false;
846
847 if ( GetCarDoorsState("CivSedanTrunk") == CarDoorState.DOORS_CLOSED )
848 return false;
849
850 return true;
851 }
852
853 override int GetCarDoorsState( string slotType )
854 {
855 CarDoor carDoor;
856
857 Class.CastTo( carDoor, FindAttachmentBySlotName( slotType ) );
858 if (!carDoor)
859 {
860 return CarDoorState.DOORS_MISSING;
861 }
862
863 switch (slotType)
864 {
865 case "CivSedanDriverDoors":
866 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
867 break;
868
869 case "CivSedanCoDriverDoors":
870 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
871 break;
872
873 case "CivSedanCargo1Doors":
874 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
875 break;
876
877 case "CivSedanCargo2Doors":
878 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
879 break;
880
881 case "CivSedanTrunk":
882 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
883 break;
884
885 case "CivSedanHood":
886 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
887 break;
888 }
889
890 return CarDoorState.DOORS_MISSING;
891 }
892
893
894 override bool CrewCanGetThrough( int posIdx )
895 {
896 switch( posIdx )
897 {
898 case 0:
899 if ( GetCarDoorsState("CivSedanDriverDoors") == CarDoorState.DOORS_CLOSED )
900 return false;
901
902 return true;
903 break;
904
905 case 1:
906 if ( GetCarDoorsState("CivSedanCoDriverDoors") == CarDoorState.DOORS_CLOSED )
907 return false;
908
909 return true;
910 break;
911
912 case 2:
913 if ( GetCarDoorsState("CivSedanCargo1Doors") == CarDoorState.DOORS_CLOSED )
914 return false;
915
916 return true;
917 break;
918
919 case 3:
920 if ( GetCarDoorsState("CivSedanCargo2Doors") == CarDoorState.DOORS_CLOSED )
921 return false;
922
923 return true;
924 break;
925 }
926
927 return false;
928 }
929
930 override string GetDoorSelectionNameFromSeatPos(int posIdx)
931 {
932 switch( posIdx )
933 {
934 case 0:
935 return "doors_driver";
936 break;
937 case 1:
938 return "doors_codriver";
939 break;
940 case 2:
941 return "doors_cargo1";
942 break;
943 case 3:
944 return "doors_cargo2";
945 break;
946 }
947
948 return super.GetDoorSelectionNameFromSeatPos(posIdx);
949 }
950
951 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
952 {
953 switch( posIdx )
954 {
955 case 0:
956 return "CivSedanDriverDoors";
957 break;
958 case 1:
959 return "CivSedanCoDriverDoors";
960 break;
961 case 2:
962 return "CivSedanCargo1Doors";
963 break;
964 case 3:
965 return "CivSedanCargo2Doors";
966 break;
967 }
968
969 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
970 }
971
972 // 0 full ambient and engine sound
973 // 1 zero ambient and engine sound
974 override float OnSound(CarSoundCtrl ctrl, float oldValue)
975 {
976 switch (ctrl)
977 {
978 case CarSoundCtrl.DOORS:
979 float newValue = 0;
980 if (GetCarDoorsState("CivSedanDriverDoors") == CarDoorState.DOORS_CLOSED)
981 {
982 newValue += 0.25;
983 }
984
985 if (GetCarDoorsState("CivSedanCoDriverDoors") == CarDoorState.DOORS_CLOSED)
986 {
987 newValue += 0.25;
988 }
989
990 if (GetCarDoorsState("CivSedanCargo1Doors") == CarDoorState.DOORS_CLOSED)
991 {
992 newValue += 0.25;
993 }
994
995 if (GetCarDoorsState("CivSedanCargo2Doors") == CarDoorState.DOORS_CLOSED)
996 {
997 newValue += 0.25;
998 }
999
1000 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
1001 {
1002 newValue -= 0.6;
1003 }
1004
1005 if (GetHealthLevel("WindowBack") == GameConstants.STATE_RUINED)
1006 {
1007 newValue -= 0.6;
1008 }
1009
1010 return Math.Clamp(newValue, 0, 1);
1011 break;
1012 }
1013
1014 return super.OnSound(ctrl, oldValue);
1015 }
1016
1017 override string GetAnimSourceFromSelection(string selection)
1018 {
1019 switch (selection)
1020 {
1021 case "doors_driver":
1022 return "DoorsDriver";
1023 case "doors_codriver":
1024 return "DoorsCoDriver";
1025 case "doors_cargo1":
1026 return "DoorsCargo1";
1027 case "doors_cargo2":
1028 return "DoorsCargo2";
1029 case "doors_hood":
1030 return "DoorsHood";
1031 case "doors_trunk":
1032 return "DoorsTrunk";
1033 }
1034
1035 return "";
1036 }
1037
1038 override bool IsVitalTruckBattery()
1039 {
1040 return false;
1041 }
1042
1043 override bool IsVitalGlowPlug()
1044 {
1045 return false;
1046 }
1047
1048 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1049 {
1050 switch (currentSeat)
1051 {
1052 case 0:
1053 return nextSeat == 1;
1054
1055 case 1:
1056 return nextSeat == 0;
1057
1058 case 2:
1059 return nextSeat == 3;
1060
1061 case 3:
1062 return nextSeat == 2;
1063 }
1064
1065 return false;
1066 }
1067
1068 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
1069 {
1070 switch (pCurrentSeat)
1071 {
1072 case 0:
1073 return pDoorsSelection == "DoorsDriver";
1074
1075 case 1:
1076 return pDoorsSelection == "DoorsCoDriver";
1077
1078 case 2:
1079 return pDoorsSelection == "DoorsCargo1";
1080
1081 case 3:
1082 return pDoorsSelection == "DoorsCargo2";
1083 }
1084
1085 return false;
1086 }
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");
1100 GetInventory().CreateInInventory("CivSedanDoors_CoDriver");
1101 GetInventory().CreateInInventory("CivSedanDoors_BackLeft");
1102 GetInventory().CreateInInventory("CivSedanDoors_BackRight");
1103 GetInventory().CreateInInventory("CivSedanHood");
1104 GetInventory().CreateInInventory("CivSedanTrunk");
1105
1106 //-----IN CAR CARGO
1107 GetInventory().CreateInInventory("CivSedanWheel");
1108 GetInventory().CreateInInventory("CivSedanWheel");
1109 }
1110
1111 override float GetPushForceCoefficientMultiplier()
1112 {
1113 return 1.5;
1114 }
1115}
1116
1117class CivilianSedan_Wine extends CivilianSedan
1118{
1119 override void OnDebugSpawn()
1120 {
1121 SpawnUniversalParts();
1122 SpawnAdditionalItems();
1123 FillUpCarFluids();
1124
1125 GetInventory().CreateInInventory("CivSedanWheel");
1126 GetInventory().CreateInInventory("CivSedanWheel");
1127 GetInventory().CreateInInventory("CivSedanWheel");
1128 GetInventory().CreateInInventory("CivSedanWheel");
1129
1130 GetInventory().CreateInInventory("CivSedanDoors_Driver_Wine");
1131 GetInventory().CreateInInventory("CivSedanDoors_CoDriver_Wine");
1132 GetInventory().CreateInInventory("CivSedanDoors_BackLeft_Wine");
1133 GetInventory().CreateInInventory("CivSedanDoors_BackRight_Wine");
1134 GetInventory().CreateInInventory("CivSedanHood_Wine");
1135 GetInventory().CreateInInventory("CivSedanTrunk_Wine");
1136
1137 //-----IN CAR CARGO
1138 GetInventory().CreateInInventory("CivSedanWheel");
1139 GetInventory().CreateInInventory("CivSedanWheel");
1140 }
1141}
1142
1143class CivilianSedan_Black extends CivilianSedan
1144{
1145 override void OnDebugSpawn()
1146 {
1147 SpawnUniversalParts();
1148 SpawnAdditionalItems();
1149 FillUpCarFluids();
1150
1151 GetInventory().CreateInInventory("CivSedanWheel");
1152 GetInventory().CreateInInventory("CivSedanWheel");
1153 GetInventory().CreateInInventory("CivSedanWheel");
1154 GetInventory().CreateInInventory("CivSedanWheel");
1155
1156 GetInventory().CreateInInventory("CivSedanDoors_Driver_Black");
1157 GetInventory().CreateInInventory("CivSedanDoors_CoDriver_Black");
1158 GetInventory().CreateInInventory("CivSedanDoors_BackLeft_Black");
1159 GetInventory().CreateInInventory("CivSedanDoors_BackRight_Black");
1160 GetInventory().CreateInInventory("CivSedanHood_Black");
1161 GetInventory().CreateInInventory("CivSedanTrunk_Black");
1162
1163 //-----IN CAR CARGO
1164 GetInventory().CreateInInventory("CivSedanWheel");
1165 GetInventory().CreateInInventory("CivSedanWheel");
1166 }
1167}
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.