Skip to content

Commit

Permalink
SAM Fixed
Browse files Browse the repository at this point in the history
-Fixed SAM to show corretc moves at correct times based on the current combo chain status
-related to issue #111
  • Loading branch information
FrigidWalrus committed Jul 17, 2024
1 parent b4ea93a commit 08268f2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 26 deletions.
41 changes: 19 additions & 22 deletions XIVComboVX/Combos/SAM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,28 +74,27 @@ public const byte
}

// returning Soon™ (when we have the time to go over everything)
/*

internal class SamuraiBloodbathReplacer: SecondBloodbathCombo {
public override CustomComboPreset Preset => CustomComboPreset.SamuraiBloodbathReplacer;
}
/*
internal class SamuraiGurenSeneiLevelSyncFeature: CustomCombo {
public override CustomComboPreset Preset { get; } = CustomComboPreset.SamuraiGurenSeneiLevelSyncFeature;
public override uint[] ActionIDs { get; } = [SAM.HissatsuSenei];
protected override uint Invoke(uint actionID, uint lastComboActionId, float comboTime, byte level)
=> level >= SAM.Levels.HissatsuSenei ? SAM.HissatsuSenei : SAM.HissatsuGuren;
}
*/
internal class SamuraiYukikazeCombo: CustomCombo {
public override CustomComboPreset Preset => CustomComboPreset.SamuraiYukikazeCombo;
public override uint[] ActionIDs { get; } = [SAM.Yukikaze];

protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) {
bool meikyo = SelfHasEffect(SAM.Buffs.MeikyoShisui);

if ((level >= SAM.Levels.MeikyoShisui && SelfHasEffect(SAM.Buffs.MeikyoShisui))
|| (comboTime > 0 && lastComboMove == SAM.Hakaze && level >= SAM.Levels.Yukikaze)
) {
if ((level >= SAM.Levels.MeikyoShisui && meikyo) || (lastComboMove is SAM.Hakaze or SAM.Gyofu && level >= SAM.Levels.Yukikaze)) {
return SAM.Yukikaze;
}

Expand All @@ -108,16 +107,17 @@ internal class SamuraiGekkoCombo: CustomCombo {
public override uint[] ActionIDs { get; } = [SAM.Gekko];

protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) {
bool meikyo = SelfHasEffect(SAM.Buffs.MeikyoShisui);

if (level >= SAM.Levels.MeikyoShisui && SelfHasEffect(SAM.Buffs.MeikyoShisui))
if (level >= SAM.Levels.MeikyoShisui && meikyo)
return SAM.Gekko;

if (comboTime > 0) {
if (!meikyo) {

if (lastComboMove == SAM.Hakaze && level >= SAM.Levels.Jinpu)
if (lastComboMove is SAM.Hakaze or SAM.Gyofu && level >= SAM.Levels.Jinpu)
return SAM.Jinpu;

if (lastComboMove == SAM.Jinpu && level >= SAM.Levels.Gekko)
if (lastComboMove is SAM.Jinpu && level >= SAM.Levels.Gekko)
return SAM.Gekko;

}
Expand All @@ -133,12 +133,13 @@ internal class SamuraiKashaCombo: CustomCombo {
public override uint[] ActionIDs { get; } = [SAM.Kasha];

protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) {
bool meikyo = SelfHasEffect(SAM.Buffs.MeikyoShisui);

if (level >= SAM.Levels.MeikyoShisui && SelfHasEffect(SAM.Buffs.MeikyoShisui))
if (meikyo && SelfHasEffect(SAM.Buffs.MeikyoShisui))
return SAM.Kasha;

if (comboTime > 0) {
if (lastComboMove == SAM.Hakaze && level >= SAM.Levels.Shifu)
if (!meikyo) {
if (lastComboMove is SAM.Hakaze or SAM.Gyofu && level >= SAM.Levels.Shifu)
return SAM.Shifu;

if (lastComboMove == SAM.Shifu && level >= SAM.Levels.Kasha)
Expand All @@ -156,11 +157,9 @@ internal class SamuraiMangetsuCombo: CustomCombo {
public override uint[] ActionIDs { get; } = [SAM.Mangetsu];

protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) {
bool meikyo = SelfHasEffect(SAM.Buffs.MeikyoShisui);

if (
(level >= SAM.Levels.MeikyoShisui && SelfHasEffect(SAM.Buffs.MeikyoShisui))
|| (comboTime > 0 && lastComboMove is SAM.Fuga or SAM.Fuko && level >= SAM.Levels.Mangetsu)
) {
if ((level >= SAM.Levels.MeikyoShisui && meikyo) || (lastComboMove is SAM.Fuga or SAM.Fuko && level >= SAM.Levels.Mangetsu)) {
return SAM.Mangetsu;
}

Expand All @@ -173,18 +172,16 @@ internal class SamuraiOkaCombo: CustomCombo {
public override uint[] ActionIDs { get; } = [SAM.Oka];

protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) {
bool meikyo = SelfHasEffect(SAM.Buffs.MeikyoShisui);

if (
(level >= SAM.Levels.MeikyoShisui && SelfHasEffect(SAM.Buffs.MeikyoShisui))
|| (comboTime > 0 && lastComboMove is SAM.Fuga or SAM.Fuko && level >= SAM.Levels.Oka)
) {
if ((level >= SAM.Levels.MeikyoShisui && meikyo) || (lastComboMove is SAM.Fuga or SAM.Fuko && level >= SAM.Levels.Oka)) {
return SAM.Oka;
}

return OriginalHook(SAM.Fuga);
}
}
/*
internal class SamuraiTsubameGaeshiFeature: CustomCombo {
public override CustomComboPreset Preset => CustomComboPreset.SamAny;
public override uint[] ActionIDs { get; } = [SAM.TsubameGaeshi];
Expand Down
8 changes: 4 additions & 4 deletions XIVComboVX/CustomComboPreset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ public enum CustomComboPreset {
// ====================================================================================
#region SAMURAI (34xx)
// Working on updating SAM. Will gradually be releasing more features as they are verified working.
/*


[CustomComboInfo("Bloodbath Replacer Feature", "Replace Bloodbath with Second Wind when underlevel or when Bloodbath is on cooldown and Second Wind is not.", SAM.JobID)]
SamuraiBloodbathReplacer = 3419,
Expand Down Expand Up @@ -1211,9 +1211,9 @@ public enum CustomComboPreset {
//[CustomComboInfo("Ikishoten Namikiri Feature", "Replace Ikishoten with Shoha, Kaeshi Namikiri, and then Ogi Namikiri when available.", SAM.JobID)]
//SamuraiIkishotenNamikiriFeature = 3411,

[CustomComboInfo("Hissatsu Senei/Guren Sync Feature", "Replace Hissatsu Senei with Hissatsu Guren when underlevel.", SAM.JobID)]
SamuraiGurenSeneiLevelSyncFeature = 3418,
*/
//[CustomComboInfo("Hissatsu Senei/Guren Sync Feature", "Replace Hissatsu Senei with Hissatsu Guren when underlevel.", SAM.JobID)]
//SamuraiGurenSeneiLevelSyncFeature = 3418,


#endregion
// ====================================================================================
Expand Down

0 comments on commit 08268f2

Please sign in to comment.