Beispiel #1
0
    //Find out which skill it is based on the button name
    void FindSkill()
    {
        if (skillClicked.name == "Fire")
        {
            thisSkillStat = playerSkills.fire;
        }
        else if (skillClicked.name == "Water")
        {
            thisSkillStat = playerSkills.water;
        }
        else if (skillClicked.name == "Earth")
        {
            thisSkillStat = playerSkills.earth;
        }
        else if (skillClicked.name == "Air")
        {
            thisSkillStat = playerSkills.air;
        }
        else if (skillClicked.name == "Animal")
        {
            thisSkillStat = playerSkills.animal;
        }
        else
        {
            thisSkillStat = playerSkills.potions;
        }

        return;
    }
 void CheckWhichToIncrease(Skills.SkillStats thisClass)
 {
     //If it is the first year, max class level is 5
     if (clock.years == 1)
     {
         if (thisClass.max < 5)
         {
             IncreaseStats(thisClass, 5, true);
         }
         else if (thisClass.max == 5)
         {
             IncreaseStats(thisClass, 5, false);
         }
     }
 }
Beispiel #3
0
    //Create the individual stats
    private Skills.SkillStats CreateStats(Skills.SkillStats stat)
    {
        stat.max         = 1;
        stat.maxEXP      = 0;
        stat.level       = 1;
        stat.levelEXP    = 0;
        stat.skillPoints = 0;
        stat.skill1      = 1;
        stat.skill2a     = 0;
        stat.skill2b     = 0;
        stat.skill3a     = 0;
        stat.skill3b     = 0;
        stat.skill3c     = 0;
        stat.skill4a     = 0;
        stat.skill4b     = 0;
        stat.skill5      = 0;

        return(stat);
    }
 void IncreaseStats(Skills.SkillStats thisClass, int max, bool lessThan)
 {
     //If the max skill level isn't yet equal to the max for that year, increase only the max skill level
     if (lessThan)
     {
         thisClass.maxEXP += increaseByMax;
         if (thisClass.maxEXP >= 100)
         {
             thisClass.maxEXP -= 100;
             thisClass.max    += 1;
             if (thisClass.max == max)
             {
                 thisClass.maxEXP = 0;
             }
         }
     }
     //Increase skill points if max level is maxed and skill level isn't maxed
     else if (thisClass.level < thisClass.max)
     {
         thisClass.levelEXP += increaseByLevel;
         //Level Up!!
         if (thisClass.levelEXP >= 100)
         {
             thisClass.levelEXP    -= 100;
             thisClass.level       += 1;
             thisClass.skillPoints += 1;
             if (thisClass.level == thisClass.max)
             {
                 thisClass.levelEXP = 0;
             }
         }
     }
     else
     {
         Debug.Log("Max level reached!");
     }
 }
Beispiel #5
0
    public void UpdateHoverText()
    {
        //Find the skill we are working with
        playerSkills = skillMaster.GetComponent <SkillMaster>().playerSkills.playerSkills;

        //Display different text depending on which skill
        //1ST - Fire skills
        if (this.name == "Fireball")
        {
            thisSkillStat = playerSkills.fire;
            skillToCheck  = thisSkillStat.skill1;
            description.GetComponent <Text>().text  = "Fireball\nBasic Fire Attack";
            currentLevel.GetComponent <Text>().text = "Current Level: " + skillToCheck;
            //Check the level of the skill and adjust text accordingly
            if (skillToCheck == 1)
            {
                currentLevel.GetComponent <Text>().text += "\nlevel 1 skills here";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\nlevel 2 skills here";
            }
            else if (skillToCheck == 2)
            {
                currentLevel.GetComponent <Text>().text += "\nlevel 2 skills here";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\nlevel 3 skills here";
            }
            else if (skillToCheck == 3)
            {
                currentLevel.GetComponent <Text>().text += "\nlevel 3 skills here";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\nlevel 4 skills here";
            }
            else
            {
                currentLevel.GetComponent <Text>().text += "\nlevel 4 skills here";

                nextLevel.GetComponent <Text>().text = "Max level reached!";
            }

            levelAmount.GetComponent <Text>().text = "Level " + skillToCheck + "/4";
        }
        else if (this.name == "Flame Barrier")
        {
            thisSkillStat = playerSkills.fire;
            skillToCheck  = thisSkillStat.skill2a;
            description.GetComponent <Text>().text  = "Flame Barrier\nInflict dmg on opponent when hit";
            currentLevel.GetComponent <Text>().text = "Current Level: " + skillToCheck;
            //Check the level of the skill and adjust text accordingly
            if (skillToCheck == 0)
            {
                currentLevel.GetComponent <Text>().text += "\nReq: Fireball Lv2";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\nlevel 1 skills here";
            }
            else if (skillToCheck == 1)
            {
                currentLevel.GetComponent <Text>().text += "\nlevel 1 skills here";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\nlevel 2 skills here";
            }
            else if (skillToCheck == 2)
            {
                currentLevel.GetComponent <Text>().text += "\nlevel 2 skills here";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\nlevel 3 skills here";
            }
            else if (skillToCheck == 3)
            {
                currentLevel.GetComponent <Text>().text += "\nlevel 3 skills here";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\nlevel 4 skills here";
            }
            else
            {
                currentLevel.GetComponent <Text>().text += "\nlevel 4 skills here";

                nextLevel.GetComponent <Text>().text = "Max level reached!";
            }

            levelAmount.GetComponent <Text>().text = "Level " + skillToCheck + "/4";
        }
        else if (this.name == "Quick Cast Fire")
        {
            thisSkillStat = playerSkills.fire;
            skillToCheck  = thisSkillStat.skill2b;
            description.GetComponent <Text>().text  = "Quick Fire Cast\nCast fire more quickly.";
            currentLevel.GetComponent <Text>().text = "Current Level: " + skillToCheck;
            //Check the level of the skill and adjust text accordingly
            if (skillToCheck == 0)
            {
                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\n1.5x Speed";
            }
            else if (skillToCheck == 1)
            {
                currentLevel.GetComponent <Text>().text += "\n1.5x Speed";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\n2x Speed";
            }
            else
            {
                currentLevel.GetComponent <Text>().text += "\n2x Speed";

                nextLevel.GetComponent <Text>().text = "Max level reached!";
            }

            levelAmount.GetComponent <Text>().text = "Level " + skillToCheck + "/2";
        }
        else if (this.name == "Sparks")
        {
            thisSkillStat = playerSkills.fire;
            skillToCheck  = thisSkillStat.skill3a;
            description.GetComponent <Text>().text  = "Sparks\nIncrease Fire Damage";
            currentLevel.GetComponent <Text>().text = "Current Level: " + skillToCheck;
            //Check the level of the skill and adjust text accordingly
            if (skillToCheck == 0)
            {
                currentLevel.GetComponent <Text>().text += "\nReq: Flame Barrier Lv2";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\n1.5x Fire Dmg";
            }
            else if (skillToCheck == 1)
            {
                currentLevel.GetComponent <Text>().text += "\n1.5x Fire Dmg";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\n2x Fire Dmg";
            }
            else
            {
                currentLevel.GetComponent <Text>().text += "\n2x Fire Dmg";

                nextLevel.GetComponent <Text>().text = "Max level reached!";
            }

            levelAmount.GetComponent <Text>().text = "Level " + skillToCheck + "/2";
        }
        else if (this.name == "Dynamite")
        {
            thisSkillStat = playerSkills.fire;
            skillToCheck  = thisSkillStat.skill3b;
            description.GetComponent <Text>().text  = "Dynamite\nIncrease Mining Range";
            currentLevel.GetComponent <Text>().text = "Current Level: " + skillToCheck;
            //Check the level of the skill and adjust text accordingly
            if (skillToCheck == 0)
            {
                currentLevel.GetComponent <Text>().text += "\nReq: Flame Barrier Lv1, Quick Cast Fire Lv1";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\nlevel 1 skills here";
            }
            else if (skillToCheck == 1)
            {
                currentLevel.GetComponent <Text>().text += "\nlevel 1 skills here";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\nlevel 2 skills here";
            }
            else if (skillToCheck == 2)
            {
                currentLevel.GetComponent <Text>().text += "\nlevel 2 skills here";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\nlevel 3 skills here";
            }
            else if (skillToCheck == 3)
            {
                currentLevel.GetComponent <Text>().text += "\nlevel 3 skills here";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\nlevel 4 skills here";
            }
            else if (skillToCheck == 4)
            {
                currentLevel.GetComponent <Text>().text += "\nlevel 4 skills here";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\nlevel 5 skills here";
            }
            else
            {
                currentLevel.GetComponent <Text>().text += "\nlevel 5 skills here";

                nextLevel.GetComponent <Text>().text = "Max level reached!";
            }

            levelAmount.GetComponent <Text>().text = "Level " + skillToCheck + "/5";
        }
        else if (this.name == "Fireworks")
        {
            thisSkillStat = playerSkills.fire;
            skillToCheck  = thisSkillStat.skill3c;
            description.GetComponent <Text>().text  = "Fireworks\nIncrease Mine Yield";
            currentLevel.GetComponent <Text>().text = "Current Level: " + skillToCheck;
            //Check the level of the skill and adjust text accordingly
            if (skillToCheck == 0)
            {
                currentLevel.GetComponent <Text>().text += "\nReq: Quick Cast Fire Lv2";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\nlevel 1 skills here";
            }
            else if (skillToCheck == 1)
            {
                currentLevel.GetComponent <Text>().text += "\nlevel 1 skills here";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\nlevel 2 skills here";
            }
            else if (skillToCheck == 2)
            {
                currentLevel.GetComponent <Text>().text += "\nlevel 2 skills here";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\nlevel 3 skills here";
            }
            else if (skillToCheck == 3)
            {
                currentLevel.GetComponent <Text>().text += "\nlevel 3 skills here";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\nlevel 4 skills here";
            }
            else if (skillToCheck == 4)
            {
                currentLevel.GetComponent <Text>().text += "\nlevel 4 skills here";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\nlevel 5 skills here";
            }
            else
            {
                currentLevel.GetComponent <Text>().text += "\nlevel 5 skills here";

                nextLevel.GetComponent <Text>().text = "Max level reached!";
            }

            levelAmount.GetComponent <Text>().text = "Level " + skillToCheck + "/5";
        }
        else if (this.name == "Mine Teleport")
        {
            thisSkillStat = playerSkills.fire;
            skillToCheck  = thisSkillStat.skill4a;
            description.GetComponent <Text>().text  = "Mine Teleport\nTeleport to the Mine";
            currentLevel.GetComponent <Text>().text = "Current Level: " + skillToCheck;
            //Check the level of the skill and adjust text accordingly
            if (skillToCheck == 0)
            {
                currentLevel.GetComponent <Text>().text += "\nReq: Sparks Lv2";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\nTeleport to mine";
            }
            else
            {
                currentLevel.GetComponent <Text>().text += "\nTeleport to mine";

                nextLevel.GetComponent <Text>().text = "Max level reached!";
            }

            levelAmount.GetComponent <Text>().text = "Level " + skillToCheck + "/1";
        }
        else if (this.name == "Flame Spirit")
        {
            thisSkillStat = playerSkills.fire;
            skillToCheck  = thisSkillStat.skill4b;
            description.GetComponent <Text>().text  = "Flame Spirit\nIncrease Tomorrow's Mine Nodes";
            currentLevel.GetComponent <Text>().text = "Current Level: " + skillToCheck;
            //Check the level of the skill and adjust text accordingly
            if (skillToCheck == 0)
            {
                currentLevel.GetComponent <Text>().text += "\nReq: Dynamite Lv5, Fireworks Lv5";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\nMine Nodes Increase";
            }
            else
            {
                currentLevel.GetComponent <Text>().text += "\nMine Nodes Increase";

                nextLevel.GetComponent <Text>().text = "Max level reached!";
            }

            levelAmount.GetComponent <Text>().text = "Level " + skillToCheck + "/1";
        }
        else if (this.name == "Volcano")
        {
            thisSkillStat = playerSkills.fire;
            skillToCheck  = thisSkillStat.skill5;
            description.GetComponent <Text>().text  = "Volcano\nBig Fire Attack";
            currentLevel.GetComponent <Text>().text = "Current Level: " + skillToCheck;
            //Check the level of the skill and adjust text accordingly
            if (skillToCheck == 0)
            {
                currentLevel.GetComponent <Text>().text += "\nReq: Mine Teleport Lv1, Flame Spirit Lv1";

                nextLevel.GetComponent <Text>().text = "Next Level: " + (skillToCheck + 1) + "\nBig fire attack";
            }
            else
            {
                currentLevel.GetComponent <Text>().text += "\nBig fire attack";

                nextLevel.GetComponent <Text>().text = "Max level reached!";
            }

            levelAmount.GetComponent <Text>().text = "Level " + skillToCheck + "/1";
        }
    }
    public void AllocateSkillPoints()
    {
        //Find the skill we are working with
        playerSkills = skillMaster.GetComponent <SkillMaster>().playerSkills.playerSkills;

        if (this.name == "Fireball")
        {
            thisSkillStat = playerSkills.fire;

            //Check if there are any skill points first
            if (thisSkillStat.skillPoints == 0)
            {
                return;
            }
            else
            {
                skillToCheck = thisSkillStat.skill1;
                //Check if the skill points allocated are less than max
                if (skillToCheck < 4)
                {
                    thisSkillStat.skill1++;
                    thisSkillStat.skillPoints--;
                    this.GetComponentInParent <SkillChanger>().UpdateChanges();
                    this.GetComponent <HoverText>().UpdateHoverText();
                    return;
                }
                else
                {
                    return;
                }
            }
        }
        else if (this.name == "Flame Barrier")
        {
            thisSkillStat = playerSkills.fire;

            //Check if there are any skill points first
            if (thisSkillStat.skillPoints == 0)
            {
                return;
            }
            else
            {
                skillToCheck = thisSkillStat.skill2a;
                //Check if prereq is met
                if (thisSkillStat.skill1 < 2)
                {
                    return;
                }
                //Check if the skill points allocated are less than max
                else if (skillToCheck < 4)
                {
                    thisSkillStat.skill2a++;
                    thisSkillStat.skillPoints--;
                    this.GetComponentInParent <SkillChanger>().UpdateChanges();
                    this.GetComponent <HoverText>().UpdateHoverText();
                    return;
                }
                else
                {
                    return;
                }
            }
        }
        else if (this.name == "Quick Cast Fire")
        {
            thisSkillStat = playerSkills.fire;

            //Check if there are any skill points first
            if (thisSkillStat.skillPoints == 0)
            {
                return;
            }
            else
            {
                skillToCheck = thisSkillStat.skill2b;
                //Check if the skill points allocated are less than max
                if (skillToCheck < 2)
                {
                    thisSkillStat.skill2b++;
                    thisSkillStat.skillPoints--;
                    this.GetComponentInParent <SkillChanger>().UpdateChanges();
                    this.GetComponent <HoverText>().UpdateHoverText();
                    return;
                }
                else
                {
                    return;
                }
            }
        }
        else if (this.name == "Sparks")
        {
            thisSkillStat = playerSkills.fire;

            //Check if there are any skill points first
            if (thisSkillStat.skillPoints == 0)
            {
                return;
            }
            else
            {
                skillToCheck = thisSkillStat.skill3a;
                //Check if prereq is met
                if (thisSkillStat.skill2a < 2)
                {
                    return;
                }
                //Check if the skill points allocated are less than max
                else if (skillToCheck < 2)
                {
                    thisSkillStat.skill3a++;
                    thisSkillStat.skillPoints--;
                    this.GetComponentInParent <SkillChanger>().UpdateChanges();
                    this.GetComponent <HoverText>().UpdateHoverText();
                    return;
                }
                else
                {
                    return;
                }
            }
        }
        else if (this.name == "Dynamite")
        {
            thisSkillStat = playerSkills.fire;

            //Check if there are any skill points first
            if (thisSkillStat.skillPoints == 0)
            {
                return;
            }
            else
            {
                skillToCheck = thisSkillStat.skill3b;
                //Check if prereq is met
                if (thisSkillStat.skill2a < 1 || thisSkillStat.skill2b < 1)
                {
                    return;
                }
                //Check if the skill points allocated are less than max
                else if (skillToCheck < 5)
                {
                    thisSkillStat.skill3b++;
                    thisSkillStat.skillPoints--;
                    this.GetComponentInParent <SkillChanger>().UpdateChanges();
                    this.GetComponent <HoverText>().UpdateHoverText();
                    return;
                }
                else
                {
                    return;
                }
            }
        }
        else if (this.name == "Fireworks")
        {
            thisSkillStat = playerSkills.fire;

            //Check if there are any skill points first
            if (thisSkillStat.skillPoints == 0)
            {
                return;
            }
            else
            {
                skillToCheck = thisSkillStat.skill3c;
                //Check if prereq is met
                if (thisSkillStat.skill2b < 2)
                {
                    return;
                }
                //Check if the skill points allocated are less than max
                else if (skillToCheck < 5)
                {
                    thisSkillStat.skill3c++;
                    thisSkillStat.skillPoints--;
                    this.GetComponentInParent <SkillChanger>().UpdateChanges();
                    this.GetComponent <HoverText>().UpdateHoverText();
                    return;
                }
                else
                {
                    return;
                }
            }
        }
        else if (this.name == "Mine Teleport")
        {
            thisSkillStat = playerSkills.fire;

            //Check if there are any skill points first
            if (thisSkillStat.skillPoints == 0)
            {
                return;
            }
            else
            {
                skillToCheck = thisSkillStat.skill4a;
                //Check if prereq is met
                if (thisSkillStat.skill3a < 2)
                {
                    return;
                }
                //Check if the skill points allocated are less than max
                else if (skillToCheck < 1)
                {
                    thisSkillStat.skill4a++;
                    thisSkillStat.skillPoints--;
                    this.GetComponentInParent <SkillChanger>().UpdateChanges();
                    this.GetComponent <HoverText>().UpdateHoverText();
                    return;
                }
                else
                {
                    return;
                }
            }
        }
        else if (this.name == "Flame Spirit")
        {
            thisSkillStat = playerSkills.fire;

            //Check if there are any skill points first
            if (thisSkillStat.skillPoints == 0)
            {
                return;
            }
            else
            {
                skillToCheck = thisSkillStat.skill4b;
                //Check if prereq is met
                if (thisSkillStat.skill3b < 5 || thisSkillStat.skill3c < 5)
                {
                    return;
                }
                //Check if the skill points allocated are less than max
                else if (skillToCheck < 1)
                {
                    thisSkillStat.skill4b++;
                    thisSkillStat.skillPoints--;
                    this.GetComponentInParent <SkillChanger>().UpdateChanges();
                    this.GetComponent <HoverText>().UpdateHoverText();
                    return;
                }
                else
                {
                    return;
                }
            }
        }
        else if (this.name == "Volcano")
        {
            thisSkillStat = playerSkills.fire;

            //Check if there are any skill points first
            if (thisSkillStat.skillPoints == 0)
            {
                return;
            }
            else
            {
                skillToCheck = thisSkillStat.skill5;
                //Check if prereq is met
                if (thisSkillStat.skill4a < 1 || thisSkillStat.skill4b < 1)
                {
                    return;
                }
                //Check if the skill points allocated are less than max
                else if (skillToCheck < 1)
                {
                    thisSkillStat.skill5++;
                    thisSkillStat.skillPoints--;
                    this.GetComponentInParent <SkillChanger>().UpdateChanges();
                    this.GetComponent <HoverText>().UpdateHoverText();
                    return;
                }
                else
                {
                    return;
                }
            }
        }

        return;
    }