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 211de82be..4a324a310 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 @@ -30,6 +30,7 @@ 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.LifeLink; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor; import com.shatteredpixel.shatteredpixeldungeon.effects.Beam; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing; @@ -40,6 +41,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.ArmorKit; import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.LloydsBeacon; +import com.shatteredpixel.shatteredpixeldungeon.items.quest.GooBlob; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; import com.shatteredpixel.shatteredpixeldungeon.levels.NewCityBossLevel; import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; @@ -270,6 +272,8 @@ public class DwarfKing extends Mob { } private boolean teleportSubject(){ + if (enemy == null) return false; + Mob furthest = null; for (Mob m : getSubjects()){ @@ -355,6 +359,10 @@ public class DwarfKing extends Mob { } int preHP = HP; super.damage(dmg, src); + + LockedFloor lock = Dungeon.hero.buff(LockedFloor.class); + if (lock != null && !isImmune(src.getClass())) lock.addTime(dmg/3); + if (phase == 1) { int dmgTaken = preHP - HP; abilityCooldown -= dmgTaken/8f; @@ -396,7 +404,13 @@ public class DwarfKing extends Mob { public void die(Object cause) { GameScene.bossSlain(); - Dungeon.level.drop( new ArmorKit(), pos ).sprite.drop(); + + 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 ); 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 0c7699e52..a838265ec 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 @@ -28,8 +28,10 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption; import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing; import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.GhoulSprite; +import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.utils.Bundle; import com.watabou.utils.PathFinder; import com.watabou.utils.Random; @@ -146,6 +148,8 @@ public class Ghoul extends Mob { timesDowned++; Buff.append(nearby, GhoulLifeLink.class).set(timesDowned*5, this); ((GhoulSprite)sprite).crumple(); + HP = Math.round(HT/10f); + GLog.i(Messages.get(this, "collapse")); return; } } @@ -275,7 +279,6 @@ public class Ghoul extends Mob { turnsToRevive--; if (turnsToRevive <= 0){ - ghoul.HP = Math.round(ghoul.HT/10f); if (Actor.findChar( ghoul.pos ) != null) { ArrayList candidates = new ArrayList<>(); for (int n : PathFinder.NEIGHBOURS8) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/GoldenMimic.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/GoldenMimic.java index 84d8dc451..5ebfc3671 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/GoldenMimic.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/GoldenMimic.java @@ -65,7 +65,7 @@ public class GoldenMimic extends Mimic { public void stopHiding(){ state = HUNTING; - 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/NewTengu.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewTengu.java index ad0da70fc..8fc072d83 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewTengu.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewTengu.java @@ -117,10 +117,9 @@ public class NewTengu extends Mob { //Tengu is immune to debuffs and damage when removed from the level @Override public void add(Buff buff) { - if (!Dungeon.level.mobs.contains(this)){ - return; + if (Actor.chars().contains(this)){ + super.add(buff); } - super.add(buff); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java index 3025d0a8d..105aab5af 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java @@ -101,7 +101,8 @@ public class WandOfWarding extends Wand { GameScene.add(ward, 1f); Dungeon.level.occupyCell(ward); ward.sprite.emitter().burst(MagicMissile.WardParticle.UP, ward.tier); - + Dungeon.level.pressCell(bolt.collisionPos); + } else { GLog.w( Messages.get(this, "bad_location")); Dungeon.level.pressCell(bolt.collisionPos); @@ -188,6 +189,12 @@ public class WandOfWarding extends Wand { state = WANDERING; } + @Override + protected boolean act() { + throwItem(); + return super.act(); + } + @Override public String name() { return Messages.get(this, "name_" + tier ); 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 b9a453f84..0bebd47ea 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/CharHealthIndicator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/CharHealthIndicator.java @@ -21,6 +21,7 @@ package com.shatteredpixel.shatteredpixeldungeon.ui; +import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; @@ -46,7 +47,7 @@ public class CharHealthIndicator extends HealthBar { public void update() { super.update(); - if (target != null && target.isAlive() && target.sprite.visible) { + if (target != null && target.isAlive() && target.sprite.visible && Actor.chars().contains(target)) { 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 755462a1a..c8fca6090 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/TargetHealthIndicator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/TargetHealthIndicator.java @@ -21,6 +21,7 @@ package com.shatteredpixel.shatteredpixeldungeon.ui; +import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; @@ -40,7 +41,7 @@ public class TargetHealthIndicator extends HealthBar { public void update() { super.update(); - if (target != null && target.isAlive() && target.sprite.visible) { + if (target != null && target.isAlive() && target.sprite.visible && Actor.chars().contains(target)) { CharSprite sprite = target.sprite; width = sprite.width(); x = sprite.x; diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties index 010b127f9..78c6306f3 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties @@ -551,6 +551,7 @@ actors.mobs.fetidrat.name=fetid rat actors.mobs.fetidrat.desc=Something is clearly wrong with this rat. Its greasy black fur and rotting skin are very different from the healthy rats you've seen previously. Its pale green eyes make it seem especially menacing.\n\nThe rat carries a cloud of horrible stench with it, it's overpoweringly strong up close.\n\nDark ooze dribbles from the rat's mouth, it eats through the floor but seems to dissolve in water. actors.mobs.ghoul.name=dwarven ghoul +actors.mobs.ghoul.collapse=The dwarven ghoul collapses. actors.mobs.ghoul.desc=As dwarven society slowly began to collapse, and the current king of the dwarves seized absolute power, those who were weak or who resisted him were not treated well. As the king grew more adept at wielding dark magic, he bent these dwarves to his will, and now they make up the footsoldiers of his army.\n\nGhouls are not especially strong on their own, but always travel in groups and are much harder to kill in large numbers. _When a ghoul is defeated, it will rise again after a few turns as long as another ghoul is nearby._ actors.mobs.gnoll.name=gnoll scout