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
@@ -1682,6 +1682,12 @@ public class Hero extends Char {
items.remove( item ); items.remove( item );
} }
for (Char c : Actor.chars()){
if (c instanceof DriedRose.GhostHero){
((DriedRose.GhostHero) c).sayHeroKilled();
}
}
GameScene.gameOver(); GameScene.gameOver();
if (cause instanceof Hero.Doom) { if (cause instanceof Hero.Doom) {
@@ -568,12 +568,7 @@ public class DriedRose extends Artifact {
damage(1, this); damage(1, this);
} }
if (!isAlive()) if (!isAlive()) {
return true;
if (!Dungeon.hero.isAlive()){
sayHeroKilled();
sprite.die();
destroy();
return true; return true;
} }
return super.act(); return super.act();
@@ -827,11 +822,8 @@ public class DriedRose extends Artifact {
} }
public void sayHeroKilled(){ public void sayHeroKilled(){
if (Dungeon.bossLevel()){ yell( Messages.get( this, "player_killed_" + Random.IntRange(1, 3) ));
yell( Messages.get( this, "hero_killed_boss_" + Random.IntRange(1, 3) )); GLog.newLine();
} else {
yell( Messages.get( this, "hero_killed_" + Random.IntRange(1, 3) ));
}
Sample.INSTANCE.play( Assets.Sounds.GHOST ); Sample.INSTANCE.play( Assets.Sounds.GHOST );
} }