3 const float TICK_INTERVAL_SEC = 3;
5 bool m_DisableBloodLoss =
false;
12 return m_BleedingSourceZone.Get(GetSelectionNameFromBit(
bit));
22 m_DeleteList.Insert(
bit);
39 if (!
super.RemoveBleedingSource(
bit))
40 Error(
"Failed to remove bleeding source:" +
bit);
74 int bit = GetMostSignificantBleedingSource();
76 RemoveBleedingSource(
bit);
82 RemoveMostSignificantBleedingSource();
118 if (
m_Tick > TICK_INTERVAL_SEC)
120 while (m_DeleteList.Count() > 0)
122 RemoveBleedingSource(m_DeleteList.Get(0));
123 m_DeleteList.Remove(0);
129 for (
int i = 0;
i < m_BleedingSources.Count();
i++)
130 m_BleedingSources.GetElement(
i).OnUpdateServer(
m_Tick,
blood_scale, m_DisableBloodLoss);
137 for (
int i = 0;
i < m_BleedingSourceZone.Count();
i++)
139 int bit = m_BleedingSourceZone.GetElement(
i).GetBit();
140 if (CanAddBleedingSource(
bit))
141 AddBleedingSource(
bit);
179 Debug.
BleedingChancesLog(
"true",
"BleedingSourcesManagerServer",
"n/a",
"Attempting to create bleeding source");
189 if (
source >= m_BleedingSourceZone.Count() || !m_BleedingSourceZone.GetElement(
source))
return;
191 int bit = m_BleedingSourceZone.GetElement(
source).GetBit();
193 if (
bit && CanAddBleedingSource(
bit))
194 AddBleedingSource(
bit);
199 m_DisableBloodLoss =
status;
236 AddBleedingSource(
bit);
248 SetBleedingSourceType(
bit, type);
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
const int STORAGE_VERSION
Static data of bleeding chance probabilities; currently used for melee only.
static bool CalculateBleedChance(string damageType, float bloodDamage, float bleedThreshold, out float bleedChance)
returns 'false' when damageType is unhandled
void DebugActivateBleedingSource(int source)
void SetBloodLoss(bool status)
void RemoveMostSignificantBleedingSource()
void OnTick(float delta_time)
void AddBleedingSource(int bit)
int GetMostSignificantBleedingSource()
void OnStoreSave(ParamsWriteContext ctx)
void ProcessHit(float damage, EntityAI source, int component, string zone, string ammo, vector modelPos)
void RemoveAnyBleedingSource()
void ~BleedingSourcesManagerServer()
bool RemoveBleedingSource(int bit)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void RequestDeletion(int bit)
void RemoveMostSignificantBleedingSourceEx(ItemBase item)
BleedingSourceZone GetBleedingSourceZone(int bit)
static ref Param1< bool > PARAM1_BOOL
static void BleedingChancesLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
override float GetInfectionChance(int system=0, Param param=null)
static bool IsBleedingChancesLogEnable()
static const float BLEEDING_LOW_PRESSURE_MIN_MOD
static const float BLEEDING_LOW_PRESSURE_BLOOD
static const float BLEEDING_SOURCE_CLOSE_INFECTION_CHANCE
static const int BLOOD_THRESHOLD_FATAL
Serialization general interface. Serializer API works with:
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
static float RandomFloat01()
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].