From 21a0cf9e8769c2b353027a76d2c80f66245f8aad Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 18 Apr 2024 15:01:52 -0400 Subject: [PATCH] v2.4.0: fixed emp strike effect not fully triggering with blastwave --- .../shatteredpixeldungeon/actors/hero/Talent.java | 5 ++++- .../items/wands/WandOfBlastWave.java | 9 +++++++++ .../items/weapon/melee/MagesStaff.java | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java index 735a7c28c..e21ffe847 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java @@ -182,7 +182,10 @@ public enum Talent { public static class LethalMomentumTracker extends FlavourBuff{}; public static class StrikingWaveTracker extends FlavourBuff{}; public static class WandPreservationCounter extends CounterBuff{{revivePersists = true;}}; - public static class EmpoweredStrikeTracker extends FlavourBuff{}; + public static class EmpoweredStrikeTracker extends FlavourBuff{ + //blast wave on-hit doesn't resolve instantly, so we delay detaching for it + public boolean delayedDetach = false; + }; public static class ProtectiveShadowsTracker extends Buff { float barrierInc = 0.5f; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java index 49e4367da..d7259472c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java @@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.effects.Effects; import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile; import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing; @@ -184,6 +185,13 @@ public class WandOfBlastWave extends DamageWand { @Override public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) { + + Talent.EmpoweredStrikeTracker tracker = attacker.buff(Talent.EmpoweredStrikeTracker.class); + + if (tracker != null){ + tracker.delayedDetach = true; + } + //acts like elastic enchantment //we delay this with an actor to prevent conflicts with regular elastic //so elastic always fully resolves first, then this effect activates @@ -198,6 +206,7 @@ public class WandOfBlastWave extends DamageWand { if (defender.isAlive()) { new BlastWaveOnHit().proc(staff, attacker, defender, damage); } + if (tracker != null) tracker.detach(); return true; } }); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MagesStaff.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MagesStaff.java index 8c5720d08..ac2518bfe 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MagesStaff.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MagesStaff.java @@ -184,7 +184,7 @@ public class MagesStaff extends MeleeWeapon { } if (empoweredStrike != null){ - empoweredStrike.detach(); + if (!empoweredStrike.delayedDetach) empoweredStrike.detach(); if (!(defender instanceof Mob) || !((Mob) defender).surprisedBy(attacker)){ Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG, 0.75f, 1.2f); }