From 5b35f8ffe395ad1832d4121c5b3addb99f118bb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E6=B0=B4?= <1123993881@qq.com> Date: Tue, 8 Aug 2023 20:45:35 +0800 Subject: [PATCH] fix: add is in high-end duty property. --- RotationSolver.Basic/DataCenter.cs | 2 +- .../Rotations/Basic/BLU_Base.cs | 2 +- .../Rotations/CustomRotation_Medicine.cs | 2 +- .../Rotations/CustomRotation_OtherInfo.cs | 5 +++++ RotationSolver/Updaters/SocialUpdater.cs | 17 ++--------------- 5 files changed, 10 insertions(+), 18 deletions(-) diff --git a/RotationSolver.Basic/DataCenter.cs b/RotationSolver.Basic/DataCenter.cs index c7776b304..a9e90ed7e 100644 --- a/RotationSolver.Basic/DataCenter.cs +++ b/RotationSolver.Basic/DataCenter.cs @@ -36,7 +36,7 @@ internal static bool HasApplyStatus(uint id, StatusID[] ids) } return false; } - public static bool InHighEndDuty { get; set; } = false; + public static bool IsInHighEndDuty { get; set; } = false; public static TerritoryContentType TerritoryContentType { get; set; } = TerritoryContentType.None; public static AutoStatus AutoStatus { get; private set; } = AutoStatus.None; diff --git a/RotationSolver.Basic/Rotations/Basic/BLU_Base.cs b/RotationSolver.Basic/Rotations/Basic/BLU_Base.cs index e0314f9dd..bff995837 100644 --- a/RotationSolver.Basic/Rotations/Basic/BLU_Base.cs +++ b/RotationSolver.Basic/Rotations/Basic/BLU_Base.cs @@ -465,7 +465,7 @@ public override bool CanUse(out IAction act, CanUseOption option = CanUseOption. /// /// /// - public static IBLUAction MortalFlame { get; } = new BLUAction(ActionID.MortalFlame); + public static IBLUAction MortalFlame { get; } = new BLUAction(ActionID.MortalFlame, ActionOption.Dot); /// /// diff --git a/RotationSolver.Basic/Rotations/CustomRotation_Medicine.cs b/RotationSolver.Basic/Rotations/CustomRotation_Medicine.cs index 16caf1d9b..1fd37f22e 100644 --- a/RotationSolver.Basic/Rotations/CustomRotation_Medicine.cs +++ b/RotationSolver.Basic/Rotations/CustomRotation_Medicine.cs @@ -122,7 +122,7 @@ protected bool UseBurstMedicine(out IAction act, bool clippingCheck = true) { act = null; - if (!(Target?.IsDummy() ?? false) && !DataCenter.InHighEndDuty) return false; + if (!(Target?.IsDummy() ?? false) && !DataCenter.IsInHighEndDuty) return false; return MedicineType switch { diff --git a/RotationSolver.Basic/Rotations/CustomRotation_OtherInfo.cs b/RotationSolver.Basic/Rotations/CustomRotation_OtherInfo.cs index cbd18f5a9..2c4e67457 100644 --- a/RotationSolver.Basic/Rotations/CustomRotation_OtherInfo.cs +++ b/RotationSolver.Basic/Rotations/CustomRotation_OtherInfo.cs @@ -244,6 +244,11 @@ public abstract partial class CustomRotation /// protected static TerritoryContentType TerritoryContentType => DataCenter.TerritoryContentType; + /// + /// Is player in high-end duty. + /// + protected static bool IsInHighEndDuty => DataCenter.IsInHighEndDuty; + /// /// /// diff --git a/RotationSolver/Updaters/SocialUpdater.cs b/RotationSolver/Updaters/SocialUpdater.cs index 344688dde..d751ae115 100644 --- a/RotationSolver/Updaters/SocialUpdater.cs +++ b/RotationSolver/Updaters/SocialUpdater.cs @@ -3,16 +3,12 @@ using Dalamud.Game.Text.SeStringHandling; using Dalamud.Game.Text.SeStringHandling.Payloads; using Dalamud.Logging; -using ECommons.Automation; -using ECommons.Configuration; using ECommons.DalamudServices; using ECommons.GameFunctions; using ECommons.GameHelpers; using FFXIVClientStructs.FFXIV.Client.UI; using Lumina.Excel.GeneratedSheets; -using RotationSolver.Commands; using RotationSolver.Localization; -using RotationSolver.UI; using System.Security.Cryptography; using System.Text; @@ -21,7 +17,6 @@ namespace RotationSolver.Updaters; internal class SocialUpdater { public static bool InPvp { get; private set; } - //public static bool InHouse { get; private set; } private static readonly List _macroToAuthor = new() { @@ -38,9 +33,6 @@ internal class SocialUpdater static bool _canSaying = false; public static TerritoryType[] HighEndDuties { get; private set; } = Array.Empty(); - //public static bool IsHouseArea(TerritoryType territory) - // => territory?.Bg.RawString.Contains("/hou/") ?? false; - public static string GetDutyName(TerritoryType territory) { return territory.ContentFinderCondition?.Value?.Name?.RawString ?? "High-end Duty"; @@ -95,14 +87,9 @@ static void ClientState_TerritoryChanged(object sender, ushort e) _canSaying = true; } InPvp = territory?.IsPvpZone ?? false; - //InHouse = IsHouseArea(territory); - //if (PainterManager._painter != null) PainterManager._painter.Enable = !InHouse; - DataCenter.TerritoryContentType = (TerritoryContentType)(territory?.ContentFinderCondition?.Value?.ContentType?.Value?.RowId ?? 0); - DataCenter.InHighEndDuty = HighEndDuties.Any(t => t.RowId == territory.RowId); -#if DEBUG - //PluginLog.Information($"Territory: {e}"); -#endif + DataCenter.TerritoryContentType = (TerritoryContentType)(territory?.ContentFinderCondition?.Value?.ContentType?.Value?.RowId ?? 0); + DataCenter.IsInHighEndDuty = HighEndDuties.Any(t => t.RowId == territory.RowId); try {