# 70. Fix Player Action Crash and Double Damage ## 1. 문제 (Problem) - **Crash:** `BattleProvider.playerAction`에서 생성하는 `EffectEvent`에 `attacker`, `targetEntity`, `damageValue` 등이 누락되어 있어, UI가 `handleImpact`를 호출할 때 `event.attacker!` 등에서 Null Pointer Exception이 발생함. - **Double Damage:** `playerAction` 메서드 내부에 구버전의 데미지 적용 로직이 남아 있어, 이를 수정하지 않으면 데미지가 두 번 들어감. ## 2. 해결 방안 (Solution) - `playerAction` 메서드를 대대적으로 수정하여 `_enemyTurn`과 동일한 패턴을 적용합니다. - **즉시 데미지 적용 로직 삭제:** HP/Armor 감소 로직을 제거합니다. - **`EffectEvent` 완전체 생성:** `attacker`, `targetEntity`, `damageValue` 등을 모두 채워서 이벤트를 생성합니다. - **위임:** 모든 데미지 처리는 `EffectEvent`를 통해 `handleImpact` -> `_processAttackImpact`로 위임됩니다. ## 3. 기대 효과 (Expected Outcome) - 앱 크래시 해결. - 플레이어 공격 시 애니메이션과 데미지 적용 시점이 정확히 일치. - 데미지 중복 적용 방지.