v0.9.2: fixed succubus vfx/sfx triggering even if they aren't visible

This commit is contained in:
Evan Debenham 2021-02-11 13:47:54 -05:00
parent e714c7860e
commit 0131feb0b9

View File

@ -83,14 +83,18 @@ public class Succubus extends Mob {
} else { } else {
HP += 5 + damage; HP += 5 + damage;
} }
if (Dungeon.level.heroFOV[pos]) {
sprite.emitter().burst( Speck.factory( Speck.HEALING ), 2 ); sprite.emitter().burst( Speck.factory( Speck.HEALING ), 2 );
Sample.INSTANCE.play( Assets.Sounds.CHARMS ); Sample.INSTANCE.play( Assets.Sounds.CHARMS );
}
} else if (Random.Int( 3 ) == 0) { } else if (Random.Int( 3 ) == 0) {
Charm c = Buff.affect( enemy, Charm.class, Charm.DURATION/2f ); Charm c = Buff.affect( enemy, Charm.class, Charm.DURATION/2f );
c.object = id(); c.object = id();
c.ignoreNextHit = true; //so that the -5 duration from succubus hit is ignored c.ignoreNextHit = true; //so that the -5 duration from succubus hit is ignored
enemy.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 5 ); if (Dungeon.level.heroFOV[enemy.pos]) {
Sample.INSTANCE.play( Assets.Sounds.CHARMS ); enemy.sprite.centerEmitter().start(Speck.factory(Speck.HEART), 0.2f, 5);
Sample.INSTANCE.play(Assets.Sounds.CHARMS);
}
} }
return damage; return damage;