v0.8.1: Fixed the following minor bugs:

- preparation incorrect killing enemies at health threshold, instead of below it
- preparation incorrectly ignoring boss phases and death resistance effects
- talisman of foresight vision marking effects incorrectly persisting between depths
- packs filling past capacity in some cases
- fireblast incorrectly setting adjacent cells on fire when not flammable
- typos in the description of shields
- game incorrectly closing when back button is pressed in new hero select
- memory leaks on Android phones when the game is closed/opened
- cursed wand gas zaps not using new SFX
This commit is contained in:
Evan Debenham 2020-06-22 20:02:24 -04:00
parent 4415dde0fa
commit 148fc96d91
11 changed files with 35 additions and 11 deletions

View File

@ -309,7 +309,13 @@ public abstract class Char extends Actor {
buff(FrostImbue.class).proc(enemy);
if (enemy.isAlive() && prep != null && prep.canKO(enemy)){
enemy.die(this);
enemy.HP = 0;
if (!enemy.isAlive()) {
enemy.die(this);
} else {
//helps with triggering any on-damage effects that need to activate
enemy.damage(-1, this);
}
enemy.sprite.showStatus(CharSprite.NEGATIVE, Messages.get(Preparation.class, "assassinated"));
}

View File

@ -72,9 +72,9 @@ public class Preparation extends Buff implements ActionIndicator.Action {
public boolean canKO(Char defender){
if (defender.properties().contains(Char.Property.MINIBOSS)
|| defender.properties().contains(Char.Property.BOSS)){
return (defender.HP/(float)defender.HT) <= (KOThreshold/5f);
return (defender.HP/(float)defender.HT) < (KOThreshold/5f);
} else {
return (defender.HP/(float)defender.HT) <= KOThreshold;
return (defender.HP/(float)defender.HT) < KOThreshold;
}
}

View File

@ -340,6 +340,7 @@ public class TalismanOfForesight extends Artifact {
public static class CharAwareness extends FlavourBuff {
public int charID;
public int depth = Dungeon.depth;
private static final String ID = "id";
@ -367,8 +368,10 @@ public class TalismanOfForesight extends Artifact {
public static class HeapAwareness extends FlavourBuff {
public int pos;
public int depth = Dungeon.depth;
private static final String POS = "pos";
private static final String DEPTH = "depth";
@Override
public void detach() {
@ -381,12 +384,14 @@ public class TalismanOfForesight extends Artifact {
public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle);
pos = bundle.getInt(POS);
depth = bundle.getInt(DEPTH);
}
@Override
public void storeInBundle(Bundle bundle) {
super.storeInBundle(bundle);
bundle.put(POS, pos);
bundle.put(DEPTH, depth);
}
}

View File

@ -152,7 +152,7 @@ public class Bag extends Item implements Iterable<Item> {
public boolean canHold( Item item ){
if (items.contains(item) || item instanceof Bag || items.size() < capacity()){
return true;
} else {
} else if (item.stackable) {
for (Item i : items) {
if (item.isSimilar( i )) {
return true;

View File

@ -171,6 +171,7 @@ public class CursedWand {
GameScene.add( Blob.seed( bolt.collisionPos, 200, ParalyticGas.class ) );
break;
}
Sample.INSTANCE.play( Assets.Sounds.GAS );
afterZap.call();
}
});

View File

@ -77,7 +77,10 @@ public class WandOfFireblast extends DamageWand {
continue;
}
GameScene.add( Blob.seed( cell, 1+chargesPerCast(), Fire.class ) );
//only ignite cells directly near caster if they are flammable
if (!Dungeon.level.adjacent(bolt.sourcePos, cell) || Dungeon.level.flamable[cell]){
GameScene.add( Blob.seed( cell, 1+chargesPerCast(), Fire.class ) );
}
Char ch = Actor.findChar( cell );
if (ch != null) {

View File

@ -46,9 +46,9 @@ public class Greatshield extends MeleeWeapon {
public String statsInfo(){
if (isIdentified()){
return Messages.get(this, "stats_desc", 10+3*buffedLvl());
return Messages.get(this, "stats_desc", 6+3*buffedLvl());
} else {
return Messages.get(this, "typical_stats_desc", 10);
return Messages.get(this, "typical_stats_desc", 6);
}
}
}

View File

@ -50,9 +50,9 @@ public class RoundShield extends MeleeWeapon {
public String statsInfo(){
if (isIdentified()){
return Messages.get(this, "stats_desc", 5+2*buffedLvl());
return Messages.get(this, "stats_desc", 4+2*buffedLvl());
} else {
return Messages.get(this, "typical_stats_desc", 5);
return Messages.get(this, "typical_stats_desc", 4);
}
}
}

View File

@ -1094,6 +1094,7 @@ public abstract class Level implements Bundlable {
}
for (TalismanOfForesight.CharAwareness a : c.buffs(TalismanOfForesight.CharAwareness.class)){
if (Dungeon.depth != a.depth) continue;
Char ch = (Char) Actor.findById(a.charID);
if (ch == null) {
a.detach();
@ -1105,9 +1106,9 @@ public abstract class Level implements Bundlable {
}
for (TalismanOfForesight.HeapAwareness h : c.buffs(TalismanOfForesight.HeapAwareness.class)){
int p = h.pos;
if (Dungeon.depth != h.depth) continue;
for (int i : PathFinder.NEIGHBOURS9)
fieldOfView[p+i] = true;
fieldOfView[h.pos+i] = true;
}
for (Mob m : mobs){

View File

@ -988,6 +988,9 @@ public class GameScene extends PixelScene {
}
public static void selectCell( CellSelector.Listener listener ) {
if (cellSelector.listener != null && cellSelector.listener != defaultCellListener){
cellSelector.listener.onSelect(null);
}
cellSelector.listener = listener;
if (scene != null)
scene.prompt( listener.prompt() );

View File

@ -270,6 +270,11 @@ public class HeroSelectScene extends PixelScene {
uiAlpha = 2f;
}
@Override
protected void onBackPressed() {
ShatteredPixelDungeon.switchScene( TitleScene.class );
}
private class HeroBtn extends StyledButton {
private HeroClass cl;