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

Commit

Permalink
Merge SAM changes
Browse files Browse the repository at this point in the history
Based on the RSR SAM spell updates, merged two version of RR SAM rotation files. Delayed opener for manually weaving tincture + correct level 100 spells. Single target and AOE are tested on dummy and level 70 and 100 dungeons (both synced, but not full clear).
  • Loading branch information
MillerTheBest committed Jul 14, 2024
1 parent 5e36f2d commit b8533b3
Showing 1 changed file with 29 additions and 38 deletions.
67 changes: 29 additions & 38 deletions BasicRotations/Melee/SAM_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public sealed class SAM_Default : SamuraiRotation

protected override IAction? CountDownAction(float remainTime)
{
// pre-pull: can be changed to -9 and -5 instead of 5 and 2, but it's hard to be universal !!! check later !!!
if (remainTime <= 5 && MeikyoShisuiPvE.CanUse(out var act)) return act;
if (remainTime <= 2 && TrueNorthPvE.CanUse(out act)) return act;
return base.CountDownAction(remainTime);
Expand All @@ -31,13 +32,12 @@ protected override bool AttackAbility(IAction nextGCD, out IAction? act)
var IsTargetBoss = HostileTarget?.IsBossFromTTK() ?? false;
var IsTargetDying = HostileTarget?.IsDying() ?? false;

if (Kenki >= 50 && HasMoon && HasFlower && HaveZanshinReady)
{
if (ZanshinPvE.CanUse(out act, skipAoeCheck: true)) return true;
}

// IkishotenPvE logic combined with the delayed opener:
// you should weave the tincture in manually after rsr lands the first gcd (usually Gekko)
// and that's the only chance for tincture weaving during opener
if (Kenki <= 50 && !CombatElapsedLessGCD(2) && IkishotenPvE.CanUse(out act)) return true;

// from old version - didn't touch this, didn't test this, never saw Hagakure button pressed personally !!! check later !!!
if ((HostileTarget?.HasStatus(true, StatusID.Higanbana) ?? false) &&
(HostileTarget?.WillStatusEnd(32, true, StatusID.Higanbana) ?? false) &&
!(HostileTarget?.WillStatusEnd(28, true, StatusID.Higanbana) ?? false) &&
Expand All @@ -46,31 +46,34 @@ protected override bool AttackAbility(IAction nextGCD, out IAction? act)
if (HagakurePvE.CanUse(out act)) return true;
}

// moon: fugetsu buff; flower: fuka buff
// only use senei/guren when the two buffs are up for max dps and correct rotation order
if (HasMoon && HasFlower)
{
if (HissatsuGurenPvE.CanUse(out act, skipAoeCheck: !HissatsuSeneiPvE.EnoughLevel)) return true;
if (HissatsuSeneiPvE.CanUse(out act)) return true;
}

if (ShohaPvE.CanUse(out act, skipAoeCheck: true)) return true;
// Shoha is combined from two spells since 7.0, use it in both single target and aoe
if (ShohaPvE.CanUse(out act, skipAoeCheck: true)) return true; // need to check rsr code for upgrade and remove aoecheck here !!! check later !!!

if (!HaveZanshinReady && (Kenki >= 50 && IkishotenPvE.Cooldown.WillHaveOneCharge(10) || Kenki >= AddKenki || IsTargetBoss && IsTargetDying))
// dump shinten
if (Kenki >= 50 && IkishotenPvE.Cooldown.WillHaveOneCharge(10) || Kenki >= AddKenki || IsTargetBoss && IsTargetDying)
{
if (ZanshinPvE.CanUse(out act, skipAoeCheck: true)) return true; // need to check rsr code for upgrade and remove aoecheck here !!! check later !!!
if (HissatsuKyutenPvE.CanUse(out act)) return true;
if (HissatsuShintenPvE.CanUse(out act))
{
//Debug.WriteLine("Send to debug outputa.");
return true;
}
if (HissatsuShintenPvE.CanUse(out act)) return true;
}

return base.AttackAbility(nextGCD, out act);
}

protected override bool EmergencyAbility(IAction nextGCD, out IAction? act)
{
var IsTargetBoss = HostileTarget?.IsBossFromTTK() ?? false;
var IsTargetDying = HostileTarget?.IsDying() ?? false;

// from old version - didn't touch this, didn't test this, personally i doubt it's working !!! check later !!!
if (HasHostilesInRange && IsLastGCD(true, YukikazePvE, MangetsuPvE, OkaPvE) &&
(!IsTargetBoss || (HostileTarget?.HasStatus(true, StatusID.Higanbana) ?? false) && !(HostileTarget?.WillStatusEnd(40, true, StatusID.Higanbana) ?? false) || !HasMoon && !HasFlower || IsTargetBoss && IsTargetDying))
{
Expand All @@ -85,18 +88,17 @@ protected override bool EmergencyAbility(IAction nextGCD, out IAction? act)

protected override bool GeneralGCD(out IAction? act)
{
// use 2nd finisher combo spell first
if (KaeshiNamikiriPvE.CanUse(out act, skipAoeCheck: true, usedUp: true)) return true;

var IsTargetBoss = HostileTarget?.IsBossFromTTK() ?? false;
var IsTargetDying = HostileTarget?.IsDying() ?? false;

//if (TendoKaeshiGokenPvE.CanUse(out act, skipAoeCheck: true, usedUp: true)) return true;
//if (TendoKaeshiSetsugekkaPvE.CanUse(out act, skipAoeCheck: true, usedUp: true)) return true;

if (IsLastGCD(true, TendoSetsugekkaPvE) && TendoKaeshiSetsugekkaPvE.CanUse(out act)) return true;

// use 2nd finisher combo spell first
if (KaeshiGokenPvE.CanUse(out act, skipAoeCheck: true, usedUp: true)) return true;
if (KaeshiSetsugekkaPvE.CanUse(out act, skipAoeCheck: true, usedUp: true)) return true;
if (TendoKaeshiGokenPvE.CanUse(out act, skipAoeCheck: true, usedUp: true)) return true;
if (TendoKaeshiSetsugekkaPvE.CanUse(out act, skipAoeCheck: true, usedUp: true)) return true;

// burst finisher
if ((!IsTargetBoss || (HostileTarget?.HasStatus(true, StatusID.Higanbana) ?? false)) && HasMoon && HasFlower
Expand All @@ -109,47 +111,38 @@ protected override bool GeneralGCD(out IAction? act)
}
if (SenCount == 2) // 2 sen aoe combo finisher
{
// !!! to be updated to TendoGokenPvE
if (TendoGokenPvE.CanUse(out act)) return true;
if (TenkaGokenPvE.CanUse(out act, skipAoeCheck: !MidareSetsugekkaPvE.EnoughLevel)) return true;
}
if (SenCount == 3) // 3 sen single target combo finisher
{
// if 7.0 spell buff is not up, use normal finisher
if (!HaveTsubamegaeshiReady && MidareSetsugekkaPvE.CanUse(out act, skipComboCheck: !HaveTsubamegaeshiReady)) return true;
// if 7.0 spell buff is up, use the upgraded finisher
if (HaveTsubamegaeshiReady && TendoSetsugekkaPvE.CanUse(out act, skipComboCheck: HaveTsubamegaeshiReady)) return true;

// use TendoSetsugekka when the level is met, or use MidareSetsugekka - not tested
if (!TendoSetsugekkaPvE.EnoughLevel && MidareSetsugekkaPvE.CanUse(out act)) return true;
// need to test for low level content !!! check later !!!
if (TendoSetsugekkaPvE.CanUse(out act)) return true;
if (MidareSetsugekkaPvE.CanUse(out act)) return true;
}

// aoe 12 combo's 2
if ((!HasMoon || IsMoonTimeLessThanFlower || !OkaPvE.EnoughLevel) && MangetsuPvE.CanUse(out act, skipComboCheck: HaveMeikyoShisui && !HasGetsu)) return true;
if ((!HasFlower || !IsMoonTimeLessThanFlower) && OkaPvE.CanUse(out act, skipComboCheck: HaveMeikyoShisui && !HasKa)) return true;

// !!! not working
if (!HasSetsu && YukikazePvE.CanUse(out act, skipComboCheck: HaveMeikyoShisui && HasGetsu && HasKa || IsLastGCD(true, HakazePvE))) return true;

if (!HasSetsu && YukikazePvE.CanUse(out act, skipComboCheck: HaveMeikyoShisui && HasGetsu && HasKa)) return true;
// single target 123 combo's 3 or used 3 directly during burst when MeikyoShisui is active
if (GekkoPvE.CanUse(out act, skipComboCheck: HaveMeikyoShisui && !HasGetsu)) return true;
if (KashaPvE.CanUse(out act, skipComboCheck: HaveMeikyoShisui && !HasKa)) return true;

// single target 123 combo's 2
if ((!HasMoon || IsMoonTimeLessThanFlower || !ShifuPvE.EnoughLevel) && JinpuPvE.CanUse(out act, skipComboCheck: IsLastGCD(true, HakazePvE))) return true;
if ((!HasFlower || !IsMoonTimeLessThanFlower) && ShifuPvE.CanUse(out act, skipComboCheck: IsLastGCD(true, HakazePvE))) return true;
if ((!HasMoon || IsMoonTimeLessThanFlower || !ShifuPvE.EnoughLevel) && JinpuPvE.CanUse(out act)) return true;
if ((!HasFlower || !IsMoonTimeLessThanFlower) && ShifuPvE.CanUse(out act)) return true;

// initiate aoe
if (FukoPvE.CanUse(out act, skipComboCheck: true)) return true;
if (FukoPvE.CanUse(out act, skipComboCheck: true)) return true; // fuga doesn't becomes fuko automatically
if (!FukoPvE.EnoughLevel && FugaPvE.CanUse(out act, skipComboCheck: true)) return true;

// MeikyoShisui buff is not active - not bursting - single target 123 combo's 1
if (!HaveMeikyoShisui)
{
// target in range
if (HakazePvE.CanUse(out act)) return true;

//if (GyofuPvE.CanUse(out act)) return true;
//if (!GyofuPvE.EnoughLevel && HakazePvE.CanUse(out act)) return true;
if (HakazePvE.CanUse(out act)) return true; // hakaze becomes gyofu automatically, maybe it's something in rsr

// target out of range
if (EnpiPvE.CanUse(out act)) return true;
Expand All @@ -162,8 +155,6 @@ protected override bool GeneralGCD(out IAction? act)

#region Extra Methods
private static bool HaveMeikyoShisui => Player.HasStatus(true, StatusID.MeikyoShisui);
private static bool HaveTsubamegaeshiReady => Player.HasStatus(true, StatusID.TsubamegaeshiReady);
private static bool HaveZanshinReady => Player.HasStatus(true, StatusID.ZanshinReady);


#endregion
}

0 comments on commit b8533b3

Please sign in to comment.