Hold the battle result until the replay ends, then show it last.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user