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

◆ CanReachSeatFromSeat()

override bool OnDebugSpawn::CanReachSeatFromSeat ( int currentSeat,
int nextSeat )
protected

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

788{
792
793 void CivilianSedan()
794 {
795 //m_dmgContactCoef = 0.065;
796
797 m_EngineStartOK = "CivilianSedan_engine_start_SoundSet";
798 m_EngineStartBattery = "CivilianSedan_engine_failed_start_battery_SoundSet";
799 m_EngineStartPlug = "CivilianSedan_engine_failed_start_sparkplugs_SoundSet";
800 m_EngineStartFuel = "CivilianSedan_engine_failed_start_fuel_SoundSet";
801 m_EngineStop = "CivilianSedan_engine_stop_SoundSet";
802 m_EngineStopFuel = "CivilianSedan_engine_stop_fuel_SoundSet";
803
804 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
805 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
806
807 m_CarHornShortSoundName = "CivilianSedan_Horn_Short_SoundSet";
808 m_CarHornLongSoundName = "CivilianSedan_Horn_SoundSet";
809
810 SetEnginePos("0 0.7 1.6");
811 }
812
813 override void EEInit()
814 {
815 super.EEInit();
816
817 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
818 {
820 m_UTSSettings.m_ManualUpdate = true;
822 m_UTSSettings.m_TemperatureCap = 0;
823 m_UTSSettings.m_RangeFull = 0.5;
824 m_UTSSettings.m_RangeMax = 2;
825
828 }
829 }
830
831 override void OnEngineStart()
832 {
833 super.OnEngineStart();
834
835 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
836 {
837 m_UTSource.SetDefferedActive(true, 20.0);
838 }
839 }
840
841 override void OnEngineStop()
842 {
843 super.OnEngineStop();
844
845 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
846 {
847 m_UTSource.SetDefferedActive(false, 10.0);
848 }
849 }
850
851 override void EOnPostSimulate(IEntity other, float timeSlice)
852 {
853 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
854 {
855 if (m_UTSource.IsActive())
856 {
858 }
859 }
860 }
861
862 override int GetAnimInstance()
863 {
864 return VehicleAnimInstances.SEDAN;
865 }
866
867 override float GetTransportCameraDistance()
868 {
869 return 4.5;
870 }
871
872 override int GetSeatAnimationType(int posIdx)
873 {
874 switch (posIdx)
875 {
876 case 0:
877 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
878 case 1:
879 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
880 case 2:
881 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
882 case 3:
883 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
884 }
885
886 return 0;
887 }
888
889 // Override for car-specific light type
891 {
892 return CarLightBase.Cast( ScriptedLightBase.CreateLight(CivilianSedanFrontLight) );
893 }
894
895 // Override for car-specific light type
897 {
898 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(CivilianSedanRearLight) );
899 }
900
901 override bool CanReleaseAttachment( EntityAI attachment )
902 {
903 if( !super.CanReleaseAttachment( attachment ) )
904 return false;
905
906 string attType = attachment.GetType();
907
908 if ( EngineIsOn() || GetCarDoorsState("CivSedanHood") == CarDoorState.DOORS_CLOSED )
909 {
910 if ( attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
911 return false;
912 }
913
914 return true;
915 }
916
917 override protected bool CanManipulateSpareWheel(string slotSelectionName)
918 {
919 return GetCarDoorsState("CivSedanTrunk") != CarDoorState.DOORS_CLOSED;
920 }
921
922 override bool CanDisplayAttachmentCategory(string category_name)
923 {
924 //super
925 if (!super.CanDisplayAttachmentCategory(category_name))
926 return false;
927 //
928
929 category_name.ToLower();
930 if (category_name.Contains("engine"))
931 {
932 if (GetCarDoorsState("CivSedanHood") == CarDoorState.DOORS_CLOSED)
933 return false;
934 }
935
936 return true;
937 }
938
939 override bool CanDisplayCargo()
940 {
941 if ( !super.CanDisplayCargo() )
942 return false;
943
944 if ( GetCarDoorsState("CivSedanTrunk") == CarDoorState.DOORS_CLOSED )
945 return false;
946
947 return true;
948 }
949
950 override int GetCarDoorsState( string slotType )
951 {
952 CarDoor carDoor;
953
954 Class.CastTo( carDoor, FindAttachmentBySlotName( slotType ) );
955 if (!carDoor)
956 {
957 return CarDoorState.DOORS_MISSING;
958 }
959
960 switch (slotType)
961 {
962 case "CivSedanDriverDoors":
963 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
964 break;
965
966 case "CivSedanCoDriverDoors":
967 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
968 break;
969
970 case "CivSedanCargo1Doors":
971 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
972 break;
973
974 case "CivSedanCargo2Doors":
975 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
976 break;
977
978 case "CivSedanTrunk":
979 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
980 break;
981
982 case "CivSedanHood":
983 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
984 break;
985 }
986
987 return CarDoorState.DOORS_MISSING;
988 }
989
990
991 override bool CrewCanGetThrough( int posIdx )
992 {
993 switch( posIdx )
994 {
995 case 0:
996 if ( GetCarDoorsState("CivSedanDriverDoors") == CarDoorState.DOORS_CLOSED )
997 return false;
998
999 return true;
1000 break;
1001
1002 case 1:
1003 if ( GetCarDoorsState("CivSedanCoDriverDoors") == CarDoorState.DOORS_CLOSED )
1004 return false;
1005
1006 return true;
1007 break;
1008
1009 case 2:
1010 if ( GetCarDoorsState("CivSedanCargo1Doors") == CarDoorState.DOORS_CLOSED )
1011 return false;
1012
1013 return true;
1014 break;
1015
1016 case 3:
1017 if ( GetCarDoorsState("CivSedanCargo2Doors") == CarDoorState.DOORS_CLOSED )
1018 return false;
1019
1020 return true;
1021 break;
1022 }
1023
1024 return false;
1025 }
1026
1027 override string GetDoorSelectionNameFromSeatPos(int posIdx)
1028 {
1029 switch( posIdx )
1030 {
1031 case 0:
1032 return "doors_driver";
1033 break;
1034 case 1:
1035 return "doors_codriver";
1036 break;
1037 case 2:
1038 return "doors_cargo1";
1039 break;
1040 case 3:
1041 return "doors_cargo2";
1042 break;
1043 }
1044
1045 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1046 }
1047
1048 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
1049 {
1050 switch( posIdx )
1051 {
1052 case 0:
1053 return "CivSedanDriverDoors";
1054 break;
1055 case 1:
1056 return "CivSedanCoDriverDoors";
1057 break;
1058 case 2:
1059 return "CivSedanCargo1Doors";
1060 break;
1061 case 3:
1062 return "CivSedanCargo2Doors";
1063 break;
1064 }
1065
1066 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1067 }
1068
1069 // 0 full ambient and engine sound
1070 // 1 zero ambient and engine sound
1071 override float OnSound(CarSoundCtrl ctrl, float oldValue)
1072 {
1073 switch (ctrl)
1074 {
1075 case CarSoundCtrl.DOORS:
1076 float newValue = 0;
1077 if (GetCarDoorsState("CivSedanDriverDoors") == CarDoorState.DOORS_CLOSED)
1078 {
1079 newValue += 0.25;
1080 }
1081
1082 if (GetCarDoorsState("CivSedanCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1083 {
1084 newValue += 0.25;
1085 }
1086
1087 if (GetCarDoorsState("CivSedanCargo1Doors") == CarDoorState.DOORS_CLOSED)
1088 {
1089 newValue += 0.25;
1090 }
1091
1092 if (GetCarDoorsState("CivSedanCargo2Doors") == CarDoorState.DOORS_CLOSED)
1093 {
1094 newValue += 0.25;
1095 }
1096
1097 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
1098 {
1099 newValue -= 0.6;
1100 }
1101
1102 if (GetHealthLevel("WindowBack") == GameConstants.STATE_RUINED)
1103 {
1104 newValue -= 0.6;
1105 }
1106
1107 return Math.Clamp(newValue, 0, 1);
1108 break;
1109 }
1110
1111 return super.OnSound(ctrl, oldValue);
1112 }
1113
1114 override string GetAnimSourceFromSelection(string selection)
1115 {
1116 switch (selection)
1117 {
1118 case "doors_driver":
1119 return "DoorsDriver";
1120 case "doors_codriver":
1121 return "DoorsCoDriver";
1122 case "doors_cargo1":
1123 return "DoorsCargo1";
1124 case "doors_cargo2":
1125 return "DoorsCargo2";
1126 case "doors_hood":
1127 return "DoorsHood";
1128 case "doors_trunk":
1129 return "DoorsTrunk";
1130 }
1131
1132 return "";
1133 }
1134
1135 override bool IsVitalTruckBattery()
1136 {
1137 return false;
1138 }
1139
1140 override bool IsVitalGlowPlug()
1141 {
1142 return false;
1143 }
1144
1145 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1146 {
1147 switch (currentSeat)
1148 {
1149 case 0:
1150 return nextSeat == 1;
1151
1152 case 1:
1153 return nextSeat == 0;
1154
1155 case 2:
1156 return nextSeat == 3;
1157
1158 case 3:
1159 return nextSeat == 2;
1160 }
1161
1162 return false;
1163 }
1164
1165 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
1166 {
1167 switch (pCurrentSeat)
1168 {
1169 case 0:
1170 return pDoorsSelection == "DoorsDriver";
1171
1172 case 1:
1173 return pDoorsSelection == "DoorsCoDriver";
1174
1175 case 2:
1176 return pDoorsSelection == "DoorsCargo1";
1177
1178 case 3:
1179 return pDoorsSelection == "DoorsCargo2";
1180 }
1181
1182 return false;
1183 }
1184
1185 override void OnDebugSpawn()
1186 {
1187 SpawnUniversalParts();
1188 SpawnAdditionalItems();
1189 FillUpCarFluids();
1190
1191 GetInventory().CreateInInventory("CivSedanWheel");
1192 GetInventory().CreateInInventory("CivSedanWheel");
1193 GetInventory().CreateInInventory("CivSedanWheel");
1194 GetInventory().CreateInInventory("CivSedanWheel");
1195
1196 GetInventory().CreateInInventory("CivSedanDoors_Driver");
1197 GetInventory().CreateInInventory("CivSedanDoors_CoDriver");
1198 GetInventory().CreateInInventory("CivSedanDoors_BackLeft");
1199 GetInventory().CreateInInventory("CivSedanDoors_BackRight");
1200 GetInventory().CreateInInventory("CivSedanHood");
1201 GetInventory().CreateInInventory("CivSedanTrunk");
1202
1203 //-----IN CAR CARGO
1204 GetInventory().CreateInInventory("CivSedanWheel");
1205 GetInventory().CreateInInventory("CivSedanWheel");
1206 }
1207
1208 override float GetPushForceCoefficientMultiplier()
1209 {
1210 return 1.5;
1211 }
1212}
1213
1214class CivilianSedan_Wine extends CivilianSedan
1215{
1216 override void OnDebugSpawn()
1217 {
1218 SpawnUniversalParts();
1219 SpawnAdditionalItems();
1220 FillUpCarFluids();
1221
1222 GetInventory().CreateInInventory("CivSedanWheel");
1223 GetInventory().CreateInInventory("CivSedanWheel");
1224 GetInventory().CreateInInventory("CivSedanWheel");
1225 GetInventory().CreateInInventory("CivSedanWheel");
1226
1227 GetInventory().CreateInInventory("CivSedanDoors_Driver_Wine");
1228 GetInventory().CreateInInventory("CivSedanDoors_CoDriver_Wine");
1229 GetInventory().CreateInInventory("CivSedanDoors_BackLeft_Wine");
1230 GetInventory().CreateInInventory("CivSedanDoors_BackRight_Wine");
1231 GetInventory().CreateInInventory("CivSedanHood_Wine");
1232 GetInventory().CreateInInventory("CivSedanTrunk_Wine");
1233
1234 //-----IN CAR CARGO
1235 GetInventory().CreateInInventory("CivSedanWheel");
1236 GetInventory().CreateInInventory("CivSedanWheel");
1237 }
1238}
1239
1240class CivilianSedan_Black extends CivilianSedan
1241{
1242 override void OnDebugSpawn()
1243 {
1244 SpawnUniversalParts();
1245 SpawnAdditionalItems();
1246 FillUpCarFluids();
1247
1248 GetInventory().CreateInInventory("CivSedanWheel");
1249 GetInventory().CreateInInventory("CivSedanWheel");
1250 GetInventory().CreateInInventory("CivSedanWheel");
1251 GetInventory().CreateInInventory("CivSedanWheel");
1252
1253 GetInventory().CreateInInventory("CivSedanDoors_Driver_Black");
1254 GetInventory().CreateInInventory("CivSedanDoors_CoDriver_Black");
1255 GetInventory().CreateInInventory("CivSedanDoors_BackLeft_Black");
1256 GetInventory().CreateInInventory("CivSedanDoors_BackRight_Black");
1257 GetInventory().CreateInInventory("CivSedanHood_Black");
1258 GetInventory().CreateInInventory("CivSedanTrunk_Black");
1259
1260 //-----IN CAR CARGO
1261 GetInventory().CreateInInventory("CivSedanWheel");
1262 GetInventory().CreateInInventory("CivSedanWheel");
1263 }
1264}
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.