public override void Setup(Game game, Supply supply)
        {
            base.Setup(game, supply);

            supply.AddTo(new BagOfGold());
            supply.AddTo(new Diadem());
            supply.AddTo(new Followers());
            supply.AddTo(new Princess());
            supply.AddTo(new TrustySteed());
        }
Exemple #2
0
        public override void Setup(Game game, Supply supply)
        {
            base.Setup(game, supply);

            IList <Card> availableCards = null;

            try
            {
                if (game.Settings.Preset != null)
                {
                    availableCards = game.Settings.Preset.CardCards[game.Settings.Preset.Cards.First(c => c.CardType == typeof(BlackMarket))];
                    // Shuffle the preset cards -- these should definitely not be set up in a known order
                    Utilities.Shuffler.Shuffle(availableCards);
                }
                else
                {
                    int cardsToUse = 25;
                    //Boolean errorOnNotEnoughCards = true;
                    Boolean shouldUseGameConstraints   = true;
                    ConstraintCollection bmConstraints = new ConstraintCollection();
                    if (game.Settings.CardSettings.ContainsKey("Black Market"))
                    {
                        CardsSettings bmSettings = game.Settings.CardSettings["Black Market"];
                        cardsToUse = (int)bmSettings.CardSettingCollection[typeof(BlackMarket.BlackMarket_NumberOfCards)].Value;
                        //errorOnNotEnoughCards = (Boolean)bmSettings.CardSettingCollection[typeof(BlackMarket.BlackMarket_ErrorOnNotEnoughCards)].Value;
                        shouldUseGameConstraints = (Boolean)bmSettings.CardSettingCollection[typeof(BlackMarket.BlackMarket_UseGameConstraints)].Value;
                        bmConstraints            = (ConstraintCollection)bmSettings.CardSettingCollection[typeof(BlackMarket.BlackMarket_Constraints)].Value;
                    }

                    // need to set up a supply pile for Black Market; randomly pick an unused supply card and add it to the pile until we have the requisite number of cards
                    availableCards = game.CardsAvailable;
                    if (shouldUseGameConstraints)
                    {
                        // Skip all "Must Use" constraints
                        ConstraintCollection constraints = new ConstraintCollection(game.Settings.Constraints.Where(c => c.ConstraintType != ConstraintType.CardMustUse));
                        availableCards = constraints.SelectCards(availableCards, cardsToUse);
                    }
                    else
                    {
                        availableCards = bmConstraints.SelectCards(availableCards, cardsToUse);
                    }
                }
            }
            catch (DominionBase.Cards.ConstraintException ce)
            {
                throw new BlackMarketConstraintException(String.Format("Problem setting up Black Market constraints: {0}", ce.Message));
            }

            foreach (Card cardToUse in availableCards)
            {
                game.CardsAvailable.Remove(cardToUse);
                supply.AddTo(cardToUse);
            }
        }
Exemple #3
0
        public void AddKingdomSupply(PlayerCollection players, Type cardType)
        {
            // Minimum required -- Need to do this first to figure out what kind of card it is (silly, I know)
            Supply newSupply = new Supply(this._Game, players, cardType, 8);

            if ((newSupply.Category & Category.Victory) == Category.Victory)
            {
                // Victory supply piles should be 12 in 3+ player games
                if (NumPlayers > 2)
                {
                    newSupply.AddTo(_BaseVictoryCards - 8);
                }
            }
            else              // Not a Victory card, so there should be 10
            {
                newSupply.AddTo(2);
            }

            _SupplyPiles[cardType] = newSupply;
            _SupplyKeys            = null;
        }
		public override void Setup(Game game, Supply supply)
		{
			base.Setup(game, supply);

			IList<Card> availableCards = null; 
			try
			{
				if (game.Settings.Preset != null)
				{
					availableCards = game.Settings.Preset.CardCards[game.Settings.Preset.Cards.First(c => c.CardType == typeof(BlackMarket))];
					// Shuffle the preset cards -- these should definitely not be set up in a known order
					Utilities.Shuffler.Shuffle(availableCards);
				}
				else
				{
					int cardsToUse = 25;
					//Boolean errorOnNotEnoughCards = true;
					Boolean shouldUseGameConstraints = true;
					ConstraintCollection bmConstraints = new ConstraintCollection();
					if (game.Settings.CardSettings.ContainsKey("Black Market"))
					{
						CardsSettings bmSettings = game.Settings.CardSettings["Black Market"];
						cardsToUse = (int)bmSettings.CardSettingCollection[typeof(BlackMarket.BlackMarket_NumberOfCards)].Value;
						//errorOnNotEnoughCards = (Boolean)bmSettings.CardSettingCollection[typeof(BlackMarket.BlackMarket_ErrorOnNotEnoughCards)].Value;
						shouldUseGameConstraints = (Boolean)bmSettings.CardSettingCollection[typeof(BlackMarket.BlackMarket_UseGameConstraints)].Value;
						bmConstraints = (ConstraintCollection)bmSettings.CardSettingCollection[typeof(BlackMarket.BlackMarket_Constraints)].Value;
					}

					// need to set up a supply pile for Black Market; randomly pick an unused supply card and add it to the pile until we have the requisite number of cards
					availableCards = game.CardsAvailable;
					if (shouldUseGameConstraints)
					{
						// Skip all "Must Use" constraints
						ConstraintCollection constraints = new ConstraintCollection(game.Settings.Constraints.Where(c => c.ConstraintType != ConstraintType.CardMustUse));
						availableCards = constraints.SelectCards(availableCards, cardsToUse);
					}
					else
						availableCards = bmConstraints.SelectCards(availableCards, cardsToUse);
				}
			}
			catch (DominionBase.Cards.ConstraintException ce)
			{
				throw new BlackMarketConstraintException(String.Format("Problem setting up Black Market constraints: {0}", ce.Message));
			}

			foreach (Card cardToUse in availableCards)
			{
				game.CardsAvailable.Remove(cardToUse);
				supply.AddTo(cardToUse);
			}
		}
		public override void Setup(Game game, Supply supply)
		{
			base.Setup(game, supply);

			CardCollection cards = new CardCollection();
			for (int i = 0; i < 10; i++)
			{
				cards.Add(new AbandonedMine());
				cards.Add(new RuinedLibrary());
				cards.Add(new RuinedMarket());
				cards.Add(new RuinedVillage());
				cards.Add(new Survivors());
			}

			Utilities.Shuffler.Shuffle<Card>(cards);

			supply.AddTo(cards.Take(10 * (game.Players.Count - 1)));
		}
		public override void Setup(Game game, Supply supply)
		{
			base.Setup(game, supply);

			// Add 10 more cards to the Rats pile, bringing it to 20
			supply.AddTo(10);
		}
		public override void Setup(Game game, Supply supply)
		{
			base.Setup(game, supply);

			supply.Empty();

			CardCollection cards = new CardCollection();
			cards.Add(new DameAnna());
			cards.Add(new DameJosephine());
			cards.Add(new DameMolly());
			cards.Add(new DameNatalie());
			cards.Add(new DameSylvia());
			cards.Add(new SirBailey());
			cards.Add(new SirDestry());
			cards.Add(new SirMartin());
			cards.Add(new SirMichael());
			cards.Add(new SirVander());

			Utilities.Shuffler.Shuffle<Card>(cards);

			supply.AddTo(cards);
		}
		public override void Setup(Game game, Supply supply)
		{
			base.Setup(game, supply);

			supply.AddTo(new BagOfGold());
			supply.AddTo(new Diadem());
			supply.AddTo(new Followers());
			supply.AddTo(new Princess());
			supply.AddTo(new TrustySteed());
		}
		public void AddKingdomSupply(PlayerCollection players, Type cardType)
		{
			// Minimum required -- Need to do this first to figure out what kind of card it is (silly, I know)
			Supply newSupply = new Supply(this._Game, players, cardType, 8);
			if ((newSupply.Category & Category.Victory) == Category.Victory)
			{
				// Victory supply piles should be 12 in 3+ player games
				if (NumPlayers > 2)
					newSupply.AddTo(_BaseVictoryCards - 8);
			}
			else  // Not a Victory card, so there should be 10
			{
				newSupply.AddTo(2);
			}

			_SupplyPiles[cardType] = newSupply;
			_SupplyKeys = null;
		}