diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java index a871ad1c6..35415bf72 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java @@ -914,7 +914,7 @@ public class Dungeon { } for (TalismanOfForesight.HeapAwareness h : hero.buffs(TalismanOfForesight.HeapAwareness.class)){ - if (Dungeon.depth != h.depth) continue; + if (Dungeon.depth != h.depth || Dungeon.branch != h.branch) continue; BArray.or( level.visited, level.heroFOV, h.pos - 1 - level.width(), 3, level.visited ); BArray.or( level.visited, level.heroFOV, h.pos - 1, 3, level.visited ); BArray.or( level.visited, level.heroFOV, h.pos - 1 + level.width(), 3, level.visited ); @@ -922,7 +922,7 @@ public class Dungeon { } for (RevealedArea a : hero.buffs(RevealedArea.class)){ - if (Dungeon.depth != a.depth) continue; + if (Dungeon.depth != a.depth || Dungeon.branch != a.branch) continue; BArray.or( level.visited, level.heroFOV, a.pos - 1 - level.width(), 3, level.visited ); BArray.or( level.visited, level.heroFOV, a.pos - 1, 3, level.visited ); BArray.or( level.visited, level.heroFOV, a.pos - 1 + level.width(), 3, level.visited ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/RevealedArea.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/RevealedArea.java index 9486ecf26..96ef87083 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/RevealedArea.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/RevealedArea.java @@ -35,7 +35,7 @@ public class RevealedArea extends FlavourBuff{ type = Buff.buffType.POSITIVE; } - public int pos, depth; + public int pos, depth, branch; @Override public void detach() { @@ -64,6 +64,7 @@ public class RevealedArea extends FlavourBuff{ return Messages.get(this, "desc", (int)visualcooldown()); } + private static final String BRANCH = "branch"; private static final String DEPTH = "depth"; private static final String POS = "pos"; @@ -71,6 +72,7 @@ public class RevealedArea extends FlavourBuff{ public void storeInBundle(Bundle bundle) { super.storeInBundle(bundle); bundle.put(DEPTH, depth); + bundle.put(BRANCH, branch); bundle.put(POS, pos); } @@ -78,6 +80,7 @@ public class RevealedArea extends FlavourBuff{ public void restoreFromBundle(Bundle bundle) { super.restoreFromBundle(bundle); depth = bundle.getInt(DEPTH); + branch = bundle.getInt(BRANCH); pos = bundle.getInt(POS); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java index b7eddeb72..2f503d9ad 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java @@ -383,9 +383,11 @@ public class TalismanOfForesight extends Artifact { public int pos; public int depth = Dungeon.depth; + public int branch = Dungeon.branch; private static final String POS = "pos"; private static final String DEPTH = "depth"; + private static final String BRANCH = "branch"; @Override public void detach() { @@ -399,6 +401,7 @@ public class TalismanOfForesight extends Artifact { super.restoreFromBundle(bundle); pos = bundle.getInt(POS); depth = bundle.getInt(DEPTH); + branch = bundle.getInt(BRANCH); } @Override @@ -406,6 +409,7 @@ public class TalismanOfForesight extends Artifact { super.storeInBundle(bundle); bundle.put(POS, pos); bundle.put(DEPTH, depth); + bundle.put(BRANCH, branch); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/keys/Key.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/keys/Key.java index c74f0accb..c6d002b88 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/keys/Key.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/keys/Key.java @@ -38,7 +38,8 @@ public abstract class Key extends Item { stackable = true; unique = true; } - + + //TODO currently keys can only appear on branch = 0, add branch support here if that changes public int depth; @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Notes.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Notes.java index 8e4c702a5..e49798d94 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Notes.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Notes.java @@ -33,7 +33,8 @@ import java.util.Collections; public class Notes { public static abstract class Record implements Comparable, Bundlable { - + + //TODO currently notes can only relate to branch = 0, add branch support here if that changes protected int depth; public int depth(){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java index 585b5b1a2..9444c0db1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -1337,7 +1337,7 @@ public abstract class Level implements Bundlable { } for (TalismanOfForesight.HeapAwareness h : c.buffs(TalismanOfForesight.HeapAwareness.class)){ - if (Dungeon.depth != h.depth) continue; + if (Dungeon.depth != h.depth || Dungeon.branch != h.branch) continue; for (int i : PathFinder.NEIGHBOURS9) heroMindFov[h.pos+i] = true; } @@ -1354,7 +1354,7 @@ public abstract class Level implements Bundlable { } for (RevealedArea a : c.buffs(RevealedArea.class)){ - if (Dungeon.depth != a.depth) continue; + if (Dungeon.depth != a.depth || Dungeon.branch != a.branch) continue; for (int i : PathFinder.NEIGHBOURS9) heroMindFov[a.pos+i] = true; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/PitfallTrap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/PitfallTrap.java index f1f194dcb..06b88735f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/PitfallTrap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/PitfallTrap.java @@ -79,12 +79,13 @@ public class PitfallTrap extends Trap { int pos; int depth; + int branch; @Override public boolean act() { boolean herofell = false; - if (depth == Dungeon.depth) { + if (depth == Dungeon.depth && branch == Dungeon.branch) { for (int i : PathFinder.NEIGHBOURS9) { int cell = pos + i; @@ -131,12 +132,14 @@ public class PitfallTrap extends Trap { private static final String POS = "pos"; private static final String DEPTH = "depth"; + private static final String BRANCH = "branch"; @Override public void storeInBundle(Bundle bundle) { super.storeInBundle(bundle); bundle.put(POS, pos); bundle.put(DEPTH, depth); + bundle.put(BRANCH, branch); } @Override @@ -144,6 +147,7 @@ public class PitfallTrap extends Trap { super.restoreFromBundle(bundle); pos = bundle.getInt(POS); depth = bundle.getInt(DEPTH); + branch = bundle.getInt(BRANCH); } }