7 bool m_ShowingDiagDraw;
9 bool m_EnableHitIndication =
false;
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);
36 if (current_bits != m_BleedingBits)
38 if (m_BleedingBits == 0)
40 m_Player.OnBleedingBegin();
43 m_BleedingBits = current_bits;
44 if (m_BleedingBits == 0)
46 m_Player.OnBleedingEnd();
53 m_BleedingSourceZone.Clear();
60 int bit = 1 << bit_offset;
62 if ((bit & m_BleedingBits) != 0)
73 super.AddBleedingSource(bit);
75 m_BleedingSources.Get(bit).m_DiagTimeStart =
g_Game.GetTickTime();
77 if (
g_Game.IsMultiplayer())
78 m_Player.OnBleedingSourceAdded();
83 if (super.RemoveBleedingSource(bit))
85 if (
g_Game.IsMultiplayer())
86 m_Player.OnBleedingSourceRemovedEx(m_Item);
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;
125 int bit =
Math.Pow(2, pow);
127 if ((m_BleedingBits & bit) != 0)
129 bleeding_source_count++;
133 return bleeding_source_count;
149 else if (m_ShowingDiag || m_ShowingDiagDraw)
153 if (m_ShowingDiagDraw)
161 m_ShowingDiag =
true;
162 DbgUI.BeginCleanupScope();
163 DbgUI.Begin(
"Bleeding Sources", 50, 50);
166 bool anyBleedingSourceActive =
false;
170 int bit =
Math.Pow(2, pow);
172 if ((m_BleedingBits & bit) != 0)
176 string slot_name =
InventorySlots.GetSlotName(bsz.GetInvLocation());
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.");
201 DbgUI.EndCleanupScope();
206 m_ShowingDiag =
false;
208 DbgUI.BeginCleanupScope();
209 DbgUI.Begin(
"Bleeding Sources", 50, 50);
211 DbgUI.EndCleanupScope();
235 m_ShowingDiagDraw =
true;
237 int bsCount = m_BleedingSources.Count();
238 for (
int i = 0; i < bsCount; ++i)
240 m_BleedingSources.GetElement(i).DrawDebugShape();
246 m_ShowingDiagDraw =
false;
248 int bsCount = m_BleedingSources.Count();
249 for (
int i = 0; i < bsCount; ++i)
251 m_BleedingSources.GetElement(i).RemoveDebugShape();
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)
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)
void OnBleedingBitsUpdate(int old_mask, int new_mask)
provides access to slot configuration