Пример #1
0
 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);
 }
Пример #2
0
 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);
 }