79 PreloadAmmoTypeData();
150 playerBase.ForceUpdateInjuredState();
158 int randomizedSign = -1;
162 float randomizationValue = 0;
176 return pValue + (randomizedSign * pValue * randomizationValue);
183 int bleedingSelectionIndex;
184 BleedingSourcesManagerServer bleedingManager = pPlayer.GetBleedingManagerServer();
207 EntityAI gloves = pPlayer.FindAttachmentBySlotName(
"Gloves");
211 EntityAI shoes = pPlayer.FindAttachmentBySlotName(
"Feet");
215 EntityAI pants = pPlayer.FindAttachmentBySlotName(
"Legs");
221 FallDamageDebugData GetFallDamageDebugData()
223 FallDamageDebugData data =
new FallDamageDebugData();
229 void ShowFallDamageDebugInfo(
bool enabled)
231 FallDamageDebugData data = GetFallDamageDebugData();
232 DisplayFallDamageDebugInfo(enabled, data);
235 private static string LandTypeToString(
int landType)
250 private void PreloadAmmoTypeData()
252 if (m_AmmoTypeData == null)
261 private vector GetValuesFromAmmoType(
string pAmmoType)
264 values[0] =
GetGame().
ConfigGetFloat(
string.Format(
"CfgAmmo %1 DamageApplied Health damage", pAmmoType));
265 values[1] =
GetGame().
ConfigGetFloat(
string.Format(
"CfgAmmo %1 DamageApplied Blood damage", pAmmoType));
266 values[2] =
GetGame().
ConfigGetFloat(
string.Format(
"CfgAmmo %1 DamageApplied Shock damage", pAmmoType));
271 static void DisplayFallDamageDebugInfo(
bool enabled, FallDamageDebugData data)
280 DbgUI.
Text(
string.Format(
"Land Type:\t%1 (%2)", data.m_LandType, LandTypeToString(data.m_LandType)));
295 DbgUI.
Text(
string.Format(
" hands:%1", data.m_BleedingHandsCoef));
296 DbgUI.
Text(
string.Format(
" feet:%1", data.m_BleedingFeetCoef));
297 DbgUI.
Text(
string.Format(
" legs:%1", data.m_BleedingLegsCoef));
298 DbgUI.
Text(
string.Format(
" H&F chance:%1", data.m_BleedingChanceCoef));
305 void FillDebugFallDamageData(FallDamageDebugData data)
336class FallDamageDebugData :
Param
342 float m_BrokenLegsCoef;
343 float m_GlovesHealthCoef;
344 float m_ShoesHealthCoef;
345 float m_PantsHealthCoef;
346 float m_BleedingHandsCoef;
347 float m_BleedingFeetCoef;
348 float m_BleedingLegsCoef;
349 float m_BleedingChanceCoef;
354 m_LandType = fallDamage.GetLandType();
356 fallDamage.FillDebugFallDamageData(
this);
361 return ctx.
Write(
m_Height) && ctx.
Write(m_LandType) && ctx.
Write(m_HealthCoef) && ctx.
Write(m_ShockCoef) && ctx.
Write(m_BrokenLegsCoef) && ctx.
Write(m_GlovesHealthCoef) && ctx.
Write(m_ShoesHealthCoef) && ctx.
Write(m_PantsHealthCoef) && ctx.
Write(m_BleedingHandsCoef) && ctx.
Write(m_BleedingFeetCoef) && ctx.
Write(m_BleedingLegsCoef);
366 return ctx.
Read(
m_Height) && ctx.
Read(m_LandType) && ctx.
Read(m_HealthCoef) && ctx.
Read(m_ShockCoef) && ctx.
Write(m_BrokenLegsCoef) && ctx.
Read(m_GlovesHealthCoef) && ctx.
Read(m_ShoesHealthCoef) && ctx.
Read(m_PantsHealthCoef) && ctx.
Read(m_BleedingHandsCoef) && ctx.
Read(m_BleedingFeetCoef) && ctx.
Read(m_BleedingLegsCoef);
class FallDamageData FALL_DAMAGE_AMMO_HEALTH
static private const string BLEEDING_LEGS_SELECTIONS[2]
private const float SHOCK_HEIGHT_HIGH
const float FD_DMG_FROM_HEIGHT
damage will not be taken into account bellow this HeightToDamage
private const float RANDOM_THRESHOLD_HEALTH_LOW
private const float BLEEDINGFEET_HEIGHT_LOW
private const float BLEEDINGLEGS_HEIGHT_LOW
static const string FALL_DAMAGE_AMMO_HEALTH_OTHER_ATTACHMENTS
const float HEALTH_HEIGHT_LOW
private const float SHOES_HEALTH_HEIGHT_LOW
private const float PANTS_HEALTH_HEIGHT_HIGH
void DayZPlayerImplementFallDamage(DayZPlayer pPlayer)
private ref FallDamageData m_FallDamageData
private const float BROKENLEGS_HEIGHT_LOW
private const int DAMAGE_TYPE_ATTACHMENTS
private const float RANDOM_THRESHOLD_LEGS_HIGH
const float FD_MAX_HEIGHT_LEG_BREAK
height where legs break most of the time
const float FD_MAX_DMG_AT_HEIGHT
height where player gets 100% damage
private const float BLEEDING_CHANCE_HEIGHT_LOW
private const float BLEEDINGHANDS_HEIGHT_LOW
static const string FALL_DAMAGE_AMMO_SHOCK
static const string FALL_DAMAGE_AMMO_HEALTH_ATTACHMENT
private void AttachBleedingToZonesByHeight(notnull PlayerBase pPlayer)
private const float GLOVES_HEALTH_HEIGHT_HIGH
private const int DAMAGE_TYPE_GLOBAL
private const float BLEEDING_CHANCE_HEIGHT_HIGH
private void DamageAttachedGear(notnull PlayerBase pPlayer)
static private const float BROKENLEGS_HEALTH_DAMAGE_MAX
private const float RANDOM_THRESHOLD_ATTACHMENTS_HIGH
private const float GLOVES_HEALTH_HEIGHT_LOW
float DamageCoef(float pHeight)
void HandleFallDamage(FallDamageData pData)
const string FD_AMMO
ammo type used for damaging
private const float BROKENLEGS_HEIGHT_HIGH
private const int DAMAGE_TYPE_LEGS
private const float RANDOM_THRESHOLD_HEALTH_HIGH
static private const string BLEEDING_HANDS_SELECTIONS[2]
private float Randomize(int pType, float pValue)
private const float RANDOM_THRESHOLD_ATTACHMENTS_LOW
private const float SHOCK_HEIGHT_LOW
private const float SHOES_HEALTH_HEIGHT_HIGH
private const float PANTS_HEALTH_HEIGHT_LOW
private const float RANDOM_THRESHOLD_LEGS_LOW
static private const string BLEEDING_FEET_SELECTIONS[2]
const float HEALTH_HEIGHT_HIGH
class PresenceNotifierNoiseEvents windowPosX
dbgUI settings
protected void Synch(EntityAI victim)
keeping "step" here for consistency only
proto native float ConfigGetFloat(string path)
Get float value from config on path.
float m_BleedingHandsCoef
float m_BleedingChanceCoef
float m_BleedingChanceLegsCoef
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
bool Deserializer(Serializer ctx)
Serialization general interface. Serializer API works with:
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native CGame GetGame()
static proto native void Begin(string windowTitle, float x=0, float y=0)
static proto native void Text(string label)
static proto native void End()
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
static proto int Randomize(int seed)
Sets the seed for the random number generator.
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'.
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].