Fix nurse shark and remove mid-battle choice.
This commit is contained in:
+1
-14
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user