Beispiel #1
0
    IEnumerator CastBuffAfterTime(float time, PartyMemberScript target, Spell buff)
    {
        yield return new WaitForSeconds(time);
        if (target.isActiveAndEnabled)
        {
            ManaBar.value -= SpellStats.GetManaCost(buff);

            if (buff == Spell.Ultimate1)
            {
                BuffHandler.Buff newBuff = new BuffHandler.Buff(SpellStats.GetSpellName(Spell.Ultimate1), true, SpellStats.GetHealAmount(Spell.Ultimate1),SpellStats.Ultimate1Duration, Spell.Ultimate1);
                target.PlaceBuff(newBuff);
            }
            else if (buff == Spell.Ultimate3)
            {

                BuffHandler.Buff newBuff = new BuffHandler.Buff(SpellStats.GetSpellName(Spell.Ultimate3), true, SpellStats.GetHealAmount(Spell.Ultimate3), SpellStats.Ultimate3Duration, Spell.Ultimate3);
                target.PlaceBuff(newBuff);
            }
            else if (buff == Spell.Spell5)
            {
                BuffHandler.Buff newBuff = new BuffHandler.Buff(SpellStats.GetSpellName(Spell.Spell5), true, SpellStats.GetHealAmount(Spell.Spell5), SpellStats.Spell5Duration, Spell.Spell5);
                target.PlaceBuff(newBuff);
            }
            else if (buff == Spell.Spell8)
            {
                BuffHandler.Buff newBuff = new BuffHandler.Buff(SpellStats.GetSpellName(Spell.Spell8), true, SpellStats.GetHealAmount(Spell.Spell8), SpellStats.Spell8Duration, Spell.Spell8);
                target.PlaceBuff(newBuff);
                StartCoroutine(ReCastSpell8(SpellStats.Spell8Duration, SpellStats.Spell8Jumps));
            }
        }
    }