Add anti-repeat mob ability selection when multiple options are valid

- Track last used ability key and consecutive-use count on MobInstance

- In ProcessMobAbility, avoid repeating the same ability more than 3 times in a row if alternatives are currently usable

- Keep existing priority-based selection as primary behavior
This commit is contained in:
dingo
2026-02-11 09:19:32 -05:00
parent 7e8d195aec
commit e5ee966451
2 changed files with 41 additions and 5 deletions
+6
View File
@@ -106,6 +106,12 @@ public class MobInstance
// === Abilities ===
/// <summary>Abilities this mob can use</summary>
public List<MobAbilityState> Abilities { get; set; } = new();
/// <summary>Last ability key used by this mob (for anti-repeat selection).</summary>
public string? LastUsedAbilityKey { get; set; }
/// <summary>How many times in a row the same ability has been used.</summary>
public int ConsecutiveAbilityUses { get; set; }
/// <summary>Currently casting ability (null if not casting)</summary>
public MobAbilityState? CastingAbility { get; set; }