コード例 #1
0
        public void SelectRoutine()
        {
            if (Core.Settings.Routine == null)
            {
                return;
            }

            if (!TrinityPlugin.IsEnabled)
            {
                return;
            }

            // Ignore wizards going into archon mode.
            if (Core.Player.ActorClass == ActorClass.Wizard && Core.Hotbar.ActivePowers.Any(p
                                                                                            => GameData.ArchonSkillIds.Contains((int)p)))
            {
                return;
            }

            var genericRoutines     = new List <IRoutine>();
            var manualSelectionName = Core.Settings.Routine.SelectedRoutineClassName;

            if (Settings.RoutineMode == RoutineMode.Manual && !string.IsNullOrEmpty(manualSelectionName))
            {
                var routine = AllRoutines.FirstOrDefault(r => r.GetType().Name == manualSelectionName);
                if (routine != null)
                {
                    if (routine != CurrentRoutine)
                    {
                        Core.Logger.Log($"Loading Force-Selected Routine: {manualSelectionName}");
                        CurrentRoutine = routine;
                    }

                    return;
                }
            }

            if (!Core.Actors.Actors.Any())
            {
                Core.Actors.Update();
            }

            foreach (var routine in CurrentClassRoutines.OrderBy(r => r.BuildRequirements?.RequirementCount))
            {
                if (routine.BuildRequirements == null && routine.Class != ActorClass.Invalid)
                {
                    genericRoutines.Add(routine);
                    continue;
                }
                if (routine.BuildRequirements?.IsEquipped() ?? false)
                {
                    CurrentRoutine = routine;
                    return;
                }
            }

            CurrentRoutine = genericRoutines.FirstOrDefault();
        }
コード例 #2
0
ファイル: RoutineSettings.cs プロジェクト: ysj1995/Trinity
        private void OnRoutineChanged(IRoutine newRoutine)
        {
            var routineViewModel = AllRoutines.FirstOrDefault(r => r.DisplayName == newRoutine.DisplayName);

            if (routineViewModel != null)
            {
                CurrentRoutine  = routineViewModel;
                SelectedRoutine = routineViewModel;
                UpdateRoutineLists();
            }
        }
コード例 #3
0
        public void ManualSelectRoutine(string typeName)
        {
            var routine = AllRoutines.FirstOrDefault(r => r.GetType().Name == typeName);

            if (routine != null)
            {
                CurrentRoutine = routine;
                Settings.SelectedRoutineClassName = routine.GetType().Name;
                Settings.RoutineMode = RoutineMode.Manual;
                Core.Logger.Log($"Set Routine Selection: {Settings.SelectedRoutineClassName}");
            }
        }
コード例 #4
0
ファイル: RoutineManager.cs プロジェクト: xinhuaer/Trinity
        public void SelectRoutine()
        {
            if (Core.Settings.Routine == null)
            {
                return;
            }

            if (!TrinityPlugin.IsEnabled)
            {
                return;
            }

            // Ignore wizards going into archon mode.
            if (Core.Player.ActorClass == ActorClass.Wizard && Core.Hotbar.ActivePowers.Any(p
                                                                                            => GameData.ArchonSkillIds.Contains((int)p)))
            {
                return;
            }

            var genericRoutines     = new List <IRoutine>();
            var manualSelectionName = Core.Settings.Routine.SelectedRoutineClassName;

            if (Settings.RoutineMode == RoutineMode.Manual && !string.IsNullOrEmpty(manualSelectionName))
            {
                var routine = AllRoutines.FirstOrDefault(r => r.GetType().Name == manualSelectionName);
                if (routine != null)
                {
                    if (routine != CurrentRoutine)
                    {
                        Core.Logger.Log($"Loading Force-Selected Routine:");
                        CurrentRoutine = routine;
                        Core.Logger.Warn($"Author: {CurrentRoutine.Author}");
                        Core.Logger.Warn($"Class: {CurrentRoutine.Class}");
                        Core.Logger.Warn($"DisplayName: {CurrentRoutine.DisplayName}");
                        //Range
                        Core.Logger.Warn($"ClusterRadius: {CurrentRoutine.ClusterRadius}");
                        Core.Logger.Warn($"ClusterSize: {CurrentRoutine.ClusterSize}");
                        Core.Logger.Warn($"EliteRange: {CurrentRoutine.EliteRange}");
                        Core.Logger.Warn($"TrashRange: {CurrentRoutine.TrashRange}");
                        Core.Logger.Warn($"ShrineRange: {CurrentRoutine.ShrineRange}");
                        //Health
                        Core.Logger.Warn($"PotionHealthPct: {CurrentRoutine.PotionHealthPct}");
                        Core.Logger.Warn($"EmergencyHealthPct: {CurrentRoutine.EmergencyHealthPct}");
                        Core.Logger.Warn($"HealthGlobeRange: {CurrentRoutine.HealthGlobeRange}");

                        Core.Logger.Warn($"PrimaryEnergyReserve: {CurrentRoutine.PrimaryEnergyReserve}");
                    }

                    return;
                }
            }

            if (!Core.Actors.Actors.Any())
            {
                Core.Actors.Update();
            }

            foreach (var routine in CurrentClassRoutines.OrderBy(r => r.BuildRequirements?.RequirementCount))
            {
                if (routine.BuildRequirements == null && routine.Class != ActorClass.Invalid)
                {
                    genericRoutines.Add(routine);
                    continue;
                }
                if (routine.BuildRequirements?.IsEquipped() ?? false)
                {
                    CurrentRoutine = routine;
                    return;
                }
            }

            CurrentRoutine = genericRoutines.FirstOrDefault();
        }