From 5ade968e4f455c88731be2bd36100eedb2873b41 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 7 May 2021 16:41:38 -0400 Subject: [PATCH] v0.9.3: fixed the ghost's hero death lines not playing --- .../shatteredpixeldungeon/actors/hero/Hero.java | 6 ++++++ .../items/artifacts/DriedRose.java | 14 +++----------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index e7d1e1523..13aec2598 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -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) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java index 1e9c0fd79..f47c36f8e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java @@ -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 ); }