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

Commit

Permalink
Merge pull request #182 from FFXIV-CombatReborn/dnc-beta
Browse files Browse the repository at this point in the history
Formatting fixes and DNC beta
  • Loading branch information
LTS-FFXIV authored Aug 13, 2024
2 parents 6b1eeed + 6964820 commit 853f69d
Show file tree
Hide file tree
Showing 17 changed files with 1,052 additions and 821 deletions.
2 changes: 1 addition & 1 deletion BasicRotations/Healer/WHM_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace DefaultRotations.Healer;
[Rotation("Default", CombatType.PvE, GameVersion = "7.00")]
[SourceCode(Path = "main/DefaultRotations/Healer/WHM_Default.cs")]
[Api(3)]
public sealed class WHM_Default :WhiteMageRotation
public sealed class WHM_Default : WhiteMageRotation
{
#region Config Options

Expand Down
616 changes: 308 additions & 308 deletions BasicRotations/Magical/PCT_Default.cs

Large diffs are not rendered by default.

180 changes: 89 additions & 91 deletions BasicRotations/Magical/RDM_Default.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using FFXIVClientStructs.FFXIV.Client.Game;

namespace DefaultRotations.Magical;

[Rotation("Default", CombatType.PvE, GameVersion = "7.05")]
Expand All @@ -15,7 +13,7 @@ public sealed class RDM_Default : RedMageRotation

[RotationConfig(CombatType.PvE, Name = "Cast Reprise when moving with no instacast.")]
public bool RangedSwordplay { get; set; } = false;

[RotationConfig(CombatType.PvE, Name = "DO NOT CAST EMBOLDEN/MANAFICATION OUTSIDE OF MELEE RANGE, I'M SERIOUS YOU HAVE TO MOVE UP FOR IT TO WORK IF THIS IS ON.")]
public bool AnyonesMeleeRule { get; set; } = false;

Expand All @@ -41,52 +39,52 @@ public sealed class RDM_Default : RedMageRotation

#region oGCD Logic
protected override bool AttackAbility(IAction nextGCD, out IAction? act)

//When we removed emergencyGCD vercure/verraise start overwriting all logic below. Need to do something about it.

//No bugs in this section (mostly™). Extra Methods is fucked up tho, need to good look of experienced rotation dev.

{
bool AnyoneInRange = AllHostileTargets.Any(hostile => hostile.DistanceToPlayer() <= 4);

act = null;

if (CombatElapsedLess(4)) return false;

//COMMENT FOR MYSELF FROM FUTURE - WHY THE HELL EMBOLDEN DONT WORK WITHOUT skipAoeCheck:true???
if (!AnyonesMeleeRule)
{
if (IsBurst && HasHostilesInRange && EmboldenPvE.CanUse(out act, skipAoeCheck: true)) return true;
}
else
{
if (IsBurst && AnyoneInRange && EmboldenPvE.CanUse(out act, skipAoeCheck: true)) return true;
}

//If manafication usage OUTSIDE of embolden enabled.
if (AnyoneManafication)
{
if (AnyoneInRange && ManaficationPvE.CanUse(out act)) return true;
}

//Use Manafication after embolden.
if (!AnyoneManafication && (Player.HasStatus(true, StatusID.Embolden) || IsLastAbility(ActionID.EmboldenPvE)) &&
ManaficationPvE.CanUse(out act)) return true;

//Swiftcast/Acceleration usage OLD VERSION
// if (ManaStacks == 0 && (BlackMana < 50 || WhiteMana < 50)
// && (CombatElapsedLess(4) || !ManaficationPvE.EnoughLevel || !ManaficationPvE.Cooldown.WillHaveOneChargeGCD(0, 1)))
// {
// if (InCombat && !Player.HasStatus(true, StatusID.VerfireReady, StatusID.VerstoneReady))
// {
// if (SwiftcastPvE.CanUse(out act)) return true;
// if (AccelerationPvE.CanUse(out act, usedUp: true)) return true;
// }
// }

//Melee combo interrupt protection (i hate this too)
bool checkmelee = IsLastGCD(new[]
{
bool AnyoneInRange = AllHostileTargets.Any(hostile => hostile.DistanceToPlayer() <= 4);

act = null;

if (CombatElapsedLess(4)) return false;

//COMMENT FOR MYSELF FROM FUTURE - WHY THE HELL EMBOLDEN DONT WORK WITHOUT skipAoeCheck:true???
if (!AnyonesMeleeRule)
{
if (IsBurst && HasHostilesInRange && EmboldenPvE.CanUse(out act, skipAoeCheck: true)) return true;
}
else
{
if (IsBurst && AnyoneInRange && EmboldenPvE.CanUse(out act, skipAoeCheck: true)) return true;
}

//If manafication usage OUTSIDE of embolden enabled.
if (AnyoneManafication)
{
if (AnyoneInRange && ManaficationPvE.CanUse(out act)) return true;
}

//Use Manafication after embolden.
if (!AnyoneManafication && (Player.HasStatus(true, StatusID.Embolden) || IsLastAbility(ActionID.EmboldenPvE)) &&
ManaficationPvE.CanUse(out act)) return true;

//Swiftcast/Acceleration usage OLD VERSION
// if (ManaStacks == 0 && (BlackMana < 50 || WhiteMana < 50)
// && (CombatElapsedLess(4) || !ManaficationPvE.EnoughLevel || !ManaficationPvE.Cooldown.WillHaveOneChargeGCD(0, 1)))
// {
// if (InCombat && !Player.HasStatus(true, StatusID.VerfireReady, StatusID.VerstoneReady))
// {
// if (SwiftcastPvE.CanUse(out act)) return true;
// if (AccelerationPvE.CanUse(out act, usedUp: true)) return true;
// }
// }

//Melee combo interrupt protection (i hate this too)
bool checkmelee = IsLastGCD(new[]
{
ActionID.ResolutionPvE,
ActionID.ScorchPvE,
ActionID.VerflarePvE,
Expand All @@ -103,50 +101,50 @@ protected override bool AttackAbility(IAction nextGCD, out IAction? act)
ActionID.MoulinetPvE
//I dont know at this point if nextGCD.IsTheSameTo even working, but stil gonna left it in here.
}) && !nextGCD.IsTheSameTo(new[]
{
{
ActionID.RipostePvE,
ActionID.EnchantedRipostePvE,
ActionID.MoulinetPvE,
ActionID.EnchantedMoulinetPvE
});
//i really hate this.
bool ambatumelee = Player.HasStatus(true, StatusID.Manafication, StatusID.MagickedSwordplay);

//Acceleration usage on rotation with saving 1 charge for movement
if (GrandImpactPvE.EnoughLevel && !checkmelee && !ambatumelee && //Check for enough level to use Grand Impact, or its pointless.
!Player.HasStatus(true, StatusID.Manafication, StatusID.MagickedSwordplay) &&
!Player.HasStatus(true, StatusID.Dualcast) && AccelerationPvE.CanUse(out act)) return true;

//i really hate this.
bool ambatumelee = Player.HasStatus(true, StatusID.Manafication, StatusID.MagickedSwordplay);

//Acceleration usage on rotation with saving 1 charge for movement
if (GrandImpactPvE.EnoughLevel && !checkmelee && !ambatumelee && //Check for enough level to use Grand Impact, or its pointless.
!Player.HasStatus(true, StatusID.Manafication, StatusID.MagickedSwordplay) &&
!Player.HasStatus(true, StatusID.Dualcast) && AccelerationPvE.CanUse(out act)) return true;

//Acceleration/Swiftcast usage on move
if (IsMoving && !Player.HasStatus(true, StatusID.Dualcast) && !checkmelee && !ambatumelee &&
//Checks for not override previous acceleration and lose grand impact
!Player.HasStatus(true, StatusID.Acceleration) &&
!Player.HasStatus(true, StatusID.GrandImpactReady) && HasHostilesInRange &&
//Use acceleration. If acceleration not available, use switfcast instead
(AccelerationPvE.CanUse(out act, usedUp: IsMoving) || (!AccelerationPvE.CanUse(out _) && SwiftcastPvE.CanUse(out act))))
{
return true;
}
if (IsMoving && !Player.HasStatus(true, StatusID.Dualcast) && !checkmelee && !ambatumelee &&
//Checks for not override previous acceleration and lose grand impact
!Player.HasStatus(true, StatusID.Acceleration) &&
!Player.HasStatus(true, StatusID.GrandImpactReady) && HasHostilesInRange &&
//Use acceleration. If acceleration not available, use switfcast instead
(AccelerationPvE.CanUse(out act, usedUp: IsMoving) || (!AccelerationPvE.CanUse(out _) && SwiftcastPvE.CanUse(out act))))
{
return true;
}


//Reprise logic
if (IsMoving && RangedSwordplay && !checkmelee && !ambatumelee &&
//Check to not use Reprise when player can do melee combo, to not break it
(ManaStacks == 0 && (BlackMana < 50 || WhiteMana < 50) &&
//Check if dualcast active
!Player.HasStatus(true, StatusID.Dualcast) &&
//Bunch of checks if anything else can be used instead of Reprise
!AccelerationPvE.CanUse(out _) &&
!Player.HasStatus(true, StatusID.Acceleration) &&
!SwiftcastPvE.CanUse(out _) &&
!Player.HasStatus(true, StatusID.Swiftcast) &&
!GrandImpactPvE.CanUse(out _) &&
!Player.HasStatus(true, StatusID.GrandImpactReady) &&
//If nothing else to use and player moving - fire reprise.
EnchantedReprisePvE.CanUse(out act))) return true;
if (IsBurst && UseBurstMedicine(out act)) return true;
if (IsMoving && RangedSwordplay && !checkmelee && !ambatumelee &&
//Check to not use Reprise when player can do melee combo, to not break it
(ManaStacks == 0 && (BlackMana < 50 || WhiteMana < 50) &&
//Check if dualcast active
!Player.HasStatus(true, StatusID.Dualcast) &&
//Bunch of checks if anything else can be used instead of Reprise
!AccelerationPvE.CanUse(out _) &&
!Player.HasStatus(true, StatusID.Acceleration) &&
!SwiftcastPvE.CanUse(out _) &&
!Player.HasStatus(true, StatusID.Swiftcast) &&
!GrandImpactPvE.CanUse(out _) &&
!Player.HasStatus(true, StatusID.GrandImpactReady) &&
//If nothing else to use and player moving - fire reprise.
EnchantedReprisePvE.CanUse(out act))) return true;

if (IsBurst && UseBurstMedicine(out act)) return true;

//Attack abilities.
if (PrefulgencePvE.CanUse(out act, skipAoeCheck: true)) return true;
Expand Down Expand Up @@ -192,12 +190,12 @@ protected override bool GeneralGCD(out IAction? act)
if (IsLastGCD(false, EnchantedMoulinetPvE) && EnchantedMoulinetDeuxPvE.CanUse(out act)) return true;
if (EnchantedRedoublementPvE.CanUse(out act)) return true;
if (EnchantedZwerchhauPvE.CanUse(out act)) return true;


//Check if you can start melee combo
if (CanStartMeleeCombo)
{
if (EnchantedMoulinetPvE.CanUse(out act))
if (EnchantedMoulinetPvE.CanUse(out act))
{
if (BlackMana >= 50 && WhiteMana >= 50 || Player.HasStatus(true, StatusID.MagickedSwordplay)) return true;
}
Expand All @@ -208,18 +206,18 @@ protected override bool GeneralGCD(out IAction? act)
}
}
//Grand impact usage if not interrupting melee combo
if (GrandImpactPvE.CanUse(out act, skipStatusProvideCheck: Player.HasStatus(true, StatusID.GrandImpactReady), skipCastingCheck:true, skipAoeCheck: true)) return true;
if (GrandImpactPvE.CanUse(out act, skipStatusProvideCheck: Player.HasStatus(true, StatusID.GrandImpactReady), skipCastingCheck: true, skipAoeCheck: true)) return true;

if (ManaStacks == 3) return false;

if (!VerthunderIiPvE.CanUse(out _))
{
if (VerfirePvE.CanUse(out act)) return true;
if (VerstonePvE.CanUse(out act)) return true;
}

if (ScatterPvE.CanUse(out act)) return true;

if (WhiteMana < BlackMana)
{
if (VeraeroIiPvE.CanUse(out act) && BlackMana - WhiteMana != 5) return true;
Expand All @@ -237,20 +235,20 @@ protected override bool GeneralGCD(out IAction? act)
#endregion

#region Extra Methods


//why is this not working if called. Its always return false.
// private bool _didWeJustCombo = IsLastGCD([
// ActionID.ScorchPvE, ActionID.VerflarePvE, ActionID.VerholyPvE, ActionID.EnchantedZwerchhauPvE,
// ActionID.EnchantedRedoublementPvP, ActionID.EnchantedRipostePvE, ActionID.EnchantedMoulinetPvE, ActionID.EnchantedMoulinetDeuxPvE, ActionID.EnchantedMoulinetTroisPvE
// ]);

private bool CanStartMeleeCombo
{
get
{
if (Player.HasStatus(true, StatusID.Dualcast)) return false;

if (Player.HasStatus(true, StatusID.Manafication, StatusID.Embolden, StatusID.MagickedSwordplay) ||
BlackMana >= 50 || WhiteMana >= 50) return true;

Expand Down
Loading

0 comments on commit 853f69d

Please sign in to comment.