v0.6.1: more bugfixes and improvements to the dried rose

This commit is contained in:
Evan Debenham 2017-08-01 14:51:06 -04:00
parent d0dfa22fe4
commit b294155fb1
6 changed files with 26 additions and 13 deletions

View File

@ -75,7 +75,7 @@ public class Ghost extends NPC {
@Override @Override
protected boolean act() { protected boolean act() {
if (Quest.completed()) if (Quest.processed())
target = Dungeon.hero.pos; target = Dungeon.hero.pos;
return super.act(); return super.act();
} }
@ -87,7 +87,7 @@ public class Ghost extends NPC {
@Override @Override
public float speed() { public float speed() {
return Quest.completed() ? 2f : 0.5f; return Quest.processed() ? 2f : 0.5f;
} }
@Override @Override
@ -334,7 +334,6 @@ public class Ghost extends NPC {
GLog.n( Messages.get(Ghost.class, "find_me") ); GLog.n( Messages.get(Ghost.class, "find_me") );
Sample.INSTANCE.play( Assets.SND_GHOST ); Sample.INSTANCE.play( Assets.SND_GHOST );
processed = true; processed = true;
Generator.Category.ARTIFACT.probs[10] = 1; //flags the dried rose as spawnable.
} }
} }
@ -345,8 +344,12 @@ public class Ghost extends NPC {
Notes.remove( Notes.Landmark.GHOST ); Notes.remove( Notes.Landmark.GHOST );
} }
public static boolean completed(){ public static boolean processed(){
return spawned && processed; return spawned && processed;
} }
public static boolean completed(){
return processed() && weapon == null && armor == null;
}
} }
} }

View File

@ -23,7 +23,6 @@ package com.shatteredpixel.shatteredpixeldungeon.items;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClothArmor; import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClothArmor;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.LeatherArmor; import com.shatteredpixel.shatteredpixeldungeon.items.armor.LeatherArmor;
@ -192,7 +191,7 @@ public class Generator {
return item instanceof Bag ? Integer.MAX_VALUE : Integer.MAX_VALUE - 1; return item instanceof Bag ? Integer.MAX_VALUE : Integer.MAX_VALUE - 1;
} }
private static final float[] INITIAL_ARTIFACT_PROBS = new float[]{ 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1}; private static final float[] INITIAL_ARTIFACT_PROBS = new float[]{ 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1};
static { static {
GOLD.classes = new Class<?>[]{ GOLD.classes = new Class<?>[]{
@ -342,7 +341,7 @@ public class Generator {
TimekeepersHourglass.class, TimekeepersHourglass.class,
UnstableSpellbook.class, UnstableSpellbook.class,
AlchemistsToolkit.class, //currently removed from drop tables, pending rework. AlchemistsToolkit.class, //currently removed from drop tables, pending rework.
DriedRose.class, //starts with no chance of spawning, chance is set directly after beating ghost quest. DriedRose.class,
LloydsBeacon.class, LloydsBeacon.class,
EtherealChains.class EtherealChains.class
}; };
@ -524,10 +523,6 @@ 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 = Category.INITIAL_ARTIFACT_PROBS.clone(); Category.ARTIFACT.probs = Category.INITIAL_ARTIFACT_PROBS.clone();
//checks for dried rose quest completion, adds the rose in accordingly.
if (Ghost.Quest.completed()) Category.ARTIFACT.probs[10] = 1;
spawnedArtifacts = new ArrayList<>(); spawnedArtifacts = new ArrayList<>();
} }

View File

@ -137,6 +137,11 @@ public class Artifact extends KindofMisc {
@Override @Override
public String status() { public String status() {
//if the artifact isn't IDed, or is cursed, don't display anything
if (!isIdentified() || cursed){
return null;
}
//display the current cooldown //display the current cooldown
if (cooldown != 0) if (cooldown != 0)

View File

@ -33,6 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Wraith; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Wraith;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.NPC; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.NPC;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
@ -100,6 +101,10 @@ public class DriedRose extends Artifact {
@Override @Override
public ArrayList<String> actions( Hero hero ) { public ArrayList<String> actions( Hero hero ) {
ArrayList<String> actions = super.actions( hero ); ArrayList<String> actions = super.actions( hero );
if (!Ghost.Quest.completed()){
actions.remove(AC_EQUIP);
return actions;
}
if (isEquipped( hero ) && charge == chargeCap && !cursed) { if (isEquipped( hero ) && charge == chargeCap && !cursed) {
actions.add(AC_SUMMON); actions.add(AC_SUMMON);
} }
@ -168,6 +173,10 @@ public class DriedRose extends Artifact {
@Override @Override
public String desc() { public String desc() {
if (!Ghost.Quest.completed() && !isIdentified()){
return Messages.get(this, "desc_no_quest");
}
String desc = super.desc(); String desc = super.desc();
if (isEquipped( Dungeon.hero )){ if (isEquipped( Dungeon.hero )){
@ -262,7 +271,7 @@ public class DriedRose extends Artifact {
ghostPos = pos + PathFinder.NEIGHBOURS8[Random.Int(8)]; ghostPos = pos + PathFinder.NEIGHBOURS8[Random.Int(8)];
} while (Level.solid[ghostPos] || level.findMob(ghostPos) != null); } while (Level.solid[ghostPos] || level.findMob(ghostPos) != null);
heldGhost.pos = pos; heldGhost.pos = ghostPos;
heldGhost = null; heldGhost = null;
} }
} }

View File

@ -190,7 +190,7 @@ public abstract class Level implements Bundlable {
} }
DriedRose rose = Dungeon.hero.belongings.getItem( DriedRose.class ); DriedRose rose = Dungeon.hero.belongings.getItem( DriedRose.class );
if (rose != null && !rose.cursed){ if (rose != null && rose.isIdentified() && !rose.cursed){
//aim to drop 1 petal every 2 floors //aim to drop 1 petal every 2 floors
int petalsNeeded = (int) Math.ceil((float)((Dungeon.depth / 2) - rose.droppedPetals) / 3); int petalsNeeded = (int) Math.ceil((float)((Dungeon.depth / 2) - rose.droppedPetals) / 3);

View File

@ -176,6 +176,7 @@ items.artifacts.driedrose.cursed=You cannot use a cursed rose.
items.artifacts.driedrose.no_space=There is no free space near you. items.artifacts.driedrose.no_space=There is no free space near you.
items.artifacts.driedrose.charged=Your rose is fully charged! items.artifacts.driedrose.charged=Your rose is fully charged!
items.artifacts.driedrose.desc=Is this the rose that the ghost mentioned before disappearing? It seems to hold some spiritual power, perhaps it can be used to channel the energy of that lost warrior. items.artifacts.driedrose.desc=Is this the rose that the ghost mentioned before disappearing? It seems to hold some spiritual power, perhaps it can be used to channel the energy of that lost warrior.
items.artifacts.driedrose.desc_no_quest=A dried aged rose that is somehow still holding together despite its age.\n\nIt seems to have some spiritual power, but you have no idea how to use it right now.
items.artifacts.driedrose.desc_hint=It seems to be missing some petals. Perhaps reattaching them will strengthen the rose. items.artifacts.driedrose.desc_hint=It seems to be missing some petals. Perhaps reattaching them will strengthen the rose.
items.artifacts.driedrose.desc_cursed=The cursed rose is bound to your hand, it feels eerily cold. items.artifacts.driedrose.desc_cursed=The cursed rose is bound to your hand, it feels eerily cold.
items.artifacts.driedrose$petal.name=dried petal items.artifacts.driedrose$petal.name=dried petal