Abilities Extensions

Hi, just showing the abilities I’ve added, I’m going with a concept of elements affecting specific stats
Wind - Stamina (attacking, sprinting), Water - Health (healing, damage), Fire - Spirit & Health (reducing, damage), Lightning - Spirit (gaining, stuns).

These are just three of the skills. Put some code in projectile to call a function on the target when collied.

These are some functions in the Buff script.

public override void StartEffect(SkillData data, Action finished, float effectMultiplyer)
{
    if (fighterBuff)
    {
            data.GetUser().GetComponent<TPFighting>().ActivateBuffSkill(buffTime);
    }
    else if (aoeSkillEffect)
    {
           AOEElementSkills(data, effectMultiplyer);
    }
    else
    {
           ElementSkills(data, effectMultiplyer);
    }
    finished();    
}
private void ElementSkills(SkillData data, float stat)
{
       if (elementType == ElementType.Water)
       {
                float statAmount = data.GetUser().GetComponent<TPFighting>().WaterBond();
                float gain = statAmount * (1 + stat / 100);

                foreach (var target in data.GetTargets())
                {
                    var health = target.GetComponent<Health>();
                    if(health)
                    {
                        health.AqualaGift(buffTime, gain);
                    }
                }                  

        }
        if (elementType == ElementType.Wind)
        {
                float statAmount = data.GetUser().GetComponent<TPFighting>().WindBond();
                float gain = statAmount * (1 + stat / 100);

               foreach (var target in data.GetTargets())
               {
                    var stamina= target.GetComponent<Stamina>();
                    if (stamina)
                    {
                        //stamina.LugindForce(buffTime, gain);
                    }
               }
       }
}
private void AOEElementSkills(SkillData data, float stat)
{
            GameObject self =  data.GetUser();
            if (elementType == ElementType.Fire)
            {
                float statAmount = self.GetComponent<TPFighting>().FireBond();
                float elementBond = statAmount * (1 + stat / 100);

                self.GetComponentInChildren<SkillHitBox>().GetRadius(effectRadius);
                self.GetComponent<Element>().SetAOEEffect(buffTime, elementType, elementBond);
            }
            if (elementType == ElementType.Water)
            {
                float statAmount = data.GetUser().GetComponent<TPFighting>().WaterBond();
                float gain = statAmount * (1 + stat / 100);

                foreach (var target in data.GetTargets())
                {
                      var health = target.GetComponent<Health>();
                      if (health)
                      {
                            //health.AqualaGift(buffTime, gain);
                      }
                }                  
            }
}

The Debuff runs the same but calls function the do negative effects to targets. Time to move to the next lecture.

4 Likes

Truly incredible! Keep up the great work!

Privacy & Terms