7 bool m_ShowingDiagDraw;
9 bool m_EnableHitIndication =
false;
11 override protected void Init()
15 if (
GetGame().GetMission().GetEffectWidgets())
18 GetGame().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);
26 if (
GetGame().GetMission().GetEffectWidgets())
29 GetGame().GetMission().GetEffectWidgets().RegisterGameplayEffectData(EffectWidgetsTypes.BLEEDING_LAYER,par);
35 if (current_bits != m_BleedingBits)
37 if (m_BleedingBits == 0)
41 OnBleedingBitsUpdate(m_BleedingBits, current_bits);
42 m_BleedingBits = current_bits;
43 if (m_BleedingBits == 0)
52 m_BleedingSourceZone.Clear();
59 int bit = 1 << bit_offset;
61 if ( (bit & m_BleedingBits) != 0 )
63 RemoveBleedingSource(bit);
64 AddBleedingSource(bit);
70 override protected void AddBleedingSource(
int bit)
72 super.AddBleedingSource(bit);
77 override protected bool RemoveBleedingSource(
int bit)
79 if (super.RemoveBleedingSource(bit))
88 void OnBleedingBitsUpdate(
int old_mask,
int new_mask)
90 for (
int i = 0; i < 32; i++)
92 int compare_bit = 1 << i;
93 int new_compare_result_bit = compare_bit & new_mask;
94 int old_compare_result_bit = compare_bit & old_mask;
96 if ( new_compare_result_bit )
98 if ( !(new_compare_result_bit & old_mask))
101 AddBleedingSource(new_compare_result_bit);
106 if ( new_compare_result_bit != old_compare_result_bit )
108 RemoveBleedingSource(old_compare_result_bit);
114 int GetBleedingSourceCountRemote()
116 int bleeding_source_count = 0;
121 int bit =
Math.Pow(2, pow);
123 if ( (m_BleedingBits & bit) != 0)
125 bleeding_source_count++;
129 return bleeding_source_count;
132 void SetDiag(
bool value)
137 int boneIdx =
m_Player.GetBoneIndexByName(
"RightArmExtra");
141 Object linkedObject =
GetGame().CreateObject(
"Ammo_ArrowBolt",
"0 0 0");
152 eff.SetAutodestroy(
true);
158 m_Player.AddChild(linkedObject, boneIdx);
169 DisplayVisualDebug();
171 else if ( m_ShowingDiag || m_ShowingDiagDraw )
175 if (m_ShowingDiagDraw)
183 m_ShowingDiag =
true;
185 DbgUI.BeginCleanupScope();
186 DbgUI.Begin(
"Bleeding Sources", 50, 50);
190 bool anyBleedingSourceActive =
false;
194 int bit =
Math.Pow(2, pow);
196 if ( (m_BleedingBits & bit) != 0)
200 string name = GetSelectionNameFromBit(bit);
201 string slot_name =
InventorySlots.GetSlotName(bsz.GetInvLocation());
202 DbgUI.Text(
name +
"| slot name: "+ slot_name);
203 anyBleedingSourceActive =
true;
207 if (!anyBleedingSourceActive)
209 DbgUI.Text(
"Currently no bleeding sources are active.");
213 DbgUI.EndCleanupScope();
218 m_ShowingDiag =
false;
220 DbgUI.BeginCleanupScope();
221 DbgUI.Begin(
"Bleeding Sources", 50, 50);
223 DbgUI.EndCleanupScope();
226 void DisplayVisualDebug()
247 m_ShowingDiagDraw =
true;
249 int bsCount = m_BleedingSources.Count();
250 for (
int i = 0; i < bsCount; ++i)
252 m_BleedingSources.GetElement(i).DrawDebugShape();
256 void CleanVisualDebug()
258 m_ShowingDiagDraw =
false;
260 int bsCount = m_BleedingSources.Count();
261 for (
int i = 0; i < bsCount; ++i)
263 m_BleedingSources.GetElement(i).RemoveDebugShape();