From 9479c7858257599ed48a6de22ad701cfda376283 Mon Sep 17 00:00:00 2001
From: NostraThomas99 <34015422+NostraThomas99@users.noreply.github.com>
Date: Mon, 1 Apr 2024 16:26:39 -0500
Subject: [PATCH 1/2] Reworked manual mode to be better
---
.github/workflows/publish.yaml | 14 ------
.../Actions/ActionTargetInfo.cs | 44 +++++--------------
RotationSolver/Updaters/StateUpdater.cs | 2 +-
3 files changed, 12 insertions(+), 48 deletions(-)
diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml
index 5cafaedc9..b92876f13 100644
--- a/.github/workflows/publish.yaml
+++ b/.github/workflows/publish.yaml
@@ -19,15 +19,6 @@ jobs:
$tag = "${{ github.ref }}" -replace 'refs/tags/', ''
"tag=$tag" | Out-File -Append -FilePath $Env:GITHUB_ENV
-
- if ($tag -match "-test$") {
- $branch = "testing"
- $tag = $tag -replace '-test$', ''
- } else {
- $branch = "latest"
- }
-
- "branch=$branch" | Out-File -Append -FilePath $Env:GITHUB_ENV
- name: Set up .NET
uses: actions/setup-dotnet@v1
@@ -53,9 +44,4 @@ jobs:
with:
files: ./build/RotationSolver.zip
token: ${{ secrets.GITHUB_TOKEN }}
- draft: false
- make_latest: ${{ env.branch == 'latest' }}
- prerelease: ${{ env.branch == 'testing' }}
-
-
diff --git a/RotationSolver.Basic/Actions/ActionTargetInfo.cs b/RotationSolver.Basic/Actions/ActionTargetInfo.cs
index 563f43a9d..dab601e86 100644
--- a/RotationSolver.Basic/Actions/ActionTargetInfo.cs
+++ b/RotationSolver.Basic/Actions/ActionTargetInfo.cs
@@ -30,11 +30,15 @@ public struct ActionTargetInfo(IBaseAction action)
///
public readonly bool IsSingleTarget => action.Action.CastType == 1;
///
- /// Is this action target are.
+ /// Is this action target area.
///
-
public readonly bool IsTargetArea => action.Action.TargetArea;
+ ///
+ /// Is this action friendly.
+ ///
+ public readonly bool IsTargetFriendly => action.Setting.IsFriendly;
+
private static bool NoAOE
{
get
@@ -66,6 +70,11 @@ private readonly IEnumerable GetCanTargets(bool skipStatusProvideCh
objs.Add(obj);
}
+ if (DataCenter.IsManual && !IsTargetFriendly)
+ {
+ return objs.Where(CanUseTo).Where(InViewTarget).Where(action.Setting.CanTarget).Where(o => o.Address == Svc.Targets.Target.Address);
+ }
+
return objs.Where(CanUseTo).Where(InViewTarget).Where(action.Setting.CanTarget);
}
@@ -226,40 +235,9 @@ private readonly bool CheckTimeToKill(GameObject gameObject)
{
return FindTargetArea(canTargets, canAffects, range, player);
}
- else if (DataCenter.IsManual)
- {
- var t = Svc.Targets.Target as BattleChara;
-
- if (t == null || !action.Setting.CanTarget(t)) return null;
-
- if (type == TargetType.Move)
- {
- return null;
- }
- else if (IsSingleTarget)
- {
- if (CanUseTo(t) && CheckStatus(t, skipStatusProvideCheck) && t.DistanceToPlayer() <= range)
- {
- return new(t, [.. GetAffects(t, canAffects)], t.Position);
- }
- }
- else if (!NoAOE)
- {
- var effects = GetAffects(t, canAffects).ToArray();
- if (effects.Length >= action.Config.AoeCount || skipAoeCheck)
- {
- return new(t, effects, t.Position);
- }
- }
- return null;
- }
var targets = GetMostCanTargetObjects(canTargets, canAffects,
skipAoeCheck ? 0 : action.Config.AoeCount);
- if (type == TargetType.BeAttacked && !action.Setting.IsFriendly)
- {
- type = TargetType.Big;
- }
var target = FindTargetByType(targets, type, action.Config.AutoHealRatio, action.Setting.SpecialType);
if (target == null) return null;
diff --git a/RotationSolver/Updaters/StateUpdater.cs b/RotationSolver/Updaters/StateUpdater.cs
index baf232413..1b54dede6 100644
--- a/RotationSolver/Updaters/StateUpdater.cs
+++ b/RotationSolver/Updaters/StateUpdater.cs
@@ -106,7 +106,7 @@ private static AutoStatus StatusFromAutomatic()
}
}
- if (DataCenter.InCombat)
+ if (DataCenter.InCombat || DataCenter.IsManual)
{
if (Service.Config.UseDefenseAbility)
{
From 3099283fa8103ef9b94f72b3e31e96a7889f500c Mon Sep 17 00:00:00 2001
From: NostraThomas99 <34015422+NostraThomas99@users.noreply.github.com>
Date: Mon, 1 Apr 2024 16:27:22 -0500
Subject: [PATCH 2/2] Update StateUpdater.cs
---
RotationSolver/Updaters/StateUpdater.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/RotationSolver/Updaters/StateUpdater.cs b/RotationSolver/Updaters/StateUpdater.cs
index 1b54dede6..baf232413 100644
--- a/RotationSolver/Updaters/StateUpdater.cs
+++ b/RotationSolver/Updaters/StateUpdater.cs
@@ -106,7 +106,7 @@ private static AutoStatus StatusFromAutomatic()
}
}
- if (DataCenter.InCombat || DataCenter.IsManual)
+ if (DataCenter.InCombat)
{
if (Service.Config.UseDefenseAbility)
{