diff --git a/RotationSolver/Actions/BaseAction/BaseAction_Target.cs b/RotationSolver/Actions/BaseAction/BaseAction_Target.cs index 895695215..98096ff0d 100644 --- a/RotationSolver/Actions/BaseAction/BaseAction_Target.cs +++ b/RotationSolver/Actions/BaseAction/BaseAction_Target.cs @@ -57,11 +57,11 @@ internal static bool TankDefenseSelf(BattleChara chara) } internal static bool TankBreakOtherCheck(ClassJobID id, BattleChara chara) { - var tankHealth = Service.Configuration.HealthForDyingTanks.TryGetValue(id, out var value) ? value : 0.15f; + var tankHealth = id.GetHealthForDyingTank(); return TargetUpdater.HaveHostilesInRange && Service.ClientState.LocalPlayer.GetHealthRatio() < tankHealth - && TargetUpdater.PartyMembersAverHP > tankHealth + 0.1f; + && TargetUpdater.PartyMembersAverHP > tankHealth + 0.05f; } private bool FindTarget(bool mustUse, out BattleChara target) diff --git a/RotationSolver/Helpers/ConfigurationHelper.cs b/RotationSolver/Helpers/ConfigurationHelper.cs index b702c2be4..758622e82 100644 --- a/RotationSolver/Helpers/ConfigurationHelper.cs +++ b/RotationSolver/Helpers/ConfigurationHelper.cs @@ -45,24 +45,24 @@ public record LocationInfo(EnemyPositional Loc, byte[] Tags); public static readonly VirtualKey[] Keys = new VirtualKey[] { VirtualKey.CONTROL, VirtualKey.SHIFT, VirtualKey.MENU }; - internal static float GetHealAreaAbility(ClassJobID job) + internal static float GetHealAreaAbility(this ClassJobID job) => Service.Configuration.HealthAreaAbilities.TryGetValue(job, out var value) ? value : Service.Configuration.HealthAreaAbility; - internal static float GetHealAreafSpell(ClassJobID job) + internal static float GetHealAreafSpell(this ClassJobID job) => Service.Configuration.HealthAreafSpells.TryGetValue(job, out var value) ? value : Service.Configuration.HealthAreafSpell; - internal static float GetHealingOfTimeSubtractArea(ClassJobID job) + internal static float GetHealingOfTimeSubtractArea(this ClassJobID job) => Service.Configuration.HealingOfTimeSubtractAreas.TryGetValue(job, out var value) ? value : 0.2f; - internal static float GetHealSingleAbility(ClassJobID job) + internal static float GetHealSingleAbility(this ClassJobID job) => Service.Configuration.HealthSingleAbilities.TryGetValue(job, out var value) ? value : Service.Configuration.HealthSingleAbility; - internal static float GetHealSingleSpell(ClassJobID job) + internal static float GetHealSingleSpell(this ClassJobID job) => Service.Configuration.HealthSingleSpells.TryGetValue(job, out var value) ? value : Service.Configuration.HealthSingleSpell; - internal static float GetHealingOfTimeSubtractSingle(ClassJobID job) + internal static float GetHealingOfTimeSubtractSingle(this ClassJobID job) => Service.Configuration.HealingOfTimeSubtractSingles.TryGetValue(job, out var value) ? value : 0.2f; - internal static float GetHealthForDyingTank(ClassJobID job) + internal static float GetHealthForDyingTank(this ClassJobID job) => Service.Configuration.HealthForDyingTanks.TryGetValue(job, out var value) ? value : 0.15f; } diff --git a/RotationSolver/Rotations/CustomRotation/CustomRotation_Display.cs b/RotationSolver/Rotations/CustomRotation/CustomRotation_Display.cs index 35135f242..04091dab7 100644 --- a/RotationSolver/Rotations/CustomRotation/CustomRotation_Display.cs +++ b/RotationSolver/Rotations/CustomRotation/CustomRotation_Display.cs @@ -7,6 +7,7 @@ using RotationSolver.Helpers; using RotationSolver.Localization; using RotationSolver.SigReplacers; +using RotationSolver.Windows.RotationConfigWindow; using System; using System.Collections.Generic; using System.Linq; @@ -60,23 +61,7 @@ public unsafe void Display(ICustomRotation[] rotations, bool canAddButton) => th ImGuiHelper.HoveredString(LocalizationManager.RightLang.Configwindow_Helper_OpenSource); }, () => { - int isAllTargetAsHostile = (byte)IconReplacer.GetTargetHostileType(Job); - ImGui.SetNextItemWidth(300); - if (ImGui.Combo(LocalizationManager.RightLang.Configwindow_Param_RightNowTargetToHostileType + $"##HostileType{GetHashCode()}", ref isAllTargetAsHostile, new string[] - { - LocalizationManager.RightLang.Configwindow_Param_TargetToHostileType1, - LocalizationManager.RightLang.Configwindow_Param_TargetToHostileType2, - LocalizationManager.RightLang.Configwindow_Param_TargetToHostileType3, - }, 3)) - { - Service.Configuration.TargetToHostileTypes[Job.RowId] = (byte)isAllTargetAsHostile; - Service.Configuration.Save(); - } - - if(isAllTargetAsHostile != 2 && !Service.Configuration.AutoOffBetweenArea) - { - ImGui.TextColored(ImGuiColors.DPSRed, LocalizationManager.RightLang.Configwindow_Param_NoticeUnexpectedCombat); - } + RotationConfigWindow.DrawRotationRole(this); Configs.Draw(canAddButton); }); diff --git a/RotationSolver/Rotations/Melee/RPR/RPR_Default.cs b/RotationSolver/Rotations/Melee/RPR/RPR_Default.cs index 47f2b899c..ad7e38773 100644 --- a/RotationSolver/Rotations/Melee/RPR/RPR_Default.cs +++ b/RotationSolver/Rotations/Melee/RPR/RPR_Default.cs @@ -36,6 +36,7 @@ public RPR_Default() {DescType.DefenseSingle, $"{ArcaneCrest}"}, {DescType.MoveAction, $"{HellsIngress}"}, }; + private protected override IAction CountDownAction(float remainTime) { //倒数收获月 diff --git a/RotationSolver/Updaters/TargetUpdater_Friends.cs b/RotationSolver/Updaters/TargetUpdater_Friends.cs index cbad8a647..ff84d7dfc 100644 --- a/RotationSolver/Updaters/TargetUpdater_Friends.cs +++ b/RotationSolver/Updaters/TargetUpdater_Friends.cs @@ -162,10 +162,9 @@ internal unsafe static void UpdateFriends() var job = (ClassJobID)Service.ClientState.LocalPlayer.ClassJob.Id; - float value; if(PartyMembers.Count() > 2) { - var hotSubArea = Service.Configuration.HealingOfTimeSubtractAreas.TryGetValue(job, out value) ? value : 0.3f; + var hotSubArea = job.GetHealingOfTimeSubtractArea(); var areaHots = new StatusID[] { @@ -190,7 +189,7 @@ internal unsafe static void UpdateFriends() CanHealAreaAbility = CanHealAreaSpell = false; } - var hotSubSingle = Service.Configuration.HealingOfTimeSubtractSingles.TryGetValue(job, out value) ? value : 0.3f; + var hotSubSingle = job.GetHealingOfTimeSubtractSingle(); var singleHots = new StatusID[] { @@ -200,7 +199,7 @@ internal unsafe static void UpdateFriends() StatusID.Regen3 }; - var healsingAbility = Service.Configuration.HealthSingleAbilities.TryGetValue(job, out value) ? value : Service.Configuration.HealthSingleAbility; + var healsingAbility = job.GetHealSingleAbility(); //Hot衰减 var abilityCount = PartyMembers.Count(p => { @@ -213,7 +212,8 @@ internal unsafe static void UpdateFriends() }); CanHealSingleAbility = abilityCount > 0; - var healsingSpell = Service.Configuration.HealthSingleSpells.TryGetValue(job, out value) ? value : Service.Configuration.HealthSingleSpell; + + var healsingSpell = job.GetHealSingleSpell(); var gcdCount = PartyMembers.Count(p => { diff --git a/RotationSolver/Windows/RotationConfigWindow_Rotation.cs b/RotationSolver/Windows/RotationConfigWindow_Rotation.cs index d63243257..da0e8ceca 100644 --- a/RotationSolver/Windows/RotationConfigWindow_Rotation.cs +++ b/RotationSolver/Windows/RotationConfigWindow_Rotation.cs @@ -80,16 +80,12 @@ private static void DrawRotations(IconReplacer.CustomRotationGroup[] rotations) } } - private static void DrawRotation(ICustomRotation rotation, bool canAddButton) + internal static void DrawRotationRole(ICustomRotation rotation) { - ImGui.Spacing(); - DrawTargetHostileTYpe(rotation); DrawSpecialRoleSettings(rotation.Job.GetJobRole(), rotation.JobIDs[0]); ImGui.Spacing(); - - rotation.Configs.Draw(canAddButton); } private static void DrawTargetHostileTYpe(ICustomRotation rotation) @@ -106,6 +102,11 @@ private static void DrawTargetHostileTYpe(ICustomRotation rotation) Service.Configuration.TargetToHostileTypes[rotation.Job.RowId] = (byte)isAllTargetAsHostile; Service.Configuration.Save(); } + + if (isAllTargetAsHostile != 2 && !Service.Configuration.AutoOffBetweenArea) + { + ImGui.TextColored(ImGuiColors.DPSRed, LocalizationManager.RightLang.Configwindow_Param_NoticeUnexpectedCombat); + } } private static void DrawSpecialRoleSettings(JobRole role, ClassJobID job) diff --git a/docs/RotationDev/_sidebar.md b/docs/RotationDev/_sidebar.md index 68eac3e01..e7f22334b 100644 --- a/docs/RotationDev/_sidebar.md +++ b/docs/RotationDev/_sidebar.md @@ -3,6 +3,14 @@ - [Simple Rotation](RotationDev/simple-rotation.md) - Fundamentals - [Rotation Part](RotationDev/rotation.md) + - Rotation Info + - Action + - Character - Advanced + - Customization + - Action List + - Data Maintain + - Debug +