Exemple #1
0
 //Applies repel and prints appropriate debug log
 //Returns true if reflected, false if not.
 //MAY need fixing for targeting
 public static bool calcRepel(CastData data, int d, int element, ICaster caster, ICaster target, bool crit, bool repel)
 {
     //repel damage to caster if enemy reflects this element (FIX for targeting)
     if (target.Stats.vsElement[element] == Elements.repel && repel == false)
     {
         Debug.Log(target.Stats.name + " reflects " + d + " " + Elements.toString(element) + " damage back at " + caster.Stats.name);
         data.repel = true;
         caster.damage(data, d, element, caster, crit, true);
         return(true);
     }
     return(false);
 }
Exemple #2
0
    public override CastData cast(ICaster target, ICaster caster)
    {
        CastData data = new CastData();

        data.element = element;
        if (hitCheck(data, target, caster, true))
        {
            int  powerMod;
            bool crit = critCheck(data, target, caster, out powerMod);
            target.damage(data, powerMod, element, caster, crit);
            if (buff != null)
            {
                buffCheck(data, target, caster, powerMod);
            }
        }
        return(data);
    }