public IEnumerator StartOfGame() { foreach (BaseDeckEntry e in startingDeck) { for (int i = 0; i < e.copies; ++i) { e.card.Clone().MoveTo(deck); } } foreach (Card c in basicCards) { Store.StoreEntry storeEntry = new Store.StoreEntry(); coinsShop.AddPile(c.name, c.buyCost); for (int j = 0; j < BASIC_CARDS_COUNT; ++j) { coinsShop.AddElement(c.Clone()); } } BuyableSet uniqueCards = cards.Clone(); //Don't add cards that we already have uniqueCards.Modify((Buyable b) => coinsShop.HasPile(b.name), 0.0f); for (int i = 0; i < 4; ++i) { Card c = (Card)uniqueCards.RandomlyChooseElement(); if (c != null) { Store.StoreEntry storeEntry = new Store.StoreEntry(); coinsShop.AddPile(c.name, c.buyCost); for (int j = 0; j < INIT_STORE_CARDS_COUNT; ++j) { coinsShop.AddElement(c.Clone()); } } } BuyableSet uniqueBlueprints = blueprints.Clone(); uniqueBlueprints.Modify((Buyable b) => hammersShop.HasPile(b.name), 0.0f); for (int i = 0; i < 4; ++i) { Blueprint b = (Blueprint)uniqueBlueprints.RandomlyChooseElement(); if (b != null) { Store.StoreEntry storeEntry = new Store.StoreEntry(); hammersShop.AddPile(b.name, b.buyCost); hammersShop.AddElement(b.Clone()); } } //TODO: Research health = 100; yield return(InputManager.instance.PlayEffect(new StartOfTurn())); }
public override IEnumerator Buy() { if (r is Card) { Card card = (Card)r; GameplayManager.instance.coinsShop.AddPile(card.name, card.buyCost); for (int i = 0; i < RESEARCH_COUNT; ++i) { GameplayManager.instance.coinsShop.AddElement(card.Clone()); } } else { Blueprint bp = (Blueprint)r; GameplayManager.instance.hammersShop.AddPile(bp.name, bp.buyCost); GameplayManager.instance.hammersShop.AddElement(bp.Clone()); } yield break; }