don't preserve items when shooting self with blank

This commit is contained in:
Branden J Brown 2024-02-03 14:59:22 -06:00
parent e82899a209
commit 1c0db61385
1 changed files with 9 additions and 2 deletions

View File

@ -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
}