Exemplo n.º 1
0
        //CHANGE SKILL LEVEL
        public void skillLevelUp(GameObject _skill)
        {
            if (HeroController.mainHero.freeSkillPoints > 0)
            {
                string  _sName = _skill.name;
                A_Skill _s     = skillTree.Find(x => x.skillName == _sName);
                // skills are default level 1
                if ((_s.skillLevel + 1 <= _s.skillMaxLevel) || (!_s.isLearned && _s.skillMaxLevel == 1))
                {
                    string _availability = HeroSkillsController.getSkillAvailability(_s);

                    if (_availability.Equals("Available"))
                    {
                        HeroSkillsController.setSkillAsLearned(_s);
                        HeroSkillsController.getNewAvailableSKills(skillTree, _sName);
                        --HeroController.mainHero.freeSkillPoints;
                        visualValuesUpdated = false;
                    }
                    else if (_availability.Equals("Learned"))
                    {
                        ++_s.skillLevel;
                        refreshSkill(_skill, _sName, _s);
                        --HeroController.mainHero.freeSkillPoints;
                        visualValuesUpdated = false;
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void skillLevelUp(GameObject skillObject)
        {
            if (HeroController.mainHero.freeSkillPoints > 0)
            {
                string  skillName = skillObject.name;
                A_Skill skill     = skillTree.Find(x => x.skillName == skillName);
                // skills are default level 1
                if ((skill.skillLevel + 1 <= skill.skillMaxLevel) || (!skill.isLearned && skill.skillMaxLevel == 1))
                {
                    if (skill.isAvailableForLearning && !skill.isLearned)
                    {
                        // skill init as level 1

                        HeroSkillsController.setSkillAsLearned(skill);
                        HeroSkillsController.getNewAvailableSKills(skillTree, skillName);
                        --HeroController.mainHero.freeSkillPoints;
                        refreshSkillLevelText(skillObject, skillName, skill);
                    }
                    else if (skill.isLearned)
                    {
                        ++skill.skillLevel;
                        // skill init as level X

                        refreshSkillLevelText(skillObject, skillName, skill);
                        --HeroController.mainHero.freeSkillPoints;
                    }
                    refreshSkillLevelText(skillObject, skillName, skill);
                    skillToolTip.setToolTipGeneratedValue(false);
                    skillToolTip.generateToolTip(skill, "LoadNextLevel");
                    // cmController.getSkillPoints();     //display skillpoints
                }
            }
        }