From 08268f21e985a57ffcdc0d7acecfc2f797a22981 Mon Sep 17 00:00:00 2001 From: Frigidwalrus Date: Tue, 16 Jul 2024 23:41:12 -0500 Subject: [PATCH] SAM Fixed -Fixed SAM to show corretc moves at correct times based on the current combo chain status -related to issue #111 --- XIVComboVX/Combos/SAM.cs | 41 +++++++++++++++------------------ XIVComboVX/CustomComboPreset.cs | 8 +++---- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/XIVComboVX/Combos/SAM.cs b/XIVComboVX/Combos/SAM.cs index b7791184..61dd58f9 100644 --- a/XIVComboVX/Combos/SAM.cs +++ b/XIVComboVX/Combos/SAM.cs @@ -74,11 +74,11 @@ 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]; @@ -86,16 +86,15 @@ internal class SamuraiGurenSeneiLevelSyncFeature: CustomCombo { 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; } @@ -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; } @@ -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) @@ -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; } @@ -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]; diff --git a/XIVComboVX/CustomComboPreset.cs b/XIVComboVX/CustomComboPreset.cs index 81bd31c5..9955e372 100644 --- a/XIVComboVX/CustomComboPreset.cs +++ b/XIVComboVX/CustomComboPreset.cs @@ -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, @@ -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 // ====================================================================================