private void SpellBook_OnStopCast(Obj_AI_Base sender, SpellBookStopCastEventArgs e) { if (sender.IsMe && (e.DestroyMissile || e.ForceStop)) // || e.StopAnimation { this.ResetAutoAttackTimer(); } }
private void OnStopCast(Obj_AI_Base sender, SpellBookStopCastEventArgs e) { if (!e.DestroyMissile || !e.StopAnimation || !(sender is Obj_AI_Minion) || sender.Type == GameObjectType.obj_AI_Turret) { return; } if (!this.Attacks.TryGetValue(sender.NetworkId, out HashSet <Attack> value)) { return; } value.RemoveWhere(x => x.Active); }
private void SpellBook_OnStopCast(Obj_AI_Base sender, SpellBookStopCastEventArgs e) { if (sender.IsValid) { if (sender is Obj_AI_Turret) { return; } if (sender is Obj_AI_Base && (e.DestroyMissile || e.StopAnimation)) { foreach (var value in this.incomingAttacks.Values) { value.RemoveAll(x => x.Sender.NetworkId == sender.NetworkId); } } } }
private void SpellBook_OnStopCast(Obj_AI_Base sender, SpellBookStopCastEventArgs e) { if (sender == null || !sender.IsValid) { return; } var ob = Attacks.GetOutBoundAttacks(sender.NetworkId); if (ob != null) { //Remove any pending attacks or attacks in progress because the auto attack was cancelled if (e.StopAnimation || e.ForceStop || e.DestroyMissile) { ob.Clear(); } } }
private void SpellBook_OnStopCast(Obj_AI_Base sender, SpellBookStopCastEventArgs e) { if (sender == null || !sender.IsValid) { return; } var ob = Attacks.GetOutBoundAttacks(sender.NetworkId); if (ob != null) { //Remove any pending attacks or attacks in progress because the auto attack was cancelled if (e.StopAnimation || e.ForceStop || e.DestroyMissile) { foreach (var attack in ob) { if (attack.AttackStatus == AutoAttack.AttackState.Completed) { continue; } attack.Completed(); var rattack = attack as RangedAttack; if (rattack == null) { continue; } if (e.DestroyMissile) { rattack.MissileDestroyed(); } } } } }
/// <summary> /// Called when [stop cast]. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="SpellBookStopCastEventArgs"/> instance containing the event data.</param> protected virtual void OnStopCast(Obj_AI_Base sender, SpellBookStopCastEventArgs e) { return; }