11 override protected void Init()
15 if (
g_Game.GetMission().GetEffectWidgets())
18 g_Game.GetMission().GetEffectWidgets().RegisterGameplayEffectData(EffectWidgetsTypes.BLEEDING_LAYER,par);
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);
60 int bit = 1 << bit_offset;
73 super.AddBleedingSource(bit);
77 if (
g_Game.IsMultiplayer())
83 if (super.RemoveBleedingSource(bit))
85 if (
g_Game.IsMultiplayer())
94 for (
int i = 0; i < 32; ++i)
96 int compare_bit = 1 << i;
97 int new_compare_result_bit = compare_bit & new_mask;
98 int old_compare_result_bit = compare_bit & old_mask;
100 if (new_compare_result_bit)
102 if (!(new_compare_result_bit & old_mask))
110 if (new_compare_result_bit != old_compare_result_bit)
120 int bleeding_source_count = 0;
129 bleeding_source_count++;
133 return bleeding_source_count;
166 bool anyBleedingSourceActive =
false;
177 float timeRemaining = -1;
179 #ifdef DIAG_DEVELOPER
181 timeRemaining = bsz.
GetMaxTime() + bsi.m_DiagTimeStart -
g_Game.GetTickTime();
182 timeRemaining =
Math.
Round(timeRemaining);
185 DbgUI.
Text(
string.Format(
"zone: %1 | closest inv. slot: %2 | time remaining: %3",
name, slot_name, timeRemaining.
ToString()));
186 anyBleedingSourceActive =
true;
190 if (!anyBleedingSourceActive)
192 DbgUI.
Text(
"No bleeding sources are active.");
197 DbgUI.
Text(
"Note: BleedingSourcesManagerServer only updates active sources every 3s, displayed times are client estimates.");
238 for (
int i = 0; i < bsCount; ++i)
249 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)
static proto native owned string GetSlotName(int id)
converts slot_id to string
provides access to slot configuration
proto string ToString(bool simple=true)
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.