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

Commit

Permalink
Merge pull request #1831 from Akechi-kun/69
Browse files Browse the repository at this point in the history
[SAM] fixes/adjustments
  • Loading branch information
Taurenkey authored Nov 17, 2024
2 parents 2496eb7 + 6d8fd24 commit 6b32e4b
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 19 deletions.
4 changes: 4 additions & 0 deletions XIVSlothCombo/Combos/CustomComboPreset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3629,6 +3629,10 @@ The three digets after RDM.JobID can be used to reorder items in the list
[CustomComboInfo("Senei Option", "Adds Senei to the rotation.", SAM.JobID)]
SAM_ST_CDs_Senei = 15020,

[ParentCombo(SAM_ST_CDs_Senei)]
[CustomComboInfo("Guren Option", "Adds Guren to the rotation if Senei is not unlocked.", SAM.JobID)]
SAM_ST_CDs_Guren = 15021,

#endregion

[ParentCombo(SAM_ST_AdvancedMode)]
Expand Down
63 changes: 44 additions & 19 deletions XIVSlothCombo/Combos/PvE/SAM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,17 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
HasEffect(Buffs.Fugetsu) && HasEffect(Buffs.Fuka))
return Senei;

//Guren if no Senei
if (!LevelChecked(Senei) &&
gauge.Kenki >= 25 && ActionReady(Guren) &&
HasEffect(Buffs.Fugetsu) && HasEffect(Buffs.Fuka))
return Guren;

//Zanshin Usage
if (LevelChecked(Zanshin) && gauge.Kenki >= 50 &&
CanWeave(actionID) && HasEffect(Buffs.ZanshinReady) &&
(JustUsed(Higanbana, 7f) ||
GetBuffRemainingTime(Buffs.ZanshinReady) <= 6))
((JustUsed(Higanbana, 7f) || oneSen && HasEffect(Buffs.OgiNamikiriReady)) ||
GetBuffRemainingTime(Buffs.ZanshinReady) <= 6)) //Protection for scuffed runs
return Zanshin;

if (LevelChecked(Shoha) && gauge.MeditationStacks is 3)
Expand All @@ -288,11 +294,12 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
if (LevelChecked(Enpi) && !InMeleeRange() && HasBattleTarget())
return Enpi;

if (IsEnabled(CustomComboPreset.SAM_ST_CDs) &&
HasEffect(Buffs.Fugetsu) && HasEffect(Buffs.Fuka))
if (HasEffect(Buffs.Fugetsu) && HasEffect(Buffs.Fuka))
{
//Ogi Namikiri Features
if (!IsMoving && ActionReady(OgiNamikiri) && (JustUsed(Higanbana, 5f) || GetBuffRemainingTime(Buffs.OgiNamikiriReady) <= GCD) &&
if (!IsMoving && LevelChecked(OgiNamikiri) &&
(((JustUsed(Higanbana, 5f) || GetDebuffRemainingTime(Debuffs.Higanbana) > 30) && HasEffect(Buffs.OgiNamikiriReady)) ||
GetBuffRemainingTime(Buffs.OgiNamikiriReady) <= GCD) && //Protection for scuffed runs
(gauge.Kaeshi == Kaeshi.NAMIKIRI || HasEffect(Buffs.OgiNamikiriReady)))
return OriginalHook(OgiNamikiri);

Expand All @@ -309,10 +316,11 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
}

if (!IsMoving &&
((oneSen && enemyHP >= 1 && GetDebuffRemainingTime(Debuffs.Higanbana) <= 19 && JustUsed(Gekko, 3f) && JustUsed(MeikyoShisui, 15f)) ||
((oneSen && enemyHP >= 1 &&
((GetDebuffRemainingTime(Debuffs.Higanbana) <= 19 && JustUsed(Gekko, 3f) && JustUsed(MeikyoShisui, 15f)) || !TargetHasEffect(Debuffs.Higanbana)) ||
(twoSen && !LevelChecked(MidareSetsugekka)) ||
(threeSen &&
(LevelChecked(MidareSetsugekka) && !HasEffect(Buffs.TsubameReady)))))
(LevelChecked(MidareSetsugekka) && !HasEffect(Buffs.TsubameReady))))))
return OriginalHook(Iaijutsu);
}
}
Expand All @@ -322,13 +330,18 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
if (trueNorthReady)
return All.TrueNorth;

if (LevelChecked(Gekko) && (!HasEffect(Buffs.Fugetsu) || (!gauge.Sen.HasFlag(Sen.GETSU) && HasEffect(Buffs.Fuka))))
if (LevelChecked(Gekko) &&
(!HasEffect(Buffs.Fugetsu) ||
(!gauge.Sen.HasFlag(Sen.GETSU) && HasEffect(Buffs.Fuka))))
return Gekko;

if (LevelChecked(Kasha) && (!HasEffect(Buffs.Fuka) || (!gauge.Sen.HasFlag(Sen.KA) && HasEffect(Buffs.Fugetsu))))
if (LevelChecked(Kasha) &&
(!HasEffect(Buffs.Fuka) ||
(!gauge.Sen.HasFlag(Sen.KA) && HasEffect(Buffs.Fugetsu))))
return Kasha;

if (LevelChecked(Yukikaze) && !gauge.Sen.HasFlag(Sen.SETSU))
if (LevelChecked(Yukikaze) &&
!gauge.Sen.HasFlag(Sen.SETSU))
return Yukikaze;
}

Expand Down Expand Up @@ -474,16 +487,25 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
}

//Senei Features
if (IsEnabled(CustomComboPreset.SAM_ST_CDs_Senei) &&
gauge.Kenki >= 25 && ActionReady(Senei) &&
HasEffect(Buffs.Fugetsu) && HasEffect(Buffs.Fuka))
return Senei;
if (IsEnabled(CustomComboPreset.SAM_ST_CDs_Senei))
{
if (gauge.Kenki >= 25 && ActionReady(Senei) &&
HasEffect(Buffs.Fugetsu) && HasEffect(Buffs.Fuka))
return Senei;

//Guren if no Senei
if (IsEnabled(CustomComboPreset.SAM_ST_CDs_Guren) &&
!LevelChecked(Senei) &&
gauge.Kenki >= 25 && ActionReady(Guren) &&
HasEffect(Buffs.Fugetsu) && HasEffect(Buffs.Fuka))
return Guren;
}

//Zanshin Usage
if (IsEnabled(CustomComboPreset.SAM_ST_CDs_Zanshin) &&
LevelChecked(Zanshin) && gauge.Kenki >= 50 &&
CanWeave(actionID) && HasEffect(Buffs.ZanshinReady) &&
(JustUsed(Higanbana, 7f) ||
((JustUsed(Higanbana, 7f) || oneSen && HasEffect(Buffs.OgiNamikiriReady)) ||
GetBuffRemainingTime(Buffs.ZanshinReady) <= 6))
return Zanshin;

Expand Down Expand Up @@ -511,7 +533,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
if (IsEnabled(CustomComboPreset.SAM_ST_CDs_OgiNamikiri) &&
(!IsEnabled(CustomComboPreset.SAM_ST_CDs_OgiNamikiri_Movement) ||
(IsEnabled(CustomComboPreset.SAM_ST_CDs_OgiNamikiri_Movement) && !IsMoving)) &&
ActionReady(OgiNamikiri) && (JustUsed(Higanbana, 5f) || GetBuffRemainingTime(Buffs.OgiNamikiriReady) <= GCD) &&
ActionReady(OgiNamikiri) &&
(((JustUsed(Higanbana, 5f) || GetDebuffRemainingTime(Debuffs.Higanbana) > 30) && HasEffect(Buffs.OgiNamikiriReady)) ||
GetBuffRemainingTime(Buffs.OgiNamikiriReady) <= GCD) &&
(gauge.Kaeshi == Kaeshi.NAMIKIRI || HasEffect(Buffs.OgiNamikiriReady)))
return OriginalHook(OgiNamikiri);

Expand All @@ -529,10 +553,11 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim

if ((!IsEnabled(CustomComboPreset.SAM_ST_CDs_Iaijutsu_Movement) ||
(IsEnabled(CustomComboPreset.SAM_ST_CDs_Iaijutsu_Movement) && !IsMoving)) &&
((oneSen && enemyHP > HiganbanaThreshold && GetDebuffRemainingTime(Debuffs.Higanbana) <= 19 && JustUsed(Gekko, 3f) && JustUsed(MeikyoShisui, 15f)) ||
((oneSen && enemyHP > HiganbanaThreshold &&
((GetDebuffRemainingTime(Debuffs.Higanbana) <= 19 && JustUsed(Gekko, 3f) && JustUsed(MeikyoShisui, 15f)) || !TargetHasEffect(Debuffs.Higanbana)) ||
(twoSen && !LevelChecked(MidareSetsugekka)) ||
(threeSen &&
(LevelChecked(MidareSetsugekka) && !HasEffect(Buffs.TsubameReady)))))
(LevelChecked(MidareSetsugekka) && !HasEffect(Buffs.TsubameReady))))))
return OriginalHook(Iaijutsu);
}
}
Expand Down Expand Up @@ -754,7 +779,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim

if (LevelChecked(TenkaGoken))
{
if (!IsMoving && (OriginalHook(Iaijutsu) is TenkaGoken or TendoGoken))
if (!IsMoving && (OriginalHook(Iaijutsu) is TenkaGoken))
return OriginalHook(Iaijutsu);

if (!IsMoving && LevelChecked(TendoGoken) && (OriginalHook(Iaijutsu) is TendoGoken))
Expand Down

0 comments on commit 6b32e4b

Please sign in to comment.