Skip to content

Commit

Permalink
Merge pull request #485 from FFXIV-CombatReborn/ninjaFix
Browse files Browse the repository at this point in the history
Attempt to fix mudra and fix for Ninki cap protection
  • Loading branch information
LTS-FFXIV authored Dec 21, 2024
2 parents db84636 + 5161839 commit 67c963c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 16 deletions.
30 changes: 24 additions & 6 deletions BasicRotations/Melee/NIN_Default.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
namespace DefaultRotations.Melee;

[Rotation("Default", CombatType.PvE, GameVersion = "7.05")]
[Rotation("Default", CombatType.PvE, GameVersion = "7.15")]
[SourceCode(Path = "main/BasicRotations/Melee/NIN_Default.cs")]
[Api(4)]

public sealed class NIN_Default : NinjaRotation
{
#region Config Options
// Configuration properties for rotation behavior.

[RotationConfig(CombatType.PvE, Name = "Use Hide")]
public bool UseHide { get; set; } = true;

[RotationConfig(CombatType.PvE, Name = "Use Unhide")]
public bool AutoUnhide { get; set; } = true;

[RotationConfig(CombatType.PvE, Name = "Attempt to lock out all GCDs except mudra during mudra to prevent ghosting")]
public bool MudraProtection { get; set; } = false;

public bool IsShadowWalking = Player.HasStatus(true, StatusID.ShadowWalker);
#endregion

Expand Down Expand Up @@ -218,7 +223,7 @@ private bool DoNinjutsu(out IAction? act)
}
else if (jinId == SuitonPvE_18881.ID && !IsLastAction(false, SuitonPvE_18881))
{
if (SuitonPvE_18881.CanUse(out act, skipAoeCheck: true)) return true;
if (SuitonPvE_18881.CanUse(out act, skipAoeCheck: true, skipStatusProvideCheck: true)) return true;
}
}

Expand Down Expand Up @@ -340,9 +345,9 @@ protected override bool AttackAbility(IAction nextGCD, out IAction? act)
// If Ninjutsu is available or not in combat, it exits early, indicating no attack action to perform.
if (!NoNinjutsu || !InCombat) return false;

// If the player is not moving, is within Trick Attack's effective window, and Ten Chi Jin hasn't recently been used,
// If the player is within Trick Attack's effective window, and Ten Chi Jin hasn't recently been used,
// then Ten Chi Jin is set as the next action to perform.
if (!IsMoving && InTrickAttack && !TenPvE.Cooldown.ElapsedAfter(30) && TenChiJinPvE.CanUse(out act)) return true;
if (InTrickAttack && !TenPvE.Cooldown.ElapsedAfter(30) && TenChiJinPvE.CanUse(out act)) return true;

// If more than 5 seconds have passed in combat, checks if Bunshin is available to use.
if (!CombatElapsedLess(5) && BunshinPvE.CanUse(out act)) return true;
Expand All @@ -368,20 +373,28 @@ protected override bool AttackAbility(IAction nextGCD, out IAction? act)
if ((!InMug || InTrickAttack)
&& (!BunshinPvE.Cooldown.WillHaveOneCharge(10) || Player.HasStatus(false, StatusID.PhantomKamaitachiReady) || MugPvE.Cooldown.WillHaveOneCharge(2)))
{
if (HellfrogMediumPvE.CanUse(out act)) return true;
if (HellfrogMediumPvE.CanUse(out act, skipAoeCheck: !BhavacakraPvE.EnoughLevel)) return true;
if (BhavacakraPvE.CanUse(out act)) return true;
if (TenriJindoPvE.CanUse(out act)) return true;
}

if (Ninki == 100)
{
if (HellfrogMediumPvE.CanUse(out act, skipAoeCheck: !BhavacakraPvE.EnoughLevel)) return true;
if (BhavacakraPvE.CanUse(out act)) return true;
}

if (MergedStatus.HasFlag(AutoStatus.MoveForward) && MoveForwardAbility(nextGCD, out act)) return true;
// If none of the conditions are met, it falls back to the base class's implementation for attack ability.
return base.AttackAbility(nextGCD, out act);
}
#endregion

#region GCD Logic
// Main method for determining the general action to take during the combat's global cooldown phase.
protected override bool GeneralGCD(out IAction? act)
{
act = null;

var hasRaijuReady = Player.HasStatus(true, StatusID.RaijuReady);

if ((InTrickAttack || InMug) && NoNinjutsu && !hasRaijuReady
Expand All @@ -398,6 +411,11 @@ protected override bool GeneralGCD(out IAction? act)
if (hasRaijuReady) return false;
}

if (IsLastAbility(true, TenPvE, ChiPvE, JinPvE) && MudraProtection)
{
return base.GeneralGCD(out act);
}

//AOE
if (HakkeMujinsatsuPvE.CanUse(out act)) return true;
if (DeathBlossomPvE.CanUse(out act)) return true;
Expand Down
2 changes: 1 addition & 1 deletion ECommons
3 changes: 0 additions & 3 deletions RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ public const string
[UI("", Action = ActionID.PassageOfArmsPvE, Parent = nameof(PoslockCasting))]
public bool PosPassageOfArms { get; set; } = false;

[UI("", Action = ActionID.TenChiJinPvE, Parent = nameof(PoslockCasting))]
public bool PosTenChiJin { get; set; } = true;

[UI("", Action = ActionID.FlamethrowerPvE, Parent = nameof(PoslockCasting))]
public bool PosFlameThrower { get; set; } = false;

Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Rotations/Basic/NinjaRotation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ static partial void ModifyDotonPvE(ref ActionSetting setting)

static partial void ModifySuitonPvE(ref ActionSetting setting)
{
setting.StatusProvide = [StatusID.ShadowWalker];
//setting.StatusProvide = [StatusID.ShadowWalker];
}

static partial void ModifyGokaMekkyakuPvE(ref ActionSetting setting)
Expand Down
5 changes: 0 additions & 5 deletions RotationSolver/Updaters/MovingUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ internal unsafe static void UpdateCanMove(bool doNextAction)
statusList.Add(StatusID.Flamethrower);
actionList.Add(ActionID.FlameThrowerPvE);
}
if (Service.Config.PosTenChiJin)
{
statusList.Add(StatusID.TenChiJin);
actionList.Add(ActionID.TenChiJinPvE);
}
if (Service.Config.PosPassageOfArms)
{
statusList.Add(StatusID.PassageOfArms);
Expand Down

0 comments on commit 67c963c

Please sign in to comment.