diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java index d14f47b7e..2847fd4ee 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java @@ -183,24 +183,6 @@ public class YogDzewa extends Mob { } } - if (phase == 4 && findFist() == null){ - yell(Messages.get(this, "hope")); - summonCooldown = -15; //summon a burst of minions! - phase = 5; - BossHealthBar.bleed(true); - Game.runOnRenderThread(new Callback() { - @Override - public void call() { - Music.INSTANCE.fadeOut(0.5f, new Callback() { - @Override - public void call() { - Music.INSTANCE.play(Assets.Music.HALLS_BOSS_FINALE, true); - } - }); - } - }); - } - if (phase == 0){ spend(TICK); return true; @@ -368,6 +350,28 @@ public class YogDzewa extends Mob { return true; } + public void processFistDeath(){ + //normally Yog has no logic when a fist dies specifically + //but the very last fist to die does trigger the final phase + if (phase == 4 && findFist() == null){ + yell(Messages.get(this, "hope")); + summonCooldown = -15; //summon a burst of minions! + phase = 5; + BossHealthBar.bleed(true); + Game.runOnRenderThread(new Callback() { + @Override + public void call() { + Music.INSTANCE.fadeOut(0.5f, new Callback() { + @Override + public void call() { + Music.INSTANCE.play(Assets.Music.HALLS_BOSS_FINALE, true); + } + }); + } + }); + } + } + @Override public boolean isAlive() { return super.isAlive() || phase != 5; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogFist.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogFist.java index ae75b34e9..58da7ebb0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogFist.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogFist.java @@ -158,6 +158,16 @@ public abstract class YogFist extends Mob { } } + @Override + public void die(Object cause) { + super.die(cause); + for ( Char c : Actor.chars() ){ + if (c instanceof YogDzewa){ + ((YogDzewa) c).processFistDeath(); + } + } + } + protected abstract void zap(); public void onZapComplete(){