v0.3.1: fixed a bug where the dried rose would fail to be droppable after loading a game.

This commit is contained in:
Evan Debenham 2015-08-07 16:32:26 -04:00
parent d73e663ef6
commit 4220c22cbf
2 changed files with 10 additions and 4 deletions

View File

@ -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;

View File

@ -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<Category,Float> categoryProbs = new HashMap<Generator.Category, Float>();
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<String>();
}