From bc4a60385a1c1dc520a22197e9c2d3b2b0ea8547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E6=B0=B4?= <1123993881@qq.com> Date: Mon, 17 Jul 2023 11:33:40 +0800 Subject: [PATCH] fix: add an option for auto heal. --- Resources/AnimationLockTime.json | 2 +- RotationSolver.Basic/Actions/BaseAction_Target.cs | 10 +++++----- RotationSolver.Basic/Configuration/MacroInfo.cs | 3 ++- .../Configuration/OtherConfiguration.cs | 10 ++++++---- .../Configuration/PluginConfiguration.cs | 4 ++-- RotationSolver.Basic/Data/RSCommandType.cs | 2 ++ .../Rotations/CustomRotation_Ability.cs | 12 ++++++------ .../Rotations/CustomRotation_GCD.cs | 2 +- .../Rotations/CustomRotation_Invoke.cs | 2 +- .../Rotations/CustomRotation_OtherInfo.cs | 13 +++++++------ RotationSolver/Commands/RSCommands_OtherCommand.cs | 4 ++-- RotationSolver/Localization/Strings.cs | 2 ++ RotationSolver/UI/NextActionWindow.cs | 8 ++++---- RotationSolver/UI/RotationConfigWindow_Major.cs | 4 ++-- RotationSolver/UI/RotationConfigWindow_Param.cs | 12 +++++++----- RotationSolver/Updaters/MajorUpdater.cs | 4 ++-- 16 files changed, 52 insertions(+), 42 deletions(-) diff --git a/Resources/AnimationLockTime.json b/Resources/AnimationLockTime.json index ee486d700..72d05b6f1 100644 --- a/Resources/AnimationLockTime.json +++ b/Resources/AnimationLockTime.json @@ -128,7 +128,7 @@ "3573": 0.6, "3574": 0.6, "3576": 0.1, - "3577": 0.1, + "3577": 0.6, "3578": 0.6, "3579": 0.1, "3582": 0.6, diff --git a/RotationSolver.Basic/Actions/BaseAction_Target.cs b/RotationSolver.Basic/Actions/BaseAction_Target.cs index 2b19975b9..7e714b830 100644 --- a/RotationSolver.Basic/Actions/BaseAction_Target.cs +++ b/RotationSolver.Basic/Actions/BaseAction_Target.cs @@ -172,7 +172,7 @@ private bool TargetAreaMove(float range, bool mustUse) private bool TargetAreaFriend(float range, bool mustUse, PlayerCharacter player) { - if (!Configuration.PluginConfiguration.GetValue(SettingsCommand.UseGroundBeneficialAbility)) return false; + if (!Service.Config.GetValue(SettingsCommand.UseGroundBeneficialAbility)) return false; if (Service.Config.BeneficialAreaOnTarget && Svc.Targets.Target != null) { @@ -330,8 +330,8 @@ private bool TargetHostileManual(BattleChara b, bool mustUse, int aoeCount, out return true; } - if (Configuration.PluginConfiguration.GetValue(SettingsCommand.UseAOEAction) - && Configuration.PluginConfiguration.GetValue(SettingsCommand.UseAOEWhenManual) || mustUse) + if (Service.Config.GetValue(SettingsCommand.UseAOEAction) + && Service.Config.GetValue(SettingsCommand.UseAOEWhenManual) || mustUse) { if (GetMostObjects(TargetFilterFuncEot(DataCenter.HostileTargets, mustUse), aoeCount).Contains(b)) { @@ -355,7 +355,7 @@ private bool TargetSelf(bool mustUse, int aoeCount) //not use when aoe. if (DataCenter.StateType == StateCommandType.Manual) { - if (!Configuration.PluginConfiguration.GetValue(SettingsCommand.UseAOEWhenManual) && !mustUse) return false; + if (!Service.Config.GetValue(SettingsCommand.UseAOEWhenManual) && !mustUse) return false; } var tars = TargetFilter.GetObjectInRadius(TargetFilterFuncEot(DataCenter.HostileTargets, mustUse), EffectRange); @@ -520,7 +520,7 @@ private static bool NoAOE { get { - if (!Configuration.PluginConfiguration.GetValue(SettingsCommand.UseAOEAction)) return true; + if (!Service.Config.GetValue(SettingsCommand.UseAOEAction)) return true; return Service.Config.ChooseAttackMark && !Service.Config.CanAttackMarkAOE diff --git a/RotationSolver.Basic/Configuration/MacroInfo.cs b/RotationSolver.Basic/Configuration/MacroInfo.cs index d9d7c935d..06ddd4b09 100644 --- a/RotationSolver.Basic/Configuration/MacroInfo.cs +++ b/RotationSolver.Basic/Configuration/MacroInfo.cs @@ -1,7 +1,7 @@ using FFXIVClientStructs.FFXIV.Client.UI.Misc; namespace RotationSolver.Basic.Configuration; - +#pragma warning disable CS1591 // Missing XML comment for publicly visible public class MacroInfo { public int MacroIndex; @@ -24,3 +24,4 @@ public unsafe bool AddMacro(GameObject tar = null) return true; } } +#pragma warning restore CS1591 // Missing XML comment for publicly visible \ No newline at end of file diff --git a/RotationSolver.Basic/Configuration/OtherConfiguration.cs b/RotationSolver.Basic/Configuration/OtherConfiguration.cs index 5114e0ca8..6d9a9eb93 100644 --- a/RotationSolver.Basic/Configuration/OtherConfiguration.cs +++ b/RotationSolver.Basic/Configuration/OtherConfiguration.cs @@ -4,6 +4,7 @@ namespace RotationSolver.Basic.Configuration; +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member public class InputConfiguration { public Dictionary KeyState { get; set; } = new Dictionary(); @@ -39,16 +40,16 @@ public class InputConfiguration public class OtherConfiguration { public static InputConfiguration InputConfig = new(); - public static SortedSet HostileCastingArea = new(); - public static SortedSet HostileCastingTank = new(); + public static HashSet HostileCastingArea = new(); + public static HashSet HostileCastingTank = new(); public static SortedList AnimationLockTime = new(); public static Dictionary NoHostileNames = new(); - public static SortedSet DangerousStatus = new(); + public static HashSet DangerousStatus = new(); - public static SortedSet InvincibleStatus = new(); + public static HashSet InvincibleStatus = new(); public static void Init() { @@ -170,3 +171,4 @@ private static void InitOne(ref T value, string name) } } } +#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member diff --git a/RotationSolver.Basic/Configuration/PluginConfiguration.cs b/RotationSolver.Basic/Configuration/PluginConfiguration.cs index 19a5fe1bf..3d3b48f20 100644 --- a/RotationSolver.Basic/Configuration/PluginConfiguration.cs +++ b/RotationSolver.Basic/Configuration/PluginConfiguration.cs @@ -25,8 +25,8 @@ public class PluginConfiguration : IPluginConfiguration [JsonProperty] private Dictionary SettingsBools { get; set; } = new Dictionary(); - public static bool GetValue(SettingsCommand command) => Service.Config.SettingsBools.TryGetValue(command, out var value) ? value : command.GetDefault(); - public static void SetValue(SettingsCommand command, bool value) => Service.Config.SettingsBools[command] = value; + public bool GetValue(SettingsCommand command) => SettingsBools.TryGetValue(command, out var value) ? value : command.GetDefault(); + public void SetValue(SettingsCommand command, bool value) => SettingsBools[command] = value; public int AddDotGCDCount = 2; diff --git a/RotationSolver.Basic/Data/RSCommandType.cs b/RotationSolver.Basic/Data/RSCommandType.cs index d71e167e5..84201e013 100644 --- a/RotationSolver.Basic/Data/RSCommandType.cs +++ b/RotationSolver.Basic/Data/RSCommandType.cs @@ -38,6 +38,7 @@ public enum OtherCommandType : byte public enum SettingsCommand : byte { AutoBurst, + AutoHeal, UseAbility, UseDefenseAbility, AutoTankStance, @@ -58,6 +59,7 @@ public static class SettingsCommandExtension public static bool GetDefault(this SettingsCommand command) => command switch { SettingsCommand.AutoBurst => true, + SettingsCommand.AutoHeal => true, SettingsCommand.UseAbility => true, SettingsCommand.UseDefenseAbility => true, SettingsCommand.AutoTankStance => true, diff --git a/RotationSolver.Basic/Rotations/CustomRotation_Ability.cs b/RotationSolver.Basic/Rotations/CustomRotation_Ability.cs index b7e887435..1b93d898e 100644 --- a/RotationSolver.Basic/Rotations/CustomRotation_Ability.cs +++ b/RotationSolver.Basic/Rotations/CustomRotation_Ability.cs @@ -12,7 +12,7 @@ private bool Ability(IAction nextGCD, out IAction act, bool helpDefenseAOE, bool if(act is IBaseItem i && i.CanUse(out _)) return true; - if (!Configuration.PluginConfiguration.GetValue(SettingsCommand.UseAbility) + if (!Service.Config.GetValue(SettingsCommand.UseAbility) || Player.TotalCastTime > 0) { act = null; @@ -57,7 +57,7 @@ private bool Ability(IAction nextGCD, out IAction act, bool helpDefenseAOE, bool if (GeneralAbility(out act)) return true; //Run! - if (IsMoving && NotInCombatDelay && PluginConfiguration.GetValue(SettingsCommand.AutoSpeedOutOfCombat) + if (IsMoving && NotInCombatDelay && Service.Config.GetValue(SettingsCommand.AutoSpeedOutOfCombat) && SpeedAbility(out act)) return true; return false; @@ -106,7 +106,7 @@ private bool ShirkOrShield(JobRole role, SpecialCommandType specialType, out IAc break; } - if (DataCenter.SetAutoStatus(AutoStatus.TankStance, Configuration.PluginConfiguration.GetValue(SettingsCommand.AutoTankStance) + if (DataCenter.SetAutoStatus(AutoStatus.TankStance, Service.Config.GetValue(SettingsCommand.AutoTankStance) && !DataCenter.AllianceTanks.Any(t => t.CurrentHp != 0 && t.HasStatus(false, StatusHelper.TankStanceStatus)) && !HasTankStance && TankStance.CanUse(out act, CanUseOption.IgnoreClippingCheck))) { @@ -185,7 +185,7 @@ private bool AutoDefense(JobRole role, bool helpDefenseAOE, bool helpDefenseSing //Auto Provoke if (DataCenter.SetAutoStatus(AutoStatus.Provoke, role == JobRole.Tank - && (Configuration.PluginConfiguration.GetValue(SettingsCommand.AutoProvokeForTank) || DataCenter.AllianceTanks.Count() < 2) + && (Service.Config.GetValue(SettingsCommand.AutoProvokeForTank) || DataCenter.AllianceTanks.Count() < 2) && TargetFilter.ProvokeTarget(DataCenter.HostileTargets, true).Count() != DataCenter.HostileTargets.Count())) { if (!HasTankStance && TankStance.CanUse(out act)) return true; @@ -193,7 +193,7 @@ private bool AutoDefense(JobRole role, bool helpDefenseAOE, bool helpDefenseSing } //No using defense abilities. - if (!Configuration.PluginConfiguration.GetValue(SettingsCommand.UseDefenseAbility)) return false; + if (!Service.Config.GetValue(SettingsCommand.UseDefenseAbility)) return false; if (helpDefenseAOE) { @@ -283,7 +283,7 @@ protected virtual bool EmergencyAbility(IAction nextGCD, out IAction act) if (ClassJob.GetJobRole() is JobRole.Healer or JobRole.RangedMagical && action.CastTime >= 5 && Swiftcast.CanUse(out act, CanUseOption.EmptyOrSkipCombo)) return true; - if (Configuration.PluginConfiguration.GetValue(SettingsCommand.AutoUseTrueNorth) + if (Service.Config.GetValue(SettingsCommand.AutoUseTrueNorth) && action.EnemyPositional != EnemyPositional.None && action.Target != null) { if (action.EnemyPositional != action.Target.FindEnemyPositional() && action.Target.HasPositional()) diff --git a/RotationSolver.Basic/Rotations/CustomRotation_GCD.cs b/RotationSolver.Basic/Rotations/CustomRotation_GCD.cs index b356934b5..24fef8ba7 100644 --- a/RotationSolver.Basic/Rotations/CustomRotation_GCD.cs +++ b/RotationSolver.Basic/Rotations/CustomRotation_GCD.cs @@ -85,7 +85,7 @@ private bool RaiseSpell(SpecialCommandType specialType, out IAction act, bool mu return DataCenter.SetAutoStatus(AutoStatus.Raise, true); } } - else if (Configuration.PluginConfiguration.GetValue(SettingsCommand.RaisePlayerBySwift) && !Swiftcast.IsCoolingDown + else if (Service.Config.GetValue(SettingsCommand.RaisePlayerBySwift) && !Swiftcast.IsCoolingDown && DataCenter.NextAbilityToNextGCD > DataCenter.MinAnimationLock + DataCenter.Ping) { return DataCenter.SetAutoStatus(AutoStatus.Raise, true); diff --git a/RotationSolver.Basic/Rotations/CustomRotation_Invoke.cs b/RotationSolver.Basic/Rotations/CustomRotation_Invoke.cs index 76d7c6cc7..a596496c0 100644 --- a/RotationSolver.Basic/Rotations/CustomRotation_Invoke.cs +++ b/RotationSolver.Basic/Rotations/CustomRotation_Invoke.cs @@ -139,7 +139,7 @@ private IAction Invoke(out IAction gcdAction) return CountDownAction(countDown); } - var helpDefenseAOE = Configuration.PluginConfiguration.GetValue(SettingsCommand.UseDefenseAbility) && DataCenter.IsHostileCastingAOE; + var helpDefenseAOE = Service.Config.GetValue(SettingsCommand.UseDefenseAbility) && DataCenter.IsHostileCastingAOE; bool helpDefenseSingle = false; if (ClassJob.GetJobRole() == JobRole.Healer || ClassJob.RowId == (uint)ECommons.ExcelServices.Job.PLD) diff --git a/RotationSolver.Basic/Rotations/CustomRotation_OtherInfo.cs b/RotationSolver.Basic/Rotations/CustomRotation_OtherInfo.cs index 8f3e5b1bf..b4492389f 100644 --- a/RotationSolver.Basic/Rotations/CustomRotation_OtherInfo.cs +++ b/RotationSolver.Basic/Rotations/CustomRotation_OtherInfo.cs @@ -2,6 +2,7 @@ using Dalamud.Game.ClientState.Conditions; using Dalamud.Game.ClientState.Objects.SubKinds; using ECommons.DalamudServices; +using RotationSolver.Basic.Configuration; using RotationSolver.Basic.Helpers; namespace RotationSolver.Basic.Rotations; @@ -120,17 +121,17 @@ public abstract partial class CustomRotation /// /// Is in burst right now? Usually it used with team support actions. /// - protected static bool InBurst => DataCenter.SpecialType == SpecialCommandType.Burst || Configuration.PluginConfiguration.GetValue(SettingsCommand.AutoBurst); + protected static bool InBurst => DataCenter.SpecialType == SpecialCommandType.Burst || Service.Config.GetValue(SettingsCommand.AutoBurst); - bool CanUseHealAction => ClassJob.GetJobRole() == JobRole.Healer || Service.Config.UseHealWhenNotAHealer; + bool _canUseHealAction => (ClassJob.GetJobRole() == JobRole.Healer || Service.Config.UseHealWhenNotAHealer) && Service.Config.GetValue(SettingsCommand.AutoHeal); - protected virtual bool CanHealAreaAbility => DataCenter.CanHealAreaAbility && CanUseHealAction; + protected virtual bool CanHealAreaAbility => DataCenter.CanHealAreaAbility && _canUseHealAction; - protected virtual bool CanHealAreaSpell => DataCenter.CanHealAreaSpell && CanUseHealAction; + protected virtual bool CanHealAreaSpell => DataCenter.CanHealAreaSpell && _canUseHealAction; - protected virtual bool CanHealSingleAbility => DataCenter.CanHealSingleAbility && CanUseHealAction; + protected virtual bool CanHealSingleAbility => DataCenter.CanHealSingleAbility && _canUseHealAction; - protected virtual bool CanHealSingleSpell => DataCenter.CanHealSingleSpell && CanUseHealAction; + protected virtual bool CanHealSingleSpell => DataCenter.CanHealSingleSpell && _canUseHealAction; protected static SpecialCommandType SpecialType => DataCenter.SpecialType; protected static StateCommandType StateType => DataCenter.StateType; diff --git a/RotationSolver/Commands/RSCommands_OtherCommand.cs b/RotationSolver/Commands/RSCommands_OtherCommand.cs index a47993996..3f4f6ebd0 100644 --- a/RotationSolver/Commands/RSCommands_OtherCommand.cs +++ b/RotationSolver/Commands/RSCommands_OtherCommand.cs @@ -39,11 +39,11 @@ private static void DoSettingCommand(string str) return; } - Basic.Configuration.PluginConfiguration.SetValue(type, !Basic.Configuration.PluginConfiguration.GetValue(type)); + Service.Config.SetValue(type, !Service.Config.GetValue(type)); //Say out. Svc.Chat.Print(string.Format(LocalizationManager.RightLang.Commands_ChangeSettingsValue, - type.ToString(), Basic.Configuration.PluginConfiguration.GetValue(type))); + type.ToString(), Service.Config.GetValue(type))); } private static void ToggleActionCommand(string str) diff --git a/RotationSolver/Localization/Strings.cs b/RotationSolver/Localization/Strings.cs index e01c1dcf0..ea356e8f9 100644 --- a/RotationSolver/Localization/Strings.cs +++ b/RotationSolver/Localization/Strings.cs @@ -172,6 +172,8 @@ internal partial class Strings public string ConfigWindow_Param_UseAOEWhenManual { get; set; } = "Use AOE actions in manual mode"; public string ConfigWindow_Param_AutoBurst { get; set; } = "Automatic burst"; + + public string ConfigWindow_Param_AutoHeal { get; set; } = "Automatic Heal"; public string ConfigWindow_Param_UseAbility { get; set; } = "Auto-use abilities"; public string ConfigWindow_Param_NoNewHostiles { get; set; } = "Don't attack new mobs by aoe"; public string ConfigWindow_Params_NoNewHostilesDesc { get; set; } = "Never use any AOE action when this action may attack the mobs that not is a hostile target."; diff --git a/RotationSolver/UI/NextActionWindow.cs b/RotationSolver/UI/NextActionWindow.cs index 6e4f3b4a0..0a61e5fd5 100644 --- a/RotationSolver/UI/NextActionWindow.cs +++ b/RotationSolver/UI/NextActionWindow.cs @@ -19,17 +19,17 @@ public override void Draw() ControlWindow.DrawIAction(ActionUpdater.NextAction, width, 1); var strs = new List(3); - if(PluginConfiguration.GetValue(SettingsCommand.UseAOEAction) + if(Service.Config.GetValue(SettingsCommand.UseAOEAction) && (DataCenter.StateType != StateCommandType.Manual - || PluginConfiguration.GetValue(SettingsCommand.UseAOEWhenManual))) + || Service.Config.GetValue(SettingsCommand.UseAOEWhenManual))) { strs.Add("AOE"); } - if (PluginConfiguration.GetValue(SettingsCommand.PreventActions)) + if (Service.Config.GetValue(SettingsCommand.PreventActions)) { strs.Add("Prevent"); } - if (PluginConfiguration.GetValue(SettingsCommand.AutoBurst)) + if (Service.Config.GetValue(SettingsCommand.AutoBurst)) { strs.Add("Burst"); } diff --git a/RotationSolver/UI/RotationConfigWindow_Major.cs b/RotationSolver/UI/RotationConfigWindow_Major.cs index ece7f8366..ef8a122b4 100644 --- a/RotationSolver/UI/RotationConfigWindow_Major.cs +++ b/RotationSolver/UI/RotationConfigWindow_Major.cs @@ -74,10 +74,10 @@ public override unsafe void Draw() internal static void DrawCheckBox(string name, SettingsCommand command, string description = "", Action otherThing = null) { - var value = Basic.Configuration.PluginConfiguration.GetValue(command); + var value = Service.Config.GetValue(command); DrawCheckBox(name, ref value, command.GetDefault(), description, () => { - Basic.Configuration.PluginConfiguration.SetValue(command, value); + Service.Config.SetValue(command, value); otherThing?.Invoke(); }); diff --git a/RotationSolver/UI/RotationConfigWindow_Param.cs b/RotationSolver/UI/RotationConfigWindow_Param.cs index 3a2655cea..4d63dcc76 100644 --- a/RotationSolver/UI/RotationConfigWindow_Param.cs +++ b/RotationSolver/UI/RotationConfigWindow_Param.cs @@ -303,7 +303,7 @@ private void DrawParamAction() DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_UseAOEAction, SettingsCommand.UseAOEAction); - if(Basic.Configuration.PluginConfiguration.GetValue(SettingsCommand.UseAOEAction)) + if(Service.Config.GetValue(SettingsCommand.UseAOEAction)) { ImGui.Indent(); DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_UseAOEWhenManual, @@ -318,7 +318,7 @@ private void DrawParamAction() DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_PreventActionsIfOutOfCombat, SettingsCommand.PreventActions); - if (Basic.Configuration.PluginConfiguration.GetValue(SettingsCommand.PreventActions)) + if (Service.Config.GetValue(SettingsCommand.PreventActions)) { ImGui.Indent(); DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_PreventActionsIfDutyRing, @@ -330,6 +330,8 @@ private void DrawParamAction() DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_AutoBurst, SettingsCommand.AutoBurst); + DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_AutoHeal, SettingsCommand.AutoHeal); + DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_UseTinctures, ref Service.Config.UseTinctures, Service.Default.UseTinctures); @@ -339,7 +341,7 @@ private void DrawParamAction() DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_UseAbility, SettingsCommand.UseAbility); - if (Basic.Configuration.PluginConfiguration.GetValue(SettingsCommand.UseAbility)) + if (Service.Config.GetValue(SettingsCommand.UseAbility)) { ImGui.Indent(); @@ -398,7 +400,7 @@ private void DrawParamCondition() DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_OnlyHotOnTanks, ref Service.Config.OnlyHotOnTanks, Service.Default.OnlyHotOnTanks); - if (Basic.Configuration.PluginConfiguration.GetValue(SettingsCommand.UseGroundBeneficialAbility)) + if (Service.Config.GetValue(SettingsCommand.UseGroundBeneficialAbility)) { DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_BeneficialAreaOnTarget, ref Service.Config.BeneficialAreaOnTarget, Service.Default.BeneficialAreaOnTarget); @@ -504,7 +506,7 @@ private void DrawParamTarget() DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_ChooseAttackMark, ref Service.Config.ChooseAttackMark, Service.Default.ChooseAttackMark); - if (Service.Config.ChooseAttackMark && Basic.Configuration.PluginConfiguration.GetValue(SettingsCommand.UseAOEAction)) + if (Service.Config.ChooseAttackMark && Service.Config.GetValue(SettingsCommand.UseAOEAction)) { ImGui.Indent(); diff --git a/RotationSolver/Updaters/MajorUpdater.cs b/RotationSolver/Updaters/MajorUpdater.cs index 65caf5881..6398410e2 100644 --- a/RotationSolver/Updaters/MajorUpdater.cs +++ b/RotationSolver/Updaters/MajorUpdater.cs @@ -16,8 +16,8 @@ internal static class MajorUpdater && !Svc.Condition[ConditionFlag.BetweenAreas51] && Player.Available && !SocialUpdater.InPvp; - public static bool ShouldPreventActions => Basic.Configuration.PluginConfiguration.GetValue(SettingsCommand.PreventActions) - && (Basic.Configuration.PluginConfiguration.GetValue(SettingsCommand.PreventActionsDuty) + public static bool ShouldPreventActions => Service.Config.GetValue(SettingsCommand.PreventActions) + && (Service.Config.GetValue(SettingsCommand.PreventActionsDuty) && Svc.Condition[ConditionFlag.BoundByDuty] && !Svc.DutyState.IsDutyStarted || !DataCenter.HasHostilesInMaxRange);