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 ) {
|
public void reset( int type, int from, int to, Callback callback ) {
|
||||||
reset( type,
|
reset( type,
|
||||||
DungeonTilemap.tileCenterToWorld( from ),
|
DungeonTilemap.raisedTileCenterToWorld( from ),
|
||||||
DungeonTilemap.tileCenterToWorld( to ),
|
DungeonTilemap.raisedTileCenterToWorld( to ),
|
||||||
callback );
|
callback );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ public class MagicMissile extends Emitter {
|
||||||
public void reset( int type, Visual from, int to, Callback callback ) {
|
public void reset( int type, Visual from, int to, Callback callback ) {
|
||||||
reset( type,
|
reset( type,
|
||||||
from.center(),
|
from.center(),
|
||||||
DungeonTilemap.tileCenterToWorld( to ),
|
DungeonTilemap.raisedTileCenterToWorld( to ),
|
||||||
callback);
|
callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ public class WandOfDisintegration extends DamageWand {
|
||||||
protected void fx( Ballistica beam, Callback callback ) {
|
protected void fx( Ballistica beam, Callback callback ) {
|
||||||
|
|
||||||
int cell = beam.path.get(Math.min(beam.dist, distance()));
|
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();
|
callback.call();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.traps.LightningTrap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
import com.watabou.noosa.Camera;
|
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()));
|
arcs.add( new Lightning.Arc(curUser.sprite.center(), ch.sprite.center()));
|
||||||
arc(ch);
|
arc(ch);
|
||||||
} else {
|
} 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 );
|
CellEmitter.center( cell ).burst( SparkParticle.FACTORY, 3 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@ public class WandOfPrismaticLight extends DamageWand {
|
||||||
@Override
|
@Override
|
||||||
protected void fx( Ballistica beam, Callback callback ) {
|
protected void fx( Ballistica beam, Callback callback ) {
|
||||||
curUser.sprite.parent.add(
|
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();
|
callback.call();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -201,7 +201,7 @@ public class WandOfTransfusion extends Wand {
|
||||||
@Override
|
@Override
|
||||||
protected void fx(Ballistica beam, Callback callback) {
|
protected void fx(Ballistica beam, Callback callback) {
|
||||||
curUser.sprite.parent.add(
|
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();
|
callback.call();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ public class EyeSprite extends MobSprite {
|
||||||
if (Actor.findChar(zapPos) != null){
|
if (Actor.findChar(zapPos) != null){
|
||||||
parent.add(new Beam.DeathRay(center(), Actor.findChar(zapPos).sprite.center()));
|
parent.add(new Beam.DeathRay(center(), Actor.findChar(zapPos).sprite.center()));
|
||||||
} else {
|
} else {
|
||||||
parent.add(new Beam.DeathRay(center(), DungeonTilemap.tileCenterToWorld(zapPos)));
|
parent.add(new Beam.DeathRay(center(), DungeonTilemap.raisedTileCenterToWorld(zapPos)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
((Eye)ch).deathGaze();
|
((Eye)ch).deathGaze();
|
||||||
|
|
|
@ -135,6 +135,12 @@ public abstract class DungeonTilemap extends Tilemap {
|
||||||
(pos % Dungeon.level.width() + 0.5f) * SIZE,
|
(pos % Dungeon.level.width() + 0.5f) * SIZE,
|
||||||
(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
|
@Override
|
||||||
public boolean overlapsScreenPoint( int x, int y ) {
|
public boolean overlapsScreenPoint( int x, int y ) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user