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:
+6
-7
@@ -67,13 +67,12 @@ func (b *Bot) Act(v *game.View, mem *Memory) *Action {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if v.Turn == v.YouSeat && me.Coins > 0 {
|
||||
// During the shop, Ready means "passed": the turn keeps coming back
|
||||
// (even with no coins — selling and trading are free) until the bot
|
||||
// passes.
|
||||
if v.Turn == v.YouSeat && !me.Ready {
|
||||
return b.decideShop(v, mem)
|
||||
}
|
||||
case game.PhaseCleanup:
|
||||
if !me.Ready {
|
||||
return b.decideCleanup(v, mem)
|
||||
}
|
||||
case game.PhaseArrange:
|
||||
if !me.Ready {
|
||||
return b.decideArrange(v, mem)
|
||||
@@ -98,8 +97,8 @@ func Pending(v *game.View) bool {
|
||||
if v.Pending != nil {
|
||||
return v.Pending.PlayerID == me.ID
|
||||
}
|
||||
return v.Turn == v.YouSeat && me.Coins > 0
|
||||
case game.PhaseCleanup, game.PhaseArrange, game.PhaseBattle:
|
||||
return v.Turn == v.YouSeat && !me.Ready
|
||||
case game.PhaseArrange, game.PhaseBattle:
|
||||
return !me.Ready
|
||||
}
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user