From bded42981fda2f8cfc03112e61ddfad39343ae30 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 12 Dec 2014 17:28:20 -0500 Subject: [PATCH] v0.2.3: more Dried Rose implementation --- .../items/artifacts/DriedRose.java | 45 +++++++++++++++++-- .../windows/WndSadGhost.java | 3 +- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java index 48c151579..99778f308 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java @@ -7,6 +7,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Wraith; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.NPC; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; @@ -103,13 +104,20 @@ public class DriedRose extends Artifact { return ""; } - - @Override protected ArtifactBuff passiveBuff() { return new roseRecharge(); } + @Override + public Item upgrade() { + if (level >= 9) + image = ItemSpriteSheet.ARTIFACT_ROSE3; + else if (level >= 4) + image = ItemSpriteSheet.ARTIFACT_ROSE2; + return super.upgrade(); + } + private static final String TALKEDTO = "talkedto"; private static final String FIRSTSUMMON = "firstsummon"; private static final String SPAWNED = "spawned"; @@ -136,8 +144,39 @@ public class DriedRose extends Artifact { @Override public boolean act() { + + if (charge < chargeCap && !cursed) { + //TODO: investigate balancing on this. + partialCharge += 1/10f; + if (partialCharge > 1){ + charge++; + partialCharge--; + if (charge == chargeCap){ + partialCharge = 0f; + GLog.p("Your rose is fully charged!"); + } + } + } else if (cursed && Random.Int(100) == 0) { + + ArrayList spawnPoints = new ArrayList(); + + for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { + int p = target.pos + Level.NEIGHBOURS8[i]; + if (Actor.findChar(p) == null && (Level.passable[p] || Level.avoid[p])) { + spawnPoints.add(p); + } + + if (spawnPoints.size() > 0) { + Wraith wraith = new Wraith(); + wraith.pos = Random.element(spawnPoints); + wraith.adjustStats(Dungeon.depth); + + GameScene.add(wraith, 1f); + Sample.INSTANCE.play(Assets.SND_CURSED); + } + } + } return super.act(); - //TODO: decide on charging logic, put here. } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndSadGhost.java b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndSadGhost.java index f8f294148..e3e91f89e 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndSadGhost.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndSadGhost.java @@ -44,8 +44,7 @@ public class WndSadGhost extends Window { "I wonder what twisted magic allowed it to live so long...\n\n"; private static final String TXT_GIVEITEM= "Please take one of these items, they are useless to me now... " + - "Maybe they will help you in your journey..."; - private static final String TXT_TotallyNotATeaser= + "Maybe they will help you in your journey...\n\n" + "Also... There is an item lost in this dungeon that is very dear to me..." + "If you ever... find my... rose......"; private static final String TXT_WEAPON = "Ghost's weapon";