Fix bleeding fail-effect API call
AttemptAddBleedingSourceByMaxCount() does not exist. Use the real API: AttemptAddBleedingSource(component) with a valid component bit pulled from GetBleedingSourcesLocations() (set<int>), looped chosen.bleedSources times. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
0dffa77caf
commit
f7df4555cc
1 changed files with 16 additions and 2 deletions
|
|
@ -168,11 +168,25 @@ void YALB_ApplyRandomFailEffect(PlayerBase player, YALB_BoxTypeDef def, ItemBase
|
|||
break;
|
||||
|
||||
case "BLEEDING":
|
||||
for (int i = 0; i < chosen.bleedSources; i++)
|
||||
{
|
||||
// AttemptAddBleedingSource(component) needs a valid body-component
|
||||
// bit; GetBleedingSourcesLocations() is the engine's set of those.
|
||||
// Pick random ones (a duplicate just no-ops if already bleeding).
|
||||
BleedingSourcesManagerServer bleedMgr = player.GetBleedingManagerServer();
|
||||
if (bleedMgr)
|
||||
{
|
||||
player.GetBleedingManagerServer().AttemptAddBleedingSourceByMaxCount();
|
||||
set<int> bleedLocs = bleedMgr.GetBleedingSourcesLocations();
|
||||
if (bleedLocs && bleedLocs.Count() > 0)
|
||||
{
|
||||
for (int bi = 0; bi < chosen.bleedSources; bi++)
|
||||
{
|
||||
int comp = bleedLocs.Get(Math.RandomInt(0, bleedLocs.Count()));
|
||||
bleedMgr.AttemptAddBleedingSource(comp);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case "SICKNESS":
|
||||
YALB_ApplySickness(player, chosen.agent);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue