public void ShowAbilityRewards()
        {
            //Debug.Log("ClassChangePanelController.ShowAbilityRewards()");

            ClearRewardIcons();
            // show ability rewards
            if (characterClass.AbilityList.Count > 0)
            {
                abilitiesArea.gameObject.SetActive(true);
            }
            else
            {
                abilitiesArea.gameObject.SetActive(false);
            }
            for (int i = 0; i < characterClass.AbilityList.Count; i++)
            {
                if (characterClass.AbilityList[i] != null)
                {
                    RewardButton rewardIcon = Instantiate(rewardIconPrefab, abilityIconsArea.transform).GetComponent <RewardButton>();
                    rewardIcon.SetDescribable(characterClass.AbilityList[i]);
                    abilityRewardIcons.Add(rewardIcon);
                    if (characterClass.AbilityList[i].MyRequiredLevel > PlayerManager.MyInstance.MyCharacter.CharacterStats.Level)
                    {
                        rewardIcon.StackSizeText.text    = "Level\n" + characterClass.AbilityList[i].MyRequiredLevel;
                        rewardIcon.MyHighlightIcon.color = new Color32(255, 255, 255, 80);
                    }
                }
            }
        }
        public void ShowAbilityRewards()
        {
            //Debug.Log("FactionChangePanelController.ShowAbilityRewards()");

            ClearRewardIcons();
            // show ability rewards
            // new game manager ? isn't this only in-game ?
            CapabilityProps capabilityProps = faction.GetFilteredCapabilities(newGameManager);

            if (capabilityProps.AbilityList.Count > 0)
            {
                abilitiesArea.gameObject.SetActive(true);
            }
            else
            {
                abilitiesArea.gameObject.SetActive(false);
                return;
            }
            for (int i = 0; i < capabilityProps.AbilityList.Count; i++)
            {
                RewardButton rewardIcon = objectPooler.GetPooledObject(rewardIconPrefab, abilityIconsArea.transform).GetComponent <RewardButton>();
                rewardIcon.Configure(systemGameManager);
                rewardIcon.SetOptions(rectTransform, false);
                rewardIcon.SetDescribable(capabilityProps.AbilityList[i]);
                abilityRewardIcons.Add(rewardIcon);
                if (capabilityProps.AbilityList[i].RequiredLevel > playerManager.MyCharacter.CharacterStats.Level)
                {
                    rewardIcon.StackSizeText.text  = "Level\n" + capabilityProps.AbilityList[i].RequiredLevel;
                    rewardIcon.HighlightIcon.color = new Color32(255, 255, 255, 80);
                }
                abilityRewardsGrid.AddActiveButton(rewardIcon);
            }
        }
        public void ShowTraitRewards()
        {
            //Debug.Log("ClassChangePanelController.ShowTraitRewards()");

            ClearTraitRewardIcons();
            // show trait rewards
            if (classSpecialization.TraitList.Count > 0)
            {
                traitsArea.gameObject.SetActive(true);
            }
            else
            {
                traitsArea.gameObject.SetActive(false);
            }
            for (int i = 0; i < classSpecialization.TraitList.Count; i++)
            {
                if (classSpecialization.TraitList[i] != null)
                {
                    RewardButton rewardIcon = Instantiate(rewardIconPrefab, traitIconsArea.transform).GetComponent <RewardButton>();
                    rewardIcon.SetDescribable(classSpecialization.TraitList[i]);
                    traitRewardIcons.Add(rewardIcon);
                    if ((classSpecialization.TraitList[i] as StatusEffect).MyRequiredLevel > PlayerManager.MyInstance.MyCharacter.CharacterStats.Level)
                    {
                        rewardIcon.StackSizeText.text    = "Level\n" + (classSpecialization.TraitList[i] as StatusEffect).MyRequiredLevel;
                        rewardIcon.MyHighlightIcon.color = new Color32(255, 255, 255, 80);
                    }
                }
            }
        }
        public void ShowTraitRewards()
        {
            //Debug.Log("ClassChangePanelController.ShowTraitRewards()");

            ClearTraitRewardIcons();
            // show trait rewards
            CapabilityProps capabilityProps = classSpecialization.GetFilteredCapabilities(playerManager.ActiveCharacter);

            if (capabilityProps.TraitList.Count > 0)
            {
                traitsArea.gameObject.SetActive(true);
            }
            else
            {
                traitsArea.gameObject.SetActive(false);
                return;
            }
            for (int i = 0; i < capabilityProps.TraitList.Count; i++)
            {
                if (capabilityProps.TraitList[i] != null)
                {
                    RewardButton rewardIcon = objectPooler.GetPooledObject(rewardIconPrefab, traitIconsArea.transform).GetComponent <RewardButton>();
                    rewardIcon.Configure(systemGameManager);
                    rewardIcon.SetOptions(rectTransform, false);
                    rewardIcon.SetDescribable(capabilityProps.TraitList[i]);
                    traitRewardIcons.Add(rewardIcon);
                    if ((capabilityProps.TraitList[i] as StatusEffect).RequiredLevel > playerManager.MyCharacter.CharacterStats.Level)
                    {
                        rewardIcon.StackSizeText.text  = "Level\n" + (capabilityProps.TraitList[i] as StatusEffect).RequiredLevel;
                        rewardIcon.HighlightIcon.color = new Color32(255, 255, 255, 80);
                    }
                }
            }
        }
Example #5
0
        public void ShowAbilityRewards()
        {
            //Debug.Log("FactionChangePanelController.ShowAbilityRewards()");

            ClearRewardIcons();
            // show ability rewards
            Faction faction = SystemFactionManager.MyInstance.GetResource(factionName);

            if (faction.MyLearnedAbilityList.Count > 0)
            {
                abilitiesArea.gameObject.SetActive(true);
            }
            else
            {
                abilitiesArea.gameObject.SetActive(false);
            }
            for (int i = 0; i < faction.MyLearnedAbilityList.Count; i++)
            {
                RewardButton rewardIcon = Instantiate(rewardIconPrefab, abilityIconsArea.transform).GetComponent <RewardButton>();
                rewardIcon.SetDescribable(SystemAbilityManager.MyInstance.GetResource(faction.MyLearnedAbilityList[i]));
                abilityRewardIcons.Add(rewardIcon);
                if (SystemAbilityManager.MyInstance.GetResource(faction.MyLearnedAbilityList[i]).MyRequiredLevel > PlayerManager.MyInstance.MyCharacter.MyCharacterStats.MyLevel)
                {
                    rewardIcon.MyStackSizeText.text  = "Level\n" + SystemAbilityManager.MyInstance.GetResource(faction.MyLearnedAbilityList[i]).MyRequiredLevel;
                    rewardIcon.MyHighlightIcon.color = new Color32(255, 255, 255, 80);
                }
            }
        }
        public void ShowTraitRewards()
        {
            //Debug.Log("ClassChangePanelController.ShowTraitRewards()");

            ClearTraitRewardIcons();
            // show trait rewards
            CapabilityProps capabilityProps = characterClass.GetFilteredCapabilities(playerManager.ActiveCharacter);

            if (playerManager.MyCharacter.Faction != null)
            {
                CapabilityConsumerSnapshot capabilityConsumerSnapshot = new CapabilityConsumerSnapshot(playerManager.ActiveCharacter, systemGameManager);
                capabilityConsumerSnapshot.CharacterClass = characterClass;
                CapabilityProps capabilityPropsFaction = playerManager.MyCharacter.Faction.GetFilteredCapabilities(capabilityConsumerSnapshot, false);
                capabilityProps = capabilityPropsFaction.Join(capabilityProps);
            }

            List <StatusEffect> traitList = capabilityProps.TraitList.Distinct().ToList();

            if (traitList.Count > 0)
            {
                traitsArea.gameObject.SetActive(true);
            }
            else
            {
                traitsArea.gameObject.SetActive(false);
                return;
            }
            for (int i = 0; i < traitList.Count; i++)
            {
                if (traitList[i] != null)
                {
                    RewardButton rewardIcon = objectPooler.GetPooledObject(rewardIconPrefab, traitIconsArea.transform).GetComponent <RewardButton>();
                    rewardIcon.Configure(systemGameManager);
                    rewardIcon.SetOptions(rectTransform, false);
                    rewardIcon.SetDescribable(traitList[i]);
                    traitRewardIcons.Add(rewardIcon);
                    if (traitList[i].RequiredLevel > playerManager.MyCharacter.CharacterStats.Level)
                    {
                        rewardIcon.StackSizeText.text  = "Level\n" + traitList[i].RequiredLevel;
                        rewardIcon.HighlightIcon.color = new Color32(255, 255, 255, 80);
                    }
                    uINavigationControllers[1].AddActiveButton(rewardIcon);
                }
            }
        }
        public void ShowAbilityRewards()
        {
            //Debug.Log("ClassChangePanelController.ShowAbilityRewards()");

            ClearRewardIcons();
            // show ability rewards
            CapabilityProps capabilityProps = characterClass.GetFilteredCapabilities(PlayerManager.MyInstance.ActiveCharacter);

            if (PlayerManager.MyInstance.MyCharacter.Faction != null)
            {
                CapabilityConsumerSnapshot capabilityConsumerSnapshot = new CapabilityConsumerSnapshot(PlayerManager.MyInstance.ActiveCharacter);
                capabilityConsumerSnapshot.CharacterClass = characterClass;
                CapabilityProps capabilityPropsFaction = PlayerManager.MyInstance.MyCharacter.Faction.GetFilteredCapabilities(capabilityConsumerSnapshot, false);
                capabilityProps = capabilityPropsFaction.Join(capabilityProps);
            }
            List <BaseAbility> abilityList = capabilityProps.AbilityList.Distinct().ToList();

            if (abilityList.Count > 0)
            {
                abilitiesArea.gameObject.SetActive(true);
            }
            else
            {
                abilitiesArea.gameObject.SetActive(false);
                return;
            }
            for (int i = 0; i < abilityList.Count; i++)
            {
                if (abilityList[i] != null)
                {
                    RewardButton rewardIcon = Instantiate(rewardIconPrefab, abilityIconsArea.transform).GetComponent <RewardButton>();
                    rewardIcon.SetDescribable(abilityList[i]);
                    abilityRewardIcons.Add(rewardIcon);
                    if (abilityList[i].RequiredLevel > PlayerManager.MyInstance.MyCharacter.CharacterStats.Level)
                    {
                        rewardIcon.StackSizeText.text    = "Level\n" + abilityList[i].RequiredLevel;
                        rewardIcon.MyHighlightIcon.color = new Color32(255, 255, 255, 80);
                    }
                }
            }
        }
        public void ShowDescription(Quest quest)
        {
            //Debug.Log("QuestDetailsArea.ShowDescription()");

            ClearDescription();

            if (quest == null)
            {
                return;
            }
            this.quest = quest;

            questDescription.text = quest.GetObjectiveDescription();

            experienceReward.text += quest.MyExperienceReward + " XP";

            // show item rewards
            if (quest.MyItemRewards.Count > 0)
            {
                itemsHeading.gameObject.SetActive(true);
                if (quest.MyMaxItemRewards > 0)
                {
                    itemsHeading.GetComponent <Text>().text = "Choose " + quest.MyMaxItemRewards + " Item Rewards:";
                }
                else
                {
                    itemsHeading.GetComponent <Text>().text = "Item Rewards:";
                }
            }
            for (int i = 0; i < quest.MyItemRewards.Count; i++)
            {
                RewardButton rewardIcon = Instantiate(rewardIconPrefab, itemIconsArea.transform).GetComponent <RewardButton>();
                rewardIcon.OnAttempSelect += HandleAttemptSelect;
                //Debug.Log("QuestDetailsArea.ShowDescription(): setting describable (and attemptselect) for: " + quest.MyItemRewards[i]);
                rewardIcon.SetDescribable(quest.MyItemRewards[i]);
                itemRewardIcons.Add(rewardIcon);
            }

            // show ability rewards
            if (quest.MyAbilityRewards.Count > 0)
            {
                abilitiesHeading.gameObject.SetActive(true);
                if (quest.MyMaxAbilityRewards > 0)
                {
                    abilitiesHeading.GetComponent <Text>().text = "Choose " + quest.MyMaxAbilityRewards + " Ability Rewards:";
                }
                else
                {
                    abilitiesHeading.GetComponent <Text>().text = "Ability Rewards:";
                }
            }
            else
            {
                abilitiesHeading.GetComponent <Text>().text = "";
            }
            for (int i = 0; i < quest.MyAbilityRewards.Count; i++)
            {
                RewardButton rewardIcon = Instantiate(rewardIconPrefab, abilityIconsArea.transform).GetComponent <RewardButton>();
                rewardIcon.OnAttempSelect += HandleAttemptSelect;
                //Debug.Log("QuestDetailsArea.ShowDescription(): setting describable (and attemptselect) for: " + quest.MyAbilityRewards[i]);
                rewardIcon.SetDescribable(quest.MyAbilityRewards[i]);
                abilityRewardIcons.Add(rewardIcon);
            }

            // show faction rewards
            if (quest.MyFactionRewards.Count > 0)
            {
                factionsHeading.gameObject.SetActive(true);
                if (quest.MyMaxFactionRewards > 0)
                {
                    factionsHeading.GetComponent <Text>().text = "Choose " + quest.MyMaxFactionRewards + " Reputation Rewards:";
                }
                else
                {
                    factionsHeading.GetComponent <Text>().text = "Reputation Rewards:";
                }
            }
            else
            {
                factionsHeading.GetComponent <Text>().text = "";
            }
            for (int i = 0; i < quest.MyFactionRewards.Count; i++)
            {
                RewardButton rewardIcon = Instantiate(rewardIconPrefab, factionIconsArea.transform).GetComponent <RewardButton>();
                rewardIcon.OnAttempSelect += HandleAttemptSelect;
                //Debug.Log("QuestDetailsArea.ShowDescription(): setting describable (and attemptselect) for: " + quest.MyFactionRewards[i]);
                rewardIcon.SetDescribable(quest.MyFactionRewards[i]);
                factionRewardIcons.Add(rewardIcon);
            }

            // show Skill rewards
            if (quest.MySkillRewards.Count > 0)
            {
                skillHeading.gameObject.SetActive(true);
                if (quest.MyMaxSkillRewards > 0)
                {
                    skillHeading.GetComponent <Text>().text = "Choose " + quest.MyMaxSkillRewards + " Skill Rewards:";
                }
                else
                {
                    skillHeading.GetComponent <Text>().text = "Skill Rewards:";
                }
            }
            else
            {
                skillHeading.GetComponent <Text>().text = "";
            }
            for (int i = 0; i < quest.MySkillRewards.Count; i++)
            {
                RewardButton rewardIcon = Instantiate(rewardIconPrefab, skillIconsArea.transform).GetComponent <RewardButton>();
                rewardIcon.SetDescribable(quest.MySkillRewards[i]);
                skillRewardIcons.Add(rewardIcon);
            }
        }
        public void ShowDescription(Quest quest)
        {
            //Debug.Log("QuestDetailsArea.ShowDescription()");

            ClearDescription();

            if (quest == null)
            {
                return;
            }
            this.quest = quest;

            questDescription.text = quest.GetObjectiveDescription();

            experienceReward.text += LevelEquations.GetXPAmountForQuest(playerManager.MyCharacter.CharacterStats.Level, quest, systemConfigurationManager) + " XP";

            // display currency rewards

            List <CurrencyNode> currencyNodes = quest.GetCurrencyReward();

            // currencies could be different
            if (currencyNodes.Count > 0)
            {
                currencyHeading.gameObject.SetActive(true);
                currencyArea.gameObject.SetActive(true);
                if (currencyLootButton != null)
                {
                    KeyValuePair <Sprite, string> keyValuePair = currencyConverter.RecalculateValues(currencyNodes, true);
                    currencyLootButton.Icon.sprite = keyValuePair.Key;
                    currencyLootButton.Title.text  = keyValuePair.Value;
                }
            }
            else
            {
                currencyHeading.gameObject.SetActive(false);
                currencyArea.gameObject.SetActive(false);
            }


            // show item rewards
            if (quest.ItemRewards.Count > 0)
            {
                itemsHeading.gameObject.SetActive(true);
                if (quest.MaxItemRewards > 0)
                {
                    itemsHeading.GetComponent <TextMeshProUGUI>().text = "Choose " + quest.MaxItemRewards + " Item Rewards:";
                }
                else
                {
                    itemsHeading.GetComponent <TextMeshProUGUI>().text = "Item Rewards:";
                }
            }
            for (int i = 0; i < quest.ItemRewards.Count; i++)
            {
                RewardButton rewardIcon = objectPooler.GetPooledObject(rewardIconPrefab, itemIconsArea.transform).GetComponent <RewardButton>();
                rewardIcon.Configure(systemGameManager);
                rewardIcon.SetOptions(owner.RectTransform, quest.MaxItemRewards > 0);
                rewardIcon.OnAttempSelect += HandleAttemptSelect;
                //Debug.Log("QuestDetailsArea.ShowDescription(): setting describable (and attemptselect) for: " + quest.MyItemRewards[i]);
                rewardIcon.SetDescribable(quest.ItemRewards[i]);
                itemRewardIcons.Add(rewardIcon);
                //if (quest.MaxItemRewards > 0) {
                itemGrid.AddActiveButton(rewardIcon);
                //}
            }

            // show ability rewards
            if (quest.AbilityRewards.Count > 0)
            {
                abilitiesHeading.gameObject.SetActive(true);
                if (quest.MaxAbilityRewards > 0)
                {
                    abilitiesHeading.GetComponent <TextMeshProUGUI>().text = "Choose " + quest.MaxAbilityRewards + " Ability Rewards:";
                }
                else
                {
                    abilitiesHeading.GetComponent <TextMeshProUGUI>().text = "Ability Rewards:";
                }
            }
            else
            {
                abilitiesHeading.GetComponent <TextMeshProUGUI>().text = "";
            }
            for (int i = 0; i < quest.AbilityRewards.Count; i++)
            {
                RewardButton rewardIcon = objectPooler.GetPooledObject(rewardIconPrefab, abilityIconsArea.transform).GetComponent <RewardButton>();
                rewardIcon.Configure(systemGameManager);
                rewardIcon.SetOptions(owner.RectTransform, quest.MaxAbilityRewards > 0);
                rewardIcon.OnAttempSelect += HandleAttemptSelect;
                //Debug.Log("QuestDetailsArea.ShowDescription(): setting describable (and attemptselect) for: " + quest.MyAbilityRewards[i]);
                rewardIcon.SetDescribable(quest.AbilityRewards[i]);
                abilityRewardIcons.Add(rewardIcon);
                //if (quest.MaxAbilityRewards > 0) {
                abilityGrid.AddActiveButton(rewardIcon);
                //}
            }

            // show faction rewards
            if (quest.FactionRewards.Count > 0)
            {
                factionsHeading.gameObject.SetActive(true);
                if (quest.MaxFactionRewards > 0)
                {
                    factionsHeading.GetComponent <TextMeshProUGUI>().text = "Choose " + quest.MaxFactionRewards + " Reputation Rewards:";
                }
                else
                {
                    factionsHeading.GetComponent <TextMeshProUGUI>().text = "Reputation Rewards:";
                }
            }
            else
            {
                factionsHeading.GetComponent <TextMeshProUGUI>().text = "";
            }
            for (int i = 0; i < quest.FactionRewards.Count; i++)
            {
                FactionRewardButton rewardIcon = objectPooler.GetPooledObject(factionRewardIconPrefab, factionIconsArea.transform).GetComponent <FactionRewardButton>();
                rewardIcon.Configure(systemGameManager);
                rewardIcon.SetOptions(owner.RectTransform, quest.MaxFactionRewards > 0);
                rewardIcon.OnAttempSelect += HandleAttemptSelect;
                //Debug.Log("QuestDetailsArea.ShowDescription(): setting describable (and attemptselect) for: " + quest.MyFactionRewards[i]);
                rewardIcon.SetDescribable(quest.FactionRewards[i]);
                factionRewardIcons.Add(rewardIcon);
                //if (quest.MaxFactionRewards > 0) {
                factionGrid.AddActiveButton(rewardIcon);
                //}
            }

            // show Skill rewards
            if (quest.SkillRewards.Count > 0)
            {
                skillHeading.gameObject.SetActive(true);
                if (quest.MaxSkillRewards > 0)
                {
                    skillHeading.GetComponent <TextMeshProUGUI>().text = "Choose " + quest.MaxSkillRewards + " Skill Rewards:";
                }
                else
                {
                    skillHeading.GetComponent <TextMeshProUGUI>().text = "Skill Rewards:";
                }
            }
            else
            {
                skillHeading.GetComponent <TextMeshProUGUI>().text = "";
            }
            for (int i = 0; i < quest.SkillRewards.Count; i++)
            {
                RewardButton rewardIcon = objectPooler.GetPooledObject(rewardIconPrefab, skillIconsArea.transform).GetComponent <RewardButton>();
                rewardIcon.Configure(systemGameManager);
                rewardIcon.SetOptions(owner.RectTransform, quest.MaxSkillRewards > 0);
                rewardIcon.SetDescribable(quest.SkillRewards[i]);
                skillRewardIcons.Add(rewardIcon);
                //if (quest.MaxSkillRewards > 0) {
                skillGrid.AddActiveButton(rewardIcon);
                //}
            }
        }