public Table(Game game, int numPlayers) : this(game) { _NumPlayers = numPlayers; int multiplier = _NumPlayers >= 5 ? 2 : 1; Copper = new Supply(game, null, Cards.Universal.TypeClass.Copper, 60 * multiplier); Silver = new Supply(game, null, Cards.Universal.TypeClass.Silver, 40 * multiplier); Gold = new Supply(game, null, Cards.Universal.TypeClass.Gold, 30 * multiplier); int extraProvinceCards = 0; switch (_NumPlayers) { case 1: case 2: _BaseVictoryCards = 8; break; case 5: extraProvinceCards = 3; break; case 6: extraProvinceCards = 6; break; } Estate = new Supply(game, null, Cards.Universal.TypeClass.Estate, 3 * _NumPlayers + _BaseVictoryCards); Duchy = new Supply(game, null, Cards.Universal.TypeClass.Duchy, _BaseVictoryCards); Province = new Supply(game, null, Cards.Universal.TypeClass.Province, _BaseVictoryCards + extraProvinceCards); Curse = new Supply(game, null, Cards.Universal.TypeClass.Curse, 10 * Math.Max(_NumPlayers - 1, 1)); }
public override void ActBefore(Game game) { Player.PlayCard(Card); }
public override void ActBefore(Game game) { Player.Buy(this.Supply); }
public virtual Thread ActAfter(Game game) { return null; }
public virtual void ActBefore(Game game) { }
public override void ActBefore(Game game) { game.Abort(); }
public override void ActBefore(Game game) { Player.PlayTokens(game, this.Token, this.Count); }
public override void ActBefore(Game game) { Player.GoToBuyPhase(); }
public override void ActBefore(Game game) { Player.PlayTreasures(game); }
public override Thread ActAfter(Game game) { return game.SetNextPlayer(); }
public override void ActBefore(Game game) { //if (Player.Phase != PhaseEnum.Waiting) Player.Cleanup(); //game.SetNextPlayer(); }
public override void ActBefore(Game game) { if (this.Card != null) this.Player.UndoPlayCard(this.Card); //if (this.Phase != PhaseEnum.Waiting) this.Player.UndoPhaseChange(this.Phase); }
protected virtual void Dispose(bool disposing) { // Check to see if Dispose has already been called. if (!this.disposed) { // If disposing equals true, dispose all managed // and unmanaged resources. if (disposing) { // Dispose managed resources. this._Game = null; this._SupplyPiles = null; this._SpecialPiles = null; this._TokenPiles = null; this._SupplyKeys = null; this._Trash = null; } // Call the appropriate methods to clean up // unmanaged resources here. // If disposing is false, // only the following code is executed. // Note disposing has been done. disposed = true; } }
internal void FinalizeSupplies(Game game) { _SupplyPiles.FinalizeSetup(); }
public Table(Game game) { _Game = game; }
internal void SetupSupplies(Game game) { // Check for addition of Platinum/Colony Boolean useColonyPlatinum = false; switch (game.Settings.ColonyPlatinumUsage) { case ColonyPlatinumUsage.Standard: case ColonyPlatinumUsage.Used: case ColonyPlatinumUsage.NotUsed: if (game.RNG.Next(1, _SupplyPiles.Values.Count(s => s.Location == Location.Kingdom) + 1) <= _SupplyPiles.Values.Count(s => s.Location == Location.Kingdom && s.Source == Source.Prosperity)) // We have a winner! useColonyPlatinum = true; break; case ColonyPlatinumUsage.Always: useColonyPlatinum = true; break; } if (useColonyPlatinum) { this.Supplies[Cards.Prosperity.TypeClass.Platinum] = new Supply(game, null, Cards.Prosperity.TypeClass.Platinum, 12); this.Supplies[Cards.Prosperity.TypeClass.Colony] = new Supply(game, null, Cards.Prosperity.TypeClass.Colony, _BaseVictoryCards); game.Settings.ColonyPlatinumUsage = ColonyPlatinumUsage.Used; } else { game.Settings.ColonyPlatinumUsage = ColonyPlatinumUsage.NotUsed; } // Check for addition of Shelters Boolean useShelter = false; switch (game.Settings.ShelterUsage) { case ShelterUsage.Standard: case ShelterUsage.Used: case ShelterUsage.NotUsed: if (game.RNG.Next(1, _SupplyPiles.Values.Count(s => s.Location == Location.Kingdom) + 1) <= _SupplyPiles.Values.Count(s => s.Location == Location.Kingdom && s.Source == Source.DarkAges)) // We have a winner! useShelter = true; break; case ShelterUsage.Always: useShelter = true; break; } if (useShelter) { this.Estate.Take(3 * game.Players.Count); this.Supplies[Cards.DarkAges.TypeClass.Shelters] = new Supply(game, null, Cards.DarkAges.TypeClass.Shelters, Visibility.Top); game.Settings.ShelterUsage = ShelterUsage.Used; } else { game.Settings.ShelterUsage = ShelterUsage.NotUsed; } _SupplyPiles.Setup(); foreach (Supply supply in _SupplyPiles.Values.Concat(SpecialPiles.Values)) { if (supply.CurrentCost.Potion.Value > 0 && !_SupplyPiles.ContainsKey(Cards.Alchemy.TypeClass.Potion)) { Potion = new Supply(game, game.Players, Cards.Alchemy.TypeClass.Potion, 16); break; } if (supply.CardTypes.Count() > 1) { foreach (Type cardType in supply.CardTypes) { Card card = Card.CreateInstance(cardType); if (game.ComputeCost(card).Potion.Value > 0 && !_SupplyPiles.ContainsKey(Cards.Alchemy.TypeClass.Potion)) { Potion = new Supply(game, game.Players, Cards.Alchemy.TypeClass.Potion, 16); break; } } } if (_SupplyPiles.ContainsKey(Cards.Alchemy.TypeClass.Potion)) break; } }