diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java index d8140d794..c41f59997 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java @@ -447,7 +447,7 @@ public abstract class Char extends Actor { if (this.buff(MagicalSleep.class) != null){ Buff.detach(this, MagicalSleep.class); } - if (this.buff(Doom.class) != null){ + if (this.buff(Doom.class) != null && !isImmune(Doom.class)){ dmg *= 2; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/CrystalMimic.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/CrystalMimic.java index d07c41c5b..a86f1945a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/CrystalMimic.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/CrystalMimic.java @@ -112,7 +112,7 @@ public class CrystalMimic extends Mimic { } else { Buff.affect(this, Haste.class, 1f); } - if (Dungeon.level.heroFOV[pos] && Actor.chars().contains(this)) { + if (Actor.chars().contains(this) && Dungeon.level.heroFOV[pos]) { enemy = Dungeon.hero; target = Dungeon.hero.pos; enemySeen = true; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DwarfKing.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DwarfKing.java index 23b9d563c..6f01d9988 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DwarfKing.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DwarfKing.java @@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barrier; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Doom; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LifeLink; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor; import com.shatteredpixel.shatteredpixeldungeon.effects.Beam; @@ -38,6 +39,8 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle; import com.shatteredpixel.shatteredpixeldungeon.items.ArmorKit; +import com.shatteredpixel.shatteredpixeldungeon.items.Heap; +import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.LloydsBeacon; @@ -143,6 +146,11 @@ public class DwarfKing extends Mob { summonCooldown--; } + if (paralysed > 0){ + spend(TICK); + return true; + } + if (abilityCooldown <= 0){ if (lastAbility == NONE) { @@ -409,15 +417,19 @@ public class DwarfKing extends Mob { GameScene.bossSlain(); - if (!Dungeon.level.solid[pos]) { - Dungeon.level.drop(new ArmorKit(), pos).sprite.drop(); - } else { - //if the king is on his throne, drop the toolkit below - Dungeon.level.drop( new ArmorKit(), pos + Dungeon.level.width() ).sprite.drop( pos ); - } - super.die( cause ); + if (Dungeon.level.solid[pos]){ + Heap h = Dungeon.level.heaps.get(pos); + for (Item i : h.items){ + Dungeon.level.drop(i, pos + Dungeon.level.width()); + } + h.destroy(); + Dungeon.level.drop(new ArmorKit(), pos + Dungeon.level.width()).sprite.drop(pos); + } else { + Dungeon.level.drop(new ArmorKit(), pos).sprite.drop(); + } + Badges.validateBossSlain(); Dungeon.level.unseal(); @@ -434,6 +446,15 @@ public class DwarfKing extends Mob { yell( Messages.get(this, "defeated") ); } + @Override + public boolean isImmune(Class effect) { + //immune to damage amplification from doomed in 2nd phase or later, but it can still be applied + if (phase > 1 && effect == Doom.class && buff(Doom.class) != null ){ + return true; + } + return super.isImmune(effect); + } + public static class Summoning extends Buff { private int delay; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Ghoul.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Ghoul.java index c81a4090c..263bb2912 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Ghoul.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Ghoul.java @@ -173,12 +173,6 @@ public class Ghoul extends Mob { } } - @Override - protected void onAdd() { - spend(-cooldown()); - super.onAdd(); - } - private class Sleeping extends Mob.Sleeping { @Override public boolean act( boolean enemyInFOV, boolean justAlerted ) { @@ -300,6 +294,7 @@ public class Ghoul extends Mob { } } Actor.add(ghoul); + ghoul.spend(-ghoul.cooldown()); Dungeon.level.mobs.add(ghoul); Dungeon.level.occupyCell( ghoul ); ghoul.sprite.idle(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewCavesBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewCavesBossLevel.java index 7f9a06ab1..053fa2b8e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewCavesBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewCavesBossLevel.java @@ -572,7 +572,7 @@ public class NewCavesBossLevel extends Level { private static short[] entryWay = new short[]{ 0, 7, 7, 7, 4, 0, 15, 15, 15, 4, - 8, 23, 23, 23, 12, + -1, 23, 23, 23, -1, -1, -1, -1, -1, -1, -1, 6, -1, 14, -1, -1, -1, -1, -1, -1, diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/CharHealthIndicator.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/CharHealthIndicator.java index 0bebd47ea..a4c4f4300 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/CharHealthIndicator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/CharHealthIndicator.java @@ -47,7 +47,7 @@ public class CharHealthIndicator extends HealthBar { public void update() { super.update(); - if (target != null && target.isAlive() && target.sprite.visible && Actor.chars().contains(target)) { + if (target != null && target.isAlive() && target.sprite.visible) { CharSprite sprite = target.sprite; width = sprite.width()*(4/6f); x = sprite.x + sprite.width()/6f; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/TargetHealthIndicator.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/TargetHealthIndicator.java index c8fca6090..946f0eb0b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/TargetHealthIndicator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/TargetHealthIndicator.java @@ -41,7 +41,7 @@ public class TargetHealthIndicator extends HealthBar { public void update() { super.update(); - if (target != null && target.isAlive() && target.sprite.visible && Actor.chars().contains(target)) { + if (target != null && target.isAlive() && target.sprite.visible) { CharSprite sprite = target.sprite; width = sprite.width(); x = sprite.x;