Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Conditions/InvincibilityCondition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ private set
if (field == value)
return;
DoUpdate(() => field = value);
IsEnabled = plugin.PluginEnabled && value;
}
}

Expand Down
8 changes: 3 additions & 5 deletions Conditions/NeedolinCondition.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using HutongGames.PlayMaker;
using HutongGames.PlayMaker.Actions;
using MonoDetour;
using MonoDetour.HookGen;
Expand All @@ -25,11 +24,10 @@ internal NeedolinCondition(InvincibilityMonitorPlugin plugin)
private readonly HashSet<CheckHeroPerformanceRegion> checks = [];
private readonly HashSet<CheckHeroPerformanceRegionV2> checksV2 = [];

private static bool IsNone(FsmEvent? fsmEvent) => fsmEvent == null || fsmEvent.name == "";

protected override bool Callback() =>
checks.Any(c => !IsNone(c.None) && c.active)
|| checksV2.Any(c => !IsNone(c.None) && c.active);
HeroPerformanceRegion.IsPerforming
&& (checks.Any(c => c.affectedState == HeroPerformanceRegion.AffectedState.ActiveInner)
|| checksV2.Any(c => c.affectedState == HeroPerformanceRegion.AffectedState.ActiveInner));

private static void PostfixOnEnter(CheckHeroPerformanceRegion self)
{
Expand Down