Files
sor/Server
365db851e2 feat(ai): activate Active abilities during turns
AiActivateAbilityAction: add Targets field (was a no-target stub).

ActionCandidateGenerator.ActivateAbilityCandidates (new):
- Iterates all field units incl. ArchSpirit
- Skips exhausted/CanUseAbility=false/disabled/uses-exhausted units
- Checks SP/ST/hand-size costs before emitting candidates
- For auto-resolved abilities (Random/Self/All targets): emits one
  null-target candidate — server resolves
- For single client-pick actions: emits one candidate per valid target
  in range, respecting TargetType (Unit/ArchSpirit/Spirit) and
  TargetOwnership (Enemy/Ally/Any)
- Multi-pick and ChooseOne: emits null, server handles
- Invalid candidates are discarded by the heuristic engine's try/catch

HeuristicDecisionEngine.ApplyAction: added AiActivateAbilityAction case
  → GameEngine.ActivateAbility (so simulation can score ability effects).

AiPlayerSession.ActionToMessage: added AiActivateAbilityAction case
  → game.activate_ability message with targets.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-04-13 12:30:21 -04:00
..