示例#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;
        }
示例#2
0
文件: Wizard.cs 项目: LordJZ/d3helper
        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;
        }
示例#3
0
文件: Bot.cs 项目: LordJZ/d3helper
 protected bool Attack(SNOActorId actorId)
 {
     SetTimer(100);
     return Player.Attack(actorId);
 }
示例#4
0
文件: Bot.cs 项目: LordJZ/d3helper
 protected bool MoveTo(SNOActorId actorId)
 {
     var u = Unit.Get().FirstOrDefault(x => x.ActorId == actorId);
     if (u == null)
         return false;
     return MoveTo(u);
 }
示例#5
0
文件: Bot.cs 项目: LordJZ/d3helper
 protected bool Interact(SNOActorId actorId)
 {
     var u = Unit.Get().FirstOrDefault(x => x.ActorId == actorId);
     if (u != null)
     {
         Interact(u);
         return true;
     }
     return false;
 }
示例#6
0
文件: Player.cs 项目: LordJZ/d3helper
 public abstract bool Attack(SNOActorId actorId);