예제 #1
0
        public override bool CheckComponent()
        {
            if (new RestState(fface).CheckComponent())
            {
                return(false);
            }

            // Target dead or null.
            if (!UnitFilters.MobFilter(fface, Target))
            {
                return(false);
            }

            // We should approach mobs that have aggroed or have been pulled.
            if (Target.Status.Equals(Status.Fighting))
            {
                return(true);
            }

            // Get usable abilities.
            var usable = Config.Instance.BattleLists["Pull"].Actions
                         .Where(x => ActionFilters.BuffingFilter(fface, x));

            // Approach when there are no pulling moves available.
            if (!usable.Any())
            {
                return(true);
            }

            // Approach mobs if their distance is close.
            return(Target.Distance < 8);
        }
예제 #2
0
            public void VerifyActionUsable()
            {
                var memoryAPI = FindMemoryApi();
                var result    = ActionFilters.BuffingFilter(memoryAPI, _battleAbility);

                Assert.True(result);
            }
예제 #3
0
        public override bool Check()
        {
            if (new RestState(Memory).Check())
            {
                return(false);
            }
            if (!EliteApi.Player.Status.Equals(Status.Standing))
            {
                return(false);
            }

            var trusts = Config.Instance.BattleLists["Trusts"].Actions
                         .Where(t => t.IsEnabled)
                         .Where(t => ActionFilters.BuffingFilter(EliteApi, t))
                         .ToList();

            var maxTrustPartySize = Config.Instance.TrustPartySize;

            foreach (var trust in trusts)
            {
                if (TrustNeedsDismissal(trust) ||
                    !TrustInParty(trust) && PartyHasSpace() && !MaxTrustsReached(maxTrustPartySize))
                {
                    return(true);
                }
            }

            return(false);
        }
예제 #4
0
        public override bool Check(IGameContext context)
        {
            if (new RestState().Check(context))
            {
                return(false);
            }
            if (!context.API.Player.Status.Equals(Status.Standing))
            {
                return(false);
            }

            var trusts = context.Config.BattleLists["Trusts"].Actions
                         .Where(t => t.IsEnabled)
                         .Where(t => ActionFilters.BuffingFilter(context.API, t))
                         .ToList();

            var maxTrustPartySize = context.Config.TrustPartySize;

            foreach (var trust in trusts)
            {
                if (TrustNeedsDismissal(context, trust) ||
                    !TrustInParty(context, trust) && PartyHasSpace(context) && !MaxTrustsReached(context, maxTrustPartySize))
                {
                    return(true);
                }
            }

            return(false);
        }
예제 #5
0
        public override void Run(IGameContext context)
        {
            var usable = context.Config.BattleLists["Start"]
                         .Actions.Where(x => ActionFilters.BuffingFilter(context.API, x));

            // Execute moves at target.
            context.Memory.Executor.UseBuffingActions(usable);
        }
예제 #6
0
            public void VerifyActionUsable()
            {
                GlobalFactory.BuildUnitService = x => new TestUnitService();
                var memory = FindMemoryApi();
                var result = ActionFilters.BuffingFilter(memory, _battleAbility);

                Assert.True(result);
            }
예제 #7
0
        public override void Run()
        {
            var usable = Config.Instance.BattleLists["Start"]
                         .Actions.Where(x => ActionFilters.BuffingFilter(fface, x));

            // Execute moves at target.
            Executor.UseBuffingActions(usable);
        }
예제 #8
0
        public override bool Check()
        {
            if (new RestState(Memory).Check())
            {
                return(false);
            }

            return(Config.Instance.BattleLists["Healing"].Actions
                   .Any(x => ActionFilters.BuffingFilter(EliteApi, x)));
        }
예제 #9
0
        public override bool Check(IGameContext context)
        {
            if (new RestState().Check(context))
            {
                return(false);
            }

            return(context.Config.BattleLists["Healing"].Actions
                   .Any(x => ActionFilters.BuffingFilter(context.API, x)));
        }
예제 #10
0
        public override void Run(IGameContext context)
        {
            // Execute moves.
            var usable = context.Config.BattleLists["End"].Actions
                         .Where(x => ActionFilters.BuffingFilter(context.API, x));

            context.Memory.Executor.UseBuffingActions(usable, context.API.Player.Position);

            // Reset all usage data to begin a new battle.
            foreach (var action in context.Config.BattleLists.Actions)
            {
                action.Usages = 0;
            }
        }
예제 #11
0
파일: EndState.cs 프로젝트: lcreed/EasyFarm
        public override void Run()
        {
            // Execute moves.
            var usable = Config.Instance.BattleLists["End"].Actions
                         .Where(x => ActionFilters.BuffingFilter(fface, x));

            _executor.UseBuffingActions(usable);

            // Reset all usage data to begin a new battle.
            foreach (var action in Config.Instance.BattleLists.Actions)
            {
                action.Usages = 0;
            }
        }
예제 #12
0
        public override bool Check()
        {
            if (new RestState(fface).Check())
            {
                return(false);
            }

            if (!Config.Instance.BattleLists["Healing"].Actions
                .Any(x => ActionFilters.BuffingFilter(fface, x)))
            {
                return(false);
            }

            return(true);
        }
예제 #13
0
        public override void Run()
        {
            // Get the list of healing abilities that can be used.
            var healingMoves = Config.Instance.BattleLists["Healing"].Actions
                               .Where(x => ActionFilters.BuffingFilter(EliteApi, x))
                               .ToList();

            if (healingMoves.Count <= 0)
            {
                return;
            }
            var healingMove = healingMoves.First();

            Executor.UseBuffingActions(new[] { healingMove });
        }
예제 #14
0
        public override void Run(IGameContext context)
        {
            // Get the list of healing abilities that can be used.
            var healingMoves = context.Config.BattleLists["Healing"].Actions
                               .Where(x => ActionFilters.BuffingFilter(context.API, x))
                               .ToList();

            if (healingMoves.Count <= 0)
            {
                return;
            }
            var healingMove = healingMoves.First();

            context.Memory.Executor.UseBuffingActions(new[] { healingMove }, context.API.Player.Position);
        }
예제 #15
0
        public override void RunComponent()
        {
            // Get the list of healing abilities that can be used.
            var usableHealingMoves = Config.Instance.BattleLists["Healing"].Actions
                                     .Where(x => ActionFilters.BuffingFilter(fface, x))
                                     .ToList();

            // Check if we have any moves to use.
            if (usableHealingMoves.Count > 0)
            {
                // Check for actions available
                var action = usableHealingMoves.FirstOrDefault();
                if (action == null)
                {
                    return;
                }

                // Create an ability from the name and launch the move.
                var healingMove = App.AbilityService.CreateAbility(action.Name);
                _executor.UseBuffingAction(healingMove);
            }
        }
예제 #16
0
        public override bool Check()
        {
            if (new RestState(Memory).Check())
            {
                return(false);
            }

            // Make sure we don't need trusts
            if (new SummonTrustsState(Memory).Check())
            {
                return(false);
            }

            // Target dead or null.
            if (!UnitFilters.MobFilter(EliteApi, Target, Config))
            {
                return(false);
            }

            // We should approach mobs that have aggroed or have been pulled.
            if (Target.Status.Equals(Status.Fighting))
            {
                return(true);
            }

            // Get usable abilities.
            var usable = Config.BattleLists["Pull"].Actions
                         .Where(x => ActionFilters.BuffingFilter(EliteApi, x));

            // Approach when there are no pulling moves available.
            if (!usable.Any())
            {
                return(true);
            }

            // Approach mobs if their distance is close.
            return(Target.Distance < 8);
        }
예제 #17
0
        public override bool Check(IGameContext context)
        {
            if (new RestState().Check(context))
            {
                return(false);
            }

            // Make sure we don't need trusts
            if (new SummonTrustsState().Check(context))
            {
                return(false);
            }

            // Target dead or null.
            if (!context.Target.IsValid)
            {
                return(false);
            }

            // We should approach mobs that have aggroed or have been pulled.
            if (context.Target.Status.Equals(Status.Fighting))
            {
                return(true);
            }

            // Get usable abilities.
            var usable = context.Config.BattleLists["Pull"].Actions
                         .Where(x => ActionFilters.BuffingFilter(context.API, x));

            // Approach when there are no pulling moves available.
            if (!usable.Any())
            {
                return(true);
            }

            // Approach mobs if their distance is close.
            return(context.Target.Distance < 8);
        }
예제 #18
0
            private void VerifyActionUsable()
            {
                var result = ActionFilters.BuffingFilter(FindMemoryApi(), _battleAbility);

                Assert.True(result);
            }