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

◆ GetPushForceCoefficientMultiplier()

override float OnDebugSpawn::GetPushForceCoefficientMultiplier ( )
protected

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

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