Skip to content
Merged
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
38 changes: 9 additions & 29 deletions ExampleRotations/BlueMage/BLU_Basic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,29 +59,6 @@ public enum BluProfile : byte
private IReadOnlyList<string> _missingSpells = Array.Empty<string>();
private string _missingSpellStatus = "Missing spells: none";

#region Tracking Properties
public override void DisplayStatus()
{
RefreshMissingSpells();
var gatingActive = StopIfMissingSpells && _missingSpells.Count > 0;

ImGui.TextColored(ImGuiColors.DalamudViolet, "Blue Mage Rotation Tracking:");
ImGui.Text($"Profile: {Profile}");
ImGui.Text($"Use offensive oGCDs: {UseOffensiveOgcds}");
ImGui.Text($"Use defensive oGCDs: {UseDefensiveOgcds}");
ImGui.Text($"Stop if missing spells: {StopIfMissingSpells}");
ImGui.Text($"AoE target threshold: {AoeTargetThreshold}");

ImGui.TextColored(_missingSpells.Count > 0 ? ImGuiColors.DalamudRed : ImGuiColors.ParsedGreen, _missingSpellStatus);

ImGui.TextColored(gatingActive ? ImGuiColors.DalamudRed : ImGuiColors.ParsedGreen,
$"Gating active: {gatingActive}");

ImGui.TextColored(ImGuiColors.DalamudViolet, "Base Tracking:");
base.DisplayStatus();
}
#endregion

private IReadOnlyList<(ActionID Id, string Name)> GetRequiredActionsForProfile()
{
return Profile switch
Expand All @@ -96,11 +73,14 @@ private bool HasSpell(ActionID id)
return ActionHelper.TryGetAction(id, out var action) && action.IsUnlock;
}

protected override IEnumerable<ActionID> ActiveActions => GetRequiredActionsForProfile().Select(req => req.Id);
protected override IBaseAction[] ActiveActions => GetRequiredActionsForProfile()
.Select(req => ActionHelper.TryGetAction(req.Id, out var action) ? action : null)
.OfType<IBaseAction>()
.ToArray();

private static bool IsValidCombatTarget(out Character? target)
private static bool IsValidCombatTarget(out IBattleChara? target)
{
target = Svc.Targets.Target as Character;
target = Svc.Targets.Target as IBattleChara;

if (target is null || !target.IsTargetable || target.IsDead)
{
Expand All @@ -121,9 +101,9 @@ private static bool IsValidCombatTarget(out Character? target)
return Vector3.Distance(player.Position, target.Position) <= DefaultSpellRange;
}

private static int CountEnemiesInRange(Character center, float radius)
private static int CountEnemiesInRange(IBattleChara center, float radius)
{
return Svc.Objects.Count(obj => obj is Character enemy
return Svc.Objects.Count(obj => obj is IBattleChara enemy
&& enemy.ObjectKind == ObjectKind.BattleNpc
&& enemy is IBattleNpc battleNpc
&& battleNpc.BattleNpcSubKind == BattleNpcSubKind.Enemy
Expand All @@ -146,7 +126,7 @@ private static bool TryGetReadyAction(ActionID actionId, out IAction? action)
return false;
}

private static bool TryGetReadySpell(ActionID actionId, Character target, out IAction? action)
private static bool TryGetReadySpell(ActionID actionId, IBattleChara target, out IAction? action)
{
if (!TryGetReadyAction(actionId, out var candidate))
{
Expand Down
16 changes: 0 additions & 16 deletions ExampleRotations/Healer/WHM_Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,6 @@ public enum Examplemultioptionconfig : byte
}
#endregion

#region Tracking Properties
public override void DisplayStatus()
{
ImGui.TextColored(ImGuiColors.DalamudViolet, "Rotation Tracking:");
ImGui.Text($"BoolExample: {BoolExample}");
ImGui.Text($"PixelExample: {PixelExample}");
ImGui.Text($"TimeExample: {TimeExample}");
ImGui.Text($"DistanceExample: {DistanceExample}");
ImGui.Text($"PercentageExample: {PercentageExample}");
ImGui.Text($"FloatValueExample: {FloatValueExample}");
ImGui.Text($"Examplemultioptionconfigset: {Examplemultioptionconfigset}");
ImGui.TextColored(ImGuiColors.DalamudViolet, "Base Tracking:");
base.DisplayStatus();
}
#endregion

#region Countdown Logic
protected override IAction? CountDownAction(float remainTime)
{
Expand Down