From 6d7d2d9d2d8ee92fd1b7e0336cf205cbd805a549 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 29 Sep 2023 13:06:30 -0400 Subject: [PATCH] v2.2.0: improved VFX for regrowth/fireblast when main ray is blocked --- .../items/wands/WandOfFireblast.java | 9 ++++++--- .../items/wands/WandOfRegrowth.java | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java index 99b54ff92..baf8b2b83 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java @@ -168,7 +168,6 @@ public class WandOfFireblast extends DamageWand { // 5/7/9 distance int maxDist = 3 + 2*chargesPerCast(); - int dist = Math.min(bolt.dist, maxDist); cone = new ConeAOE( bolt, maxDist, @@ -176,7 +175,11 @@ public class WandOfFireblast extends DamageWand { Ballistica.STOP_TARGET | Ballistica.STOP_SOLID | Ballistica.IGNORE_SOFT_SOLID); //cast to cells at the tip, rather than all cells, better performance. + Ballistica longestRay = null; for (Ballistica ray : cone.outerRays){ + if (longestRay == null || ray.dist > longestRay.dist){ + longestRay = ray; + } ((MagicMissile)curUser.sprite.parent.recycle( MagicMissile.class )).reset( MagicMissile.FIRE_CONE, curUser.sprite, @@ -185,11 +188,11 @@ public class WandOfFireblast extends DamageWand { ); } - //final zap at half distance, for timing of the actual wand effect + //final zap at half distance of the longest ray, for timing of the actual wand effect MagicMissile.boltFromChar( curUser.sprite.parent, MagicMissile.FIRE_CONE, curUser.sprite, - bolt.path.get(dist/2), + longestRay.path.get(longestRay.dist/2), callback ); Sample.INSTANCE.play( Assets.Sounds.ZAP ); Sample.INSTANCE.play( Assets.Sounds.BURNING ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java index 979ea35f0..23d8de968 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java @@ -249,7 +249,6 @@ public class WandOfRegrowth extends Wand { // 4/6/8 distance int maxDist = 2 + 2*chargesPerCast(); - int dist = Math.min(bolt.dist, maxDist); cone = new ConeAOE( bolt, maxDist, @@ -257,7 +256,11 @@ public class WandOfRegrowth extends Wand { Ballistica.STOP_SOLID | Ballistica.STOP_TARGET); //cast to cells at the tip, rather than all cells, better performance. + Ballistica longestRay = null; for (Ballistica ray : cone.outerRays){ + if (longestRay == null || ray.dist > longestRay.dist){ + longestRay = ray; + } ((MagicMissile)curUser.sprite.parent.recycle( MagicMissile.class )).reset( MagicMissile.FOLIAGE_CONE, curUser.sprite, @@ -266,11 +269,11 @@ public class WandOfRegrowth extends Wand { ); } - //final zap at half distance, for timing of the actual wand effect + //final zap at half distance of the longest ray, for timing of the actual wand effect MagicMissile.boltFromChar( curUser.sprite.parent, MagicMissile.FOLIAGE_CONE, curUser.sprite, - bolt.path.get(dist/2), + longestRay.path.get(longestRay.dist/2), callback ); Sample.INSTANCE.play( Assets.Sounds.ZAP ); }