diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/MagicMissile.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/MagicMissile.java index c7b097a98..c4e33c5ca 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/MagicMissile.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/MagicMissile.java @@ -65,8 +65,8 @@ public class MagicMissile extends Emitter { public void reset( int type, int from, int to, Callback callback ) { reset( type, - DungeonTilemap.tileCenterToWorld( from ), - DungeonTilemap.tileCenterToWorld( to ), + DungeonTilemap.raisedTileCenterToWorld( from ), + DungeonTilemap.raisedTileCenterToWorld( to ), callback ); } @@ -80,7 +80,7 @@ public class MagicMissile extends Emitter { public void reset( int type, Visual from, int to, Callback callback ) { reset( type, from.center(), - DungeonTilemap.tileCenterToWorld( to ), + DungeonTilemap.raisedTileCenterToWorld( to ), callback); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfDisintegration.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfDisintegration.java index 7a5e6a2c9..f379785e9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfDisintegration.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfDisintegration.java @@ -119,7 +119,7 @@ public class WandOfDisintegration extends DamageWand { protected void fx( Ballistica beam, Callback callback ) { int cell = beam.path.get(Math.min(beam.dist, distance())); - curUser.sprite.parent.add(new Beam.DeathRay(curUser.sprite.center(), DungeonTilemap.tileCenterToWorld( cell ))); + curUser.sprite.parent.add(new Beam.DeathRay(curUser.sprite.center(), DungeonTilemap.raisedTileCenterToWorld( cell ))); callback.call(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java index d74efdd9e..528618653 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java @@ -33,6 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.traps.LightningTrap; import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap; import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.Camera; @@ -130,7 +131,7 @@ public class WandOfLightning extends DamageWand { arcs.add( new Lightning.Arc(curUser.sprite.center(), ch.sprite.center())); arc(ch); } else { - arcs.add( new Lightning.Arc(curUser.sprite.center(), bolt.collisionPos)); + arcs.add( new Lightning.Arc(curUser.sprite.center(), DungeonTilemap.raisedTileCenterToWorld(bolt.collisionPos))); CellEmitter.center( cell ).burst( SparkParticle.FACTORY, 3 ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfPrismaticLight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfPrismaticLight.java index e87debfff..c63537adb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfPrismaticLight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfPrismaticLight.java @@ -130,7 +130,7 @@ public class WandOfPrismaticLight extends DamageWand { @Override protected void fx( Ballistica beam, Callback callback ) { curUser.sprite.parent.add( - new Beam.LightRay(curUser.sprite.center(), DungeonTilemap.tileCenterToWorld(beam.collisionPos))); + new Beam.LightRay(curUser.sprite.center(), DungeonTilemap.raisedTileCenterToWorld(beam.collisionPos))); callback.call(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java index 33e9f3479..401d74686 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java @@ -201,7 +201,7 @@ public class WandOfTransfusion extends Wand { @Override protected void fx(Ballistica beam, Callback callback) { curUser.sprite.parent.add( - new Beam.HealthRay(curUser.sprite.center(), DungeonTilemap.tileCenterToWorld(beam.collisionPos))); + new Beam.HealthRay(curUser.sprite.center(), DungeonTilemap.raisedTileCenterToWorld(beam.collisionPos))); callback.call(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/EyeSprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/EyeSprite.java index 74cd97bd5..c1f8aa896 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/EyeSprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/EyeSprite.java @@ -108,7 +108,7 @@ public class EyeSprite extends MobSprite { if (Actor.findChar(zapPos) != null){ parent.add(new Beam.DeathRay(center(), Actor.findChar(zapPos).sprite.center())); } else { - parent.add(new Beam.DeathRay(center(), DungeonTilemap.tileCenterToWorld(zapPos))); + parent.add(new Beam.DeathRay(center(), DungeonTilemap.raisedTileCenterToWorld(zapPos))); } } ((Eye)ch).deathGaze(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTilemap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTilemap.java index 411542f1f..48c91cbd3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTilemap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTilemap.java @@ -135,6 +135,12 @@ public abstract class DungeonTilemap extends Tilemap { (pos % Dungeon.level.width() + 0.5f) * SIZE, (pos / Dungeon.level.width() + 0.5f) * SIZE ); } + + public static PointF raisedTileCenterToWorld( int pos ) { + return new PointF( + (pos % Dungeon.level.width() + 0.5f) * SIZE, + (pos / Dungeon.level.width() + 0.1f) * SIZE ); + } @Override public boolean overlapsScreenPoint( int x, int y ) {