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

Commit

Permalink
fix: fixed some healing but.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Feb 22, 2024
1 parent 6738b19 commit e8431e8
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 22 deletions.
3 changes: 2 additions & 1 deletion Resources/HostileCastingArea.json
Original file line number Diff line number Diff line change
Expand Up @@ -493,5 +493,6 @@
20253,
17435,
35384,
35386
35386,
36001
]
4 changes: 2 additions & 2 deletions Resources/RotationSolverRecord.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"ClickingCount": 68504,
"SayingHelloCount": 57,
"ClickingCount": 68802,
"SayingHelloCount": 58,
"SaidUsers": []
}
23 changes: 13 additions & 10 deletions RotationSolver.Basic/Actions/ActionTargetInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -695,19 +695,22 @@ private readonly bool CanGetTarget(GameObject target, GameObject subTarget)
if (!gameObjects.Any()) return null;
var attachedT = gameObjects.Where(ObjectHelper.IsTargetOnSelf);

if (!attachedT.Any())
if (!DataCenter.AutoStatus.HasFlag(AutoStatus.DefenseSingle))
{
attachedT = gameObjects.Where(tank => tank.HasStatus(false, StatusHelper.TankStanceStatus));
}
if (!attachedT.Any())
{
attachedT = gameObjects.Where(tank => tank.HasStatus(false, StatusHelper.TankStanceStatus));
}

if (!attachedT.Any())
{
attachedT = gameObjects.GetJobCategory(JobRole.Tank);
}
if (!attachedT.Any())
{
attachedT = gameObjects.GetJobCategory(JobRole.Tank);
}

if (!attachedT.Any())
{
attachedT = gameObjects;
if (!attachedT.Any())
{
attachedT = gameObjects;
}
}

return attachedT.OrderBy(ObjectHelper.GetHealthRatio).FirstOrDefault();
Expand Down
2 changes: 2 additions & 0 deletions RotationSolver.Basic/Rotations/CustomRotation_Ability.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ private bool Ability(IAction nextGCD, out IAction? act)
}

IBaseAction.TargetOverride = TargetType.Heal;
IBaseAction.ShouldEndSpecial = false;

if (DataCenter.CommandStatus.HasFlag(AutoStatus.HealAreaAbility))
{
Expand Down Expand Up @@ -78,6 +79,7 @@ private bool Ability(IAction nextGCD, out IAction? act)
}

IBaseAction.TargetOverride = null;
IBaseAction.ShouldEndSpecial = true;

if (DataCenter.CommandStatus.HasFlag(AutoStatus.Speed)
&& SpeedAbility(out act)) return true;
Expand Down
10 changes: 9 additions & 1 deletion RotationSolver.Basic/Rotations/CustomRotation_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ partial class CustomRotation
internal static void LoadActionSetting(ref IBaseAction action)
{
var a = action.Action;
if(!a.CanTargetFriendly && !a.CanTargetHostile)
if(a.CanTargetFriendly || a.CanTargetParty)
{
action.Setting.IsFriendly = true;
}
else if (a.CanTargetHostile)
{
action.Setting.IsFriendly = false;
}
else
{
action.Setting.IsFriendly = a.EffectRange > 5;
}
Expand Down
6 changes: 5 additions & 1 deletion RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,5 +204,9 @@
"RotationSolver.Data.UiString.ConfigWindow_List_Statuses": "Statuses",
"RotationSolver.Data.UiString.ConfigWindow_List_Actions": "Actions",
"RotationSolver.Data.UiString.ConfigWindow_List_Territories": "Map specific settings",
"RotationSolver.Data.UiString.ConfigWindow_Rotation_BetaRotation": "Beta Rotation!"
"RotationSolver.Data.UiString.ConfigWindow_Rotation_BetaRotation": "Beta Rotation!",
"RotationSolver.Data.UiString.SpecialCommandType_HealSingle": "Heal Single",
"RotationSolver.Data.UiString.SpecialCommandType_HealArea": "Heal Area",
"RotationSolver.Data.UiString.SpecialCommandType_DefenseSingle": "Defense Single",
"RotationSolver.Data.UiString.ConfigWindow_Actions_GcdCount": "How many gcds are needed to add the status."
}
4 changes: 2 additions & 2 deletions RotationSolver/UI/RotationConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1424,8 +1424,8 @@ private static unsafe void DrawActions()
ImGui.Text("Recast One: " + action.Cooldown.RecastTimeOneChargeRaw.ToString());
ImGui.Text("Recast Elapsed: " + action.Cooldown.RecastTimeElapsedRaw.ToString());

ImGui.Text($"Can Use: {action.CanUse(out _)} ");
ImGui.Text("IgnoreCastCheck:" + action.CanUse(out _, ignoreCastingCheck : true).ToString());
ImGui.Text($"Can Use: {action.CanUse(out _, ignoreClippingCheck: true)} ");
ImGui.Text("IgnoreCastCheck:" + action.CanUse(out _, ignoreClippingCheck: true, ignoreCastingCheck : true).ToString());
if (action.Target != null)
{
ImGui.Text("Target Name: " + action.Target.Value.Target?.Name ?? string.Empty);
Expand Down
11 changes: 6 additions & 5 deletions RotationSolver/Updaters/StateUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ public static void UpdateState()
DataCenter.AutoStatus = StatusFromAutomatic();
}

static readonly RandomDelay _healDelay1 = new(() => Service.Config.HealDelay),
_healDelay2 = new(() => Service.Config.HealDelay),
_healDelay3 = new(() => Service.Config.HealDelay),
_healDelay4 = new(() => Service.Config.HealDelay);
static RandomDelay
_healDelay1 = new(() => Service.Config.HealDelay),
_healDelay2 = new(() => Service.Config.HealDelay),
_healDelay3 = new(() => Service.Config.HealDelay),
_healDelay4 = new(() => Service.Config.HealDelay);

private static AutoStatus StatusFromAutomatic()
{
Expand All @@ -44,7 +45,7 @@ private static AutoStatus StatusFromAutomatic()
}
}

if (DataCenter.HPNotFull && CanUseHealAction)
if (DataCenter.HPNotFull /*&& CanUseHealAction*/)
{
var singleAbility = ShouldHealSingle(StatusHelper.SingleHots,
Service.Config.HealthSingleAbility,
Expand Down

0 comments on commit e8431e8

Please sign in to comment.