v0.9.3: fixed the ghost's hero death lines not playing

This commit is contained in:
Evan Debenham 2021-05-07 16:41:38 -04:00
parent 158fd1c730
commit 5ade968e4f
2 changed files with 9 additions and 11 deletions

View File

@ -1682,6 +1682,12 @@ public class Hero extends Char {
items.remove( item );
}
for (Char c : Actor.chars()){
if (c instanceof DriedRose.GhostHero){
((DriedRose.GhostHero) c).sayHeroKilled();
}
}
GameScene.gameOver();
if (cause instanceof Hero.Doom) {

View File

@ -568,12 +568,7 @@ public class DriedRose extends Artifact {
damage(1, this);
}
if (!isAlive())
return true;
if (!Dungeon.hero.isAlive()){
sayHeroKilled();
sprite.die();
destroy();
if (!isAlive()) {
return true;
}
return super.act();
@ -827,11 +822,8 @@ public class DriedRose extends Artifact {
}
public void sayHeroKilled(){
if (Dungeon.bossLevel()){
yell( Messages.get( this, "hero_killed_boss_" + Random.IntRange(1, 3) ));
} else {
yell( Messages.get( this, "hero_killed_" + Random.IntRange(1, 3) ));
}
yell( Messages.get( this, "player_killed_" + Random.IntRange(1, 3) ));
GLog.newLine();
Sample.INSTANCE.play( Assets.Sounds.GHOST );
}