v2.4.0: fixed emp strike effect not fully triggering with blastwave

This commit is contained in:
Evan Debenham
2024-04-18 15:01:52 -04:00
parent 2330217c0f
commit 21a0cf9e87
3 changed files with 14 additions and 2 deletions

View File

@@ -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;

View File

@@ -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;
}
});

View File

@@ -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);
}