v2.5.0: fixed cases where Yog wouldn't immediately move to final phase

This commit is contained in:
Evan Debenham
2024-07-08 15:56:02 -04:00
parent ea226259e9
commit 525571f044
2 changed files with 32 additions and 18 deletions

View File

@@ -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;

View File

@@ -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(){