Skip to content

Commit

Permalink
Merge pull request #274 from FFXIV-CombatReborn/rsr-users-can-read-an…
Browse files Browse the repository at this point in the history
…d-other-jokes-we-tell-ourselves

TLDR; UI pass for clarity and control, Dragoon base fix, new engage targeting mode, exposed TTK HP percentage to users.
  • Loading branch information
LTS-FFXIV authored Jul 26, 2024
2 parents 10871eb + dc009f3 commit 258c82e
Show file tree
Hide file tree
Showing 12 changed files with 276 additions and 386 deletions.
233 changes: 112 additions & 121 deletions RotationSolver.Basic/Configuration/Configs.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal override void OnEnable()
{
base.OnEnable();

if (!Service.Config.EnableTimelineMovement) return;
return;

var ipc = Svc.PluginInterface.GetIpcSubscriber<List<Vector3>, bool, object>("vnavmesh.Path.MoveTo");

Check warning on line 28 in RotationSolver.Basic/Configuration/Timeline/MoveTimelineItem.cs

View workflow job for this annotation

GitHub Actions / Build

Unreachable code detected

Expand All @@ -39,7 +39,7 @@ internal override void OnDisable()
{
base.OnDisable();

if (!Service.Config.EnableTimelineMovement) return;
return;

var ipc = Svc.PluginInterface.GetIpcSubscriber<object>("vnavmesh.Path.Stop");

Check warning on line 44 in RotationSolver.Basic/Configuration/Timeline/MoveTimelineItem.cs

View workflow job for this annotation

GitHub Actions / Build

Unreachable code detected
ipc?.InvokeAction();
Expand Down
14 changes: 10 additions & 4 deletions RotationSolver.Basic/Data/TargetHostileType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,25 @@
public enum TargetHostileType : byte
{
/// <summary>
/// All
/// All targets.
/// </summary>
[Description("All targets that are in range for any abilities")]
[Description("All targets that are in range for any abilities (Tanks)")]
AllTargetsCanAttack,

/// <summary>
/// Have target.
/// </summary>
[Description("Previously engaged targets (engages on countdown timer)")]
[Description("Previously engaged targets (Non-Tanks)")]
TargetsHaveTarget,

/// <summary>
/// ALl Targets When solo.
/// All targets when solo .
/// </summary>
[Description("All targets when solo in duty, or previously engaged.")]
AllTargetsWhenSoloInDuty,

/// <summary>
/// All targets when solo.
/// </summary>
[Description("All targets when solo, or previously engaged.")]
AllTargetsWhenSolo,
Expand Down
10 changes: 6 additions & 4 deletions RotationSolver.Basic/Helpers/ObjectHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Dalamud.Game.ClientState.Objects.Enums;
using Dalamud.Game.ClientState.Conditions;
using Dalamud.Game.ClientState.Objects.Enums;
using Dalamud.Game.ClientState.Objects.SubKinds;
using Dalamud.Game.ClientState.Statuses;
using ECommons.DalamudServices;
Expand Down Expand Up @@ -118,7 +119,8 @@ internal static bool IsAttackable(this IBattleChara IBattleChara)
{
TargetHostileType.AllTargetsCanAttack => true,
TargetHostileType.TargetsHaveTarget => IBattleChara.TargetObject is IBattleChara,
TargetHostileType.AllTargetsWhenSolo => DataCenter.PartyMembers.Length < 2
TargetHostileType.AllTargetsWhenSolo => DataCenter.PartyMembers.Length < 2 || IBattleChara.TargetObject is IBattleChara,
TargetHostileType.AllTargetsWhenSoloInDuty => (DataCenter.PartyMembers.Length < 2 && Svc.Condition[ConditionFlag.BoundByDuty])
|| IBattleChara.TargetObject is IBattleChara,
_ => true,
};
Expand Down Expand Up @@ -321,7 +323,7 @@ public static bool IsDying(this IBattleChara b)
{
if (b == null) return false;
if (b.IsDummy()) return false;
return b.GetTimeToKill() <= Service.Config.DyingTimeToKill || b.GetHealthRatio() < 0.02f;
return b.GetTimeToKill() <= Service.Config.DyingTimeToKill || b.GetHealthRatio() < Service.Config.IsDyingConfig;
}

internal static unsafe bool InCombat(this IBattleChara obj)
Expand Down Expand Up @@ -375,7 +377,7 @@ internal static bool IsAttacked(this IBattleChara b)

internal static unsafe bool CanSee(this IGameObject b)
{
var point = Player.Object.Position + Vector3.UnitY * Player.IGameObject->Height;
var point = Player.Object.Position + Vector3.UnitY * Player.GameObject->Height;
var tarPt = b.Position + Vector3.UnitY * b.Struct()->Height;
var direction = tarPt - point;

Expand Down
8 changes: 4 additions & 4 deletions RotationSolver.Basic/Rotations/Basic/DragoonRotation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static partial void ModifyPiercingTalonPvE(ref ActionSetting setting)
static partial void ModifyDisembowelPvE(ref ActionSetting setting)
{
setting.ComboIds = [ActionID.TrueThrustPvE, ActionID.RaidenThrustPvE];
setting.StatusProvide = [StatusID.PowerSurge];
setting.StatusProvide = [StatusID.PowerSurge_2720];
}

static partial void ModifyFullThrustPvE(ref ActionSetting setting)
Expand Down Expand Up @@ -161,7 +161,7 @@ static partial void ModifyGeirskogulPvE(ref ActionSetting setting)
static partial void ModifySonicThrustPvE(ref ActionSetting setting)
{
setting.ComboIds = [ActionID.DraconianFuryPvE, ActionID.DoomSpikePvE];
setting.StatusProvide = [StatusID.PowerSurge];
setting.StatusProvide = [StatusID.PowerSurge_2720];
setting.CreateConfig = () => new()
{
AoeCount = 2,
Expand Down Expand Up @@ -266,7 +266,7 @@ static partial void ModifyLanceBarragePvE(ref ActionSetting setting)
static partial void ModifySpiralBlowPvE(ref ActionSetting setting)
{
setting.ComboIds = [ActionID.TrueThrustPvE, ActionID.RaidenThrustPvE];
setting.StatusProvide = [StatusID.PowerSurge];
setting.StatusProvide = [StatusID.PowerSurge_2720];
}

static partial void ModifyStarcrossPvE(ref ActionSetting setting)
Expand All @@ -287,7 +287,7 @@ static partial void ModifyHighJumpPvP(ref ActionSetting setting)

/// <inheritdoc/>
[RotationDesc(ActionID.FeintPvE)]
protected sealed override bool DefenseAreaAbility(IAction nextGCD, out IAction? act)
protected override bool DefenseAreaAbility(IAction nextGCD, out IAction? act)
{
if (FeintPvE.CanUse(out act)) return true;
return false;
Expand Down
16 changes: 8 additions & 8 deletions RotationSolver.Basic/Rotations/CustomRotation_GCD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ partial class CustomRotation

IBaseAction.TargetOverride = TargetType.Death;

if (Service.Config.RaisePlayerByCasting && RaiseSpell(out act, true)) return act;
if (Service.Config.RaisePlayerByCasting && SwiftcastPvE.Cooldown.IsCoolingDown && RaiseSpell(out act, true)) return act;

IBaseAction.TargetOverride = null;

Expand Down Expand Up @@ -148,23 +148,22 @@ private bool RaiseSpell(out IAction? act, bool mustUse)
{
return true;
}
else if (mustUse)
else if (Service.Config.RaisePlayerBySwift && !SwiftcastPvE.Cooldown.IsCoolingDown)
{
var action = act;
if (SwiftcastPvE.CanUse(out act))
{
return true;
}
else if (!IsMoving)
}
else if (mustUse)
{
var action = act;
if (!IsMoving)
{
act = action;
return true;
}
}
else if (Service.Config.RaisePlayerBySwift && !SwiftcastPvE.Cooldown.IsCoolingDown)
{
return true;
}
}

return false;
Expand All @@ -178,6 +177,7 @@ bool RaiseAction(out IAction act, bool ignoreCastingCheck)
}
}


/// <summary>
/// The gcd for raising.
/// </summary>
Expand Down
Loading

0 comments on commit 258c82e

Please sign in to comment.