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

Commit

Permalink
fix: fixed targeting issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Feb 16, 2024
1 parent 206e7a6 commit 60542c3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 67 deletions.
5 changes: 5 additions & 0 deletions RotationSolver.Basic/Actions/ActionTargetInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,15 @@ private static bool InViewTarget(BattleChara gameObject)
}
return true;
}

private readonly unsafe bool CanUseTo(GameObject tar)
{
if (tar == null || !Player.Available) return false;
if (tar.ObjectId == GameObject.InvalidGameObjectId) return false;
if (tar.ObjectId == 0) return false;

var tarAddress = tar.Struct();
if (tarAddress == null) return false;

if ((ActionID)_action.Info.ID != ActionID.AethericMimicryPvE
&& !ActionManager.CanUseActionOnTarget(_action.Info.AdjustedID, tarAddress)) return false;
Expand Down
17 changes: 6 additions & 11 deletions RotationSolver.Basic/Rotations/CustomRotation_Invoke.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@ public bool TryInvoke(out IAction? newAction, out IAction? gcdAction)
return false;
}

//if (DataCenter.Territory?.IsPvpZone ?? false)
//{
// if (!Type.HasFlag(CombatType.PvP)) return false;
//}
//else
//{
// if (!Type.HasFlag(CombatType.PvE)) return false;
//}

try
{
UpdateInfo();
Expand Down Expand Up @@ -78,9 +69,10 @@ private void UpdateActions(JobRole role)
ActionHealSingleAbility = HealSingleAbility(out act) ? act : null;
}

IBaseAction.TargetOverride = TargetType.BeAttacked;
ActionDefenseAreaGCD = DefenseAreaGCD(out act) ? act : null;

ActionDefenseSingleGCD = DefenseSingleGCD(out act) ? act : null;
IBaseAction.TargetOverride = null;

ActionDispelStancePositionalGCD = role switch
{
Expand All @@ -94,9 +86,10 @@ private void UpdateActions(JobRole role)
_ => null,
};

IBaseAction.TargetOverride = TargetType.BeAttacked;
ActionDefenseAreaAbility = DefenseAreaAbility(out act) ? act : null;

ActionDefenseSingleAbility = DefenseSingleAbility(out act) ? act : null;
IBaseAction.TargetOverride = null;

ActionDispelStancePositionalAbility = role switch
{
Expand All @@ -112,7 +105,9 @@ private void UpdateActions(JobRole role)
};
ActionAntiKnockbackAbility = AntiKnockback(role, out act) ? act : null;

IBaseAction.TargetOverride = TargetType.Move;
var movingTarget = MoveForwardAbility(out act);
IBaseAction.TargetOverride = null;
ActionMoveForwardAbility = movingTarget ? act : null;

//TODO: that is too complex!
Expand Down
58 changes: 2 additions & 56 deletions RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,61 +20,7 @@
"RotationSolver.Basic.Data.SpecialCommandType.AntiKnockback": "Open a window to use knockback immunity actions.",
"RotationSolver.Basic.Data.SpecialCommandType.Speed": "Open a window to speed up.",
"RotationSolver.Basic.Data.TargetHostileType.AllTargetsCanAttack": "All targets that are in range for any abilities",
"RotationSolver.Data.UiString.ActionAbility": "Ability",
"RotationSolver.Data.UiString.ActionAttack": "Attack",
"RotationSolver.Data.UiString.ActionFriendly": "Friendly",
"RotationSolver.Data.UiString.ConfigWindow_About_Punchline": "Analyses PvE combat information in every frame and finds the best action.",
"RotationSolver.Data.UiString.ConfigWindow_About_Clicking100k": "Well, you must be a lazy player!",
"RotationSolver.Data.UiString.ConfigWindow_About_Clicking500k": "You're tiring RS out, give it a break!",
"RotationSolver.Data.UiString.ConfigWindow_Helper_GameVersion": "Game",
"RotationSolver.Data.UiString.ConfigWindow_Helper_SwitchRotation": "Click to switch rotations",
"RotationSolver.Data.UiString.ConfigWindow_ConditionSetDesc": "The condition set you chose, click to modify.",
"RotationSolver.Data.UiString.ConfigWindow_Searching": "Search... ",
"RotationSolver.Data.UiString.ConfigWindow_About_Description": "This means almost all the information available in one frame in combat, including the status of all players in the party, the status of any hostile targets, skill cooldowns, the MP and HP of characters, the location of characters, casting status of the hostile target, combo, combat duration, player level, etc.\n\nThen, it will highlight the best action on the hot bar, or help you to click on it.",
"RotationSolver.Data.UiString.ConfigWindow_About_Warning": "It is designed for GENERAL COMBAT, not for savage or ultimate. Use it carefully.",
"RotationSolver.Data.UiString.ConfigWindow_About_ClickingCount": "Rotation Solver helped you by clicking actions {0:N0} times.",
"RotationSolver.Data.UiString.ConfigWindow_About_SayHelloCount": "You have said hello to other users {0:N0} times!",
"RotationSolver.Data.UiString.ConfigWindow_About_Macros": "Macro",
"RotationSolver.Data.UiString.ConfigWindow_About_Compatibility": "Compatibility",
"RotationSolver.Data.UiString.ConfigWindow_About_Supporters": "Supporters",
"RotationSolver.Data.UiString.ConfigWindow_About_Links": "Links",
"RotationSolver.UI.RotationConfigWindowTab.Extra": "Some features that shouldn't be included in RS but help you.",
"RotationSolver.UI.RotationConfigWindowTab.Target": "The way to find the targets, hostiles or friends.",
"RotationSolver.Data.UiString.ConfigWindow_Target_Config": "Configuration",
"RotationSolver.Data.UiString.ConfigWindow_List_Hostile": "Hostile",
"RotationSolver.Data.UiString.ConfigWindow_Param_HostileDesc": "You can The logic of hostile target selection to allow flexibility in switching the logic of selecting hostile in battle.",
"RotationSolver.Data.UiString.ConfigWindow_List_Remove": "Remove",
"RotationSolver.Data.UiString.ConfigWindow_Actions_MoveUp": "Move Up",
"RotationSolver.Data.UiString.ConfigWindow_Actions_MoveDown": "Move Down",
"RotationSolver.Data.UiString.ConfigWindow_Param_HostileCondition": "Hostile target selection condition",
"MoveTargetAngleName": "The size of the sector angle that can be selected as the moveable target",
"DistanceForMovingName": "Use gapcloser as a damage ability if the distance to your target is less then this.",
"MoveTowardsScreenCenterName": "Using movement actions towards the object in the center of the screen",
"MoveAreaActionFarthestName": "Target movement area ability to the farthest possible location",
"BossTimeToKillName": "If target's time until death is higher than this, regard it as boss.",
"DyingTimeToKillName": "If target's time until death is lower than this, regard it is dying.",
"ChangeTargetForFateName": "Select only Fate targets in Fate",
"OnlyAttackInViewName": "Only attack the target in view.",
"OnlyAttackInVisionConeName": "Only attack the targets in vision cone",
"TargetFatePriorityName": "Target Fate priority",
"TargetHuntingRelicLevePriorityName": "Target Hunt/Relic/Leve priority.",
"TargetQuestPriorityName": "Target quest priority.",
"AddEnemyListToHostileName": "Add enemy list to the hostile targets.",
"ChooseAttackMarkName": "Priority attack targets with attack markers",
"FilterStopMarkName": "Never attack targets with stop markers",
"RotationSolver.Data.UiString.JobConfigTip": "This config is job specific",
"HostileTypeName": "Engage settings",
"SwitchTargetFriendlyName": "Target allies for friendly actions.",
"TargetAllForFriendlyName": "Target all for friendly actions (include passerby)",
"MoveTargetAngleDescription": "If the selection mode is based on character facing, i.e., targets within the character's viewpoint are moveable targets. \nIf the selection mode is screen-centered, i.e., targets within a sector drawn upward from the character's point are movable targets.",
"RotationSolver.Basic.Attributes.ConfigUnitType.Degree": "Angle Unit, in degrees.",
"BossTimeToKillDescription": "",
"RotationSolver.Basic.Attributes.ConfigUnitType.Seconds": "Time Unit, in seconds.",
"AddEnemyListToHostileDescription": "",
"ChooseAttackMarkDescription": "",
"FilterStopMarkDescription": "",
"HostileTypeDescription": "",
"RotationSolver.Basic.Data.TargetHostileType.TargetsHaveTarget": "Previously engaged targets (engages on countdown timer)",
"TargetAllForFriendlyDescription": "",
"SwitchTargetFriendlyDescription": ""
"RotationSolver.Data.UiString.ActionAbility": "Ability",
"RotationSolver.Data.UiString.ActionFriendly": "Friendly"
}

0 comments on commit 60542c3

Please sign in to comment.