v0.3.1d: fixed some bugs with artifact generation

This commit is contained in:
Evan Debenham 2015-09-10 16:55:24 -04:00
parent 0364319154
commit ac6f1b54cc
3 changed files with 10 additions and 7 deletions

View File

@ -140,8 +140,6 @@ public class Dungeon {
version = Game.versionCode; version = Game.versionCode;
challenges = ShatteredPixelDungeon.challenges(); challenges = ShatteredPixelDungeon.challenges();
Generator.initArtifacts();
Actor.clear(); Actor.clear();
Actor.resetNextID(); Actor.resetNextID();
@ -176,6 +174,7 @@ public class Dungeon {
Room.shuffleTypes(); Room.shuffleTypes();
Generator.initArtifacts();
hero = new Hero(); hero = new Hero();
hero.live(); hero.live();

View File

@ -246,7 +246,7 @@ public class Ghost extends NPC {
private static int type; private static int type;
private static boolean given; private static boolean given;
public static boolean processed; private static boolean processed;
private static int depth; private static int depth;
@ -371,6 +371,10 @@ public class Ghost extends NPC {
Journal.remove( Journal.Feature.GHOST ); Journal.remove( Journal.Feature.GHOST );
} }
public static boolean completed(){
return spawned && processed;
}
} }

View File

@ -202,7 +202,7 @@ public class Generator {
LloydsBeacon.class, LloydsBeacon.class,
EtherealChains.class EtherealChains.class
}; };
Category.ARTIFACT.probs = INITIAL_ARTIFACT_PROBS; Category.ARTIFACT.probs = INITIAL_ARTIFACT_PROBS.clone();
Category.SEED.classes = new Class<?>[]{ Category.SEED.classes = new Class<?>[]{
Firebloom.Seed.class, Firebloom.Seed.class,
@ -360,10 +360,10 @@ public class Generator {
//resets artifact probabilities, for new dungeons //resets artifact probabilities, for new dungeons
public static void initArtifacts() { public static void initArtifacts() {
Category.ARTIFACT.probs = INITIAL_ARTIFACT_PROBS; Category.ARTIFACT.probs = INITIAL_ARTIFACT_PROBS.clone();
//checks for dried rose quest completion, adds the rose in accordingly. //checks for dried rose quest completion, adds the rose in accordingly.
if (Ghost.Quest.processed) Category.ARTIFACT.probs[10] = 1; if (Ghost.Quest.completed()) Category.ARTIFACT.probs[10] = 1;
spawnedArtifacts = new ArrayList<String>(); spawnedArtifacts = new ArrayList<String>();
} }