diff --git a/internal/game/battle.go b/internal/game/battle.go index 3139f27..af1bfa1 100644 --- a/internal/game/battle.go +++ b/internal/game/battle.go @@ -81,20 +81,22 @@ type BattleEvent struct { // "steal": Seat's pet stole Count apples from Target's pet (Wolverine). // "eat": Seat's pet ate apples; Bonus is its new total. // "heal": Seat's pet healed; DamageAfter is its new damage total. - Type string `json:"type"` - Seat int `json:"seat,omitempty"` - Target int `json:"target,omitempty"` - Card *Card `json:"card,omitempty"` - Count int `json:"count,omitempty"` + Type string `json:"type"` + // Seat/Target must NOT be omitempty: 0 is a valid seat (the first + // player) and dropping it makes the client read sides[undefined]. + Seat int `json:"seat"` + Target int `json:"target"` + Card *Card `json:"card,omitempty"` + Count int `json:"count,omitempty"` // clash: per-seat damage totals / deaths after the exchange. Damage []int `json:"damage,omitempty"` Died []bool `json:"died,omitempty"` // rock: dice total rolled; rock/strip/steal: target pet's fate. Roll int `json:"roll"` - DamageAfter int `json:"damageAfter,omitempty"` + DamageAfter int `json:"damageAfter"` TargetDied bool `json:"targetDied,omitempty"` // eat: the pet's power bonus after eating. - Bonus int `json:"bonus,omitempty"` + Bonus int `json:"bonus"` } // BattleResult is the full, public record of one round's battle. Only what