v0.7.0: bugfixes:

- fixed warrior's broken seal buff detaching incorrectly
- made tipped dart sticking logic consistent with other missile weapons
- fixed items rarely being usable when the hero is dead
- added a bonus special room when pit rooms spawn
- fixed rockfall traps working on dead characters
- fixed a typo in magical porter
This commit is contained in:
Evan Debenham
2018-09-21 13:55:33 -04:00
parent 77decce364
commit a629295ead
6 changed files with 31 additions and 9 deletions
@@ -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;
}
} }
} }
@@ -59,10 +59,16 @@ public abstract class TippedDart extends Dart {
@Override @Override
protected void rangedHit(Char enemy, int cell) { protected void rangedHit(Char enemy, int cell) {
if (enemy.isAlive()) //attempt to stick the dart to the enemy, just drop it if we can't.
Buff.affect(enemy, PinCushion.class).stick(new Dart()); Dart d = new Dart();
else if (enemy.isAlive() && sticky) {
Dungeon.level.drop( new Dart(), enemy.pos ).sprite.drop(); PinCushion p = Buff.affect(enemy, PinCushion.class);
if (p.target == enemy){
p.stick(d);
return;
}
}
Dungeon.level.drop( d, enemy.pos ).sprite.drop();
} }
@Override @Override
@@ -111,8 +111,11 @@ public abstract class RegularLevel extends Level {
int specials = specialRooms(); int specials = specialRooms();
SpecialRoom.initForFloor(); SpecialRoom.initForFloor();
for (int i = 0; i < specials; i++) for (int i = 0; i < specials; i++) {
initRooms.add(SpecialRoom.createRoom()); SpecialRoom s = SpecialRoom.createRoom();
if (s instanceof PitRoom) specials++;
initRooms.add(s);
}
int secrets = SecretRoom.secretsForFloor(Dungeon.depth); int secrets = SecretRoom.secretsForFloor(Dungeon.depth);
for (int i = 0; i < secrets; i++) for (int i = 0; i < secrets; i++)
@@ -90,7 +90,7 @@ public class RockfallTrap extends Trap {
Char ch = Actor.findChar( cell ); Char ch = Actor.findChar( cell );
if (ch != null){ if (ch != null && ch.isAlive()){
int damage = Random.NormalIntRange(5+Dungeon.depth, 10+Dungeon.depth*2); int damage = Random.NormalIntRange(5+Dungeon.depth, 10+Dungeon.depth*2);
damage -= ch.drRoll(); damage -= ch.drRoll();
ch.damage( Math.max(damage, 0) , this); ch.damage( Math.max(damage, 0) , this);
@@ -90,7 +90,7 @@ public class WndItem extends Window {
protected void onClick() { protected void onClick() {
hide(); hide();
if (owner != null && owner.parent != null) owner.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 ); btn.setSize( btn.reqWidth(), BUTTON_HEIGHT );
@@ -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.name=magical porter
items.spells.magicalporter.inv_title=Port an item 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.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.name=phase shift
items.spells.phaseshift.tele_fail=The teleportation magic fails. items.spells.phaseshift.tele_fail=The teleportation magic fails.