Various bug fixes and improvements.

This commit is contained in:
Greyson Parrelli
2026-07-24 10:47:59 -04:00
parent 0fe0757e18
commit 6558806ba0
10 changed files with 66 additions and 27 deletions
+9
View File
@@ -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")