fix(combat): show the potion heal immediately instead of folding it into the monster's reply
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user