v0.7.2: bugfixes:

- fixed thieves rarely teleporting away when they are close
- fixed beacon losing location when scroll holder is picked up
- fixed recycle not dropping an item if inventory is full
- fixed alchemy scene not saving progress when it starts up
- fixed a rare freeze bug with tengu
This commit is contained in:
Evan Debenham 2019-03-11 22:49:01 -04:00
parent ca86bbf36d
commit 11ae926341
6 changed files with 43 additions and 3 deletions

View File

@ -192,7 +192,9 @@ public class Thief extends Mob {
if (enemySeen) {
sprite.showStatus(CharSprite.NEGATIVE, Messages.get(Mob.class, "rage"));
state = HUNTING;
} else if (item != null && !Dungeon.level.heroFOV[pos]) {
} else if (item != null
&& !Dungeon.level.heroFOV[pos]
&& Dungeon.level.distance(Dungeon.hero.pos, pos) < 6) {
int count = 32;
int newPos;

View File

@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.bags;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
import com.shatteredpixel.shatteredpixeldungeon.items.spells.BeaconOfReturning;
import com.shatteredpixel.shatteredpixeldungeon.items.spells.Spell;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
@ -39,6 +40,16 @@ public class ScrollHolder extends Bag {
return item instanceof Scroll || item instanceof Spell;
}
@Override
public void onDetach( ) {
super.onDetach();
for (Item item : items) {
if (item instanceof BeaconOfReturning) {
((BeaconOfReturning) item).returnDepth = -1;
}
}
}
@Override
public int price() {
return 40;

View File

@ -76,9 +76,19 @@ public class BeaconOfReturning extends Spell {
}
}
//we reset return depth when beacons are dropped to prevent
//having two stacks of beacons with different return locations
@Override
protected void onDetach() {
protected void onThrow(int cell) {
returnDepth = -1;
super.onThrow(cell);
}
@Override
public void doDrop(Hero hero) {
returnDepth = -1;
super.doDrop(hero);
}
private void setBeacon(Hero hero ){

View File

@ -22,6 +22,7 @@
package com.shatteredpixel.shatteredpixeldungeon.items.spells;
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
@ -79,7 +80,9 @@ public class Recycle extends InventorySpell {
item.detach(curUser.belongings.backpack);
GLog.p(Messages.get(this, "recycled", result.name()));
result.collect();
if (!result.collect()){
Dungeon.level.drop(result, curUser.pos).sprite.drop();
}
//TODO visuals
}

View File

@ -282,6 +282,14 @@ public class AlchemyScene extends PixelScene {
add(energyCost);
fadeIn();
try {
Dungeon.saveAll();
Badges.saveGlobal();
Journal.saveGlobal();
} catch (IOException e) {
ShatteredPixelDungeon.reportException(e);
}
}
@Override

View File

@ -58,6 +58,12 @@ public class TenguSprite extends MobSprite {
play( run.clone() );
}
@Override
public void idle() {
isMoving = false;
super.idle();
}
@Override
public void move( int from, int to ) {