11 override protected void Init()
15 if (
GetGame().GetMission().GetEffectWidgets())
22 override protected void RegisterBleedingZoneEx(
string name,
int max_time,
string bone =
"",
vector orientation =
"0 0 0",
vector offset =
"0 0 0",
float flow_modifier = 1,
string particle_name =
"BleedingSourceEffect",
int inv_location = 0)
24 super.RegisterBleedingZoneEx(
name,max_time,bone,orientation,offset,flow_modifier,particle_name,inv_location);
26 if (
GetGame().GetMission().GetEffectWidgets())
59 int bit = 1 << bit_offset;
72 super.AddBleedingSource(bit);
82 if (super.RemoveBleedingSource(bit))
93 for (
int i = 0; i < 32; ++i)
95 int compare_bit = 1 << i;
96 int new_compare_result_bit = compare_bit & new_mask;
97 int old_compare_result_bit = compare_bit & old_mask;
99 if (new_compare_result_bit)
101 if (!(new_compare_result_bit & old_mask))
109 if (new_compare_result_bit != old_compare_result_bit)
119 int bleeding_source_count = 0;
128 bleeding_source_count++;
132 return bleeding_source_count;
165 bool anyBleedingSourceActive =
false;
176 float timeRemaining = -1;
178 #ifdef DIAG_DEVELOPER
181 timeRemaining =
Math.
Round(timeRemaining);
184 DbgUI.
Text(
string.Format(
"zone: %1 | closest inv. slot: %2 | time remaining: %3",
name, slot_name, timeRemaining.
ToString()));
185 anyBleedingSourceActive =
true;
189 if (!anyBleedingSourceActive)
191 DbgUI.
Text(
"No bleeding sources are active.");
196 DbgUI.
Text(
"Note: BleedingSourcesManagerServer only updates active sources every 3s, displayed times are client estimates.");
237 for (
int i = 0; i < bsCount; ++i)
248 for (
int i = 0; i < bsCount; ++i)
void BleedingSource(PlayerBase player, int bit, string bone, vector orientation, vector offset, int max_time, float flow_modifier, string particle_name)
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
void OnVariablesSynchronized(int current_bits)
int GetBleedingSourceCountRemote()
void AddBleedingSource(int bit)
BleedingSourceZone GetBleedingSourceMeta(int bit)
string GetSelectionNameFromBit(int bit)
bool m_EnableHitIndication
ref map< int, ref BleedingSource > m_BleedingSources
void DisplayVisualDebug()
bool RemoveBleedingSource(int bit)
void RegisterBleedingZoneEx(string name, int max_time, string bone="", vector orientation="0 0 0", vector offset="0 0 0", float flow_modifier=1, string particle_name="BleedingSourceEffect", int inv_location=0)
ref map< string, ref BleedingSourceZone > m_BleedingSourceZone
void OnBleedingBitsUpdate(int old_mask, int new_mask)
proto native float GetTickTime()
Returns current time from start of the game.
proto native Mission GetMission()
static proto native owned string GetSlotName(int id)
converts slot_id to string
provides access to slot configuration
GameplayEffectWidgets_base GetEffectWidgets()
proto string ToString(bool simple=true)
proto native CGame GetGame()
static proto native void End()
static proto native void Begin(string windowTitle, float x=0, float y=0)
static proto native void Text(string label)
static proto void BeginCleanupScope()
static proto native void EndCleanupScope()
static proto float Round(float f)
Returns mathematical round of value.
static proto float Pow(float v, float power)
Return power of v ^ power.