 |
Dayz
1.11.153731
Dayz Code Explorer by Zeroy
|
Go to the documentation of this file.
3 const float TICK_INTERVAL_SEC = 3;
5 bool m_DisableBloodLoss =
false;
6 ref array<int> m_DeleteList =
new array<int>;
22 m_DeleteList.Insert(bit);
28 super.AddBleedingSource(bit);
33 if(!super.RemoveBleedingSource(bit))
35 Error(
"Failed to remove bleeding source:" + bit);
38 int inverse_bit_mask = ~bit;
45 int bleeding_sources_bits =
m_Player.GetBleedingBits();
46 int rightmost_bit = bleeding_sources_bits & (-bleeding_sources_bits);
59 int bleeding_sources_bits =
m_Player.GetBleedingBits();
67 int bit = 1 << bit_offset;
69 if( (bit & bleeding_sources_bits) != 0 )
77 highest_flow_bit = bit;
84 return highest_flow_bit;
90 if( m_Tick > TICK_INTERVAL_SEC )
92 while( m_DeleteList.Count() > 0 )
95 m_DeleteList.Remove(0);
101 for(
int i = 0; i < m_BleedingSources.Count(); i++)
103 m_BleedingSources.GetElement(i).OnUpdateServer( TICK_INTERVAL_SEC, blood_scale, m_DisableBloodLoss );
111 for(
int i = 0; i < m_BleedingSourceZone.Count(); i++)
113 int bit = m_BleedingSourceZone.GetElement(i).GetBit();
124 float dmg_max =
m_Player.GetMaxHealth(zone,
"Blood");
126 float bleed_threshold =
GetGame().
ConfigGetFloat(
"CfgAmmo " + ammo +
" DamageApplied " +
"bleedThreshold" );
127 bleed_threshold =
Math.
Clamp(bleed_threshold,0,1);
133 if (source.IsZombie())
141 else if ( dmg > (dmg_max * (1 - bleed_threshold)) )
153 if(source >= m_BleedingSourceZone.Count() || !m_BleedingSourceZone.GetElement(source))
return;
155 int bit = m_BleedingSourceZone.GetElement(source).GetBit();
165 m_DisableBloodLoss = status;
171 int active_bits =
m_Player.GetBleedingBits();
172 ctx.
Write(active_bits);
177 int bit = 1 << bit_offset;
178 if( (bit & active_bits) != 0 )
181 ctx.
Write(active_time);
190 if(!ctx.
Read(active_bits))
198 int bit = 1 << bit_offset;
203 if(!ctx.
Read(active_time))
proto native CGame GetGame()
protected BleedingSourceZone GetBleedingSourceZone(int bit)
void Error(string err)
Messagebox with error message.
static 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'.
void ~BleedingSourcesManagerServer()
override protected bool RemoveBleedingSource(int bit)
void RemoveMostSignificantBleedingSource()
protected BleedingSourceZone GetBleedingSourceMeta(int bit)
const int STORAGE_VERSION
void OnTick(float delta_time)
const int STORAGE_VERSION
protected bool RemoveBleedingSource(int bit)
int GetMostSignificantBleedingSource()
protected bool CanAddBleedingSource(int bit)
void DebugActivateBleedingSource(int source)
proto bool Write(void value_out)
Serialization general interface.
void SetBloodLoss(bool status)
void ProcessHit(float damage, EntityAI source, int component, string zone, string ammo, vector modelPos)
override protected void AddBleedingSource(int bit)
static const float BLEEDING_LOW_PRESSURE_MIN_MOD
bool AttemptAddBleedingSource(int component)
bool OnStoreLoad(ParamsReadContext ctx, int version)
int GetBleedingSourceActiveTime(int bit)
protected void AddBleedingSource(int bit)
void RequestDeletion(int bit)
void SetBleedingSourceActiveTime(int bit, int time)
protected string GetSelectionNameFromBit(int bit)
static float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...
static const float BLEEDING_LOW_PRESSURE_BLOOD
void OnStoreSave(ParamsWriteContext ctx)
proto bool Read(void value_in)
static const int BLOOD_THRESHOLD_FATAL
proto native float ConfigGetFloat(string path)
Get float value from config on path.
Base native class of all vehicles in game.
void RemoveAnyBleedingSource()
proto static native int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].