From 1c0db61385b00162965f96a9e70cec63d52c72a5 Mon Sep 17 00:00:00 2001 From: Branden J Brown Date: Sat, 3 Feb 2024 14:59:22 -0600 Subject: [PATCH] don't preserve items when shooting self with blank --- game/game.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 }