v0.6.2b: fixed distortion traps not full clearing notes entries

This commit is contained in:
Evan Debenham 2017-11-09 02:40:59 -05:00 committed by Evan Debenham
parent 04c67713e8
commit aa6baa035f
2 changed files with 11 additions and 5 deletions

View File

@ -249,4 +249,8 @@ public class Notes {
return filtered;
}
public static void remove( Record rec ){
records.remove(rec);
}
}

View File

@ -25,9 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.LloydsBeacon;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.GoldenKey;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.Key;
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene;
import com.watabou.noosa.Game;
@ -43,8 +40,13 @@ public class DistortionTrap extends Trap{
public void activate() {
InterlevelScene.returnDepth = Dungeon.depth;
Belongings belongings = Dungeon.hero.belongings;
Notes.remove((Key) new IronKey(Dungeon.depth).quantity(99));
Notes.remove((Key) new GoldenKey(Dungeon.depth).quantity(99));
for (Notes.Record rec : Notes.getRecords()){
if (rec.depth() == Dungeon.depth){
Notes.remove(rec);
}
}
for (Item i : belongings){
if (i instanceof LloydsBeacon && ((LloydsBeacon) i).returnDepth == Dungeon.depth)
((LloydsBeacon) i).returnDepth = -1;