public bool IsInRangeOfFoes(IMap currentMap, Move move, int moveSlot) { // Check if any players are in range foreach (Client i in currentMap.GetClients()) { // Check if the target player is in range if (MoveProcessor.IsInRange(move.RangeType, move.Range, this.X, this.Y, this.Direction, i.Player.X, i.Player.Y)) { // They are in range, attack them return(true); } } return(false); }
public bool IsInRangeOfAllies(IMap currentMap, Move move, int moveSlot) { for (int i = 0; i < currentMap.ActiveNpc.Length; i++) { if (currentMap.ActiveNpc[i].Num > 0) { if (MoveProcessor.IsInRange(move.RangeType, move.Range, this.X, this.Y, this.Direction, currentMap.ActiveNpc[i].X, currentMap.ActiveNpc[i].Y)) { return(true); } } } return(false); }