void InitBoard() { fearCardCount = -1; fearEarnedCount = -1; fearPoolCount = 0; fearCards = new FearCards(); playerCount = numPlayersDropdown.value + 2; blightCount = playerCount * 5; invader_deck = new List <string> [3]; for (int i = 0; i < LAND_SETS.Length; i++) { invader_deck[i] = new List <string>(LAND_SETS[i]); FearCards.Shuffle(invader_deck[i]); invader_deck[i].RemoveAt(0); } invadePhase = InvadePhase.TimePass; invadeExploreImage.gameObject.SetActive(true); invadeBuildImage.gameObject.SetActive(false); invadeRavageImage.gameObject.SetActive(false); invadeDiscardImage.gameObject.SetActive(false); invader_cards_showing = new List <string>(); endGameText.gameObject.SetActive(false); UpdateBoard(); }
void AdvanceInvaders() { switch (invadePhase) { case InvadePhase.TimePass: string newCard = null; for (int i = 0; i < invader_deck.Length; i++) { if (invader_deck[i].Count > 0) { newCard = invader_deck[i][0]; invader_deck[i].Remove(newCard); break; } } if (newCard == null) { endGameText.text = "Invaders Win"; endGameText.gameObject.SetActive(true); return; } invadePhase = InvadePhase.Invade; invader_cards_showing.Insert(0, newCard); int fearLevel = GetFearLevel(); for (; fearEarnedCount > 0; fearEarnedCount--) { FearCard next = fearCards.GetNextCard(); fearActiveText.text += next.name + ": " + next.levels[fearLevel - 1] + "\n"; } break; default: invadePhase = InvadePhase.TimePass; fearActiveText.text = ""; break; } UpdateBoard(); }