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

Commit

Permalink
fix: changed action ahead to job config.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Nov 11, 2023
1 parent 2768f65 commit 06a9f4d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 29 deletions.
38 changes: 14 additions & 24 deletions Resources/InvincibleStatus.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,16 @@
[

//PvE

151, //Stoneskin
198, //Ice Spikes
350, //Vulnerability Down
385, //Fool's Tightrope
469, //High and Mighty
592, //Ring of Fire
945, //Shield of the Heavens

//PvE

//PvP

1240, //Chiten
1302, //Hallowed Ground
1303, //Inner Release
2413, //Covered
3039, //Undead redemption
3052, //Relentless Rush
3054 //Guard

//PvP
151,
198,
350,
385,
469,
592,
945,
1240,
1302,
1303,
2413,
3039,
3052,
3054
]
3 changes: 2 additions & 1 deletion RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ public enum JobConfigFloat : byte

[Default(0.15f), Unit(ConfigUnitType.Percent)] HealthForDyingTanks,
[Default(1f), Unit(ConfigUnitType.Percent)] HealthForAutoDefense,

[Default(0.08f, 0f, 0.5f), Unit(ConfigUnitType.Seconds)] ActionAhead,
}
#endregion

Expand Down Expand Up @@ -398,7 +400,6 @@ public enum PluginConfigFloat : byte

[Default(3f, 1f, 20f), Unit(ConfigUnitType.Seconds)] SpecialDuration,

[Default(0.08f, 0f, 0.5f), Unit(ConfigUnitType.Seconds)] ActionAhead,
[Default(0.06f, 0f, 0.5f), Unit(ConfigUnitType.Seconds)] ActionAheadForLast0GCD,

[Default(0f, 0f, 1f), Unit(ConfigUnitType.Seconds)] WeaponDelayMin,
Expand Down
4 changes: 3 additions & 1 deletion RotationSolver/Localization/ConfigTranslation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ internal static class ConfigTranslation
{
JobConfigFloat.HealthForDyingTanks => LocalizationManager.RightLang.ConfigWindow_Param_HealthForDyingTank,
JobConfigFloat.HealthForAutoDefense => LocalizationManager.RightLang.ConfigWindow_Auto_HealthForAutoDefense,

JobConfigFloat.ActionAhead => LocalizationManager.RightLang.ConfigWindow_Param_ActionAhead,

_ => string.Empty,
};

Expand Down Expand Up @@ -158,7 +161,6 @@ internal static class ConfigTranslation
public static string ToName(this PluginConfigFloat config) => config switch
{
// basic
PluginConfigFloat.ActionAhead => LocalizationManager.RightLang.ConfigWindow_Param_ActionAhead,
PluginConfigFloat.MinLastAbilityAdvanced => LocalizationManager.RightLang.ConfigWindow_Param_MinLastAbilityAdvanced,
PluginConfigFloat.CountDownAhead => LocalizationManager.RightLang.ConfigWindow_Param_CountDownAhead,
PluginConfigFloat.SpecialDuration => LocalizationManager.RightLang.ConfigWindow_Param_SpecialDuration,
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver/UI/RotationConfigWindow_Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ private static void DrawBasicTimer()
ImGui.PopStyleColor();
ImGui.PopFont();

var actionAhead = Service.Config.GetValue(PluginConfigFloat.ActionAhead);
var actionAhead = Service.Config.GetValue(DataCenter.Job, JobConfigFloat.ActionAhead);
var minAbilityAhead = Service.Config.GetValue(PluginConfigFloat.MinLastAbilityAdvanced);
var animationLockTime = DataCenter.MinAnimationLock;
var weaponDelay = (Service.Config.GetValue(PluginConfigFloat.WeaponDelayMin) + Service.Config.GetValue(PluginConfigFloat.WeaponDelayMax)) / 2;
Expand Down Expand Up @@ -368,7 +368,7 @@ private static void DrawBasicOthers()

private static readonly ISearchable[] _basicTimer = new ISearchable[]
{
new DragFloatSearchPlugin(PluginConfigFloat.ActionAhead, 0.002f),
new DragFloatSearchJob(JobConfigFloat.ActionAhead, 0.002f),
new DragFloatSearchPlugin(PluginConfigFloat.MinLastAbilityAdvanced, 0.002f),
new DragFloatSearchPlugin(PluginConfigFloat.MaxPing, 0.002f),
new DragFloatRangeSearchPlugin(PluginConfigFloat.WeaponDelayMin, PluginConfigFloat.WeaponDelayMax, 0.002f),
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Updaters/ActionUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ internal unsafe static bool CanDoAction()
|| Player.Object.CurrentHp == 0) return false;

var maxAhead = Math.Max(DataCenter.MinAnimationLock - DataCenter.Ping, 0.08f);
var ahead = Math.Min(maxAhead, Service.Config.GetValue(PluginConfigFloat.ActionAhead));
var ahead = Math.Min(maxAhead, Service.Config.GetValue(DataCenter.Job, JobConfigFloat.ActionAhead));

//GCD
var canUseGCD = DataCenter.WeaponRemain <= ahead;
Expand Down

0 comments on commit 06a9f4d

Please sign in to comment.