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

◆ OnVehicleJumpOutServer()

void Car::OnVehicleJumpOutServer ( GetOutTransportActionData gotActionData)
inlineprotected

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

1165 {
1166 PlayerBase player = gotActionData.m_Player;
1167
1168 array<ClothingBase> equippedClothes = new array<ClothingBase>;
1169 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("LEGS")));
1170 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("BACK")));
1171 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("VEST")));
1172 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("HeadGear")));
1173 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("Mask")));
1174 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("BODY")));
1175 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("FEET")));
1176 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("GLOVES")));
1177
1178 // -----------------------------------------------
1179 float shockTaken = (gotActionData.m_Speed * gotActionData.m_Speed) / ActionGetOutTransport.DMG_FACTOR;
1180
1181 //Lower shock taken if player uses a helmet
1182 ItemBase headGear = ClothingBase.Cast(player.GetItemOnHead());
1183 HelmetBase helmet;
1184 if (Class.CastTo(helmet, headGear))
1185 shockTaken *= 0.5;
1186
1187 // -----------------------------------------------
1188
1189 int randNum; //value used for probability evaluation
1190 randNum = Math.RandomInt(0, 100);
1191 if (gotActionData.m_Speed < ActionGetOutTransport.LOW_SPEED_VALUE)
1192 {
1193 if (randNum < 20)
1194 player.GiveShock(-shockTaken); //To inflict shock, a negative value must be passed
1195
1196 randNum = Math.RandomIntInclusive(0, PlayerBase.m_BleedingSourcesLow.Count() - 1);
1197
1198 if (player.m_BleedingManagerServer)
1199 player.m_BleedingManagerServer.AttemptAddBleedingSourceBySelection(PlayerBase.m_BleedingSourcesLow[randNum]);
1200 }
1201 else if (gotActionData.m_Speed >= ActionGetOutTransport.LOW_SPEED_VALUE && gotActionData.m_Speed < ActionGetOutTransport.HIGH_SPEED_VALUE)
1202 {
1203 if (randNum < 50)
1204 player.GiveShock(-shockTaken);
1205
1206 randNum = Math.RandomInt(0, PlayerBase.m_BleedingSourcesUp.Count() - 1);
1207
1208 if (player.m_BleedingManagerServer)
1209 player.m_BleedingManagerServer.AttemptAddBleedingSourceBySelection(PlayerBase.m_BleedingSourcesUp[randNum]);
1210 }
1211 else if (gotActionData.m_Speed >= ActionGetOutTransport.HIGH_SPEED_VALUE)
1212 {
1213 if (!headGear && player.m_BleedingManagerServer)
1214 player.m_BleedingManagerServer.AttemptAddBleedingSourceBySelection("Head");
1215
1216 if (randNum < 75)
1217 player.GiveShock(-shockTaken);
1218 }
1219
1220 float dmgTaken = (gotActionData.m_Speed * gotActionData.m_Speed) / ActionGetOutTransport.SHOCK_FACTOR;
1221
1222 //Damage all currently equipped clothes
1223 foreach (ClothingBase cloth : equippedClothes)
1224 {
1225 //If no item is equipped on slot, slot is ignored
1226 if (cloth == null)
1227 continue;
1228
1229 cloth.DecreaseHealth(dmgTaken, false);
1230 }
1231
1232 vector posMS = gotActionData.m_Player.WorldToModel(gotActionData.m_Player.GetPosition());
1233 gotActionData.m_Player.DamageAllLegs(dmgTaken); //Additionnal leg specific damage dealing
1234
1235 float healthCoef = Math.InverseLerp(ActionGetOutTransport.HEALTH_LOW_SPEED_VALUE, ActionGetOutTransport.HEALTH_HIGH_SPEED_VALUE, gotActionData.m_Speed);
1236 healthCoef = Math.Clamp(healthCoef, 0.0, 1.0);
1237 gotActionData.m_Player.ProcessDirectDamage(DamageType.CUSTOM, gotActionData.m_Player, "", "FallDamageHealth", posMS, healthCoef);
1238 }
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.