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

◆ OnVehicleJumpOutServer()

void Car::OnVehicleJumpOutServer ( GetOutTransportActionData gotActionData)
inlineprotected

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

1219 {
1220 PlayerBase player = gotActionData.m_Player;
1221
1222 array<ClothingBase> equippedClothes = new array<ClothingBase>;
1223 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("LEGS")));
1224 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("BACK")));
1225 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("VEST")));
1226 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("HeadGear")));
1227 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("Mask")));
1228 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("BODY")));
1229 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("FEET")));
1230 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("GLOVES")));
1231
1232 // -----------------------------------------------
1233 float shockTaken = (gotActionData.m_Speed * gotActionData.m_Speed) / ActionGetOutTransport.DMG_FACTOR;
1234
1235 //Lower shock taken if player uses a helmet
1236 ItemBase headGear = ClothingBase.Cast(player.GetItemOnHead());
1237 HelmetBase helmet;
1238 if (Class.CastTo(helmet, headGear))
1239 shockTaken *= 0.5;
1240
1241 // -----------------------------------------------
1242
1243 int randNum; //value used for probability evaluation
1244 randNum = Math.RandomInt(0, 100);
1245 if (gotActionData.m_Speed < ActionGetOutTransport.LOW_SPEED_VALUE)
1246 {
1247 if (randNum < 20)
1248 player.GiveShock(-shockTaken); //To inflict shock, a negative value must be passed
1249
1250 randNum = Math.RandomIntInclusive(0, PlayerBase.m_BleedingSourcesLow.Count() - 1);
1251
1252 if (player.m_BleedingManagerServer)
1253 player.m_BleedingManagerServer.AttemptAddBleedingSourceBySelection(PlayerBase.m_BleedingSourcesLow[randNum]);
1254 }
1255 else if (gotActionData.m_Speed >= ActionGetOutTransport.LOW_SPEED_VALUE && gotActionData.m_Speed < ActionGetOutTransport.HIGH_SPEED_VALUE)
1256 {
1257 if (randNum < 50)
1258 player.GiveShock(-shockTaken);
1259
1260 randNum = Math.RandomInt(0, PlayerBase.m_BleedingSourcesUp.Count() - 1);
1261
1262 if (player.m_BleedingManagerServer)
1263 player.m_BleedingManagerServer.AttemptAddBleedingSourceBySelection(PlayerBase.m_BleedingSourcesUp[randNum]);
1264 }
1265 else if (gotActionData.m_Speed >= ActionGetOutTransport.HIGH_SPEED_VALUE)
1266 {
1267 if (!headGear && player.m_BleedingManagerServer)
1268 player.m_BleedingManagerServer.AttemptAddBleedingSourceBySelection("Head");
1269
1270 if (randNum < 75)
1271 player.GiveShock(-shockTaken);
1272 }
1273
1274 float dmgTaken = (gotActionData.m_Speed * gotActionData.m_Speed) / ActionGetOutTransport.SHOCK_FACTOR;
1275
1276 //Damage all currently equipped clothes
1277 foreach (ClothingBase cloth : equippedClothes)
1278 {
1279 //If no item is equipped on slot, slot is ignored
1280 if (cloth == null)
1281 continue;
1282
1283 cloth.DecreaseHealth(dmgTaken, false);
1284 }
1285
1286 vector posMS = gotActionData.m_Player.WorldToModel(gotActionData.m_Player.GetPosition());
1287 gotActionData.m_Player.DamageAllLegs(dmgTaken); //Additionnal leg specific damage dealing
1288
1289 float healthCoef = Math.InverseLerp(ActionGetOutTransport.HEALTH_LOW_SPEED_VALUE, ActionGetOutTransport.HEALTH_HIGH_SPEED_VALUE, gotActionData.m_Speed);
1290 healthCoef = Math.Clamp(healthCoef, 0.0, 1.0);
1291 gotActionData.m_Player.ProcessDirectDamage(DamageType.CUSTOM, gotActionData.m_Player, "", "FallDamageHealth", posMS, healthCoef);
1292 }
Clothing ClothingBase
Определения Clothing_Base.c:194
DamageType
exposed from C++ (do not change)
Определения DamageSystem.c:11
class GP5GasMask extends MaskBase ItemBase

Перекрестные ссылки Class::CastTo(), Math::Clamp(), ActionGetOutTransport::DMG_FACTOR, ActionGetOutTransport::HEALTH_HIGH_SPEED_VALUE, ActionGetOutTransport::HEALTH_LOW_SPEED_VALUE, ActionGetOutTransport::HIGH_SPEED_VALUE, Math::InverseLerp(), ActionGetOutTransport::LOW_SPEED_VALUE, GetOutTransportActionData::m_Speed, Math::RandomInt(), Math::RandomIntInclusive() и ActionGetOutTransport::SHOCK_FACTOR.