v0.2.2b: fixed interaction between challenges and bones
This commit is contained in:
@@ -47,8 +47,10 @@ public class Bones {
|
|||||||
depth = Dungeon.depth;
|
depth = Dungeon.depth;
|
||||||
|
|
||||||
//heroes which have won the game, who die far above their farthest depth, or who are challenged drop no bones.
|
//heroes which have won the game, who die far above their farthest depth, or who are challenged drop no bones.
|
||||||
if (Statistics.amuletObtained || (Statistics.deepestFloor - 5) >= depth || Dungeon.challenges > 0)
|
if (Statistics.amuletObtained || (Statistics.deepestFloor - 5) >= depth || Dungeon.challenges > 0) {
|
||||||
|
depth = -1;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
item = pickItem(Dungeon.hero);
|
item = pickItem(Dungeon.hero);
|
||||||
|
|
||||||
@@ -122,10 +124,6 @@ public class Bones {
|
|||||||
public static Item get() {
|
public static Item get() {
|
||||||
if (depth == -1) {
|
if (depth == -1) {
|
||||||
|
|
||||||
//challenged heroes cannot find bones.
|
|
||||||
if (Dungeon.challenges > 0)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
InputStream input = Game.instance.openFileInput( BONES_FILE ) ;
|
InputStream input = Game.instance.openFileInput( BONES_FILE ) ;
|
||||||
Bundle bundle = Bundle.read( input );
|
Bundle bundle = Bundle.read( input );
|
||||||
@@ -141,7 +139,8 @@ public class Bones {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (depth == Dungeon.depth) {
|
//heroes who are challenged cannot find bones
|
||||||
|
if (depth == Dungeon.depth && Dungeon.challenges == 0) {
|
||||||
Game.instance.deleteFile( BONES_FILE );
|
Game.instance.deleteFile( BONES_FILE );
|
||||||
depth = 0;
|
depth = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user