fix(combat): clear the monster's pending action once it is defeated
This commit is contained in:
@@ -124,7 +124,8 @@ export class CombatEngineService {
|
||||
): CombatEngineResult {
|
||||
if (monster.currentHp <= 0) {
|
||||
events.push({ source: Combatant.PLAYER, target: Combatant.MONSTER, type: CombatEventType.COMBAT_WON });
|
||||
return { state: { ...state, player, monster, status: CombatStatus.WON }, events };
|
||||
const defeatedMonster = { ...monster, stats: { ...monster.stats, pendingAction: undefined } };
|
||||
return { state: { ...state, player, monster: defeatedMonster, status: CombatStatus.WON }, events };
|
||||
}
|
||||
|
||||
if (!interrupted) {
|
||||
|
||||
Reference in New Issue
Block a user