Skip to content

Commit

Permalink
Avoid enemies spawning in view
Browse files Browse the repository at this point in the history
  • Loading branch information
IntelOrca committed Dec 8, 2023
1 parent 05615c0 commit 8ba57fd
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion IntelOrca.Biohazard.BioRand/Events/PlotBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,19 @@ public SbNode CreateTrigger(
int? triggerCut = null;

var triggerPoi = PoiGraph.GetRandomPoi(Rng, x => x.HasTag(PoiKind.Trigger) && notCuts?.Contains(x.Cut) != true);
if (triggerPoi != null && Rng.NextProbability(75))
if (triggerPoi != null)
{
triggerCut = triggerPoi.Cut;

// If event can be shown in any cut,
// we don't always need a trigger cut
if (notCuts?.Any() != true)
{
if (Rng.NextProbability(75))
{
triggerCut = null;
}
}
}

if (triggerCut == null && Rng.NextProbability(50))
Expand Down

0 comments on commit 8ba57fd

Please sign in to comment.