Skip to content

Commit

Permalink
Add option to not clear rotation on combat end.
Browse files Browse the repository at this point in the history
  • Loading branch information
awgil committed Jul 6, 2024
1 parent 61473b0 commit 796a95e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions BossMod/Autorotation/AutorotationConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ public sealed class AutorotationConfig : ConfigNode
[PropertyDisplay("Show positional hints in world")]
public bool ShowPositionals = false;

[PropertyDisplay("Automatically end autorotation when exiting combat")]
public bool ClearPresetOnCombatEnd = false;

[PropertyDisplay("Early pull threshold: if player enters combat when countdown is larger than this value, we consider it a ninja-pull and force disable autorotation")]
[PropertySlider(0, 30, Speed = 1)]
public float EarlyPullThreshold = 1.5f;
Expand Down
6 changes: 3 additions & 3 deletions BossMod/Autorotation/RotationModuleManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,19 +137,19 @@ private void OnCombatChanged(Actor actor)

CombatStart = actor.InCombat ? WorldState.CurrentTime : default; // keep track of combat time in case rotation modules want to do something special in openers

if (!actor.InCombat)
if (!actor.InCombat && Config.ClearPresetOnCombatEnd)
{
// player exits combat => clear manual overrides
Service.Log($"[RMM] Player exits combat => clear preset '{Preset?.Name ?? "<n/a>"}'");
Preset = null;
}
else if (WorldState.Client.CountdownRemaining > Config.EarlyPullThreshold)
else if (actor.InCombat && WorldState.Client.CountdownRemaining > Config.EarlyPullThreshold)
{
// player enters combat while countdown is in progress => force disable
Service.Log($"[RMM] Player ninja pulled => force-disabling from '{Preset?.Name ?? "<n/a>"}'");
Preset = ForceDisable;
}
// else: player enters combat when countdown is either not active or around zero, proceed normally - if override is queued, let it run, otherwise let plan run
// if player enters combat when countdown is either not active or around zero, proceed normally - if override is queued, let it run, otherwise let plan run
}

private void OnDeadChanged(Actor actor)
Expand Down

0 comments on commit 796a95e

Please sign in to comment.