From 4220c22cbf510fe2fcd926c29ccccc51102ea9a0 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 7 Aug 2015 16:32:26 -0400 Subject: [PATCH] v0.3.1: fixed a bug where the dried rose would fail to be droppable after loading a game. --- .../actors/mobs/npcs/Ghost.java | 2 +- .../shatteredpixeldungeon/items/Generator.java | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java index d354cd38a..3aef15070 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; - private static boolean processed; + public static boolean processed; private static int depth; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java index 0171522c4..5a1270b47 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java @@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Wandmaker.Rotberry; import com.shatteredpixel.shatteredpixeldungeon.items.armor.*; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.*; @@ -81,6 +82,8 @@ public class Generator { }; private static HashMap categoryProbs = new HashMap(); + + private static final float[] INITIAL_ARTIFACT_PROBS = new float[]{ 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1}; static { @@ -199,7 +202,7 @@ public class Generator { LloydsBeacon.class, EtherealChains.class }; - Category.ARTIFACT.probs = new float[]{ 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1}; + Category.ARTIFACT.probs = INITIAL_ARTIFACT_PROBS; Category.SEED.classes = new Class[]{ Firebloom.Seed.class, @@ -357,8 +360,11 @@ public class Generator { //resets artifact probabilities, for new dungeons public static void initArtifacts() { - //FIXME: the duplicated logic here has caused 1 bug so far, should refactor. - Category.ARTIFACT.probs = new float[]{ 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1}; + Category.ARTIFACT.probs = INITIAL_ARTIFACT_PROBS; + + //checks for dried rose quest completion, adds the rose in accordingly. + if (Ghost.Quest.processed) Category.ARTIFACT.probs[10] = 1; + spawnedArtifacts = new ArrayList(); }