Hold the battle result until the replay ends, then show it last.

This commit is contained in:
Greyson Parrelli
2026-07-23 08:40:42 -04:00
parent 3821469c61
commit 1705de5a3f
4 changed files with 41 additions and 14 deletions
+6 -2
View File
@@ -724,10 +724,14 @@ func (g *Game) resolveBattle() {
g.Battle = res
g.Phase = PhaseBattle
// Tagged "result" so the client can hold it back until the replay finishes
// (the outcome is known now, but showing it early would spoil the battle).
if winner < 0 {
g.logf(-1, "⚔️", "Round %d battle ends in a draw.", g.Round)
g.addLog(LogEntry{Seat: -1, Icon: "⚔️", Kind: "result",
Text: fmt.Sprintf("Round %d battle ends in a draw.", g.Round)})
} else {
g.logf(winner, "⚔️", "%s wins the round %d battle (+%d🏆).", pname(winner), g.Round, res.Trophies)
g.addLog(LogEntry{Seat: winner, Icon: "⚔️", Kind: "result",
Text: fmt.Sprintf("%s wins the round %d battle (+%d🏆).", pname(winner), g.Round, res.Trophies)})
}
for _, p := range g.Players {
p.Ready = false