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

◆ IsVitalTruckBattery()

override bool OnDebugSpawn::IsVitalTruckBattery ( )
protected

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

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