/// <summary> /// Cast the spell and returns whether the cast was /// successful or not. /// </summary> /// <param name="ability"></param> /// <returns></returns> public bool CastSpell(Ability ability) { // Try to cast the spell and return false if // we've failed to start casting or the // casting was interrupted. if (EnsureCast(ability.Command)) { return MonitorCast(); } return false; }
public void UseBuffingAction(Ability action) { if (action == null) throw new ArgumentNullException(nameof(action)); var baction = new BattleAbility { Name = action.English, IsEnabled = true, Ability = action }; UseBuffingActions(new List<BattleAbility> { baction }); }
/// <summary> /// Execute a single buffing type action. /// </summary> /// <param name="action"></param> public void UseBuffingAction(Ability action) { if (action == null) throw new ArgumentNullException(nameof(action)); // Create new new ability and set its basic required information. var baction = new BattleAbility { Name = action.English, IsEnabled = true, Ability = action }; // Convert ability to new battle ability object. UseBuffingActions(new List<BattleAbility> { baction }); }
/// <summary> /// Checks whether a spell or ability can be recasted. /// </summary> /// <param name="fface"></param> /// <param name="ability"></param> /// <returns></returns> public static bool IsRecastable(IMemoryAPI fface, Ability ability) { var recast = 0; // No recast time on weaponskills. if (ability.AbilityType == AbilityType.Weaponskill) return true; // No recast for ranged attacks. if (AbilityType.Range.HasFlag(ability.AbilityType)) return true; // If a spell get spell recast if (ResourceHelper.IsSpell(ability.AbilityType)) { recast = fface.Timer.GetSpellRecast(ability.Index); } // if ability get ability recast. if (ResourceHelper.IsAbility(ability.AbilityType)) { recast = fface.Timer.GetAbilityRecast(ability.Id); } return recast <= 0; }
/// <summary> /// Create a storing a reference to the given ability. /// </summary> /// <param name="ability"></param> public BattleAbility(Ability ability) { Ability = ability; Name = ability.English; }
private bool CastSpell(Ability ability) { if (EnsureCast(ability.Command)) return MonitorCast(); return false; }
private bool CastAbility(Ability ability) { _fface.Windower.SendString(ability.Command); Thread.Sleep(100); return true; }
public bool CastAbility(Ability ability) { // Send the command to the game. _fface.Windower.SendString(ability.Command); Thread.Sleep(100); return true; }
private void CompleteSelectionButton_Click(object sender, RoutedEventArgs e) { SelectedAbility = AbilityListBox.SelectedValue as Ability; Close(); }