Exemplo n.º 1
0
        public void ShowAbilityRewards()
        {
            //Debug.Log("ClassChangePanelController.ShowAbilityRewards()");

            ClearRewardIcons();
            // show ability rewards
            if (characterClass != null && characterClass.GetFilteredCapabilities(NewGamePanel.MyInstance).AbilityList.Count > 0)
            {
                CapabilityProps capabilityProps = characterClass.GetFilteredCapabilities(NewGamePanel.MyInstance);
                abilityLabel.SetActive(true);
                abilityLabel.transform.SetAsFirstSibling();
                for (int i = 0; i < capabilityProps.AbilityList.Count; i++)
                {
                    if (capabilityProps.AbilityList[i] != null)
                    {
                        NewGameAbilityButton rewardIcon = Instantiate(rewardIconPrefab, abilityButtonArea.transform).GetComponent <NewGameAbilityButton>();
                        rewardIcon.AddAbility(capabilityProps.AbilityList[i]);
                        abilityRewardIcons.Add(rewardIcon);

                        /*
                         * if (characterClass.AbilityList[i].MyRequiredLevel > 1) {
                         *  rewardIcon.StackSizeText.text = "Level\n" + characterClass.AbilityList[i].MyRequiredLevel;
                         *  rewardIcon.MyHighlightIcon.color = new Color32(255, 255, 255, 80);
                         * }
                         */
                    }
                }
            }
            else
            {
                abilityLabel.SetActive(false);
            }
        }
        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 ShowAbilityRewards()
        {
            //Debug.Log("FactionChangePanelController.ShowAbilityRewards()");

            ClearRewardIcons();
            // show ability rewards
            CapabilityProps capabilityProps = faction.GetFilteredCapabilities(NewGamePanel.MyInstance);

            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 = Instantiate(rewardIconPrefab, abilityIconsArea.transform).GetComponent <RewardButton>();
                rewardIcon.SetDescribable(capabilityProps.AbilityList[i]);
                abilityRewardIcons.Add(rewardIcon);
                if (capabilityProps.AbilityList[i].RequiredLevel > PlayerManager.MyInstance.MyCharacter.CharacterStats.Level)
                {
                    rewardIcon.StackSizeText.text    = "Level\n" + capabilityProps.AbilityList[i].RequiredLevel;
                    rewardIcon.MyHighlightIcon.color = new Color32(255, 255, 255, 80);
                }
            }
        }
Exemplo n.º 4
0
        public void ShowTraitRewards()
        {
            //Debug.Log("ClassChangePanelController.ShowTraitRewards()");

            ClearTraitRewardIcons();
            // show trait rewards
            if (characterClass != null && characterClass.GetFilteredCapabilities(NewGamePanel.MyInstance).TraitList.Count > 0)
            {
                CapabilityProps capabilityProps = characterClass.GetFilteredCapabilities(NewGamePanel.MyInstance);
                traitLabel.SetActive(true);
                // move to bottom of list before putting traits below it
                traitLabel.transform.SetAsLastSibling();
                for (int i = 0; i < capabilityProps.TraitList.Count; i++)
                {
                    if (capabilityProps.TraitList[i] != null)
                    {
                        NewGameAbilityButton rewardIcon = Instantiate(rewardIconPrefab, abilityButtonArea.transform).GetComponent <NewGameAbilityButton>();
                        rewardIcon.AddAbility(capabilityProps.TraitList[i]);
                        traitRewardIcons.Add(rewardIcon);

                        /*
                         * if ((characterClass.TraitList[i] as StatusEffect).MyRequiredLevel > 1) {
                         *  rewardIcon.StackSizeText.text = "Level\n" + (characterClass.TraitList[i] as StatusEffect).MyRequiredLevel;
                         *  rewardIcon.MyHighlightIcon.color = new Color32(255, 255, 255, 80);
                         * }
                         */
                    }
                }
            }
            else
            {
                traitLabel.SetActive(false);
            }
        }
        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);
                    }
                }
            }
        }
 /// <summary>
 /// query a capability consumer's capability providers for an armor class
 /// </summary>
 /// <param name="armor"></param>
 /// <returns></returns>
 public bool IsArmorSupported(Armor armor)
 {
     foreach (ICapabilityProvider capabilityProvider in capabilityProviders)
     {
         CapabilityProps capabilityProps = capabilityProvider.GetFilteredCapabilities(capabilityConsumer);
         if (capabilityProps.ArmorClassList.Contains(armor.ArmorClass.DisplayName))
         {
             return(true);
         }
     }
     return(false);
 }
 public bool IsWeaponSkillSupported(WeaponSkill weaponSkill)
 {
     foreach (ICapabilityProvider capabilityProvider in capabilityProviders)
     {
         CapabilityProps capabilityProps = capabilityProvider.GetFilteredCapabilities(capabilityConsumer);
         if (capabilityProps.WeaponSkillList.Contains(weaponSkill))
         {
             return(true);
         }
     }
     return(false);
 }
        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);
                    }
                }
            }
        }