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

Commit

Permalink
fix: add using ground beneficial only moving option.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Aug 23, 2023
1 parent 1a921a2 commit 58a1039
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 10 deletions.
4 changes: 3 additions & 1 deletion Resources/HostileCastingArea.json
Original file line number Diff line number Diff line change
Expand Up @@ -396,5 +396,7 @@
20486,
20920,
20912,
10094
10094,
28973,
6622
]
2 changes: 1 addition & 1 deletion Resources/RotationSolverRecord.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ClickingCount": 6217
"ClickingCount": 7157
}
12 changes: 9 additions & 3 deletions RotationSolver.Basic/Actions/BaseAction_Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public partial class BaseAction
public byte AOECount { private get; init; } = 3;

/// <summary>
/// How many time does this ation need the target keep in live.
/// How many time does this action need the target keep in live.
/// </summary>
public float TimeToDie { get; init; } = 0;

Expand Down Expand Up @@ -196,10 +196,14 @@ private bool TargetAreaMove(float range, bool mustUse)
private bool TargetAreaFriend(float range, bool mustUse, PlayerCharacter player)
{
if (!Service.Config.GetValue(PluginConfigBool.UseGroundBeneficialAbility)) return false;
if (!Service.Config.GetValue(PluginConfigBool.UseGroundBeneficialAbilityWhenMoving) && DataCenter.IsMoving) return false;

switch (Service.Config.GetValue(PluginConfigInt.BeneficialAreaStrategy))
var strategy = Service.Config.GetValue(PluginConfigInt.BeneficialAreaStrategy);
switch (strategy)
{
case 0: // Find from list
case 1: // Only the list

if (OtherConfiguration.BeneficialPositions.TryGetValue(Svc.ClientState.TerritoryType, out var pts)
&& pts != null && pts.Length > 0)
{
Expand All @@ -214,8 +218,10 @@ private bool TargetAreaFriend(float range, bool mustUse, PlayerCharacter player)
return true;
}
}

if (strategy == 1) return false;
break;
case 1: // Target
case 2: // Target
if(Svc.Targets.Target != null && Svc.Targets.Target.DistanceToPlayer() < range)
{
Position = Svc.Targets.Target.Position;
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ public enum PluginConfigBool : byte
[Default(true)] RaisePlayerBySwift,
[Default(true)] AutoSpeedOutOfCombat,
[Default(true)] UseGroundBeneficialAbility,
[Default(false)] UseGroundBeneficialAbilityWhenMoving,
[Default(false)] TargetAllForFriendly,
[Default(false)] ShowCooldownWindow,

Expand Down Expand Up @@ -399,7 +400,7 @@ public enum PluginConfigFloat : byte
[Default(2f, 0f, 10f)] HostileIconHeight,
[Default(1f, 0.1f, 10f)] HostileIconSize,

[Default(1f, 0f, 2.5f)] StateIconHeight,
[Default(0.5f, 0f, 2.5f)] StateIconHeight,
[Default(1f, 0.7f, 10f)] StateIconSize,
}

Expand Down
2 changes: 2 additions & 0 deletions RotationSolver.Basic/Helpers/ObjectHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ public static bool IsDying(this BattleChara b)
public static float GetDeadTime(this BattleChara b, bool wholeTime = false)
{
if (b == null) return float.NaN;
if (b.IsDummy()) return 999f;

var objectId = b.ObjectId;

DateTime startTime = DateTime.MinValue;
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Rotations/Basic/DNC_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ protected static bool ExecuteStepGCD(out IAction act)
[RotationDesc(ActionID.EnAvant)]
protected sealed override bool MoveForwardAbility(out IAction act)
{
if (EnAvant.CanUse(out act, CanUseOption.MustUseEmpty)) return true;
if (EnAvant.CanUse(out act, CanUseOption.EmptyOrSkipCombo)) return true;
return false;
}

Expand Down
1 change: 1 addition & 0 deletions RotationSolver/Localization/ConfigTranslation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ internal static class ConfigTranslation
PluginConfigBool.RaisePlayerBySwift => LocalizationManager.RightLang.ConfigWindow_Param_RaisePlayerBySwift,
PluginConfigBool.AutoSpeedOutOfCombat => LocalizationManager.RightLang.ConfigWindow_Param_AutoSpeedOutOfCombat,
PluginConfigBool.UseGroundBeneficialAbility => LocalizationManager.RightLang.ConfigWindow_Param_UseGroundBeneficialAbility,
PluginConfigBool.UseGroundBeneficialAbilityWhenMoving => LocalizationManager.RightLang.ConfigWindow_Auto_UseGroundBeneficialAbilityWhenMoving,
PluginConfigBool.RaisePlayerByCasting => LocalizationManager.RightLang.ConfigWindow_Param_RaisePlayerByCasting,
PluginConfigBool.UseHealWhenNotAHealer => LocalizationManager.RightLang.ConfigWindow_Param_UseHealWhenNotAHealer,
PluginConfigBool.InterruptibleMoreCheck => LocalizationManager.RightLang.ConfigWindow_Param_InterruptibleMoreCheck,
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -494,5 +494,6 @@
"ConfigWindow_UI_HostileIconHeight": "Hostile Icon height from position",
"ConfigWindow_UI_HostileIconSize": "Hostile Icon size",
"ConfigWindow_UI_StateIconHeight": "State Icon height from position",
"ConfigWindow_UI_StateIconSize": "State Icon size"
"ConfigWindow_UI_StateIconSize": "State Icon size",
"ConfigWindow_UI_ShowStateIcon": "Show State Icon"
}
2 changes: 2 additions & 0 deletions RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ internal partial class Strings
public string ConfigWindow_Param_OnlyHotOnTanks { get; set; } = "Use single target healing over time actions only on tanks";

public string ConfigWindow_Param_BeneficialAreaOnLocations { get; set; } = "On Listed Position";
public string ConfigWindow_Param_BeneficialAreaOnlyOnLocations { get; set; } = "Only On Listed Position";
public string ConfigWindow_Param_BeneficialAreaOnTarget { get; set; } = "On target";

public string ConfigWindow_Param_BeneficialAreaOnCalculated { get; set; } = "On the calculated Position";
Expand Down Expand Up @@ -711,4 +712,5 @@ internal partial class Strings
public string ConfigWindow_UI_StateIconHeight { get; set; } = "State Icon height from position";
public string ConfigWindow_UI_StateIconSize { get; set; } = "State Icon size";
public string ConfigWindow_UI_ShowStateIcon { get; set; } = "Show State Icon";
public string ConfigWindow_Auto_UseGroundBeneficialAbilityWhenMoving { get; set; } = "Use beneficial area action when moving.";
}
1 change: 1 addition & 0 deletions RotationSolver/UI/PainterManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ public static void Init()
_stateImage = new Drawing3DImage(null, default, 0)
{
MustInViewRange = true,
DrawWithHeight = false,
UpdateEveryFrame = () =>
{
if (!Player.Available) return;
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/UI/RotationConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ private static void DrawRotationInformation()
ImGui.NewLine();
if (IconSet.GetTexture("https://www.gstatic.com/youtube/img/branding/youtubelogo/svg/youtubelogo.svg", out var icon) && ImGuiHelper.TextureButton(icon, wholeWidth, 250 * _scale, "Youtube Link"))
{
Util.OpenLink("https://youtu.be/" + youtubeLink);
Util.OpenLink("https://www.youtube.com/watch?v=" + youtubeLink);
}
}

Expand Down
4 changes: 3 additions & 1 deletion RotationSolver/UI/RotationConfigWindow_Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -715,8 +715,10 @@ private static void DrawAutoActionCondition()
new CheckBoxSearchPlugin(PluginConfigBool.UseGroundBeneficialAbility,
new DragIntSearchPlugin(PluginConfigInt.BeneficialAreaStrategy, () => new string[]{
LocalizationManager.RightLang.ConfigWindow_Param_BeneficialAreaOnLocations,
LocalizationManager.RightLang.ConfigWindow_Param_BeneficialAreaOnlyOnLocations,
LocalizationManager.RightLang.ConfigWindow_Param_BeneficialAreaOnTarget,
LocalizationManager.RightLang.ConfigWindow_Param_BeneficialAreaOnCalculated }))
LocalizationManager.RightLang.ConfigWindow_Param_BeneficialAreaOnCalculated }),
new CheckBoxSearchPlugin(PluginConfigBool.UseGroundBeneficialAbilityWhenMoving))
{
JobRoles = new JobRole[]
{
Expand Down

0 comments on commit 58a1039

Please sign in to comment.