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

◆ HandleFallDamage() [1/2]

void HandleFallDamage ( FallDamageData pData)
private

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

94 {
95 m_FallDamageData = pData;
96
99 m_FallDamageData.m_HealthCoef = Math.Clamp(m_FallDamageData.m_HealthCoef, 0, 1);
100
102 m_FallDamageData.m_ShockCoef = Math.Clamp(m_FallDamageData.m_ShockCoef, 0, 1);
103
105 m_FallDamageData.m_BrokenLegsCoef = Randomize(DAMAGE_TYPE_LEGS, m_FallDamageData.m_BrokenLegsCoef);
106 m_FallDamageData.m_BrokenLegsCoef = Math.Clamp(m_FallDamageData.m_BrokenLegsCoef, 0, 1);
107
108 m_FallDamageData.m_BleedingHandsCoef = Math.InverseLerp(0, BLEEDINGHANDS_HEIGHT_LOW, pData.m_Height);
109 m_FallDamageData.m_BleedingHandsCoef = Math.Clamp(m_FallDamageData.m_BleedingHandsCoef, 0, 1);
110
111 m_FallDamageData.m_BleedingFeetCoef = Math.InverseLerp(0, BLEEDINGFEET_HEIGHT_LOW, pData.m_Height);
112 m_FallDamageData.m_BleedingFeetCoef = Math.Clamp(m_FallDamageData.m_BleedingFeetCoef, 0, 1);
113
114 m_FallDamageData.m_BleedingLegsCoef = Math.InverseLerp(0, BLEEDINGLEGS_HEIGHT_LOW, pData.m_Height);
115 m_FallDamageData.m_BleedingLegsCoef = Math.Clamp(m_FallDamageData.m_BleedingLegsCoef, 0, 1);
116
118 m_FallDamageData.m_GlovesHealthCoef = Randomize(DAMAGE_TYPE_ATTACHMENTS, m_FallDamageData.m_GlovesHealthCoef);
119 m_FallDamageData.m_GlovesHealthCoef = Math.Clamp(m_FallDamageData.m_GlovesHealthCoef, 0, 1);
120
122 m_FallDamageData.m_ShoesHealthCoef = Randomize(DAMAGE_TYPE_ATTACHMENTS, m_FallDamageData.m_ShoesHealthCoef);
123 m_FallDamageData.m_ShoesHealthCoef = Math.Clamp(m_FallDamageData.m_ShoesHealthCoef, 0, 1);
124
126 m_FallDamageData.m_PantsHealthCoef = Randomize(DAMAGE_TYPE_ATTACHMENTS, m_FallDamageData.m_PantsHealthCoef);
127 m_FallDamageData.m_PantsHealthCoef = Math.Clamp(m_FallDamageData.m_PantsHealthCoef, 0, 1);
128
130 m_FallDamageData.m_BleedingChanceCoef = Math.Clamp(m_FallDamageData.m_BleedingChanceCoef, 0, 0.7);
131
132 m_FallDamageData.m_BleedingChanceLegsCoef = 0.15;
133
134 if (GetGame().IsServer())
135 {
136 PlayerBase playerBase = PlayerBase.Cast(m_Player);
137 if (playerBase)
138 {
140 DamageAttachedGear(playerBase);
141 playerBase.DamageAllLegs(BROKENLEGS_HEALTH_DAMAGE_MAX * m_FallDamageData.m_BrokenLegsCoef);
142 playerBase.ForceUpdateInjuredState();
143 }
144
145 m_Player.ProcessDirectDamage(DamageType.CUSTOM, m_Player, "", FALL_DAMAGE_AMMO_HEALTH, vector.Zero, m_FallDamageData.m_HealthCoef);
146 m_Player.ProcessDirectDamage(DamageType.CUSTOM, m_Player, "", FALL_DAMAGE_AMMO_SHOCK, vector.Zero, m_FallDamageData.m_ShockCoef);
147
148 }
149 }
DamageType
exposed from C++ (do not change)
Определения DamageSystem.c:11
class FallDamageData FALL_DAMAGE_AMMO_HEALTH
void DamageAttachedGear(notnull PlayerBase pPlayer)
const float BLEEDINGFEET_HEIGHT_LOW
Определения DayZPlayerImplementFallDamage.c:42
const float BLEEDING_CHANCE_HEIGHT_LOW
Определения DayZPlayerImplementFallDamage.c:52
const float BLEEDINGLEGS_HEIGHT_LOW
Определения DayZPlayerImplementFallDamage.c:43
const float SHOES_HEALTH_HEIGHT_HIGH
Определения DayZPlayerImplementFallDamage.c:37
ref FallDamageData m_FallDamageData
Определения DayZPlayerImplementFallDamage.c:66
const float HEALTH_HEIGHT_LOW
Определения DayZPlayerImplementFallDamage.c:26
const float PANTS_HEALTH_HEIGHT_HIGH
Определения DayZPlayerImplementFallDamage.c:39
const float GLOVES_HEALTH_HEIGHT_LOW
Определения DayZPlayerImplementFallDamage.c:34
static const string FALL_DAMAGE_AMMO_SHOCK
Определения DayZPlayerImplementFallDamage.c:21
const float BROKENLEGS_HEIGHT_LOW
Определения DayZPlayerImplementFallDamage.c:31
const float SHOCK_HEIGHT_HIGH
Определения DayZPlayerImplementFallDamage.c:30
const float BLEEDINGHANDS_HEIGHT_LOW
Определения DayZPlayerImplementFallDamage.c:41
void AttachBleedingToZonesByHeight(notnull PlayerBase pPlayer)
const int DAMAGE_TYPE_LEGS
Определения DayZPlayerImplementFallDamage.c:62
const float GLOVES_HEALTH_HEIGHT_HIGH
Определения DayZPlayerImplementFallDamage.c:35
const int DAMAGE_TYPE_GLOBAL
Определения DayZPlayerImplementFallDamage.c:61
const float SHOES_HEALTH_HEIGHT_LOW
Определения DayZPlayerImplementFallDamage.c:36
const float PANTS_HEALTH_HEIGHT_LOW
Определения DayZPlayerImplementFallDamage.c:38
static const float BROKENLEGS_HEALTH_DAMAGE_MAX
Определения DayZPlayerImplementFallDamage.c:55
const int DAMAGE_TYPE_ATTACHMENTS
Определения DayZPlayerImplementFallDamage.c:63
const float SHOCK_HEIGHT_LOW
Определения DayZPlayerImplementFallDamage.c:29
const float BROKENLEGS_HEIGHT_HIGH
Определения DayZPlayerImplementFallDamage.c:32
float Randomize(int pType, float pValue)
const float BLEEDING_CHANCE_HEIGHT_HIGH
Определения DayZPlayerImplementFallDamage.c:53
const float HEALTH_HEIGHT_HIGH
Определения DayZPlayerImplementFallDamage.c:27
DayZPlayer m_Player
Определения Hand_Events.c:42
Определения EnMath.c:7
Определения PlayerBaseClient.c:2
static const vector Zero
Определения EnConvert.c:110
Определения EnConvert.c:106
proto native CGame GetGame()
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,...

Перекрестные ссылки AttachBleedingToZonesByHeight(), BLEEDING_CHANCE_HEIGHT_HIGH, BLEEDING_CHANCE_HEIGHT_LOW, BLEEDINGFEET_HEIGHT_LOW, BLEEDINGHANDS_HEIGHT_LOW, BLEEDINGLEGS_HEIGHT_LOW, BROKENLEGS_HEALTH_DAMAGE_MAX, BROKENLEGS_HEIGHT_HIGH, BROKENLEGS_HEIGHT_LOW, Math::Clamp(), DAMAGE_TYPE_ATTACHMENTS, DAMAGE_TYPE_GLOBAL, DAMAGE_TYPE_LEGS, DamageAttachedGear(), FALL_DAMAGE_AMMO_HEALTH, FALL_DAMAGE_AMMO_SHOCK, GetGame(), GLOVES_HEALTH_HEIGHT_HIGH, GLOVES_HEALTH_HEIGHT_LOW, HEALTH_HEIGHT_HIGH, HEALTH_HEIGHT_LOW, Math::InverseLerp(), m_FallDamageData, FallDamageData::m_Height, m_Player, PANTS_HEALTH_HEIGHT_HIGH, PANTS_HEALTH_HEIGHT_LOW, Randomize(), SHOCK_HEIGHT_HIGH, SHOCK_HEIGHT_LOW, SHOES_HEALTH_HEIGHT_HIGH, SHOES_HEALTH_HEIGHT_LOW и vector::Zero.