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

Commit

Permalink
fix: changed target area movement.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Aug 21, 2023
1 parent 35a1f55 commit ba1c311
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Resources/InvincibleStatus.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[
151,
198,
469
469,
350
]
2 changes: 1 addition & 1 deletion Resources/RotationSolverRecord.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ClickingCount": 1144
"ClickingCount": 1468
}
19 changes: 16 additions & 3 deletions RotationSolver.Basic/Actions/BaseAction_Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using ECommons.GameFunctions;
using ECommons.GameHelpers;
using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
using FFXIVClientStructs.FFXIV.Common.Component.BGCollision;
using RotationSolver.Basic.Configuration;

Expand Down Expand Up @@ -163,9 +164,21 @@ private bool TargetAreaMove(float range, bool mustUse)
if (Service.Config.GetValue(PluginConfigBool.MoveAreaActionFarthest))
{
Vector3 pPosition = Player.Object.Position;
float rotation = Player.Object.Rotation;
Position = new Vector3(pPosition.X + (float)Math.Sin(rotation) * range, pPosition.Y,
pPosition.Z + (float)Math.Cos(rotation) * range);
if (Service.Config.GetValue(PluginConfigBool.MoveTowardsScreenCenter)) unsafe
{
var camera = CameraManager.Instance()->CurrentCamera;
var tar = camera->LookAtVector - camera->Object.Position;
tar.Y = 0;
tar = tar / ((Vector3)tar).Length() * range;
Position = new Vector3(pPosition.X + tar.X, pPosition.Y,
pPosition.Z + tar.Z);
}
else
{
float rotation = Player.Object.Rotation;
Position = new Vector3(pPosition.X + (float)Math.Sin(rotation) * range, pPosition.Y,
pPosition.Z + (float)Math.Cos(rotation) * range);
}
return true;
}
else
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"ConfigWindow_Param_TargetQuestPriority": "Target quest priority.",
"ConfigWindow_Param_RaiseBrinkOfDeath": "Raise player even has Brink of Death",
"ConfigWindow_Param_MoveAreaActionFarthest": "Moving Area Ability to farthest",
"ConfigWindow_Param_MoveAreaActionFarthestDesc": "Move to the furthest position from character's face direction.",
"ConfigWindow_Param_MoveAreaActionFarthestDesc": "Move to the furthest position for targeting are movement actions.",
"ConfigWindow_Param_HostileDesc": "You can set the logic of hostile target selection to allow flexibility in switching the logic of selecting hostile in battle.",
"ConfigWindow_Param_HostileCondition": "Hostile target selection condition",
"ConfigWindow_Control_OnlyShowWithHostileOrInDuty": "Only show these windows if there are enemies in or in duty",
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ internal partial class Strings

public string ConfigWindow_Param_RaiseBrinkOfDeath { get; set; } = "Raise player even has Brink of Death";
public string ConfigWindow_Param_MoveAreaActionFarthest { get; set; } = "Moving Area Ability to farthest";
public string ConfigWindow_Param_MoveAreaActionFarthestDesc { get; set; } = "Move to the furthest position from character's face direction.";
public string ConfigWindow_Param_MoveAreaActionFarthestDesc { get; set; } = "Move to the furthest position for targeting are movement actions.";

public string ConfigWindow_Param_HostileDesc { get; set; } = "You can set the logic of hostile target selection to allow flexibility in switching the logic of selecting hostile in battle.";
public string ConfigWindow_Param_HostileCondition { get; set; } = "Hostile target selection condition";
Expand Down

0 comments on commit ba1c311

Please sign in to comment.