private void CommonCheck() { for (int i = 0; i < _activeCards.Count; i++) { if (_activeCards[i]._cardRarity == Card.Rarity.Common) { _commonCards += 1; if (_commonCards == 4) { DetermineDrop(); if (_currentRarity == Card.Rarity.Common) { _currentSprite = _cardDataArray[(int)_currentExpansion]._rareCards[Random.Range(0, _cardDataArray[(int)_currentExpansion]._rareCards.Count)]; _currentAudioClip = _turnOverSounds[1]; _currentRarity = Card.Rarity.Rare; break; } break; } } else if (_activeCards[i]._cardRarity == Card.Rarity.None) { //skip card } else { //DetermineDrop(); break; } } _commonCards = 0; }
public static Card Random(Card.Rarity rarity) { Card card = null; var random = new Random(); var result = rarity == Card.Rarity.Legendary ? random.Next(1, 3) : random.Next(1, 4); switch (result) { case 1: { var datas = Csv.Tables.Get(Csv.Files.SpellsCharacters).GetDatas() .Where(s => !((SpellsCharacters)s).NotInUse && ((SpellsCharacters)s).Rarity == rarity.ToString()); var enumerable = datas.ToList(); if (enumerable.ElementAt(random.Next(0, enumerable.Count)) is SpellsCharacters c) { card = new Card(26, c.GetInstanceId(), false); } break; } case 2: { var datas = Csv.Tables.Get(Csv.Files.SpellsOther).GetDatas() .Where(s => !((SpellsOther)s).NotInUse && ((SpellsOther)s).Rarity == rarity.ToString()); var enumerable = datas.ToList(); if (enumerable.ElementAt(random.Next(0, enumerable.Count)) is SpellsOther c) { card = new Card(28, c.GetInstanceId(), false); } break; } case 3: { var datas = Csv.Tables.Get(Csv.Files.SpellsBuildings).GetDatas() .Where(s => !((SpellsBuildings)s).NotInUse && ((SpellsBuildings)s).Rarity == rarity.ToString()); var enumerable = datas.ToList(); if (enumerable.ElementAt(random.Next(0, enumerable.Count)) is SpellsBuildings c) { card = new Card(27, c.GetInstanceId(), false); } break; } } return(card); }
public SpellShopItem RandomSpell(Card.Rarity rarity) { var card = Cards.Random(rarity); return(new SpellShopItem { ClassId = card.ClassId, InstanceId = card.InstanceId, Rarity = (int)card.CardRarity }); }
public void ChangeGlow(Card.Rarity rarity, Vector3 colorLerpPos) { for (int i = 0; i < _colorLerpPresets.Length; i++) { if (rarity == _colorLerpPresets[i]._rarity) { _colorLerp.startColor = _colorLerpPresets[i]._startColor; _colorLerp.endColor = _colorLerpPresets[i]._endColor; transform.position = new Vector3(colorLerpPos.x, colorLerpPos.y - 0.1f, colorLerpPos.z); GetComponent <Image>().enabled = true; break; } } }
public override void AfterCardTargetingCallback() { Card.Rarity discardRarity = Rarity.Paper; foreach (GameObject tempGO in S.GameControlInst.TargetedCards) { Card c = tempGO.GetComponent <Card>(); discardRarity = c.ThisRarity; c.Discard(); } if (discardRarity == Rarity.Paper) { x = 1; } if (discardRarity == Rarity.Bronze) { x = 2; } if (discardRarity == Rarity.Silver) { x = 3; } if (discardRarity == Rarity.Gold) { x = 4; } if (discardRarity == Rarity.Platinum) { x = 5; } S.GridControlInst.EnterTargetingMode(GridControl.TargetTypes.diamond, 1, x); //these must be done manually because after targeting a card, you must finish the card action by attacking. S.ClickControlInst.DisallowEveryInput(); S.ClickControlInst.AllowInfoInput = true; S.ClickControlInst.AllowSquareTargetInput = true; S.GameControlInst.TargetSquareCallback = this; QControl.AddToQ(this, QControl.QMethodType.FreeSpecial); base.AfterCardTargetingCallback(); }
public Card GetCard(Card.Rarity rarity = Card.Rarity.Common) { if (rarity == Card.Rarity.Rare) //If a specific rarity is specified { return(GetRareCard()); } else //Else roll based on rarity distribution { int roll = Random.Range(0, 100); if (roll <= rarePercentage) { return(GetRareCard()); } else { return(GetCommonCard()); } } }
public static Card RandomByArena(Card.Rarity rarity, List <string> chestArenas) { var random = new Random(); var cards = new List <Card>(); foreach (var chestArena in chestArenas) { if (_spellsCharacters.Any(x => x.UnlockArena == chestArena)) { cards.AddRange(_spellsCharacters .Where(x => x.UnlockArena == chestArena && x.Rarity == rarity.ToString()) .Select(data => new Card(26, data.GetInstanceId(), false))); } } foreach (var chestArena in chestArenas) { if (_spellsOther.Any(x => x.UnlockArena == chestArena)) { cards.AddRange(_spellsOther.Where(x => x.UnlockArena == chestArena && x.Rarity == rarity.ToString()) .Select(data => new Card(28, data.GetInstanceId(), false))); } } if (rarity != Card.Rarity.Legendary) { foreach (var chestArena in chestArenas) { if (_spellsBuildings.Any(x => x.UnlockArena == chestArena)) { cards.AddRange(_spellsBuildings .Where(x => x.UnlockArena == chestArena && x.Rarity == rarity.ToString()) .Select(data => new Card(27, data.GetInstanceId(), false))); } } } //Console.WriteLine($"Found {cards.Count} cards for {chestArenas.Count} Arenas with rarity {rarity.ToString()}"); return(cards.Count > 0 ? cards.ElementAt(random.Next(0, cards.Count)) : null); }
private void DetermineDrop() { _drop = Random.Range(0, _dropChance); if (_drop >= 0f && _drop <= 71f) { //common _currentSprite = _cardDataArray[(int)_currentExpansion]._commonCards[Random.Range(0, _cardDataArray[(int)_currentExpansion]._commonCards.Count)]; _currentAudioClip = _turnOverSounds[0]; _currentRarity = Card.Rarity.Common; } else if (_drop > 71f && _drop <= 94.4f) { //rare _currentSprite = _cardDataArray[(int)_currentExpansion]._rareCards[Random.Range(0, _cardDataArray[(int)_currentExpansion]._rareCards.Count)]; _currentAudioClip = _turnOverSounds[1]; _currentRarity = Card.Rarity.Rare; } else if (_drop > 94.4f && _drop <= 98.9f) { //epic _currentSprite = _cardDataArray[(int)_currentExpansion]._epicCards[Random.Range(0, _cardDataArray[(int)_currentExpansion]._epicCards.Count)]; _currentAudioClip = _turnOverSounds[2]; _currentRarity = Card.Rarity.Epic; } else { //legendary _currentSprite = _cardDataArray[(int)_currentExpansion]._legendaryCards[Random.Range(0, _cardDataArray[(int)_currentExpansion]._legendaryCards.Count)]; _currentAudioClip = _turnOverSounds[3]; _currentRarity = Card.Rarity.Legendary; } }
public SpellShopItem RandomSpell(Card.Rarity rarity) { SpellShopItem item = null; var random = new Random(); var result = rarity != Card.Rarity.Legendary ? random.Next(26, 29) : random.Next(0, 2) == 1 ? 26 : 28; switch (result) { case 26: { var datas = Csv.Tables.Get(Csv.Files.SpellsCharacters).GetDatas() .Where(s => !((SpellsCharacters)s).NotInUse && ((SpellsCharacters)s).Rarity == rarity.ToString()); if (datas.ElementAt(random.Next(0, datas.Count())) is SpellsCharacters c) { item = new SpellShopItem { ClassId = 26, InstanceId = c.GetInstanceId(), Rarity = (int)Card.GetRarity(c.Rarity) } } ; break; } case 27: { var datas = Csv.Tables.Get(Csv.Files.SpellsBuildings).GetDatas() .Where(s => !((SpellsBuildings)s).NotInUse && ((SpellsBuildings)s).Rarity == rarity.ToString()); if (datas.ElementAt(random.Next(0, datas.Count())) is SpellsBuildings c) { item = new SpellShopItem { ClassId = 27, InstanceId = c.GetInstanceId(), Rarity = (int)Card.GetRarity(c.Rarity) } } ; break; } case 28: { var datas = Csv.Tables.Get(Csv.Files.SpellsOther).GetDatas() .Where(s => !((SpellsOther)s).NotInUse && ((SpellsOther)s).Rarity == rarity.ToString()); if (datas.ElementAt(random.Next(0, datas.Count())) is SpellsOther c) { item = new SpellShopItem { ClassId = 28, InstanceId = c.GetInstanceId(), Rarity = (int)Card.GetRarity(c.Rarity) } } ; break; } } return(item); } }
private void PoolCard() { _cardImage.DOFade(1f, 0f); _cardRarity = Card.Rarity.None; ObjectPool.Instance.PoolObject(gameObject); }
//normal public LibraryCard(string cardname, string displayname, string iconpath, ShopControl.Gods god, Card.Rarity rarity, string tooltip, string displaytext, string minidisplaytext, Card.CardActionTypes cardAction, GridControl.TargetTypes rangeTargetType, int rangeMinArg, int rangeMaxArg, GridControl.TargetTypes aoeTargetType, int aoeMinArg, int aoeMaxArg) { CardName = cardname; DisplayName = displayname; IconPath = iconpath; God = god; ThisRarity = rarity; Tooltip = tooltip; DisplayText = displaytext; MiniDisplayText = minidisplaytext; CardAction = cardAction; RangeTargetType = rangeTargetType; rangeMin = rangeMinArg; rangeMax = rangeMaxArg; AoeTargetType = aoeTargetType; aoeMinRange = aoeMinArg; aoeMaxRange = aoeMaxArg; switch(rarity) { case Card.Rarity.Paper: Cost = 0; break; case Card.Rarity.Bronze: Cost = 2; break; case Card.Rarity.Silver: Cost = 4; break; case Card.Rarity.Gold: Cost = 6; break; case Card.Rarity.Platinum: Cost = 8; break; } UnlockCost = Cost; }
public void ProduceCards() { S.ShopControlGUIInst.UpdateGoalInfos(); CardsToBuyFrom = new List <LibraryCard> [3]; for (int i = 0; i < CardsToBuyFrom.Length; i++) { CardsToBuyFrom[i] = new List <LibraryCard>(); } // Count - 2 because the last ones are 'pantheon' and 'none' for (int i = 0, j = 0; i < AllGods.Count - 2; i++) { Debug.Log(AllGods[i]); Debug.Log(SaveDataControl.UnlockedGods.IndexOf(AllGods[i])); if (SaveDataControl.UnlockedGods.IndexOf(AllGods[i]) != -1) { Card.Rarity rare = Card.Rarity.Bronze; if (shopCardRarityLevelsByGod[i] == 1) { rare = Card.Rarity.Silver; } else if (shopCardRarityLevelsByGod[i] == 2) { rare = Card.Rarity.Gold; } LibraryCard tempLC = S.CardLibraryInst.PullCardFromPack(AllGods[i], rare); CardsToBuyFrom[j].Add(tempLC); } if (i == 1 | i == 4) { j++; } } int[] finalScores = FinalScores(); for (int i = 0; i < Goals.Length; i++) { Debug.Log("pulling a card for " + Goals[i].God + " with the final score " + finalScores[i]); if (finalScores[i] == 1) { S.GameControlInst.AddDollars(1); } if (finalScores[i] >= 2) { CardsToBuyFrom[i].Add(S.CardLibraryInst.PullCardFromPack(Goals[i].God, Card.Rarity.Silver)); } if (finalScores[i] == 2) { S.GameControlInst.AddDollars(2); } if (finalScores[i] >= 3) { CardsToBuyFrom[i].Add(S.CardLibraryInst.PullCardFromPack(Goals[i].God, Card.Rarity.Gold)); } if (finalScores[i] == 3) { S.GameControlInst.AddDollars(3); } if (finalScores[i] >= 4) { CardsToBuyFrom[i].Add(S.CardLibraryInst.PullCardFromPack(Goals[i].God, Card.Rarity.Gold)); } if (finalScores[i] == 4) { S.GameControlInst.AddDollars(5); } } TurnOnShopGUI(); }
void OnGUI() { GUI.depth = 1; GUI.Box(new Rect(0, 0, Screen.width, Screen.height), "", S.GUIStyleLibraryInst.MainStyles.BlackBackground); GUI.depth = 0; GUI.BeginGroup(new Rect(Screen.width * .1f, Screen.height * .05f, Screen.width * .9f, Screen.height * .9f)); if (allCards.Length == 0) { FindCards(); } for (int i = 0; i < ShopControl.AllGods.Count - 2; i++) { if (SaveDataControl.UnlockedGods.Contains(ShopControl.AllGods[i])) { GUI.Box(new Rect(seventh * i, 0f, seventh, Screen.height * .1f), new GUIContent(S.ShopControlGUIInst.GodIcons[i]), GUIStyle.none); } else { GUI.Box(new Rect(seventh * i, 0f, seventh, Screen.height * .1f), new GUIContent(S.ShopControlGUIInst.GodIcons[7]), GUIStyle.none); } } scrollPos = GUI.BeginScrollView(new Rect(0, Screen.height * .1f, Screen.width * .9f, Screen.height * .47f), scrollPos, new Rect(0, Screen.height * .1f, Screen.width * .795f, Screen.height * .1f * longestLength)); for (int i = 0; i < ShopControl.AllGods.Count; i++) { for (int j = 0; j < allCards[i].Count; j++) { LibraryCard thisCard = allCards[i][j]; Texture2D Rarity = S.ShopControlGUIInst.PaperTexture; if (thisCard.ThisRarity == Card.Rarity.Bronze) { Rarity = S.ShopControlGUIInst.BronzeTexture; } else if (thisCard.ThisRarity == Card.Rarity.Silver) { Rarity = S.ShopControlGUIInst.SilverTexture; } else if (thisCard.ThisRarity == Card.Rarity.Gold) { Rarity = S.ShopControlGUIInst.GoldTexture; } GUIContent name = new GUIContent(thisCard.CardName, Rarity); //if this isn't unlocked, don't display it.... if (!UnlockedCardNames.Contains(thisCard.CardName) | (thisCard.ThisRarity != Card.Rarity.Paper && !SaveDataControl.UnlockedGods.Contains(thisCard.God))) { if (GUI.Button(new Rect(seventh * i, Screen.height * .1f * (j + 1), seventh, Screen.height * .1f), "???", S.GUIStyleLibraryInst.CustomizeStyles.CardToggleOff)) { } } //if this is in your starting deck, show a CardToggleRemove button, which removes it else if (StartingDeckCardNames.Contains(thisCard.CardName)) { GUIStyle UnlockedStyle = new GUIStyle(S.GUIStyleLibraryInst.CustomizeStyles.CardToggleRemove); if (thisCard.ThisRarity == Card.Rarity.Paper) { UnlockedStyle.normal = S.GUIStyleLibraryInst.CustomizeStyles.CardNeutral.normal; } if (GUI.Button(new Rect(seventh * i, Screen.height * .1f * (j + 1), seventh, Screen.height * .1f), name, UnlockedStyle)) { selectedCard = thisCard; selectedGod = i; if (thisCard.ThisRarity == Card.Rarity.Paper) { return; } for (int k = 0; k < SaveDataControl.StartingDeckCards.Count; k++) { if (SaveDataControl.StartingDeckCards[k].CardName == thisCard.CardName) { SaveDataControl.StartingDeckCards.RemoveAt(k); } } FindCards(); } } //if this isn't in your starting deck, show a CardToggleAdd button, //which adds it to your starting deck if you haven't added your Bronze or silver card else { if (GUI.Button(new Rect(seventh * i, Screen.height * .1f * (j + 1), seventh, Screen.height * .1f), name, S.GUIStyleLibraryInst.CustomizeStyles.CardToggleAdd)) { selectedCard = thisCard; selectedGod = i; if (thisCard.ThisRarity == Card.Rarity.Paper) { return; } else { Card.Rarity thisRarity = thisCard.ThisRarity; for (int k = 0; k < SaveDataControl.StartingDeckCards.Count; k++) { if (SaveDataControl.StartingDeckCards[k].ThisRarity == thisRarity) { SaveDataControl.StartingDeckCards.RemoveAt(k); break; } } SaveDataControl.StartingDeckCards.Add(thisCard); } FindCards(); } } } } GUI.EndScrollView(); GUI.BeginGroup(new Rect(Screen.width * .4f, Screen.height * .585f, Screen.width * .4f, Screen.height * .3f), ""); if (BronzeSpotTaken != "") { if (GUI.Button(new Rect(0, 0, Screen.width * .4f, Screen.height * .1f), new GUIContent("Your added Bronze card is " + BronzeSpotTaken + " ", S.ShopControlGUIInst.BronzeTexture), S.GUIStyleLibraryInst.CustomizeStyles.RarityToggleOn)) { selectedCard = CardLibrary.Lib[BronzeSpotTaken]; } } else { GUI.Box(new Rect(0, 0, Screen.width * .4f, Screen.height * .1f), new GUIContent("You haven't chosen a Bronze card to add to your deck."), S.GUIStyleLibraryInst.CustomizeStyles.RarityToggleOff); } if (silverSpotTaken != "") { if (GUI.Button(new Rect(0, Screen.height * .1f, Screen.width * .4f, Screen.height * .1f), new GUIContent("Your added Silver card is " + silverSpotTaken + " ", S.ShopControlGUIInst.SilverTexture), S.GUIStyleLibraryInst.CustomizeStyles.RarityToggleOn)) { selectedCard = CardLibrary.Lib[silverSpotTaken]; } } else { GUI.Box(new Rect(0, Screen.height * .1f, Screen.width * .4f, Screen.height * .1f), new GUIContent("You haven't chosen a silver card to add to your deck."), S.GUIStyleLibraryInst.CustomizeStyles.RarityToggleOff); } if (goldSpotTaken != "") { if (GUI.Button(new Rect(0, Screen.height * .2f, Screen.width * .4f, Screen.height * .1f), new GUIContent("Your added Gold card is " + goldSpotTaken + " ", S.ShopControlGUIInst.GoldTexture), S.GUIStyleLibraryInst.CustomizeStyles.RarityToggleOn)) { selectedCard = CardLibrary.Lib[goldSpotTaken]; } } else { GUI.Box(new Rect(0, Screen.height * .2f, Screen.width * .4f, Screen.height * .1f), new GUIContent("You haven't chosen a gold card to add to your deck."), S.GUIStyleLibraryInst.CustomizeStyles.RarityToggleOff); } GUI.EndGroup(); if (selectedCard.CardName != null) { GUI.BeginGroup(new Rect(Screen.width * 0f, Screen.height * .585f, Screen.width * .35f, Screen.height * .3f), ""); if (S.ShopControlGUIInst.CardTextures[selectedGod] != null) { GUI.DrawTexture(new Rect(Screen.width * .0f, Screen.height * .0f, Screen.width * .35f, Screen.height * .3f), S.ShopControlGUIInst.CardTextures[selectedGod]); } GUIStyle cardNameStyle = new GUIStyle(S.GUIStyleLibraryInst.CustomizeStyles.CardNameStyle); cardNameStyle.fontSize = S.GUIStyleLibraryInst.CustomizeStyles.CustomizeCardNameFontSize; cardNameStyle.alignment = TextAnchor.UpperLeft; GUIStyle cardTextStyle = new GUIStyle(S.GUIStyleLibraryInst.CustomizeStyles.CardTextStyle); cardTextStyle.fontSize = S.GUIStyleLibraryInst.CustomizeStyles.CustomizeCardTextFontSize; cardTextStyle.alignment = TextAnchor.UpperLeft; if (selectedCard.God == ShopControl.Gods.Akan | selectedCard.God == ShopControl.Gods.Buluc | selectedCard.God == ShopControl.Gods.Ikka | selectedCard.God == ShopControl.Gods.Kinich | selectedCard.God == ShopControl.Gods.Chac) { cardNameStyle.normal.textColor = Color.black; cardTextStyle.normal.textColor = Color.black; } else { cardNameStyle.normal.textColor = Color.white; cardTextStyle.normal.textColor = Color.white; } GUI.Box(new Rect(Screen.width * .025f, Screen.height * .025f, Screen.width * .25f, Screen.height * .1f), selectedCard.DisplayName, cardNameStyle); Texture2D icon = Resources.Load("sprites/card icons/" + selectedCard.IconPath) as Texture2D; GUI.Box(new Rect(Screen.width * .21f, Screen.height * .025f, Screen.width * .11f, Screen.height * .11f), icon, GUIStyle.none); GUI.Box(new Rect(Screen.width * .025f, Screen.height * .1f, Screen.width * .3f, Screen.height * .15f), selectedCard.DisplayText, cardTextStyle); GUI.DrawTexture(new Rect(Screen.width * .275f, Screen.height * .25f, Screen.width * .05f, Screen.width * .05f), S.ShopControlGUIInst.GodIcons[selectedGod]); Card.Rarity rarity = selectedCard.ThisRarity; Texture2D rarityTexture = S.ShopControlGUIInst.PaperTexture; if (rarity == Card.Rarity.Bronze) { rarityTexture = S.ShopControlGUIInst.BronzeTexture; } else if (rarity == Card.Rarity.Silver) { rarityTexture = S.ShopControlGUIInst.SilverTexture; } else if (rarity == Card.Rarity.Gold) { rarityTexture = S.ShopControlGUIInst.GoldTexture; } GUI.DrawTexture(new Rect(Screen.width * .025f, Screen.height * .25f, Screen.width * .05f, Screen.width * .05f), rarityTexture); GUI.EndGroup(); } else { GUI.Box(new Rect(Screen.width * .0f, Screen.height * .585f, Screen.width * .3f, Screen.height * .3f), "Your starting deck consists of two of every card of paper rarity.\n\n" + "You can pick one unlocked card of each rarity to add to your starting deck.", S.GUIStyleLibraryInst.CustomizeStyles.InstructionInfoBox); } GUI.EndGroup(); GUIStyle gobackstyle = new GUIStyle(S.GUIStyleLibraryInst.CustomizeStyles.CardToggleRemove); gobackstyle.fontSize = 14; if (GUI.Button(new Rect(Screen.width * .3f, Screen.height * .95f, Screen.width * .4f, Screen.height * .05f), "Go back", gobackstyle)) { SaveDataControl.Save(); selectedCard = new LibraryCard(); S.MenuControlInst.TurnOnMenu(MenuControl.MenuType.MainMenu); } }
void OnGUI() { GUI.skin.verticalScrollbar = S.GUIStyleLibraryInst.MainStyles.Scrollbar; GUI.skin.verticalScrollbarThumb = S.GUIStyleLibraryInst.MainStyles.Scrollbarthumb; GUI.depth = 1; GUI.Box(new Rect(0, 0, Screen.width, Screen.height), "", S.GUIStyleLibraryInst.MainStyles.BlackBackground); GUI.depth = 0; GUI.BeginGroup(new Rect(Screen.width * .1f, Screen.height * .051f, Screen.width * .9f, Screen.height * .91f), ""); if (GUI.Button(new Rect(0, Screen.height * .81f, Screen.width * .8f, Screen.height * .1f), "Go back", S.GUIStyleLibraryInst.EncyclopediaStyles.BackButton)) { S.MenuControlInst.TurnOnMenu(MenuControl.MenuType.MainMenu); } for (int i = 0; i < TabStrings.Length; i++) { GUIStyle buttonStyle = new GUIStyle(S.GUIStyleLibraryInst.EncyclopediaStyles.TabOff); if (Tabs[i]) { buttonStyle = new GUIStyle(S.GUIStyleLibraryInst.EncyclopediaStyles.TabOn); } buttonStyle.fontSize = S.GUIStyleLibraryInst.EncyclopediaStyles.SlightlyBiggerTextFontSize; if (GUI.Button(new Rect(Screen.width * (.2f * i), 0, Screen.width * .2f, Screen.height * .09f), TabStrings[i], buttonStyle)) { shownGoals = new List <Goal>(); shownCards = new List <LibraryCard>(); FindEnemies(); selectedGoal = -1; selectedCard = -1; for (int j = 0; j < Tabs.Length; j++) { if (i == j) { Tabs[j] = true; } else { Tabs[j] = false; } } SelectedGod = -1; scrollPos = Vector2.zero; } } if (!Tabs[2] && !Tabs[3] && !Tabs[1] && !Tabs[0]) { //Intro menu GUI.Box(new Rect(Screen.width * .1f, Screen.height * .2f, Screen.width * .6f, Screen.height * .4f), "Pick a tab to learn more", S.GUIStyleLibraryInst.EncyclopediaStyles.InfoBox); } else if (Tabs[2] | Tabs[1] | Tabs[0]) { //God tabs // AllGods.Count - 2 to not show pantheon for (int i = 0; i < ShopControl.AllGods.Count - 2; i++) { GUIStyle godIconStyle = S.GUIStyleLibraryInst.EncyclopediaStyles.TabOff; if (SelectedGod == i) { godIconStyle = S.GUIStyleLibraryInst.EncyclopediaStyles.TabOn; } if (GUI.Button(new Rect(Screen.width * .8f / 7 * i, Screen.height * .1f, Screen.width * .8f / 7, Screen.height * .09f), S.ShopControlGUIInst.GodIcons[i], godIconStyle)) { SelectedGod = i; selectedCard = -1; selectedGoal = -1; FindGoals(); FindCards(); } } if (SelectedGod == -1) { GUI.Box(new Rect(Screen.width * .1f, Screen.height * .2f, Screen.width * .6f, Screen.height * .4f), "Pick a God to learn more", S.GUIStyleLibraryInst.EncyclopediaStyles.InfoBox); GUI.EndGroup(); return; } if (Tabs[0]) { string godName = ShopControl.AllGods[SelectedGod].ToString(); GUIStyle RedirectButton = new GUIStyle(S.GUIStyleLibraryInst.EncyclopediaStyles.TabOn); RedirectButton.fontSize = S.GUIStyleLibraryInst.EncyclopediaStyles.RedirectButtonFontSize; GUI.DrawTexture(new Rect(0, Screen.height * .2f, Screen.width * .38f, Screen.height * .4f), S.ShopControlGUIInst.GodFullTextures[SelectedGod]); GUIStyle GodDescription = new GUIStyle(S.GUIStyleLibraryInst.EncyclopediaStyles.NeutralButton); GodDescription.fontSize = S.GUIStyleLibraryInst.EncyclopediaStyles.GodFontDescriptionSize; GodDescription.alignment = TextAnchor.UpperLeft; GodDescription.padding = new RectOffset(12, 12, 12, 12); GUI.Box(new Rect(Screen.width * .4f, Screen.height * .2f, Screen.width * .4f, Screen.height * .4f), ShopControl.GodDescriptions[SelectedGod], GodDescription); if (GUI.Button(new Rect(0, Screen.height * .65f, Screen.width * .35f, Screen.height * .1f), "Go to " + godName + "'s Goals", RedirectButton)) { Tabs[0] = false; Tabs[1] = true; } if (GUI.Button(new Rect(Screen.width * .45f, Screen.height * .65f, Screen.width * .35f, Screen.height * .1f), "Go to " + godName + "'s cards", RedirectButton)) { Tabs[0] = false; Tabs[2] = true; } } else if (Tabs[1]) { if (shownGoals.Count == 0 && selectedGoal != -1) { FindGoals(); } scrollPos = GUI.BeginScrollView(new Rect(Screen.width * .6f, Screen.height * .2f, Screen.width * .4f, Screen.height * .59f), scrollPos, new Rect(Screen.width * .6f, Screen.height * .2f, Screen.width * .4f, Screen.height * (.1f * shownGoals.Count)), S.GUIStyleLibraryInst.MainStyles.Scrollbar, GUIStyle.none); for (int i = 0; i < shownGoals.Count; i++) { GUIStyle goalStyle = new GUIStyle(S.GUIStyleLibraryInst.EncyclopediaStyles.TabOff); if (selectedGoal == i) { goalStyle = new GUIStyle(S.GUIStyleLibraryInst.EncyclopediaStyles.TabOn); } goalStyle.fontSize = S.GUIStyleLibraryInst.EncyclopediaStyles.GoalFontSize; if (GUI.Button(new Rect(Screen.width * .6f, Screen.height * .1f * (i + 2), Screen.width * .18f, Screen.height * .1f), shownGoals[i].MiniDescription, goalStyle)) { selectedGoal = i; } } GUI.EndScrollView(); if (selectedGoal == -1) { GUI.Box(new Rect(0, Screen.height * .2f, Screen.width * .6f, Screen.height * .4f), "Pick a goal to learn more", S.GUIStyleLibraryInst.EncyclopediaStyles.InfoBox); } else { GUIStyle goalTitleStyle = new GUIStyle(S.GUIStyleLibraryInst.EncyclopediaStyles.NeutralButton); goalTitleStyle.fontSize = S.GUIStyleLibraryInst.EncyclopediaStyles.SlightlyBiggerTextFontSize; GUI.Box(new Rect(Screen.width * .1f, Screen.height * .2f, Screen.width * .4f, Screen.height * .2f), shownGoals[selectedGoal].MiniDescription, goalTitleStyle); GUI.Box(new Rect(0, Screen.height * .45f, Screen.width * .3f, Screen.height * .3f), "", S.GUIStyleLibraryInst.EncyclopediaStyles.NeutralButton); GUI.Box(new Rect(Screen.width * .02f, Screen.height * .45f, Screen.width * .2f, Screen.height * .3f), shownGoals[selectedGoal].GoalScore[0] + "\n" + shownGoals[selectedGoal].GoalScore[1] + "\n" + shownGoals[selectedGoal].GoalScore[2], S.GUIStyleLibraryInst.EncyclopediaStyles.BigText); GUI.DrawTexture(new Rect(Screen.width * .175f, Screen.height * .47f, Screen.width * .1f, Screen.height * .24f), S.ShopControlGUIInst.STOPLIGHTTEXTURE); if (SaveDataControl.GoalHighScores.ContainsKey(shownGoals[selectedGoal].MiniDescription)) { GUI.Box(new Rect(Screen.width * .3f, Screen.height * .45f, Screen.width * .3f, Screen.height * .3f), "Your high score is " + SaveDataControl.GoalHighScores[shownGoals[selectedGoal].MiniDescription].ToString(), S.GUIStyleLibraryInst.EncyclopediaStyles.NeutralButton); } else { GUI.Box(new Rect(Screen.width * .3f, Screen.height * .45f, Screen.width * .3f, Screen.height * .3f), "You don't have a high score for this goal.", S.GUIStyleLibraryInst.EncyclopediaStyles.NeutralButton); } } } else if (Tabs[2]) { if (shownCards.Count == 0 && selectedCard != -1) { FindCards(); } // NOTE: .27 was where the fat scrollbar was put in. the old version was .2? i think? scrollPos = GUI.BeginScrollView(new Rect(Screen.width * .6f, Screen.height * .2f, Screen.width * .27f, Screen.height * .6f), scrollPos, new Rect(Screen.width * .6f, Screen.height * .2f, Screen.width * .15f, Screen.height * .1f * shownCards.Count), GUIStyle.none, S.GUIStyleLibraryInst.MainStyles.Scrollbar); for (int i = 0; i < shownCards.Count; i++) { if (UnlockedCardNames.Contains(shownCards[i].CardName)) { GUIStyle CardTabStyle = new GUIStyle(S.GUIStyleLibraryInst.EncyclopediaStyles.TabOff); if (selectedCard == i) { CardTabStyle = new GUIStyle(S.GUIStyleLibraryInst.EncyclopediaStyles.TabOn); } if (shownCards[i].ThisRarity == Card.Rarity.Paper) { CardTabStyle.normal = S.GUIStyleLibraryInst.EncyclopediaStyles.NeutralButton.normal; CardTabStyle.active = S.GUIStyleLibraryInst.EncyclopediaStyles.NeutralButton.active; } if (GUI.Button(new Rect(Screen.width * .6f, Screen.height * .1f * (i + 2), Screen.width * .17f, Screen.height * .1f), shownCards[i].DisplayName, CardTabStyle)) { selectedCard = i; } } else { GUI.Box(new Rect(Screen.width * .6f, Screen.height * .1f * (i + 2), Screen.width * .17f, Screen.height * .1f), "???", S.GUIStyleLibraryInst.EncyclopediaStyles.TabOff); } } GUI.EndScrollView(); if (selectedCard == -1) { GUI.Box(new Rect(0, Screen.height * .2f, Screen.width * .6f, Screen.height * .4f), "Pick a card to learn more", S.GUIStyleLibraryInst.EncyclopediaStyles.InfoBox); } else { GUI.DrawTexture(new Rect(Screen.width * .0f, Screen.height * .2f, Screen.width * .6f, Screen.height * .6f), S.ShopControlGUIInst.CardTextures[SelectedGod]); GUIStyle cardNameStyle = new GUIStyle(S.GUIStyleLibraryInst.EncyclopediaStyles.CardNameStyle); GUIStyle cardTextStyle = new GUIStyle(S.GUIStyleLibraryInst.EncyclopediaStyles.CardTextStyle); cardTextStyle.alignment = TextAnchor.UpperLeft; cardTextStyle.fontSize = S.GUIStyleLibraryInst.EncyclopediaStyles.SlightlyBiggerTextFontSize; if (shownCards[selectedCard].God == ShopControl.Gods.Akan | shownCards[selectedCard].God == ShopControl.Gods.Buluc | shownCards[selectedCard].God == ShopControl.Gods.Ikka | shownCards[selectedCard].God == ShopControl.Gods.Kinich | shownCards[selectedCard].God == ShopControl.Gods.Chac) { cardNameStyle.normal.textColor = Color.black; cardTextStyle.normal.textColor = Color.black; } else { cardNameStyle.normal.textColor = Color.white; cardTextStyle.normal.textColor = Color.white; } GUI.Box(new Rect(Screen.width * .0f, Screen.height * .2f, Screen.width * .3f, Screen.height * .2f), shownCards[selectedCard].DisplayName, cardNameStyle); Texture2D icon = Resources.Load("sprites/card icons/" + shownCards[selectedCard].IconPath) as Texture2D; GUI.Box(new Rect(Screen.width * .325f, Screen.height * .225f, Screen.width * .25f, Screen.height * .15f), icon, GUIStyle.none); GUI.Box(new Rect(Screen.width * .045f, Screen.height * .4f, Screen.width * .53f, Screen.height * .3f), shownCards[selectedCard].DisplayText, cardTextStyle); GUI.DrawTexture(new Rect(Screen.width * .45f, Screen.height * .7f, Screen.width * .1f, Screen.width * .1f), S.ShopControlGUIInst.GodIcons[SelectedGod]); Card.Rarity rarity = shownCards[selectedCard].ThisRarity; Texture2D rarityTexture = S.ShopControlGUIInst.PaperTexture; if (rarity == Card.Rarity.Bronze) { rarityTexture = S.ShopControlGUIInst.BronzeTexture; } else if (rarity == Card.Rarity.Silver) { rarityTexture = S.ShopControlGUIInst.SilverTexture; } else if (rarity == Card.Rarity.Gold) { rarityTexture = S.ShopControlGUIInst.GoldTexture; } GUI.DrawTexture(new Rect(Screen.width * .05f, Screen.height * .7f, Screen.width * .1f, Screen.width * .1f), rarityTexture); } } } else if (Tabs[3]) { // NOTE: .87 is the spot where the fat scrollbar was added in. Old version was .8 scrollPos = GUI.BeginScrollView(new Rect(0, Screen.height * .11f, Screen.width * .87f, Screen.height * .68f), scrollPos, new Rect(0, Screen.height * .11f, Screen.width * .6f, Screen.height * .15f * allEnemies.Count)); for (int i = 0; i < allEnemies.Count; i++) { if (SaveDataControl.DefeatedEnemies.Contains(allEnemies[i].Name)) { GUI.BeginGroup(new Rect(0, Screen.height * (.15f * (i + 1) - .04f), Screen.width * .75f, Screen.height * .14f), S.GUIStyleLibraryInst.EncyclopediaStyles.NeutralButton); if (enemyPortraitTextures[i] != null) { GUI.DrawTexture(new Rect(Screen.height * .01f, Screen.height * .02f, Screen.height * .10f, Screen.height * .10f), enemyPortraitTextures[i]); } GUI.Box(new Rect(Screen.width * .21f, Screen.height * .005f, Screen.width * .38f, Screen.height * .09f), allEnemies[i].EncyclopediaEntry, S.GUIStyleLibraryInst.EncyclopediaStyles.NoneStyleWordWrap); GUI.DrawTexture(new Rect(Screen.width * .593f, Screen.width * .0325f, Screen.width * .14f, Screen.width * .14f), enemyAttackTextures[i]); GUI.Box(new Rect(Screen.width * .6f, Screen.width * .18f, Screen.width * .14f, Screen.width * .4f), "Lv. " + allEnemies[i].ChallengeRating, S.GUIStyleLibraryInst.EncyclopediaStyles.NoneStyleWordWrap); GUI.EndGroup(); } else { GUIStyle tabOffNoHover = new GUIStyle(S.GUIStyleLibraryInst.EncyclopediaStyles.TabOff); tabOffNoHover.hover = new GUIStyleState(); GUI.Box(new Rect(0, Screen.height * (.15f * (i + 1) - .04f), Screen.width * .75f, Screen.height * .14f), "???", tabOffNoHover); } } GUI.EndScrollView(); } GUI.EndGroup(); }