Various bug fixes and improvements.
This commit is contained in:
@@ -159,6 +159,15 @@ func (g *Game) battleDraw(n int) int {
|
||||
// rollRockDie rolls one rock die: 0, 1, or 2 with equal probability.
|
||||
func (g *Game) rollRockDie() int { return g.battleDraw(3) }
|
||||
|
||||
// battleShuffle does an in-place Fisher-Yates over a battle deck, routing its
|
||||
// randomness through battleDraw like every other in-battle draw (Komodo).
|
||||
func (g *Game) battleShuffle(s []Card) {
|
||||
for i := len(s) - 1; i > 0; i-- {
|
||||
j := g.battleDraw(i + 1)
|
||||
s[i], s[j] = s[j], s[i]
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
ErrNotYourTurn = errors.New("not your turn")
|
||||
ErrWrongPhase = errors.New("action not allowed in this phase")
|
||||
|
||||
Reference in New Issue
Block a user