Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: fix for unused UI and param for role.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jan 22, 2023
1 parent 38932a2 commit 0eb96c9
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 36 deletions.
4 changes: 2 additions & 2 deletions RotationSolver/Actions/BaseAction/BaseAction_Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 7 additions & 7 deletions RotationSolver/Helpers/ConfigurationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
19 changes: 2 additions & 17 deletions RotationSolver/Rotations/CustomRotation/CustomRotation_Display.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
});
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/Rotations/Melee/RPR/RPR_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public RPR_Default()
{DescType.DefenseSingle, $"{ArcaneCrest}"},
{DescType.MoveAction, $"{HellsIngress}"},
};

private protected override IAction CountDownAction(float remainTime)
{
//倒数收获月
Expand Down
10 changes: 5 additions & 5 deletions RotationSolver/Updaters/TargetUpdater_Friends.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
{
Expand All @@ -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[]
{
Expand All @@ -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 =>
{
Expand All @@ -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 =>
{
Expand Down
11 changes: 6 additions & 5 deletions RotationSolver/Windows/RotationConfigWindow_Rotation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions docs/RotationDev/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


0 comments on commit 0eb96c9

Please sign in to comment.