fix(combat): show the potion heal immediately instead of folding it into the monster's reply

This commit is contained in:
Bastian Wagner
2026-08-20 23:54:02 +02:00
parent 1aac3416fa
commit 62d6677298
2 changed files with 60 additions and 1 deletions

View File

@@ -126,9 +126,23 @@ export class CombatPageComponent implements OnInit {
// Show what the player's own action produced, holding back the
// monster's reply -- including whether it just started telegraphing.
// A POTION heal lands from the player's own action, before the
// monster's reply, so it must show up here rather than being folded
// into the delayed riposte reveal.
const healEvent = roundEvents.find(
(event) => event.type === 'HEAL' && event.sequence < monsterEvent.sequence,
);
const intermediatePlayer = healEvent
? {
...before.player,
currentHp: Math.min(before.player.maxHp, before.player.currentHp + (healEvent.amount ?? 0)),
potionsRemaining: after.player.potionsRemaining,
}
: before.player;
this.displayed.set({
...after,
player: before.player,
player: intermediatePlayer,
monster: {
...(dealtDamage ? after.monster : before.monster),
pendingIntent: before.monster.pendingIntent,