I implemented Tactician but I'm not sure whether it's the right way, as I had to modify the PlayerState to keep track of the number of "activated" Tacticians (it is possible to activate more than one in some rare circumstances), as doing it via a bool within the Tactician class itself resulted in some very weird behavior when you played a Tactician a few turns in a row. I'm guessing that because it's a static class, the Tacticians don't really exist as individual copies where each could possibly contain a different value of a bool?
public class Tactician
: Card
{
public static Tactician card = new Tactician();
private Tactician()
: base("Tactician", coinCost: 5, isAction: true, isDuration: true)
{
}
public override void DoSpecializedDurationActionAtBeginningOfTurn(PlayerState currentPlayer, GameState gameState)
{
if (currentPlayer.ActivatedTacticians > 0)
{
currentPlayer.DrawAdditionalCardsIntoHand(5);
currentPlayer.AddBuys(1);
currentPlayer.AddActions(1);
currentPlayer.RemoveTactician(1);
}
}
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
if (currentPlayer.hand.Count() > 0)
{
currentPlayer.DiscardHand(gameState);
currentPlayer.AddTactician(1);
}
}
}
Additions to PlayerState.cs:
public int ActivatedTacticians { get { return this.turnCounters.ActivatedTacticians; } }
internal void AddTactician(int coinAmount)
{
this.turnCounters.AddTactician(this, coinAmount);
}
internal void RemoveTactician(int coinAmount)
{
this.turnCounters.RemoveTactician(this, coinAmount);
}
Additions to PlayerTurnCounters.cs:
private int activatedTacticians = 0;
internal int ActivatedTacticians
{
get
{
return this.activatedTacticians;
}
}
public void AddTactician(PlayerState playerState, int count)
{
if (count > 0)
{
this.activatedTacticians += count;
}
}
internal void RemoveTactician(PlayerState playerState, int count)
{
this.activatedTacticians -= count;
if (this.activatedTacticians < 0)
{
this.activatedTacticians = 0;
}
}