79 PreloadAmmoTypeData();
142 playerBase.ForceUpdateInjuredState();
155 int randomizedSign = -1;
159 float randomizationValue = 0;
173 return pValue + (randomizedSign * pValue * randomizationValue);
180 int bleedingSelectionIndex;
181 BleedingSourcesManagerServer bleedingManager = pPlayer.GetBleedingManagerServer();
204 EntityAI gloves = pPlayer.FindAttachmentBySlotName(
"Gloves");
208 EntityAI shoes = pPlayer.FindAttachmentBySlotName(
"Feet");
212 EntityAI pants = pPlayer.FindAttachmentBySlotName(
"Legs");
218 FallDamageDebugData GetFallDamageDebugData()
220 FallDamageDebugData data =
new FallDamageDebugData();
226 void ShowFallDamageDebugInfo(
bool enabled)
228 FallDamageDebugData data = GetFallDamageDebugData();
229 DisplayFallDamageDebugInfo(enabled, data);
232 private static string LandTypeToString(
int landType)
247 private void PreloadAmmoTypeData()
249 if (m_AmmoTypeData == null)
258 private vector GetValuesFromAmmoType(
string pAmmoType)
260 vector values = vector.Zero;
261 values[0] =
GetGame().
ConfigGetFloat(
string.Format(
"CfgAmmo %1 DamageApplied Health damage", pAmmoType));
262 values[1] =
GetGame().
ConfigGetFloat(
string.Format(
"CfgAmmo %1 DamageApplied Blood damage", pAmmoType));
263 values[2] =
GetGame().
ConfigGetFloat(
string.Format(
"CfgAmmo %1 DamageApplied Shock damage", pAmmoType));
268 static void DisplayFallDamageDebugInfo(
bool enabled, FallDamageDebugData data)
276 DbgUI.Text(
string.Format(
"Height:\t%1", Math.Clamp(data.m_Height, 0,
float.MAX)));
277 DbgUI.Text(
string.Format(
"Land Type:\t%1 (%2)", data.m_LandType, LandTypeToString(data.m_LandType)));
279 DbgUI.Text(
"Health");
280 DbgUI.Text(
string.Format(
" coef:%1 dmg:%2", data.m_HealthCoef, m_AmmoTypeData[
FALL_DAMAGE_AMMO_HEALTH] * data.m_HealthCoef));
282 DbgUI.Text(
string.Format(
" coef:%1 dmg:%2", data.m_ShockCoef, m_AmmoTypeData[
FALL_DAMAGE_AMMO_SHOCK] * data.m_ShockCoef));
283 DbgUI.Text(
"Broken Legs:");
285 DbgUI.Text(
"Gloves damage:");
287 DbgUI.Text(
"Shoes damage:");
289 DbgUI.Text(
"Pants damage:");
291 DbgUI.Text(
"Bleeding coefs:");
292 DbgUI.Text(
string.Format(
" hands:%1", data.m_BleedingHandsCoef));
293 DbgUI.Text(
string.Format(
" feet:%1", data.m_BleedingFeetCoef));
294 DbgUI.Text(
string.Format(
" legs:%1", data.m_BleedingLegsCoef));
295 DbgUI.Text(
string.Format(
" H&F chance:%1", data.m_BleedingChanceCoef));
302 void FillDebugFallDamageData(FallDamageDebugData data)
333class FallDamageDebugData :
Param
339 float m_BrokenLegsCoef;
340 float m_GlovesHealthCoef;
341 float m_ShoesHealthCoef;
342 float m_PantsHealthCoef;
343 float m_BleedingHandsCoef;
344 float m_BleedingFeetCoef;
345 float m_BleedingLegsCoef;
346 float m_BleedingChanceCoef;
351 m_LandType = fallDamage.GetLandType();
353 fallDamage.FillDebugFallDamageData(
this);
358 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);
363 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 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
proto native float ConfigGetFloat(string path)
Get float value from config on path.
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)
proto native CGame GetGame()
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 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].