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

Commit

Permalink
fix: for the case some targets dead when HP is 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Aug 25, 2023
1 parent b2f15dd commit 18db483
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 45 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFramework>net7.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Authors>ArchiTed</Authors>
<Version>3.2.6</Version>
<Version>3.2.6.1</Version>
<PlatformTarget>x64</PlatformTarget>
<Platforms>AnyCPU</Platforms>

Expand Down
2 changes: 1 addition & 1 deletion Resources/RotationSolverRecord.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ClickingCount": 8844
"ClickingCount": 8907
}
4 changes: 2 additions & 2 deletions RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,10 @@ public enum PluginConfigFloat : byte
[Default(0.2f, 0.01f, 0.5f)] MaxPing,

[Default(8f, 0f, 30f)] AutoHealDeadTime,
[Default(2f, 0f, 10f)] HostileIconHeight,
[Default(0.5f, 0f, 2f)] HostileIconHeight,
[Default(1f, 0.1f, 10f)] HostileIconSize,

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

Expand Down
70 changes: 36 additions & 34 deletions RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,29 @@
"ConfigWindow_Param_AddDotGCDCount": "Set GCD advance of DOT refresh",
"ConfigWindow_Param_MaxPing": "Set the Max Ping that RS can get.",
"ConfigWindow_Param_AutoOffAfterCombatTime": "Auto turn off when combat is over more than several seconds.",
"ConfigWindow_Param_AutoOffBetweenArea": "Auto turn off when player is between area.",
"ConfigWindow_Param_AutoOffCutScene": "Auto turn off during cut scene.",
"ConfigWindow_Param_AutoOffBetweenArea": "Auto turn off when player is moving between areas.",
"ConfigWindow_Param_AutoOffCutScene": "Auto turn off during cutscenes.",
"ConfigWindow_Param_AutoOffWhenDead": "Auto turn off when dead.",
"ConfigWindow_Param_UseWorkTask": "Use work task for acceleration.",
"ConfigWindow_Param_ToggleManual": "Make Manual Command as toggle.",
"ConfigWindow_Param_WeaponDelay": "Set the range of random delay for GCD in second.",
"ConfigWindow_Param_DeathDelay": "Set the range of random delay for raising deaths in second.",
"ConfigWindow_Param_HostileDelay": "Set the range of random delay for finding hostile targets in second.",
"ConfigWindow_Param_InterruptDelay": "Set the range of random delay for interrupting hostile targets in second.",
"ConfigWindow_Param_WeakenDelay": "Set the range of random delay for esuna weakens in second.",
"ConfigWindow_Param_HealDelay": "Set the range of random delay for healing people in second.",
"ConfigWindow_Param_DeathDelay": "Set the range of random delay for using revival abilities in seconds.",
"ConfigWindow_Param_HostileDelay": "Set the range of random delay for targetting hostile targets in seconds.",
"ConfigWindow_Param_InterruptDelay": "Set the range of random delay for interrupting hostile targets in seconds.",
"ConfigWindow_Param_WeakenDelay": "Set the range of random delay for clensing dispellable debuffs in seconds.",
"ConfigWindow_Param_HealDelay": "Set the range of random delay for healing people in seconds.",
"ConfigWindow_Param_CountdownDelay": "Set the random delay between which auto mode activation on countdown varies.",
"ConfigWindow_Param_NotInCombatDelay": "Set the range of random delay for Not In Combat in second.",
"ConfigWindow_Param_NotInCombatDelay": "Set the range of random delay for Not In Combat in seconds.",
"ConfigWindow_Param_ClickingDelay": "Set the range of random delay for the interval of clicking actions.",
"ConfigWindow_Param_StopCastingDelay": "Set the range of random delay for stopping casting when target is no need to cast in second.",
"ConfigWindow_Param_StopCastingDelay": "Set the range of random delay for stopping casting when the target is dead or immune to damage in seconds.",
"ConfigWindow_Param_ClickMistake": "How likely is it that RS will click the wrong action.",
"ConfigWindow_Param_PoslockCasting": "Lock the movement when casting or some actions.",
"ConfigWindow_Param_UseStopCasting": "Stops casting when hostile target is dead.",
"ConfigWindow_Param_PoslockCasting": "Lock the movement when casting or when doing some actions.",
"ConfigWindow_Param_UseStopCasting": "Stops casting when the target is dead.",
"ConfigWindow_Param_ShowTooltips": "Show tooltips",
"ConfigWindow_Param_InDebug": "Debug Mode",
"ConfigWindow_Param_ShowTargetDeadTime": "Show the targets' dead time.",
"ConfigWindow_Param_DeadTimeBoss": "If target's whole dead time is higher than this, regard it as Boss.",
"ConfigWindow_Param_DeadTimeDying": "If target's dead time is lower than this, regard it is dying.",
"ConfigWindow_Param_ShowTargetDeadTime": "Show the target's time until death.",
"ConfigWindow_Param_DeadTimeBoss": "If target's time until death is higher than this, regard it as Boss.",
"ConfigWindow_Param_DeadTimeDying": "If target's time until death is lower than this, regard it is dying.",
"ConfigWindow_Param_PoslockModifier": "Set the modifier key to unlock the movement temporary",
"ConfigWindow_Param_PoslockDescription": "LT is for gamepad player",
"ConfigWindow_Param_TeachingMode": "Teaching mode",
Expand All @@ -89,28 +89,28 @@
"ConfigWindow_Param_ShowToastsAboutDoAction": "Display do action feedback on toast",
"ConfigWindow_Param_UseAOEAction": "Use AOE actions",
"ConfigWindow_Param_UseAOEWhenManual": "Use AOE actions in manual mode",
"ConfigWindow_Param_AutoBurst": "Always try to burst",
"ConfigWindow_Param_AutoBurst": "Automatically trigger dps burst phase",
"ConfigWindow_Param_AutoHeal": "Automatic Heal",
"ConfigWindow_Param_UseAbility": "Auto-use abilities",
"ConfigWindow_Param_NoNewHostiles": "Don't attack new mobs by aoe",
"ConfigWindow_Params_NoNewHostilesDesc": "Never use any AOE action when this action may attack the mobs that not is a hostile target.",
"ConfigWindow_Params_NoNewHostilesDesc": "Never use any AOE action when this action may attack the mobs that are not hostile targets.",
"ConfigWindow_Param_UseDefenseAbility": "Use defense abilities",
"ConfigWindow_Param_UseDefenseAbilityDesc": "It is recommended to check this option if you are playing Raids./nPlan the heal and defense by yourself.???",
"ConfigWindow_Param_UseDefenseAbilityDesc": "It is recommended to check this option if you are playing Raids or you can plan the heal and defense ability usage by yourself.",
"ConfigWindow_Param_AutoShield": "Auto tank stance",
"ConfigWindow_Param_AutoProvokeForTank": "Auto Provoke when there are more than one tanks",
"ConfigWindow_Param_AutoProvokeForTankDesc": "When a hostile is hitting the non-Tank member of party, it will automatically use the Provoke.",
"ConfigWindow_Param_AutoUseTrueNorth": "Auto TrueNorth (Melee)",
"ConfigWindow_Param_RaisePlayerBySwift": "Raise player by swift",
"ConfigWindow_Param_RaisePlayerBySwift": "Raise player by using swiftcast if avaliable",
"ConfigWindow_Param_UseGroundBeneficialAbility": "Use beneficial ground-targeted actions",
"ConfigWindow_Param_AutoSpeedOutOfCombat": "Use speed actions when out of combat.",
"ConfigWindow_Param_RaisePlayerByCasting": "Raise player by casting when swift is in cooldown",
"ConfigWindow_Param_UseHealWhenNotAHealer": "Use heal when not-healer",
"ConfigWindow_Param_UseHealWhenNotAHealer": "Use heal when playing a non-healer role",
"ConfigWindow_Param_LessMPNoRaise": "Never raise player if MP is less than the set value",
"ConfigWindow_Param_UseTinctures": "Use Tinctures",
"ConfigWindow_Param_UseHealPotions": "Use Heal Potions",
"ConfigWindow_Param_StartOnCountdown": "Auto mode activation delay on countdown start",
"ConfigWindow_Param_StartOnAttackedBySomeone": "Automatically turn on manual mode and target enemy when being attacked",
"ConfigWindow_Param_EsunaAll": "Esuna All Statuses.",
"ConfigWindow_Param_EsunaAll": "Clense all dispellable debuffs.",
"ConfigWindow_Param_InterruptibleMoreCheck": "Interrupt the action with action type check.",
"ConfigWindow_Param_HealOutOfCombat": "Heal party members outside of combat.",
"ConfigWindow_Param_OnlyHotOnTanks": "Use single target healing over time actions only on tanks",
Expand All @@ -132,10 +132,10 @@
"ConfigWindow_Param_HealthForDyingTank": "Set the HP%% for tank to use invulnerability",
"ConfigWindow_Param_MeleeRangeOffset": "Melee Range action using offset",
"ConfigWindow_Param_RightNowTargetToHostileType": "Engage settings",
"ConfigWindow_Param_TargetToHostileType1": "All targets can attack",
"ConfigWindow_Param_TargetToHostileType1": "All targets that you can attack and are in range for any abilities",
"ConfigWindow_Param_TargetToHostileType2": "Targets have a target or all targets can attack",
"ConfigWindow_Param_TargetToHostileType3": "Targets have a target",
"ConfigWindow_Param_AddEnemyListToHostile": "Add Enemies list to the hostile target.",
"ConfigWindow_Param_TargetToHostileType3": "Targets that already have a target or are hostile towards the player/player party",
"ConfigWindow_Param_AddEnemyListToHostile": "Add Enemies list to the hostile targets.",
"ConfigWindow_Param_ChooseAttackMark": "Priority attack targets with attack markers",
"ConfigWindow_Param_CanAttackMarkAOE": "Allowed use of AOE to attack more mobs.",
"ConfigWindow_Param_AttackMarkAOEDesc": "Attention: Checking this option , AA will attack as many hostile targets as possible, while ignoring whether the attack will cover the marked target.",
Expand All @@ -152,8 +152,8 @@
"ConfigWindow_Param_TargetFatePriority": "Target Fate priority",
"ConfigWindow_Param_TargetHuntingRelicLevePriority": "Target Hunt/Relic/Leve priority.",
"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_RaiseBrinkOfDeath": "Raise players that even have Brink of Death debuff",
"ConfigWindow_Param_MoveAreaActionFarthest": "Moving Area Ability to farthest possible location",
"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",
Expand Down Expand Up @@ -182,15 +182,15 @@
"ConfigWindow_List_Description": "In this window, you can set the parameters about some list things.",
"ConfigWindow_List_Hostile": "Hostile",
"ConfigWindow_List_Invincibility": "Invincibility",
"ConfigWindow_List_InvincibilityDesc": "If target get one of this status, it'll never attack it.",
"ConfigWindow_List_InvincibilityDesc": "If target get one of this statuses, never attack it.",
"ConfigWindow_List_DangerousStatus": "Dangerous Status",
"ConfigWindow_List_DangerousStatusDesc": "If one of your party member get this status, Esuna immediately.",
"ConfigWindow_List_DangerousStatusDesc": "Esuna immediately if one of your party members get these statuses",
"ConfigWindow_List_HostileCastingTank": "Tank Buster",
"ConfigWindow_List_HostileCastingTankDesc": "If the target is casting the action like this, it'll reduction.",
"ConfigWindow_List_HostileCastingTankDesc": "Use tank personal damage mitigation abilities if the target is casting any of these actions",
"ConfigWindow_List_HostileCastingArea": "AOE",
"ConfigWindow_List_HostileCastingAreaDesc": "If the target is casting the action like this, it'll defense area.",
"ConfigWindow_List_HostileCastingAreaDesc": "Use AOE damage mitigation abilities if the target is casting any of these actions",
"ConfigWindow_List_NoHostile": "No Hostile",
"ConfigWindow_List_NoHostileDesc": "Add a name of target that never be the hostile for you.",
"ConfigWindow_List_NoHostileDesc": "Add names of targets that will never be attacked.",
"ActionSequencer_Load": "Load From folder.",
"ActionSequencer_Can": "Can",
"ActionSequencer_Cannot": "Can Not",
Expand Down Expand Up @@ -238,7 +238,7 @@
"SpecialCommandType_Burst": "Burst",
"SpecialCommandType_EndSpecial": "End Special",
"SpecialCommandType_Speed": "Speed",
"SpecialCommandType_Smart": "Auto Target",
"SpecialCommandType_Smart": "Auto Target ",
"SpecialCommandType_Manual": "Manual Target",
"SpecialCommandType_Cancel": "Cancel",
"SpecialCommandType_Off": "Off",
Expand Down Expand Up @@ -318,6 +318,7 @@
"IsValid": "Is this rotation valid",
"ShowStatus": "Show the status",
"AverageDeadTime": "Average dead time",
"MobsTime": "Mobs Time",
"UmbralIceStacks": "Umbral Ice Stacks",
"AstralFireStacks": "Astral Fire Stacks",
"PolyglotStacks": "Polyglot Stacks",
Expand Down Expand Up @@ -456,13 +457,13 @@
"ConfigWindow_Auto_ActionUsage": "Action Usage",
"ConfigWindow_Auto_ActionUsage_Description": "Which actions Rotation Solver can use.",
"ConfigWindow_Extra_Others": "Others",
"ConfigWindow_Extra_Description": "Rotation Solver focus on rotation itself. These are side features. If there are some plugins can do that, these feature will be deleted.",
"ConfigWindow_Extra_Description": "Rotation Solver focuses on rotation itself. These are side features. If there are some plugins can do that, these feature will be deleted.",
"ConfigWindow_Auto_Description": "Change the strategy or usage of the automatically using actions.",
"ConfigWindow_Auto_ActionCondition": "Action Condition",
"ConfigWindow_Auto_ActionCondition_Description": "This will change the strategy of Rotation Solver to use these actions.",
"ConfigWindow_Target_Config": "Configuration",
"ConfigWindow_Search_Result": "Searching Result",
"ConfigWindow_UI_DrawIconAnimation": "Show animation about Icon",
"ConfigWindow_UI_DrawIconAnimation": "Show RS logo animation",
"ConfigWindow_UI_ShowBeneficialPosition": "Show beneficial positions.",
"ConfigWindow_UI_BeneficialPositionColor": "The colors of beneficial positions",
"ConfigWindow_UI_HoveredBeneficialPositionColor": "The colors of the hovered beneficial position",
Expand Down Expand Up @@ -497,5 +498,6 @@
"ConfigWindow_UI_StateIconHeight": "State Icon height from position",
"ConfigWindow_UI_StateIconSize": "State Icon size",
"ConfigWindow_UI_ShowStateIcon": "Show State Icon",
"ConfigWindow_Auto_UseGroundBeneficialAbilityWhenMoving": "Use beneficial area action when moving."
"ConfigWindow_Auto_UseGroundBeneficialAbilityWhenMoving": "Use beneficial area action when moving.",
"ConfigWindow_Auto_AutoDefenseNumber": "The count of hostiles who target on me. If it's larger than this, defense single."
}
12 changes: 8 additions & 4 deletions RotationSolver/UI/PainterManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public override void UpdateOnFrame(XIVPainter.XIVPainter painter)

class TargetsDrawing : Drawing3DPoly
{
public override void UpdateOnFrame(XIVPainter.XIVPainter painter)
public override unsafe void UpdateOnFrame(XIVPainter.XIVPainter painter)
{
SubItems = Array.Empty<IDrawing3D>();

Expand All @@ -65,7 +65,7 @@ public override void UpdateOnFrame(XIVPainter.XIVPainter painter)
foreach (var hostile in DataCenter.HostileTargets)
{
subItems.Add(new Drawing3DImage(hostileIcon, hostile.Position + new Vector3(0,
Service.Config.GetValue(PluginConfigFloat.HostileIconHeight), 0),
Service.Config.GetValue(PluginConfigFloat.HostileIconHeight) * hostile.Struct()->Character.GameObject.Height, 0),
Service.Config.GetValue(PluginConfigFloat.HostileIconSize))
{
DrawWithHeight = false,
Expand Down Expand Up @@ -262,8 +262,12 @@ public static void Init()
UpdateEveryFrame = () =>
{
if (!Player.Available) return;
_stateImage.Position = Player.Object.Position + new Vector3(0,
Service.Config.GetValue(PluginConfigFloat.StateIconHeight), 0);

unsafe
{
_stateImage.Position = Player.Object.Position + new Vector3(0,
Service.Config.GetValue(PluginConfigFloat.StateIconHeight) * Player.Object.GameObject()->Height, 0);
}

if (DataCenter.State && Service.Config.GetValue(PluginConfigBool.ShowStateIcon))
{
Expand Down
6 changes: 4 additions & 2 deletions RotationSolver/UI/RotationConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2141,10 +2141,12 @@ private static void DrawLastAction()

private static unsafe void DrawIcon()
{
foreach (var item in Svc.KeyState.GetValidVirtualKeys())
if (Player.Available)
{
ImGui.Text(item.ToString());
ImGui.Text(Player.GameObject->Height.ToString());
}

ImGui.Text(DataCenter.TerritoryContentType.ToString());
}

private static void DrawAction(ActionID id, string type)
Expand Down
4 changes: 3 additions & 1 deletion RotationSolver/Updaters/TargetUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,14 @@ private static float JobRange

private unsafe static void UpdateHostileTargets(IEnumerable<BattleChara> allTargets)
{
var deadHP = DataCenter.PartyMembers.Count() > 1 ? 0 : 1;

allTargets = allTargets.Where(b =>
{
if (!b.IsNPCEnemy()) return false;

//Dead.
if (b.CurrentHp == 0) return false;
if (b.CurrentHp <= deadHP) return false;

if (!b.IsTargetable()) return false;

Expand Down

0 comments on commit 18db483

Please sign in to comment.