v0.2.3: lots of dried rose implementation + tiny tweaks to hourglass
This commit is contained in:
parent
7212451d57
commit
1ed89667ea
|
@ -606,7 +606,9 @@ public class Hero extends Char {
|
||||||
Item item = heap.pickUp();
|
Item item = heap.pickUp();
|
||||||
if (item.doPickUp( this )) {
|
if (item.doPickUp( this )) {
|
||||||
|
|
||||||
if (item instanceof Dewdrop || item instanceof TimekeepersHourglass.sandBag) {
|
if (item instanceof Dewdrop
|
||||||
|
|| item instanceof TimekeepersHourglass.sandBag
|
||||||
|
|| item instanceof DriedRose.Petal) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,9 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.GhostSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.WraithSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.WraithSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.windows.WndQuest;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
|
import com.watabou.utils.Bundle;
|
||||||
import com.watabou.utils.Random;
|
import com.watabou.utils.Random;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -42,8 +44,9 @@ public class DriedRose extends Artifact {
|
||||||
defaultAction = AC_SUMMON;
|
defaultAction = AC_SUMMON;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean talkedTo = false;
|
protected static boolean talkedTo = false;
|
||||||
protected boolean firstSummon = false;
|
protected static boolean firstSummon = false;
|
||||||
|
protected static boolean spawned = false;
|
||||||
|
|
||||||
public int droppedPetals = 0;
|
public int droppedPetals = 0;
|
||||||
|
|
||||||
|
@ -61,7 +64,8 @@ public class DriedRose extends Artifact {
|
||||||
public void execute( Hero hero, String action ) {
|
public void execute( Hero hero, String action ) {
|
||||||
if (action.equals(AC_SUMMON)) {
|
if (action.equals(AC_SUMMON)) {
|
||||||
|
|
||||||
if (!isEquipped( hero )) GLog.i("You need to equip your rose to do that.");
|
if (spawned) GLog.n("sad ghost: I'm already here");
|
||||||
|
else if (!isEquipped( hero )) GLog.i("You need to equip your rose to do that.");
|
||||||
else if (charge != chargeCap) GLog.i("Your rose isn't fully charged yet.");
|
else if (charge != chargeCap) GLog.i("Your rose isn't fully charged yet.");
|
||||||
else {
|
else {
|
||||||
ArrayList<Integer> spawnPoints = new ArrayList<Integer>();
|
ArrayList<Integer> spawnPoints = new ArrayList<Integer>();
|
||||||
|
@ -76,7 +80,6 @@ public class DriedRose extends Artifact {
|
||||||
GhostHero ghost = new GhostHero();
|
GhostHero ghost = new GhostHero();
|
||||||
ghost.pos = Random.element(spawnPoints);
|
ghost.pos = Random.element(spawnPoints);
|
||||||
|
|
||||||
|
|
||||||
GameScene.add(ghost, 1f);
|
GameScene.add(ghost, 1f);
|
||||||
CellEmitter.get(ghost.pos).start( ShaftParticle.FACTORY, 0.3f, 4 );
|
CellEmitter.get(ghost.pos).start( ShaftParticle.FACTORY, 0.3f, 4 );
|
||||||
CellEmitter.get(ghost.pos).start( Speck.factory(Speck.LIGHT), 0.2f, 3 );
|
CellEmitter.get(ghost.pos).start( Speck.factory(Speck.LIGHT), 0.2f, 3 );
|
||||||
|
@ -85,7 +88,9 @@ public class DriedRose extends Artifact {
|
||||||
hero.busy();
|
hero.busy();
|
||||||
hero.sprite.operate(hero.pos);
|
hero.sprite.operate(hero.pos);
|
||||||
|
|
||||||
}
|
spawned = true;
|
||||||
|
} else
|
||||||
|
GLog.i("There is no free space near you.");
|
||||||
}
|
}
|
||||||
|
|
||||||
} else{
|
} else{
|
||||||
|
@ -93,13 +98,47 @@ public class DriedRose extends Artifact {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String desc() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ArtifactBuff passiveBuff() {
|
protected ArtifactBuff passiveBuff() {
|
||||||
return new roseRecharge();
|
return new roseRecharge();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final String TALKEDTO = "talkedto";
|
||||||
|
private static final String FIRSTSUMMON = "firstsummon";
|
||||||
|
private static final String SPAWNED = "spawned";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void storeInBundle( Bundle bundle ) {
|
||||||
|
super.storeInBundle(bundle);
|
||||||
|
|
||||||
|
bundle.put( TALKEDTO, talkedTo );
|
||||||
|
bundle.put( FIRSTSUMMON, firstSummon );
|
||||||
|
bundle.put( SPAWNED, spawned );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void restoreFromBundle( Bundle bundle ) {
|
||||||
|
super.restoreFromBundle(bundle);
|
||||||
|
|
||||||
|
talkedTo = bundle.getBoolean( TALKEDTO );
|
||||||
|
firstSummon = bundle.getBoolean( FIRSTSUMMON );
|
||||||
|
spawned = bundle.getBoolean( SPAWNED );
|
||||||
|
}
|
||||||
|
|
||||||
public class roseRecharge extends ArtifactBuff {
|
public class roseRecharge extends ArtifactBuff {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean act() {
|
||||||
|
return super.act();
|
||||||
|
//TODO: decide on charging logic, put here.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Petal extends Item {
|
public static class Petal extends Item {
|
||||||
|
@ -114,9 +153,8 @@ public class DriedRose extends Artifact {
|
||||||
public boolean doPickUp( Hero hero ) {
|
public boolean doPickUp( Hero hero ) {
|
||||||
DriedRose rose = hero.belongings.getItem( DriedRose.class );
|
DriedRose rose = hero.belongings.getItem( DriedRose.class );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (rose != null && rose.level < rose.levelCap){
|
if (rose != null && rose.level < rose.levelCap){
|
||||||
|
|
||||||
rose.upgrade();
|
rose.upgrade();
|
||||||
if (rose.level == rose.levelCap) {
|
if (rose.level == rose.levelCap) {
|
||||||
GLog.p("The rose is completed!");
|
GLog.p("The rose is completed!");
|
||||||
|
@ -124,11 +162,16 @@ public class DriedRose extends Artifact {
|
||||||
GLog.n("sad ghost: Thank you...");
|
GLog.n("sad ghost: Thank you...");
|
||||||
} else
|
} else
|
||||||
GLog.i("You add the petal to the rose.");
|
GLog.i("You add the petal to the rose.");
|
||||||
|
|
||||||
|
Sample.INSTANCE.play( Assets.SND_DEWDROP );
|
||||||
hero.spendAndNext(TIME_TO_PICK_UP);
|
hero.spendAndNext(TIME_TO_PICK_UP);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
GLog.w("You have no rose to add this petal to.");
|
GLog.w("You have no rose to add this petal to.");
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,10 +201,13 @@ public class DriedRose extends Artifact {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String TXT_WELCOME = "My spirit is bound to this rose, it was very precious to me, a gift " +
|
GhostHero() {
|
||||||
"from my love whom I left on the surface.\n\nI cannot return to him, but thanks to you I have a second " +
|
super();
|
||||||
"chance to complete my journey. When I am able I will respond to your call and fight with you.\n\n" +
|
if (!DriedRose.firstSummon){
|
||||||
"hopefully you may succeed where I failed...";
|
yell ( VOICE_HELLO );
|
||||||
|
DriedRose.firstSummon = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String defenseVerb() {
|
public String defenseVerb() {
|
||||||
|
@ -200,10 +246,10 @@ public class DriedRose extends Artifact {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void interact() {
|
public void interact() {
|
||||||
//if (!talkedTo){
|
if (!DriedRose.talkedTo){
|
||||||
// talkedTo = true;
|
DriedRose.talkedTo = true;
|
||||||
// GameScene.show(new WndQuest(this, TXT_WELCOME));
|
GameScene.show(new WndQuest(this, VOICE_INTRODUCE ));
|
||||||
//} else {
|
} else {
|
||||||
int curPos = pos;
|
int curPos = pos;
|
||||||
|
|
||||||
moveSprite( pos, Dungeon.hero.pos );
|
moveSprite( pos, Dungeon.hero.pos );
|
||||||
|
@ -214,15 +260,24 @@ public class DriedRose extends Artifact {
|
||||||
|
|
||||||
Dungeon.hero.spend( 1 / Dungeon.hero.speed() );
|
Dungeon.hero.spend( 1 / Dungeon.hero.speed() );
|
||||||
Dungeon.hero.busy();
|
Dungeon.hero.busy();
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void destroy() {
|
||||||
|
DriedRose.spawned = false;
|
||||||
|
super.destroy();
|
||||||
|
}
|
||||||
//************************************************************************************
|
//************************************************************************************
|
||||||
//This is a bunch strings & string arrays, used in all of the sad ghost's voice lines.
|
//This is a bunch strings & string arrays, used in all of the sad ghost's voice lines.
|
||||||
//************************************************************************************
|
//************************************************************************************
|
||||||
|
|
||||||
//public static final String GHOST_HELLO = "Hello again " + Dungeon.hero.className() + ".";
|
public static final String VOICE_HELLO = "Hello again.";
|
||||||
|
|
||||||
|
private static final String VOICE_INTRODUCE = "My spirit is bound to this rose, it was very precious to me, a "+
|
||||||
|
"gift from my love whom I left on the surface.\n\nI cannot return to him, but thanks to you I have a " +
|
||||||
|
"second chance to complete my journey. When I am able I will respond to your call and fight with you.\n\n" +
|
||||||
|
"hopefully you may succeed where I failed...";
|
||||||
|
|
||||||
//enum, for clarity.
|
//enum, for clarity.
|
||||||
public static enum DEPTHS{
|
public static enum DEPTHS{
|
||||||
|
@ -235,7 +290,7 @@ public class DriedRose extends Artifact {
|
||||||
}
|
}
|
||||||
|
|
||||||
//1st index - depth type, 2nd index - specific line.
|
//1st index - depth type, 2nd index - specific line.
|
||||||
public static final String[][] GHOST_VOICE_AMBIENT = {
|
public static final String[][] VOICE_AMBIENT = {
|
||||||
{
|
{
|
||||||
"These sewers were once safe, some even lived here in the winter...",
|
"These sewers were once safe, some even lived here in the winter...",
|
||||||
"I wonder what happened to the guard patrols, did they give up?...",
|
"I wonder what happened to the guard patrols, did they give up?...",
|
||||||
|
@ -262,7 +317,7 @@ public class DriedRose extends Artifact {
|
||||||
};
|
};
|
||||||
|
|
||||||
//1st index - depth type, 2nd index - boss or not, 3rd index - specific line.
|
//1st index - depth type, 2nd index - boss or not, 3rd index - specific line.
|
||||||
public static final String[][][] GHOST_VOICE_ENEMIES = {
|
public static final String[][][] VOICE_ENEMIES = {
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
"Let's make the sewers safe again...",
|
"Let's make the sewers safe again...",
|
||||||
|
@ -323,7 +378,7 @@ public class DriedRose extends Artifact {
|
||||||
};
|
};
|
||||||
|
|
||||||
//1st index - Yog or not, 2nd index - specific line.
|
//1st index - Yog or not, 2nd index - specific line.
|
||||||
public static final String[][] GHOST_VOICE_BOSSBEATEN = {
|
public static final String[][] VOICE_BOSSBEATEN = {
|
||||||
{
|
{
|
||||||
"Yes!",
|
"Yes!",
|
||||||
"Victory!"
|
"Victory!"
|
||||||
|
@ -334,7 +389,7 @@ public class DriedRose extends Artifact {
|
||||||
};
|
};
|
||||||
|
|
||||||
//1st index - boss or not, 2nd index - specific line.
|
//1st index - boss or not, 2nd index - specific line.
|
||||||
public static final String[][] GHOST_VOICE_DEFEATED = {
|
public static final String[][] VOICE_DEFEATED = {
|
||||||
{
|
{
|
||||||
"Good luck...",
|
"Good luck...",
|
||||||
"I will return...",
|
"I will return...",
|
||||||
|
@ -346,15 +401,16 @@ public class DriedRose extends Artifact {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public static final String[] GHOST_VOICE_HEROKILLED = {
|
public static final String[] VOICE_HEROKILLED = {
|
||||||
", nooo...",
|
"nooo...",
|
||||||
"no...",
|
"no...",
|
||||||
"I couldn't help them..."
|
"I couldn't help them..."
|
||||||
};
|
};
|
||||||
|
|
||||||
public static final String[] GHOST_VOICE_BLESSEDANKH = {
|
public static final String[] VOICE_BLESSEDANKH = {
|
||||||
"Incredible!...",
|
"Incredible!...",
|
||||||
"Wish I had one of those...",
|
"Wish I had one of those...",
|
||||||
"How did you survive that?..."
|
"How did you survive that?..."
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -325,7 +325,7 @@ public class TimekeepersHourglass extends Artifact {
|
||||||
TimekeepersHourglass hourglass = hero.belongings.getItem( TimekeepersHourglass.class );
|
TimekeepersHourglass hourglass = hero.belongings.getItem( TimekeepersHourglass.class );
|
||||||
if (hourglass != null) {
|
if (hourglass != null) {
|
||||||
hourglass.upgrade();
|
hourglass.upgrade();
|
||||||
Sample.INSTANCE.play( Assets.SND_ITEM );
|
Sample.INSTANCE.play( Assets.SND_DEWDROP );
|
||||||
if (hourglass.level == hourglass.levelCap)
|
if (hourglass.level == hourglass.levelCap)
|
||||||
GLog.p("Your hourglass is filled with magical sand!");
|
GLog.p("Your hourglass is filled with magical sand!");
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user