Beispiel #1
0
 public static bool TryToCast(this Spell.Active spell, Obj_AI_Base target, Menu m)
 {
     if (target == null)
     {
         return(false);
     }
     return(target.CanCast(spell, m) && spell.Cast());
 }
Beispiel #2
0
 public static bool TryToCast(this Spell.Skillshot spell, Obj_AI_Base target, Menu m, int percent = 75)
 {
     if (target == null)
     {
         return(false);
     }
     return(target.CanCast(spell, m, percent) && spell.Cast(target));
 }
Beispiel #3
0
 /// <summary>
 /// It will only cast the spell if it can
 /// </summary>
 /// <param name="spell">Active Spell</param>
 /// <param name="target">Target to cast the spell</param>
 public static bool TryCast(this Spell.Ranged spell, Obj_AI_Base target)
 {
     if (spell != null)
     {
         if (target.CanCast(spell))
         {
             return(spell.Cast(target));
         }
     }
     return(false);
 }
Beispiel #4
0
 /// <summary>
 /// It will only cast the spell if it can
 /// </summary>
 /// <param name="spell">Active Spell</param>
 /// <param name="target">Target to cast the spell</param>
 public static bool TryCast(this Spell.SpellBase spell, Obj_AI_Base target)
 {
     if (spell != null)
     {
         var spellSlot = spell.Slot.ToString()[spell.Slot.ToString().Length - 1];
         if (target.CanCast(spell) &&
             !OKTR_Core.OKTRSpellTargetSelectorMenu.GetCheckBoxValue(OKTR_Core.OKTRSpellTargetSelectorMenuID + spellSlot + target.BaseSkinName))
         {
             return(spell.Cast(target));
         }
     }
     return(false);
 }
Beispiel #5
0
        public static bool CanCast(this Obj_AI_Base target, Spell.Targeted spell, Menu m)
        {
            var asBase = spell as Spell.SpellBase;

            return(target.CanCast(asBase, m));
        }
Beispiel #6
0
        public static bool CanCast(this Obj_AI_Base target, Spell.Ranged spell)
        {
            var asBase = spell as Spell.SpellBase;

            return(target.CanCast(asBase));
        }
Beispiel #7
0
 public static bool TryToCast(this Spell.Ranged spell, Obj_AI_Base target, Menu m)
 {
     if (target == null) return false;
     return target.CanCast(spell, m) && spell.Cast(target);
 }
Beispiel #8
0
 public static bool TryToCast(this Spell.Skillshot spell, Obj_AI_Base target, Menu m, int percent = 75)
 {
     if (target == null) return false;
     return target.CanCast(spell, m, percent) && spell.Cast(target);
 }