diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/BrokenSeal.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/BrokenSeal.java index d76b5ffb3..c7fa7fd3c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/BrokenSeal.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/BrokenSeal.java @@ -142,5 +142,18 @@ public class BrokenSeal extends Item { } } + @Override + //logic edited slightly as buff should not detach + public int absorbDamage(int dmg) { + if (shielding >= dmg){ + shielding -= dmg; + dmg = 0; + } else { + dmg -= shielding; + shielding = 0; + } + target.needsShieldUpdate = true; + return dmg; + } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/TippedDart.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/TippedDart.java index 94c25dfac..717a7abea 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/TippedDart.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/TippedDart.java @@ -59,10 +59,16 @@ public abstract class TippedDart extends Dart { @Override protected void rangedHit(Char enemy, int cell) { - if (enemy.isAlive()) - Buff.affect(enemy, PinCushion.class).stick(new Dart()); - else - Dungeon.level.drop( new Dart(), enemy.pos ).sprite.drop(); + //attempt to stick the dart to the enemy, just drop it if we can't. + Dart d = new Dart(); + if (enemy.isAlive() && sticky) { + PinCushion p = Buff.affect(enemy, PinCushion.class); + if (p.target == enemy){ + p.stick(d); + return; + } + } + Dungeon.level.drop( d, enemy.pos ).sprite.drop(); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java index cd679d55b..1ef1eec12 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java @@ -111,8 +111,11 @@ public abstract class RegularLevel extends Level { int specials = specialRooms(); SpecialRoom.initForFloor(); - for (int i = 0; i < specials; i++) - initRooms.add(SpecialRoom.createRoom()); + for (int i = 0; i < specials; i++) { + SpecialRoom s = SpecialRoom.createRoom(); + if (s instanceof PitRoom) specials++; + initRooms.add(s); + } int secrets = SecretRoom.secretsForFloor(Dungeon.depth); for (int i = 0; i < secrets; i++) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/RockfallTrap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/RockfallTrap.java index 37bc6002c..d53251055 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/RockfallTrap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/RockfallTrap.java @@ -90,7 +90,7 @@ public class RockfallTrap extends Trap { Char ch = Actor.findChar( cell ); - if (ch != null){ + if (ch != null && ch.isAlive()){ int damage = Random.NormalIntRange(5+Dungeon.depth, 10+Dungeon.depth*2); damage -= ch.drRoll(); ch.damage( Math.max(damage, 0) , this); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndItem.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndItem.java index c391f9ff0..2d6ce930e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndItem.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndItem.java @@ -90,7 +90,7 @@ public class WndItem extends Window { protected void onClick() { hide(); if (owner != null && owner.parent != null) owner.hide(); - item.execute( Dungeon.hero, action ); + if (Dungeon.hero.isAlive()) item.execute( Dungeon.hero, action ); }; }; btn.setSize( btn.reqWidth(), BUTTON_HEIGHT ); diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index 102049f25..c1a6f20b4 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -943,7 +943,7 @@ items.spells.magicalinfusion.desc=This spell will infuse a weapon or armor with items.spells.magicalporter.name=magical porter items.spells.magicalporter.inv_title=Port an item items.spells.magicalporter.nowhere=There is nowhere for you to port an item to. -items.spells.magicalporter.desc=This spell will magical transport any item it is cast on. Unlike a merchant's beacon however, the items will be transported to the entrance of next boss floor. +items.spells.magicalporter.desc=This spell will magical transport any item it is cast on. Unlike a merchant's beacon however, the items will be transported to the entrance of the next boss floor. items.spells.phaseshift.name=phase shift items.spells.phaseshift.tele_fail=The teleportation magic fails.