don't preserve items when shooting self with blank
This commit is contained in:
parent
e82899a209
commit
1c0db61385
11
game/game.go
11
game/game.go
@ -90,8 +90,7 @@ func (g *Match) NextGame() {
|
|||||||
// NextTurn advances the turn but not the match or round state.
|
// NextTurn advances the turn but not the match or round state.
|
||||||
func (g *Match) NextTurn() {
|
func (g *Match) NextTurn() {
|
||||||
g.turn++
|
g.turn++
|
||||||
g.damage = 1
|
g.ResetTurn()
|
||||||
g.reveal = false
|
|
||||||
cur := g.CurrentPlayer()
|
cur := g.CurrentPlayer()
|
||||||
skip := cur.cuffs == CuffedSkip
|
skip := cur.cuffs == CuffedSkip
|
||||||
cur.cuffs = cur.cuffs.NextState()
|
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.
|
// CurrentPlayer gets the current player.
|
||||||
func (g *Match) CurrentPlayer() *Player {
|
func (g *Match) CurrentPlayer() *Player {
|
||||||
return &g.players[g.turn&1]
|
return &g.players[g.turn&1]
|
||||||
@ -210,6 +215,8 @@ func (g *Match) Shoot(id player.ID, self bool) error {
|
|||||||
}
|
}
|
||||||
if !self || live {
|
if !self || live {
|
||||||
g.NextTurn()
|
g.NextTurn()
|
||||||
|
} else {
|
||||||
|
g.ResetTurn()
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user