v0.5.0: corrected alignment for wand effects
This commit is contained in:
parent
14c4875082
commit
5c37f71869
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -136,6 +136,12 @@ public abstract class DungeonTilemap extends Tilemap {
|
|||
(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 ) {
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue
Block a user