v0.2.3: more Dried Rose implementation

This commit is contained in:
Evan Debenham 2014-12-12 17:28:20 -05:00
parent 80686f6ad7
commit bded42981f
2 changed files with 43 additions and 5 deletions

View File

@ -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<Integer> spawnPoints = new ArrayList<Integer>();
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.
}
}

View File

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