From ac6f1b54cc572609bac67c502651707ad32944a9 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 10 Sep 2015 16:55:24 -0400 Subject: [PATCH] v0.3.1d: fixed some bugs with artifact generation --- src/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java | 5 ++--- .../shatteredpixeldungeon/actors/mobs/npcs/Ghost.java | 6 +++++- .../shatteredpixeldungeon/items/Generator.java | 6 +++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java b/src/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java index a5b305771..aee9c2e5b 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java @@ -140,8 +140,6 @@ public class Dungeon { version = Game.versionCode; challenges = ShatteredPixelDungeon.challenges(); - Generator.initArtifacts(); - Actor.clear(); Actor.resetNextID(); @@ -175,7 +173,8 @@ public class Dungeon { Imp.Quest.reset(); Room.shuffleTypes(); - + + Generator.initArtifacts(); hero = new Hero(); hero.live(); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java index 28b3f7db9..d267e1b04 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java @@ -246,7 +246,7 @@ public class Ghost extends NPC { private static int type; private static boolean given; - public static boolean processed; + private static boolean processed; private static int depth; @@ -371,6 +371,10 @@ public class Ghost extends NPC { Journal.remove( Journal.Feature.GHOST ); } + + public static boolean completed(){ + return spawned && processed; + } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java index 5a1270b47..6852c5fa7 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java @@ -202,7 +202,7 @@ public class Generator { LloydsBeacon.class, EtherealChains.class }; - Category.ARTIFACT.probs = INITIAL_ARTIFACT_PROBS; + Category.ARTIFACT.probs = INITIAL_ARTIFACT_PROBS.clone(); Category.SEED.classes = new Class[]{ Firebloom.Seed.class, @@ -360,10 +360,10 @@ public class Generator { //resets artifact probabilities, for new dungeons 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. - if (Ghost.Quest.processed) Category.ARTIFACT.probs[10] = 1; + if (Ghost.Quest.completed()) Category.ARTIFACT.probs[10] = 1; spawnedArtifacts = new ArrayList(); }