diff --git a/game/game.go b/game/game.go index fa9229c..7be4c00 100644 --- a/game/game.go +++ b/game/game.go @@ -90,8 +90,7 @@ func (g *Match) NextGame() { // NextTurn advances the turn but not the match or round state. func (g *Match) NextTurn() { g.turn++ - g.damage = 1 - g.reveal = false + g.ResetTurn() cur := g.CurrentPlayer() skip := cur.cuffs == CuffedSkip cur.cuffs = cur.cuffs.NextState() @@ -100,6 +99,12 @@ func (g *Match) NextTurn() { } } +// ResetTurn performs start-of-turn model resets. +func (g *Match) ResetTurn() { + g.damage = 1 + g.reveal = false +} + // CurrentPlayer gets the current player. func (g *Match) CurrentPlayer() *Player { return &g.players[g.turn&1] @@ -210,6 +215,8 @@ func (g *Match) Shoot(id player.ID, self bool) error { } if !self || live { g.NextTurn() + } else { + g.ResetTurn() } return nil }