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

◆ IsVitalGlowPlug()

override bool OnDebugSpawn::IsVitalGlowPlug ( )
protected

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

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