Example #1
0
    public void Use(BaseCharacter target)
    {
        if (!coolDownTimer.IsRunning())
        {
            print("Spell " + spellData.displayName + " used on target " + target.data.displayName);

            //add the component to the list, have the components loop over and call fire?


            if (spellData != null)
            {
                //other actions- Merge ability to a databag/abstract class and have spell base
                //class per spell, have each handle its own functionality. Does not handle combinations well, EASY TO READ/DEBUG
                //component based system. COMPLEX but all functionality

                //Todo: add a spell used/casted to character or have the spell have a reference or be friend of the character
                //so we can just modifiy its health/whatever

                target.AddSpellEffect(spellData);

                coolDownTimer.Start();
                onCooldown         = true;
                fillCanvas.enabled = true;
                butt.enabled       = false;
            }
        }
    }