Files
sor/Client
f1f6183f85 Fix: sequence attack→damaged animations (no mid-attack interruption)
Attack animations were being interrupted halfway through by "damaged"
because _play_damage_animations fired immediately on state arrival —
even for the attacker who also took counter-damage.

Fix:
- Track each unit's oneshot animation_finished callback in _oneshot_callbacks
  so it can be replaced later without a stale lambda leak.
- _is_attack_track() helper matches current animation against ANIM_ALIASES.
- _play_damage_animations now sequences:
    Attacker mid-attack → override idle-return callback with "damaged",
      so attack plays fully, then damaged plays, then idle.
    Defender → delay "damaged" tween by the attack's remaining duration
      so the hit lands at the moment the swing connects.
    No attack in progress → play "damaged" immediately (existing behaviour).

Result: Attack → (attack lands) defender damaged + attacker damaged → idle.

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-03-16 11:09:43 -04:00
..