v0.8.2: Various bugfixes:

- Added a safety check to AndroidGame
- fixed Burning not checking if a thieve's item is null
- fixed wand of regrowth overriding tall grass and placing grass where it shouldn't
- fixed unique potions being vulnerable to explosions
- fixed tengu placing traps over plants
- fixed items not being IDed in rankings if players dies with an ankh
This commit is contained in:
Evan Debenham 2020-07-31 19:32:43 -04:00
parent d62cb4aa95
commit 462b1027cc
6 changed files with 28 additions and 9 deletions

View File

@ -108,6 +108,11 @@ public class AndroidGame extends AndroidApplication {
}
@Override
public void onBackPressed() {
//do nothing, game should catch all back presses
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);

View File

@ -119,7 +119,7 @@ public class Burning extends Buff implements Hero.Doom {
target.damage( damage, this );
}
if (target instanceof Thief) {
if (target instanceof Thief && ((Thief) target).item != null) {
Item item = ((Thief) target).item;

View File

@ -257,6 +257,11 @@ public class Heap implements Bundlable {
for (Item item : items.toArray( new Item[0] )) {
//unique items aren't affect by explosions
if (item.unique || (item instanceof Armor && ((Armor) item).checkSeal() != null)){
continue;
}
if (item instanceof Potion) {
items.remove(item);
((Potion) item).shatter(pos);
@ -273,10 +278,10 @@ public class Heap implements Bundlable {
return;
}
//unique and upgraded items can endure the blast
} else if (!(item.level() > 0 || item.unique
|| (item instanceof Armor && ((Armor) item).checkSeal() != null)))
//upgraded items can endure the blast
} else if (item.level() <= 0) {
items.remove( item );
}
}

View File

@ -98,9 +98,15 @@ public class WandOfRegrowth extends Wand {
terr == Terrain.HIGH_GRASS ||
terr == Terrain.FURROWED_GRASS)) {
i.remove();
} else if (Char.hasProp(Actor.findChar(cell), Char.Property.IMMOVABLE)) {
i.remove();
} else if (Dungeon.level.plants.get(cell) != null){
i.remove();
} else {
Level.set( cell, Terrain.GRASS );
GameScene.updateMap( cell );
if (terr != Terrain.HIGH_GRASS && terr != Terrain.FURROWED_GRASS) {
Level.set(cell, Terrain.GRASS);
GameScene.updateMap( cell );
}
Char ch = Actor.findChar(cell);
if (ch != null){
processSoulMark(ch, chargesPerCast());
@ -162,6 +168,8 @@ public class WandOfRegrowth extends Wand {
for (int cell : cells){
if (grassToPlace <= 0 || bolt.path.contains(cell)) break;
if (Dungeon.level.map[cell] == Terrain.HIGH_GRASS) continue;
if (Random.Float() > furrowedChance) {
Level.set(cell, Terrain.HIGH_GRASS);
} else {

View File

@ -582,6 +582,7 @@ public class NewPrisonBossLevel extends Level {
int cell = x+tenguCell.left+1 + (y+tenguCell.top+1)*width();
if (Blob.volumeAt(cell, StormCloud.class) == 0
&& Blob.volumeAt(cell, Regrowth.class) <= 9
&& Dungeon.level.plants.get(cell) == null
&& Actor.findChar(cell) == null) {
Level.set(cell, Terrain.SECRET_TRAP);
setTrap(new TenguDartTrap().hide(), cell);

View File

@ -80,8 +80,8 @@ public class WndResurrect extends Window {
protected void onClick() {
hide();
Rankings.INSTANCE.submit( false, WndResurrect.causeOfDeath.getClass() );
Hero.reallyDie( WndResurrect.causeOfDeath );
Rankings.INSTANCE.submit( false, WndResurrect.causeOfDeath.getClass() );
}
};
btnNo.setRect( 0, btnYes.bottom() + GAP, WIDTH, BTN_HEIGHT );