v2.2.0: improved VFX for regrowth/fireblast when main ray is blocked
This commit is contained in:
+6
-3
@@ -168,7 +168,6 @@ public class WandOfFireblast extends DamageWand {
|
|||||||
|
|
||||||
// 5/7/9 distance
|
// 5/7/9 distance
|
||||||
int maxDist = 3 + 2*chargesPerCast();
|
int maxDist = 3 + 2*chargesPerCast();
|
||||||
int dist = Math.min(bolt.dist, maxDist);
|
|
||||||
|
|
||||||
cone = new ConeAOE( bolt,
|
cone = new ConeAOE( bolt,
|
||||||
maxDist,
|
maxDist,
|
||||||
@@ -176,7 +175,11 @@ public class WandOfFireblast extends DamageWand {
|
|||||||
Ballistica.STOP_TARGET | Ballistica.STOP_SOLID | Ballistica.IGNORE_SOFT_SOLID);
|
Ballistica.STOP_TARGET | Ballistica.STOP_SOLID | Ballistica.IGNORE_SOFT_SOLID);
|
||||||
|
|
||||||
//cast to cells at the tip, rather than all cells, better performance.
|
//cast to cells at the tip, rather than all cells, better performance.
|
||||||
|
Ballistica longestRay = null;
|
||||||
for (Ballistica ray : cone.outerRays){
|
for (Ballistica ray : cone.outerRays){
|
||||||
|
if (longestRay == null || ray.dist > longestRay.dist){
|
||||||
|
longestRay = ray;
|
||||||
|
}
|
||||||
((MagicMissile)curUser.sprite.parent.recycle( MagicMissile.class )).reset(
|
((MagicMissile)curUser.sprite.parent.recycle( MagicMissile.class )).reset(
|
||||||
MagicMissile.FIRE_CONE,
|
MagicMissile.FIRE_CONE,
|
||||||
curUser.sprite,
|
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.boltFromChar( curUser.sprite.parent,
|
||||||
MagicMissile.FIRE_CONE,
|
MagicMissile.FIRE_CONE,
|
||||||
curUser.sprite,
|
curUser.sprite,
|
||||||
bolt.path.get(dist/2),
|
longestRay.path.get(longestRay.dist/2),
|
||||||
callback );
|
callback );
|
||||||
Sample.INSTANCE.play( Assets.Sounds.ZAP );
|
Sample.INSTANCE.play( Assets.Sounds.ZAP );
|
||||||
Sample.INSTANCE.play( Assets.Sounds.BURNING );
|
Sample.INSTANCE.play( Assets.Sounds.BURNING );
|
||||||
|
|||||||
+6
-3
@@ -249,7 +249,6 @@ public class WandOfRegrowth extends Wand {
|
|||||||
|
|
||||||
// 4/6/8 distance
|
// 4/6/8 distance
|
||||||
int maxDist = 2 + 2*chargesPerCast();
|
int maxDist = 2 + 2*chargesPerCast();
|
||||||
int dist = Math.min(bolt.dist, maxDist);
|
|
||||||
|
|
||||||
cone = new ConeAOE( bolt,
|
cone = new ConeAOE( bolt,
|
||||||
maxDist,
|
maxDist,
|
||||||
@@ -257,7 +256,11 @@ public class WandOfRegrowth extends Wand {
|
|||||||
Ballistica.STOP_SOLID | Ballistica.STOP_TARGET);
|
Ballistica.STOP_SOLID | Ballistica.STOP_TARGET);
|
||||||
|
|
||||||
//cast to cells at the tip, rather than all cells, better performance.
|
//cast to cells at the tip, rather than all cells, better performance.
|
||||||
|
Ballistica longestRay = null;
|
||||||
for (Ballistica ray : cone.outerRays){
|
for (Ballistica ray : cone.outerRays){
|
||||||
|
if (longestRay == null || ray.dist > longestRay.dist){
|
||||||
|
longestRay = ray;
|
||||||
|
}
|
||||||
((MagicMissile)curUser.sprite.parent.recycle( MagicMissile.class )).reset(
|
((MagicMissile)curUser.sprite.parent.recycle( MagicMissile.class )).reset(
|
||||||
MagicMissile.FOLIAGE_CONE,
|
MagicMissile.FOLIAGE_CONE,
|
||||||
curUser.sprite,
|
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.boltFromChar( curUser.sprite.parent,
|
||||||
MagicMissile.FOLIAGE_CONE,
|
MagicMissile.FOLIAGE_CONE,
|
||||||
curUser.sprite,
|
curUser.sprite,
|
||||||
bolt.path.get(dist/2),
|
longestRay.path.get(longestRay.dist/2),
|
||||||
callback );
|
callback );
|
||||||
Sample.INSTANCE.play( Assets.Sounds.ZAP );
|
Sample.INSTANCE.play( Assets.Sounds.ZAP );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user