79 PreloadAmmoTypeData();
92 float CurveExp(
float low,
float high,
float value,
float power)
152 playerBase.ForceUpdateInjuredState();
167 int randomizedSign = -1;
171 float randomizationValue = 0;
185 return pValue + (randomizedSign * pValue * randomizationValue);
192 int bleedingSelectionIndex;
193 BleedingSourcesManagerServer bleedingManager = pPlayer.GetBleedingManagerServer();
216 EntityAI gloves = pPlayer.FindAttachmentBySlotName(
"Gloves");
220 EntityAI shoes = pPlayer.FindAttachmentBySlotName(
"Feet");
224 EntityAI pants = pPlayer.FindAttachmentBySlotName(
"Legs");
230 FallDamageDebugData GetFallDamageDebugData()
232 FallDamageDebugData data =
new FallDamageDebugData();
238 void ShowFallDamageDebugInfo(
bool enabled)
240 FallDamageDebugData data = GetFallDamageDebugData();
241 DisplayFallDamageDebugInfo(enabled, data);
244 private static string LandTypeToString(
int landType)
259 private void PreloadAmmoTypeData()
261 if (m_AmmoTypeData == null)
262 m_AmmoTypeData =
new map<string, float>();
270 private vector GetValuesFromAmmoType(
string pAmmoType)
272 vector values = vector.Zero;
273 values[0] =
g_Game.ConfigGetFloat(
string.Format(
"CfgAmmo %1 DamageApplied Health damage", pAmmoType));
274 values[1] =
g_Game.ConfigGetFloat(
string.Format(
"CfgAmmo %1 DamageApplied Blood damage", pAmmoType));
275 values[2] =
g_Game.ConfigGetFloat(
string.Format(
"CfgAmmo %1 DamageApplied Shock damage", pAmmoType));
280 static void DisplayFallDamageDebugInfo(
bool enabled, FallDamageDebugData data)
288 DbgUI.Text(
string.Format(
"Height:\t%1", Math.Clamp(data.m_Height, 0,
float.MAX)));
289 DbgUI.Text(
string.Format(
"Land Type:\t%1 (%2)", data.m_LandType, LandTypeToString(data.m_LandType)));
291 DbgUI.Text(
"Health");
292 DbgUI.Text(
string.Format(
" coef:%1 dmg:%2", data.m_HealthCoef, m_AmmoTypeData[
FALL_DAMAGE_AMMO_HEALTH] * data.m_HealthCoef));
294 DbgUI.Text(
string.Format(
" coef:%1 dmg:%2", data.m_ShockCoef, m_AmmoTypeData[
FALL_DAMAGE_AMMO_SHOCK] * data.m_ShockCoef));
295 DbgUI.Text(
"Broken Legs:");
297 DbgUI.Text(
"Gloves damage:");
299 DbgUI.Text(
"Shoes damage:");
301 DbgUI.Text(
"Pants damage:");
303 DbgUI.Text(
"Bleeding coefs:");
304 DbgUI.Text(
string.Format(
" hands:%1", data.m_BleedingHandsCoef));
305 DbgUI.Text(
string.Format(
" feet:%1", data.m_BleedingFeetCoef));
306 DbgUI.Text(
string.Format(
" legs:%1", data.m_BleedingLegsCoef));
307 DbgUI.Text(
string.Format(
" H&F chance:%1", data.m_BleedingChanceCoef));
314 void FillDebugFallDamageData(FallDamageDebugData data)
345class FallDamageDebugData :
Param
351 float m_BrokenLegsCoef;
352 float m_GlovesHealthCoef;
353 float m_ShoesHealthCoef;
354 float m_PantsHealthCoef;
355 float m_BleedingHandsCoef;
356 float m_BleedingFeetCoef;
357 float m_BleedingLegsCoef;
358 float m_BleedingChanceCoef;
363 m_LandType = fallDamage.GetLandType();
365 fallDamage.FillDebugFallDamageData(
this);
370 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);
375 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);
DamageType
exposed from C++ (do not change)
class FallDamageData FALL_DAMAGE_AMMO_HEALTH
void DamageAttachedGear(notnull PlayerBase pPlayer)
const float RANDOM_THRESHOLD_HEALTH_LOW
const float FD_DMG_FROM_HEIGHT
damage will not be taken into account bellow this HeightToDamage
const float BLEEDINGFEET_HEIGHT_LOW
const float BLEEDING_CHANCE_HEIGHT_LOW
const float BLEEDINGLEGS_HEIGHT_LOW
const float SHOES_HEALTH_HEIGHT_HIGH
ref FallDamageData m_FallDamageData
static const string FALL_DAMAGE_AMMO_HEALTH_OTHER_ATTACHMENTS
const float HEALTH_HEIGHT_LOW
void DayZPlayerImplementFallDamage(DayZPlayer pPlayer)
const float PANTS_HEALTH_HEIGHT_HIGH
const float RANDOM_THRESHOLD_LEGS_LOW
const float GLOVES_HEALTH_HEIGHT_LOW
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
static const string BLEEDING_FEET_SELECTIONS[2]
static const string FALL_DAMAGE_AMMO_SHOCK
static const string FALL_DAMAGE_AMMO_HEALTH_ATTACHMENT
const float BROKENLEGS_HEIGHT_LOW
const float SHOCK_HEIGHT_HIGH
static const string BLEEDING_HANDS_SELECTIONS[2]
const float BLEEDINGHANDS_HEIGHT_LOW
const float RANDOM_THRESHOLD_HEALTH_HIGH
void AttachBleedingToZonesByHeight(notnull PlayerBase pPlayer)
const int DAMAGE_TYPE_LEGS
float DamageCoef(float pHeight)
void HandleFallDamage(FallDamageData pData)
const float GLOVES_HEALTH_HEIGHT_HIGH
const string FD_AMMO
ammo type used for damaging
const int DAMAGE_TYPE_GLOBAL
const float SHOES_HEALTH_HEIGHT_LOW
const float PANTS_HEALTH_HEIGHT_LOW
static const float BROKENLEGS_HEALTH_DAMAGE_MAX
const float RANDOM_THRESHOLD_LEGS_HIGH
const int DAMAGE_TYPE_ATTACHMENTS
static const string BLEEDING_LEGS_SELECTIONS[2]
const float SHOCK_HEIGHT_LOW
const float BROKENLEGS_HEIGHT_HIGH
float CurveExp(float low, float high, float value, float power)
float Randomize(int pType, float pValue)
const float RANDOM_THRESHOLD_ATTACHMENTS_LOW
const float BLEEDING_CHANCE_HEIGHT_HIGH
const float RANDOM_THRESHOLD_ATTACHMENTS_HIGH
const float HEALTH_HEIGHT_HIGH
class PresenceNotifierNoiseEvents windowPosX
dbgUI settings
void Synch(EntityAI victim)
keeping "step" here for consistency only
float m_BleedingChanceCoef
float m_BleedingChanceLegsCoef
float m_BleedingHandsCoef
bool Deserializer(Serializer ctx)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
proto bool Write(void value_out)
proto bool Read(void value_in)
static proto int Randomize(int seed)
Sets the seed for the random number generator.
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
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 proto float Pow(float v, float power)
Return power of v ^ power.
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].