v2.1.4: fixed a few caess of game effects not accounting for branches
This commit is contained in:
@@ -914,7 +914,7 @@ public class Dungeon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (TalismanOfForesight.HeapAwareness h : hero.buffs(TalismanOfForesight.HeapAwareness.class)){
|
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 - 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, 3, level.visited );
|
||||||
BArray.or( level.visited, level.heroFOV, h.pos - 1 + level.width(), 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)){
|
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 - 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, 3, level.visited );
|
||||||
BArray.or( level.visited, level.heroFOV, a.pos - 1 + level.width(), 3, level.visited );
|
BArray.or( level.visited, level.heroFOV, a.pos - 1 + level.width(), 3, level.visited );
|
||||||
|
|||||||
+4
-1
@@ -35,7 +35,7 @@ public class RevealedArea extends FlavourBuff{
|
|||||||
type = Buff.buffType.POSITIVE;
|
type = Buff.buffType.POSITIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int pos, depth;
|
public int pos, depth, branch;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void detach() {
|
public void detach() {
|
||||||
@@ -64,6 +64,7 @@ public class RevealedArea extends FlavourBuff{
|
|||||||
return Messages.get(this, "desc", (int)visualcooldown());
|
return Messages.get(this, "desc", (int)visualcooldown());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final String BRANCH = "branch";
|
||||||
private static final String DEPTH = "depth";
|
private static final String DEPTH = "depth";
|
||||||
private static final String POS = "pos";
|
private static final String POS = "pos";
|
||||||
|
|
||||||
@@ -71,6 +72,7 @@ public class RevealedArea extends FlavourBuff{
|
|||||||
public void storeInBundle(Bundle bundle) {
|
public void storeInBundle(Bundle bundle) {
|
||||||
super.storeInBundle(bundle);
|
super.storeInBundle(bundle);
|
||||||
bundle.put(DEPTH, depth);
|
bundle.put(DEPTH, depth);
|
||||||
|
bundle.put(BRANCH, branch);
|
||||||
bundle.put(POS, pos);
|
bundle.put(POS, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,6 +80,7 @@ public class RevealedArea extends FlavourBuff{
|
|||||||
public void restoreFromBundle(Bundle bundle) {
|
public void restoreFromBundle(Bundle bundle) {
|
||||||
super.restoreFromBundle(bundle);
|
super.restoreFromBundle(bundle);
|
||||||
depth = bundle.getInt(DEPTH);
|
depth = bundle.getInt(DEPTH);
|
||||||
|
branch = bundle.getInt(BRANCH);
|
||||||
pos = bundle.getInt(POS);
|
pos = bundle.getInt(POS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
@@ -383,9 +383,11 @@ public class TalismanOfForesight extends Artifact {
|
|||||||
|
|
||||||
public int pos;
|
public int pos;
|
||||||
public int depth = Dungeon.depth;
|
public int depth = Dungeon.depth;
|
||||||
|
public int branch = Dungeon.branch;
|
||||||
|
|
||||||
private static final String POS = "pos";
|
private static final String POS = "pos";
|
||||||
private static final String DEPTH = "depth";
|
private static final String DEPTH = "depth";
|
||||||
|
private static final String BRANCH = "branch";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void detach() {
|
public void detach() {
|
||||||
@@ -399,6 +401,7 @@ public class TalismanOfForesight extends Artifact {
|
|||||||
super.restoreFromBundle(bundle);
|
super.restoreFromBundle(bundle);
|
||||||
pos = bundle.getInt(POS);
|
pos = bundle.getInt(POS);
|
||||||
depth = bundle.getInt(DEPTH);
|
depth = bundle.getInt(DEPTH);
|
||||||
|
branch = bundle.getInt(BRANCH);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -406,6 +409,7 @@ public class TalismanOfForesight extends Artifact {
|
|||||||
super.storeInBundle(bundle);
|
super.storeInBundle(bundle);
|
||||||
bundle.put(POS, pos);
|
bundle.put(POS, pos);
|
||||||
bundle.put(DEPTH, depth);
|
bundle.put(DEPTH, depth);
|
||||||
|
bundle.put(BRANCH, branch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,8 @@ public abstract class Key extends Item {
|
|||||||
stackable = true;
|
stackable = true;
|
||||||
unique = true;
|
unique = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO currently keys can only appear on branch = 0, add branch support here if that changes
|
||||||
public int depth;
|
public int depth;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ import java.util.Collections;
|
|||||||
public class Notes {
|
public class Notes {
|
||||||
|
|
||||||
public static abstract class Record implements Comparable<Record>, Bundlable {
|
public static abstract class Record implements Comparable<Record>, Bundlable {
|
||||||
|
|
||||||
|
//TODO currently notes can only relate to branch = 0, add branch support here if that changes
|
||||||
protected int depth;
|
protected int depth;
|
||||||
|
|
||||||
public int depth(){
|
public int depth(){
|
||||||
|
|||||||
@@ -1337,7 +1337,7 @@ public abstract class Level implements Bundlable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (TalismanOfForesight.HeapAwareness h : c.buffs(TalismanOfForesight.HeapAwareness.class)){
|
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;
|
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)){
|
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;
|
for (int i : PathFinder.NEIGHBOURS9) heroMindFov[a.pos+i] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -79,12 +79,13 @@ public class PitfallTrap extends Trap {
|
|||||||
|
|
||||||
int pos;
|
int pos;
|
||||||
int depth;
|
int depth;
|
||||||
|
int branch;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean act() {
|
public boolean act() {
|
||||||
|
|
||||||
boolean herofell = false;
|
boolean herofell = false;
|
||||||
if (depth == Dungeon.depth) {
|
if (depth == Dungeon.depth && branch == Dungeon.branch) {
|
||||||
for (int i : PathFinder.NEIGHBOURS9) {
|
for (int i : PathFinder.NEIGHBOURS9) {
|
||||||
|
|
||||||
int cell = pos + i;
|
int cell = pos + i;
|
||||||
@@ -131,12 +132,14 @@ public class PitfallTrap extends Trap {
|
|||||||
|
|
||||||
private static final String POS = "pos";
|
private static final String POS = "pos";
|
||||||
private static final String DEPTH = "depth";
|
private static final String DEPTH = "depth";
|
||||||
|
private static final String BRANCH = "branch";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void storeInBundle(Bundle bundle) {
|
public void storeInBundle(Bundle bundle) {
|
||||||
super.storeInBundle(bundle);
|
super.storeInBundle(bundle);
|
||||||
bundle.put(POS, pos);
|
bundle.put(POS, pos);
|
||||||
bundle.put(DEPTH, depth);
|
bundle.put(DEPTH, depth);
|
||||||
|
bundle.put(BRANCH, branch);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -144,6 +147,7 @@ public class PitfallTrap extends Trap {
|
|||||||
super.restoreFromBundle(bundle);
|
super.restoreFromBundle(bundle);
|
||||||
pos = bundle.getInt(POS);
|
pos = bundle.getInt(POS);
|
||||||
depth = bundle.getInt(DEPTH);
|
depth = bundle.getInt(DEPTH);
|
||||||
|
branch = bundle.getInt(BRANCH);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user