Fix nurse shark and remove mid-battle choice.

This commit is contained in:
Greyson Parrelli
2026-07-24 10:12:17 -04:00
parent 094f38593e
commit 0fe0757e18
14 changed files with 84 additions and 326 deletions
+1 -14
View File
@@ -35,13 +35,12 @@ import (
// Action is one move the bot wants to make, mirroring the client protocol.
type Action struct {
Type string // buy | buyAvocado | sell | trade | tradeChoose | pass | arrange | ready | revealChoose | battleChoose
Type string // buy | buyAvocado | sell | trade | tradeChoose | pass | arrange | ready | revealChoose
Row int // buy / buyAvocado
Cards []string // sell / trade
Pick int // tradeChoose
Order []string // arrange
CardID string // revealChoose (Cockatoo): the pet to reveal
Value int // battleChoose (Nurse Shark): Trumpets to spend
}
// Bot is a computer player at a fixed difficulty level.
@@ -86,13 +85,6 @@ func (b *Bot) Act(v *game.View, mem *Memory) *Action {
return b.decideArrange(v, mem)
}
case game.PhaseBattle:
if v.PendingBattle != nil {
if v.PendingBattle.Seat == v.YouSeat {
// Spend as many Trumpets as allowed — more rocks is better.
return &Action{Type: "battleChoose", Value: v.PendingBattle.Max}
}
return nil
}
if !me.Ready {
return &Action{Type: "ready"}
}
@@ -134,11 +126,6 @@ func Pending(v *game.View) bool {
case game.PhaseArrange:
return !me.Ready
case game.PhaseBattle:
// A pending mid-battle decision is owed only by the deciding seat;
// otherwise everyone owes the battle acknowledgement.
if v.PendingBattle != nil {
return v.PendingBattle.Seat == v.YouSeat
}
return !me.Ready
}
return false
-2
View File
@@ -100,8 +100,6 @@ func applyAction(g *game.Game, playerID string, a *Action) error {
return g.TradeChoose(playerID, a.Pick)
case "revealChoose":
return g.RevealChoose(playerID, a.CardID)
case "battleChoose":
return g.BattleChoose(playerID, a.Value)
case "pass":
return g.Pass(playerID)
case "arrange":