Beispiel #1
0
        /// <summary>
        /// A ranger wont be able to shoot if there is an enemy adjacent to it
        /// </summary>
        /// <param name="controller"></param>
        /// <returns></returns>
        public override List <IUnit> GetAllTargets()
        {
            if (Unit.CurrentCoolDown > 0)
            {
                return(null);
            }

            var adjacents = BoardHandler.GetEnemyAround(Unit, 1);

            // if there's enemy adjacent to the unit
            if (adjacents != null && adjacents.Count > 0)
            {
                Unit.CurrentCoolDown = Unit.CurrentCoolDown == Unit.CoolDown ? Unit.CoolDown : Unit.CoolDown - 1;
                return(null);
            }

            return(BoardHandler.GetEnemyAround(Unit, Unit.Range));
        }