Exemplo n.º 1
0
        public override bool Attack(SNOActorId actorId)
        {
            var units = Unit.Get().Where(a => a.ActorId == actorId);

            if (!units.Any())
                return false;

            // getting closest unit
            var u = units.Where(x => x.Life > 0 && x.Mode != UnitMode.Dead).OrderBy(x => Bot.GetDistance(x)).FirstOrDefault();

            if (u == null)
                return false;

            if (Bot.Debug)
                Bot.Print("Attacking {0} ({1})", u.Name, u.ActorId);

            //look at the current health of the bot, and decide whether it's necessary to use any support moves.
            if (Me.Life / Me.MaxLife < MIN_HEALTH)
            {
                if (!UseSkill(3))   // use preparation if ready
                    UseSkill(1);    // if prep is not ready, use fog
            }

            //makes sure to use caltrops only when needed.
            if (Me.SecondaryResource == Me.MaxSecondaryResource)
                UseSkill(0);

            if (Me.PrimaryResource / Me.MaxPrimaryResource > 0.5f)
                UseSkill(5, u);
            else
                UseSkill(4, u);

            return true;
        }
Exemplo n.º 2
0
        public override bool Attack(SNOActorId actorId)
        {
            var units = Unit.Get().Where(a => a.ActorId == actorId);

            if (!units.Any())
                return false;

            // getting closest unit
            var u = units.Where(x => x.Life > 0 && x.Mode != UnitMode.Dead).OrderBy(x => Bot.GetDistance(x)).FirstOrDefault();

            if (u == null)
                return false;

            if (Me.PrimaryResource / Me.MaxPrimaryResource > 0.5f)
                UseSkill(5, u);
            else
                UseSkill(4, u);

            return true;
        }
Exemplo n.º 3
0
 protected bool Attack(SNOActorId actorId)
 {
     SetTimer(100);
     return Player.Attack(actorId);
 }
Exemplo n.º 4
0
 protected bool MoveTo(SNOActorId actorId)
 {
     var u = Unit.Get().FirstOrDefault(x => x.ActorId == actorId);
     if (u == null)
         return false;
     return MoveTo(u);
 }
Exemplo n.º 5
0
 protected bool Interact(SNOActorId actorId)
 {
     var u = Unit.Get().FirstOrDefault(x => x.ActorId == actorId);
     if (u != null)
     {
         Interact(u);
         return true;
     }
     return false;
 }
Exemplo n.º 6
0
 public abstract bool Attack(SNOActorId actorId);