v2.0.0: fixed returning/resurrecting causing unintended cell presses

This commit is contained in:
Evan Debenham
2023-01-16 16:25:46 -05:00
parent 8c277eddda
commit e03d489bae
2 changed files with 18 additions and 2 deletions

View File

@@ -290,6 +290,22 @@ public class ScrollOfTeleportation extends Scroll {
ch.sprite.emitter().start(Speck.factory(Speck.LIGHT), 0.2f, 3);
}
}
//just plays the VFX for teleporting, without any position changes
public static void appearVFX( Char ch ){
if (Dungeon.level.heroFOV[ch.pos]){
Sample.INSTANCE.play(Assets.Sounds.TELEPORT);
}
if (ch.invisible == 0) {
ch.sprite.alpha( 0 );
ch.sprite.parent.add( new AlphaTweener( ch.sprite, 1, 0.4f ) );
}
if (Dungeon.level.heroFOV[ch.pos]) {
ch.sprite.emitter().start(Speck.factory(Speck.LIGHT), 0.2f, 3);
}
}
@Override
public int value() {

View File

@@ -407,12 +407,12 @@ public class GameScene extends PixelScene {
switch (InterlevelScene.mode) {
case RESURRECT:
Sample.INSTANCE.play(Assets.Sounds.TELEPORT);
ScrollOfTeleportation.appear( Dungeon.hero, Dungeon.hero.pos );
ScrollOfTeleportation.appearVFX( Dungeon.hero );
SpellSprite.show(Dungeon.hero, SpellSprite.ANKH);
new Flare( 5, 16 ).color( 0xFFFF00, true ).show( hero, 4f ) ;
break;
case RETURN:
ScrollOfTeleportation.appear( Dungeon.hero, Dungeon.hero.pos );
ScrollOfTeleportation.appearVFX( Dungeon.hero );
break;
case DESCEND:
case FALL: