Fix shop action costs and pass semantics.

Only buying costs gold; selling and trading (Triple) are free. Pass is
now a final action, legal only at or under the pet limit: it forfeits
remaining gold and ends that player's shopping for the round, with the
shop closing once everyone has passed. That makes the separate cleanup
phase unreachable (you sell down in-shop before passing), so it is
removed. The client asks for confirmation before passing, and the bot
knows buys are the only coin sink, when passing is legal, and that it
must sell down before it can pass.
This commit is contained in:
Greyson Parrelli
2026-07-23 16:11:07 -04:00
parent db1a6ef290
commit 72e198a750
15 changed files with 273 additions and 297 deletions
+4 -3
View File
@@ -65,11 +65,12 @@ func TestE2EBotGame(t *testing.T) {
t.Fatal("no bot seat in the game")
}
// Play the human side: pass whenever it's our turn. The game can only
// reach the arrange phase if the bot spends its own three coins too.
// Play the human side: pass on our first turn (passing is final, so one
// is all we get). The game can only reach the arrange phase if the bot
// shops and passes on its own too.
deadline := time.Now().Add(25 * time.Second)
for v.Phase == game.PhaseShop && time.Now().Before(deadline) {
if v.Turn == v.YouSeat && v.Players[v.YouSeat].Coins > 0 && v.Pending == nil {
if v.Turn == v.YouSeat && !v.Players[v.YouSeat].Ready && v.Pending == nil {
send(t, ctx, ws, map[string]any{"type": "pass"})
}
rctx, rcancel := context.WithTimeout(ctx, 10*time.Second)