public static Composite Cast(string spell, SpellManager.GetSelection <Vector2i> location, SpellManager.GetSelection <bool> reqs = null) { // Note: this is safe to do. If we pass null to the requirements check, that means we always want to fire // as long as CanCast is true. if (reqs == null) { reqs = ret => true; } return(SpellManager.CreateSpellCastComposite(spell, reqs, location)); }
public static Composite Cast(string spell, SpellManager.GetSelection <Vector2i> location, SpellManager.GetSelection <bool> reqs = null) { // Note: this is safe to do. If we pass null to the requirements check, that means we always want to fire // as long as CanCast is true. if (reqs == null) { reqs = ret => true; } return(new PrioritySelector( new Sequence( SpellManager.CreateSpellCastComposite(spell, reqs, location), new Action(delegate { Allrounder.Log.DebugFormat("Allrounder(Cast): Casted {0}", spell); return RunStatus.Failure; })))); }
public static Composite Cast(string spell, SpellManager.GetSelection <bool> reqs = null) { // Note: this is safe to do. If we pass null to the requirements check, that means we always want to fire // as long as CanCast is true. if (reqs == null) { reqs = ret => true; } return(new PrioritySelector( new Sequence( SpellManager.CreateSpellCastComposite(spell, reqs, ret => Variables.MainTarget), //new WaitContinue(TimeSpan.FromMilliseconds(300), ret => false, new Action(delegate { return RunStatus.Success; })), new Action(delegate { Allrounder.Log.DebugFormat("Allrounder(Cast): Casted {0}", spell); return RunStatus.Failure; })))); }