Salvager
Lots of coding here, so might contain bugs
Will only be played:
- if player has suitable card to Salvage
When played:
- a list of cards is made with candidates for trashing. Only add to the list if :
-we will be able to buy something
-and the card we will be able to buy is better than what we were able to buy without using Salvager
-and the card we will be able to buy is better than the card we are about to trash
OR
-we want to trash the card and it will not have an influence on our buying power
- then, we run through the list and find the candidate that will allow player to buy the best card. If there’s a tie or we want to buy nothing we take the card we most want to trash
I still think there’s a problem with trashing silver. The script for this game was simple, buying gold/stables/salvager(1)/caravan/silver.
Salvager/stables/caravan(Plr 3)’s cards in Hand: [Estate, Copper, Estate, Salvager, Silver]
Salvager/stables/caravan(Plr 3) plays Salvager
… Salvager/stables/caravan(Plr 3) gets +1 buys
… Salvager/stables/caravan(Plr 3) trashes a Silver
… Salvager/stables/caravan(Plr 3) gets +$3
Salvager/stables/caravan(Plr 3) plays 1 Copper
Salvager/stables/caravan(Plr 3) has $4 to spend and 2 buys
Salvager/stables/caravan(Plr 3) buys a Caravan