v0.3.4: externalized artifacts part 1

This commit is contained in:
Evan Debenham
2016-01-09 05:24:48 -05:00
committed by Evan Debenham
parent 250029c19d
commit 33bef1c6cb
17 changed files with 231 additions and 306 deletions
@@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.KindofMisc;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions;
@@ -44,10 +45,6 @@ public class Artifact extends KindofMisc {
private static final String TXT_TO_STRING_LVL = "%s%+d";
private static final String TXT_TO_STRING_LVL_CHARGE = "%s%+d (%d/%d)";
private static final String TXT_UNEQUIP_TITLE = "Unequip one item";
private static final String TXT_UNEQUIP_MESSAGE =
"You can only wear two misc items at a time.";
protected Buff passiveBuff;
protected Buff activeBuff;
@@ -87,7 +84,7 @@ public class Artifact extends KindofMisc {
if ((hero.belongings.misc1 != null && hero.belongings.misc1.getClass() == this.getClass())
|| (hero.belongings.misc2 != null && hero.belongings.misc2.getClass() == this.getClass())){
GLog.w("you cannot wear two of the same artifact");
GLog.w( Messages.get(Artifact.class, "cannot_wear_two") );
return false;
} else if (hero.belongings.misc1 != null && hero.belongings.misc2 != null) {
@@ -97,7 +94,8 @@ public class Artifact extends KindofMisc {
final Artifact art = this;
ShatteredPixelDungeon.scene().add(
new WndOptions(TXT_UNEQUIP_TITLE, TXT_UNEQUIP_MESSAGE,
new WndOptions(Messages.get(Artifact.class, "unequip_title"),
Messages.get(Artifact.class, "unequip_message"),
Utils.capitalize(m1.toString()),
Utils.capitalize(m2.toString())) {
@@ -134,7 +132,7 @@ public class Artifact extends KindofMisc {
identify();
if (cursed) {
equipCursed( hero );
GLog.n( "the " + this.name + " painfully binds itself to you" );
GLog.n( Messages.get(Artifact.class, "cursed_worn") );
}
hero.spendAndNext( TIME_TO_EQUIP );
@@ -200,7 +198,7 @@ public class Artifact extends KindofMisc {
public String info() {
if (cursed && cursedKnown && !isEquipped( Dungeon.hero )) {
return desc() + "\n\nYou can feel a malevolent magic lurking within the " + name() + ".";
return desc() + "\n\n" + Messages.get(Artifact.class, "curse_known");
} else {
@@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.artifacts;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
@@ -39,7 +40,7 @@ public class CapeOfThorns extends Artifact {
chargeCap = 100;
cooldown = 0;
defaultAction = "NONE";
defaultAction = "NONE"; //so it can be quickslotted
}
@Override
@@ -49,17 +50,13 @@ public class CapeOfThorns extends Artifact {
@Override
public String desc() {
String desc = "These collapsed sheets of metal from the DM-300 have formed together into a rigid wearable " +
"cape. The metal is old and coated in thick flakes of rust. It seems to store a deep energy, " +
"perhaps it has some of the DM-300's power?";
String desc = Messages.get(this, "desc");
if (isEquipped( Dungeon.hero )) {
desc += "\n\n";
if (cooldown == 0)
desc += "The cape feels reassuringly heavy on your shoulders. You're not sure if it will directly " +
"help you in a fight, but it seems to be gaining energy from the damage you take.";
desc += Messages.get(this, "desc_inactive");
else
desc += "The cape seems to be releasing some stored energy, " +
"it is radiating a protective power at all angles. ";
desc += Messages.get(this, "desc_active");
}
return desc;
@@ -73,7 +70,7 @@ public class CapeOfThorns extends Artifact {
cooldown--;
if (cooldown == 0) {
BuffIndicator.refreshHero();
GLog.w("Your Cape becomes inert again.");
GLog.w( Messages.get(this, "inert") );
}
updateQuickslot();
}
@@ -87,7 +84,7 @@ public class CapeOfThorns extends Artifact {
if (charge >= chargeCap){
charge = 0;
cooldown = 10+level();
GLog.p("Your Cape begins radiating energy, you feel protected!");
GLog.p( Messages.get(this, "radiating") );
BuffIndicator.refreshHero();
}
}
@@ -105,7 +102,7 @@ public class CapeOfThorns extends Artifact {
if (exp >= (level()+1)*5 && level() < levelCap){
exp -= (level()+1)*5;
upgrade();
GLog.p("Your Cape grows stronger!");
GLog.p( Messages.get(this, "levelup") );
}
}
@@ -115,17 +112,12 @@ public class CapeOfThorns extends Artifact {
@Override
public String toString() {
return "Thorns";
return Messages.get(this, "name");
}
@Override
public String desc() {
return "Your cape is radiating energy, surrounding you in a field of deflective force!\n" +
"\n" +
"All damage you receive is reduced while the thorns effect is active. Additionally, " +
"if the attacker is next to you, the reduced amount is deflected back at the attacker.\n" +
"\n" +
"Your cape will continue radiating energy for " + dispTurns(cooldown) + ".";
return Messages.get(this, "desc", dispTurns(cooldown));
}
@Override
@@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.ResultDescriptions;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.plants.Earthroot;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
@@ -39,15 +40,6 @@ import java.util.ArrayList;
public class ChaliceOfBlood extends Artifact {
private static final String TXT_CHALICE = "Chalice of Blood";
private static final String TXT_YES = "Yes, I know what I'm doing";
private static final String TXT_NO = "No, I changed my mind";
private static final String TXT_PRICK =
"Each time you use the chalice it will drain more life energy, "+
"if you are not careful this draining effect can easily kill you.\n\n"+
"Are you sure you want to offer it more life energy?";
{
image = ItemSpriteSheet.ARTIFACT_CHALICE1;
@@ -74,7 +66,10 @@ public class ChaliceOfBlood extends Artifact {
if (damage > hero.HP*0.75) {
GameScene.show(
new WndOptions(TXT_CHALICE, TXT_PRICK, TXT_YES, TXT_NO) {
new WndOptions(Messages.get(this, "name"),
Messages.get(this, "prick_warn"),
Messages.get(this, "yes"),
Messages.get(this, "no")) {
@Override
protected void onSelect(int index) {
if (index == 0)
@@ -102,28 +97,19 @@ public class ChaliceOfBlood extends Artifact {
hero.sprite.operate( hero.pos );
hero.busy();
hero.spend(3f);
GLog.w( Messages.get(this, "onprick") );
if (damage <= 0){
GLog.i("You prick yourself, and your blood drips into the chalice.");
} else if (damage < 25){
GLog.w("You prick yourself and the chalice feeds on you.");
Sample.INSTANCE.play(Assets.SND_CURSED);
hero.sprite.emitter().burst( ShadowParticle.CURSE, 6 );
} else if (damage < 100){
GLog.w("Your life essence drains into the chalice.");
Sample.INSTANCE.play(Assets.SND_CURSED);
hero.sprite.emitter().burst( ShadowParticle.CURSE, 12 );
damage = 1;
} else {
GLog.w("The chalice devours your life energy.");
Sample.INSTANCE.play(Assets.SND_CURSED);
hero.sprite.emitter().burst( ShadowParticle.CURSE, 18 );
hero.sprite.emitter().burst( ShadowParticle.CURSE, 4+(damage/10) );
}
if (damage > 0)
hero.damage(damage, this);
hero.damage(damage, this);
if (!hero.isAlive()) {
Dungeon.fail(Utils.format( ResultDescriptions.ITEM, name ));
GLog.n("The Chalice sucks your life essence dry...");
GLog.n( Messages.get(this, "ondeath") );
} else {
upgrade();
}
@@ -145,32 +131,18 @@ public class ChaliceOfBlood extends Artifact {
@Override
public String desc() {
String desc = "This shining silver chalice is oddly adorned with sharp gems at the rim. ";
if (level() < levelCap)
desc += "The chalice is pulling your attention strangely, you feel like it wants something from you.";
else
desc += "The chalice is full and radiating energy.";
String desc = super.desc();
if (isEquipped (Dungeon.hero)){
desc += "\n\n";
if (cursed)
desc += "The cursed chalice has bound itself to your hand, and is slowly tugging at your life energy.";
desc += Messages.get(this, "desc_cursed");
else if (level() == 0)
desc += "As you hold the chalice, you feel oddly compelled to prick yourself on the sharp gems.";
else if (level() < 3)
desc += "Some of your blood is pooled into the chalice, you can subtly feel the chalice feeding life " +
"energy into you. You still want to cut yourself on the chalice, even though you know it will hurt.";
else if (level() < 7)
desc += "The chalice is about half full of your blood and you can feel it feeding life energy " +
"into you. you still want to hurt yourself, the chalice needs your energy, it's your friend.";
desc += Messages.get(this, "desc_1");
else if (level() < levelCap)
desc += "The chalice is getting pretty full, and the life force it's feeding you is stronger than " +
"ever. You should give it more energy, you need too, your friend needs your energy, it needs " +
"your help. Your friend knows you have limits though, it doesn't want you to die, just bleed.";
desc += Messages.get(this, "desc_2");
else
desc += "The chalice is filled to the brim with your life essence. You can feel the chalice pouring " +
"life energy back into you. It's your best friend. It's happy with you. So happy. " +
"You've done well. So well. You're being rewarded. You don't need to touch the sharp gems anymore.";
desc += Messages.get(this, "desc_3");
}
return desc;
@@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
@@ -74,9 +75,9 @@ public class CloakOfShadows extends Artifact {
if (action.equals( AC_STEALTH )) {
if (!stealthed){
if (!isEquipped(hero)) GLog.i("You need to equip your cloak to do that.");
else if (cooldown > 0) GLog.i("Your cloak needs " + cooldown + " more rounds to re-energize.");
else if (charge <= 1) GLog.i("Your cloak hasn't recharged enough to be usable yet.");
if (!isEquipped(hero)) GLog.i( Messages.get(Artifact.class, "need_to_equip") );
else if (cooldown > 0) GLog.i( Messages.get(this, "cooldown", cooldown) );
else if (charge <= 1) GLog.i( Messages.get(this, "no_charge") );
else {
stealthed = true;
hero.spend( 1f );
@@ -90,14 +91,12 @@ public class CloakOfShadows extends Artifact {
hero.sprite.alpha(0.4f);
}
hero.sprite.operate(hero.pos);
GLog.i("Your cloak blends you into the shadows.");
}
} else {
stealthed = false;
activeBuff.detach();
activeBuff = null;
hero.sprite.operate( hero.pos );
GLog.i("You return from underneath your cloak.");
}
} else
@@ -138,28 +137,6 @@ public class CloakOfShadows extends Artifact {
return super.upgrade();
}
@Override
public String desc() {
String desc = "This light silken cloak shimmers in and out of your vision as it sways in the air. When worn, " +
"it can be used to hide your presence for a short time.\n\n";
if (level() < 5)
desc += "The cloak's magic has faded and it is not very powerful, perhaps it will regain strength through use.";
else if (level() < 10)
desc += "The cloak's power has begun to return.";
else if (level() < 15)
desc += "The cloak has almost returned to full strength.";
else
desc += "The cloak is at full potential and will work for extended durations.";
if ( isEquipped (Dungeon.hero) )
desc += "\n\nThe cloak rests around your shoulders.";
return desc;
}
private static final String STEALTHED = "stealthed";
private static final String COOLDOWN = "cooldown";
@@ -231,7 +208,7 @@ public class CloakOfShadows extends Artifact {
if (turnsToCost == 0) charge--;
if (charge <= 0) {
detach();
GLog.w("Your cloak has run out of energy.");
GLog.w( Messages.get(this, "no_charge") );
((Hero)target).interrupt();
}
@@ -240,7 +217,7 @@ public class CloakOfShadows extends Artifact {
if (exp >= (level()+1)*50 && level() < levelCap) {
upgrade();
exp -= level()*50;
GLog.p("Your cloak grows stronger!");
GLog.p( Messages.get(this, "levelup") );
}
if (turnsToCost == 0) turnsToCost = 2;
@@ -260,7 +237,7 @@ public class CloakOfShadows extends Artifact {
if (exp >= (level()+1)*50 && level() < levelCap) {
upgrade();
exp -= level()*50;
GLog.p("Your cloak grows stronger!");
GLog.p( Messages.get(this, "levelup") );
}
updateQuickslot();
@@ -275,17 +252,12 @@ public class CloakOfShadows extends Artifact {
@Override
public String toString() {
return "Cloaked";
return Messages.get(this, "name");
}
@Override
public String desc() {
return "Your cloak of shadows is granting you invisibility while you are shrouded by it.\n" +
"\n" +
"While you are invisible enemies are unable to attack or follow you. " +
"Most physical attacks and magical effects (such as scrolls and wands) will immediately cancel invisibility.\n" +
"\n" +
"You will remain cloaked until it is cancelled or your cloak runs out of charge.";
return Messages.get(this, "desc");
}
@Override
@@ -37,6 +37,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShaftParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfPsionicBlast;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.GhostSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
@@ -88,7 +89,7 @@ public class DriedRose extends Artifact {
if (action.equals(AC_SUMMON)) {
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 (!isEquipped( hero )) GLog.i( Messages.get(Artifact.class, "need_to_equip") );
else if (charge != chargeCap) GLog.i("Your rose isn't fully charged yet.");
else if (cursed) GLog.i("You cannot use a cursed rose.");
else {
@@ -140,19 +141,12 @@ public class DriedRose extends Artifact {
if (isEquipped( Dungeon.hero )){
if (!cursed){
desc += "\n\nThe rose rests in your hand, it feels strangely warm.";
if (level() < 5)
desc+= "\n\nThe rose has lost most of its petals. It feels extremely frail, like it " +
"could snap any moment.";
else if (level() < 10)
desc+= "\n\nYou have reattached many petals and the rose has started to somehow come back to life."+
" It almost looks like it's ready to bloom.";
else
desc+= "\n\nThe rose has blossomed again through some kind of magic, its connection to your spirit"+
" friend is stronger than ever.";
if (level() < levelCap)
desc+= "\n\nIt seems to be missing some petals. Perhaps reattaching them out strengthen the rose.";
} else
desc += "\n\nThe cursed rose is bound to you hand, it feels eerily cold.";
desc += "\n\nThe cursed rose is bound to your hand, it feels eerily cold.";
}
return desc;
@@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Chains;
import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
@@ -71,9 +72,9 @@ public class EtherealChains extends Artifact {
curUser = hero;
if (!isEquipped( hero )) GLog.i("You need to equip the chains to do that.");
else if (charge < 1) GLog.i("Your chains do not have any available charge.");
else if (cursed) GLog.w("You can't use cursed chains.");
if (!isEquipped( hero )) GLog.i( Messages.get(Artifact.class, "need_to_equip") );
else if (charge < 1) GLog.i( Messages.get(this, "no_charge") );
else if (cursed) GLog.w( Messages.get(this, "cursed") );
else {
GameScene.selectCell(caster);
}
@@ -104,16 +105,16 @@ public class EtherealChains extends Artifact {
}
}
if (newPos == -1){
GLog.w("That won't do anything");
GLog.w( Messages.get(this, "does_nothing") );
} else {
final int newMobPos = newPos;
final Char affected = Actor.findChar( chain.collisionPos );
int chargeUse = Level.distance(affected.pos, newMobPos);
if (chargeUse > charge) {
GLog.w("Your chains do not have enough charge.");
GLog.w( Messages.get(this, "no_charge") );
return;
} else if (affected.properties().contains(Char.Property.IMMOVABLE)) {
GLog.w("Your chains cannot pull that target");
GLog.w( Messages.get(this, "cant_pull") );
return;
} else {
charge -= chargeUse;
@@ -144,12 +145,12 @@ public class EtherealChains extends Artifact {
if (!Level.solid[i] && Actor.findChar(i) == null) newPos = i;
}
if (newPos == -1) {
GLog.w("That won't do anything");
GLog.w( Messages.get(this, "does_nothing") );
} else {
final int newHeroPos = newPos;
int chargeUse = Level.distance(curUser.pos, newHeroPos);
if (chargeUse > charge){
GLog.w("Your chains do not have enough charge.");
GLog.w( Messages.get(this, "no_charge") );
return;
} else {
charge -= chargeUse;
@@ -171,7 +172,7 @@ public class EtherealChains extends Artifact {
}
} else {
GLog.i("There is nothing to grab there");
GLog.i( Messages.get(this, "nothing_to_grab") );
}
}
@@ -180,7 +181,7 @@ public class EtherealChains extends Artifact {
@Override
public String prompt() {
return "Choose a location to target";
return Messages.get(this, "prompt");
}
};
@@ -191,18 +192,14 @@ public class EtherealChains extends Artifact {
@Override
public String desc() {
String desc = "These large clanky chains glow with spiritual energy. They move with a certain heft, " +
"but are surprisingly almost weightless. These chains can be used to grab surfaces, pulling you " +
"towards terrain or pulling enemies toward you. The ethereal nature of the chains even allows them to " +
"extend and pull targets through walls!";
String desc = super.desc();
if (isEquipped( Dungeon.hero )){
if (!cursed) {
desc += "\n\nThe chains rest around your side, slowly siphoning the spiritual energy of those you defeat. " +
"Each charge is a link in the chain, which will extend out exactly one tile.";
}else
desc += "\n\nThe cursed chains are locked to your side, constantly swinging around, trying to trip or bind you";
desc += "\n\n";
if (cursed)
desc += Messages.get(this, "desc_cursed");
else
desc += Messages.get(this, "desc_equipped");
}
return desc;
}
@@ -244,7 +241,7 @@ public class EtherealChains extends Artifact {
if (exp > 100+level()*50 && level() < levelCap){
exp -= 100+level()*50;
GLog.p("Your chains grow stronger!");
GLog.p( Messages.get(this, "levelup") );
upgrade();
}
@@ -35,6 +35,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit;
import com.shatteredpixel.shatteredpixeldungeon.items.food.Food;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
@@ -65,7 +66,6 @@ public class HornOfPlenty extends Artifact {
public static final String AC_EAT = "EAT";
public static final String AC_STORE = "STORE";
protected String inventoryTitle = "Select a piece of food";
protected WndBag.Mode mode = WndBag.Mode.FOOD;
@Override
@@ -84,8 +84,8 @@ public class HornOfPlenty extends Artifact {
if (action.equals(AC_EAT)){
if (!isEquipped(hero)) GLog.i("You need to equip your horn to do that.");
else if (charge == 0) GLog.i("Your horn has no food in it to eat!");
if (!isEquipped(hero)) GLog.i( Messages.get(Artifact.class, "need_to_equip") );
else if (charge == 0) GLog.i( Messages.get(this, "no_food") );
else {
((Hunger) hero.buff(Hunger.class)).satisfy(energy * charge);
@@ -116,7 +116,7 @@ public class HornOfPlenty extends Artifact {
hero.busy();
SpellSprite.show(hero, SpellSprite.FOOD);
Sample.INSTANCE.play(Assets.SND_EAT);
GLog.i("You eat from the horn.");
GLog.i( Messages.get(this, "eat") );
hero.spend(TIME_TO_EAT);
@@ -129,7 +129,7 @@ public class HornOfPlenty extends Artifact {
} else if (action.equals(AC_STORE)){
GameScene.selectItem(itemSelector, mode, inventoryTitle);
GameScene.selectItem(itemSelector, mode, Messages.get(this, "prompt"));
}
}
@@ -140,28 +140,14 @@ public class HornOfPlenty extends Artifact {
@Override
public String desc() {
String desc = "This horn can't be blown into, but instead seems to fill up with food over time.\n\n";
if (charge == 0)
desc += "The horn is completely empty.";
else if (charge < 3)
desc += "The horn is almost empty, a few small fruits and berries sit in the back.";
else if (charge < 7)
desc += "The horn is partially filled, you can see several fruits & vegetables inside.";
else if (charge < 10)
desc += "The horn is getting quite full, several pieces of fresh produce are poking up towards the front.";
else
desc += "The horn is overflowing! A delicious array of fruit and veg is filling the horn up to its brim.";
String desc = super.desc();
if ( isEquipped( Dungeon.hero ) ){
if (!cursed) {
desc += "\n\nThe horn rests at your side and is surprisingly lightweight, even with food in it.";
if (level() < 15)
desc += " Perhaps there is a way to increase the horn's power by giving it food energy.";
if (level() < levelCap)
desc += "\n\n" +Messages.get(this, "desc_hint");
} else {
desc += "\n\nThe cursed horn has bound itself to your side, " +
"it seems to be eager to take food rather than produce it.";
desc += "\n\n" +Messages.get(this, "desc_cursed");
}
}
@@ -194,7 +180,7 @@ public class HornOfPlenty extends Artifact {
image = ItemSpriteSheet.ARTIFACT_HORN1;
if (charge == chargeCap){
GLog.p("Your horn is full of food!");
GLog.p( Messages.get(this, "full") );
partialCharge = 0;
}
@@ -215,7 +201,7 @@ public class HornOfPlenty extends Artifact {
public void onSelect( Item item ) {
if (item != null && item instanceof Food) {
if (item instanceof Blandfruit && ((Blandfruit) item).potionAttrib == null){
GLog.w("your horn rejects the unprepared blandfruit.");
GLog.w( Messages.get(HornOfPlenty.class, "reject") );
} else {
Hero hero = Dungeon.hero;
hero.sprite.operate( hero.pos );
@@ -225,9 +211,9 @@ public class HornOfPlenty extends Artifact {
curItem.upgrade(((Food)item).hornValue);
if (curItem.level() >= 30){
curItem.level(30);
GLog.p("your horn has consumed all the food it can!");
GLog.p( Messages.get(HornOfPlenty.class, "maxlevel") );
} else
GLog.p("the horn consumes your food offering and grows in strength!");
GLog.p( Messages.get(HornOfPlenty.class, "levelup") );
item.detach(hero.belongings.backpack);
}
@@ -56,24 +56,6 @@ import java.util.ArrayList;
public class LloydsBeacon extends Artifact {
private static final String TXT_PREVENTING =
"Strong magic aura of this place prevents you from using the lloyd's beacon!";
private static final String TXT_CREATURES =
"Psychic aura of neighbouring creatures doesn't allow you to use the lloyd's beacon at this moment.";
private static final String TXT_RETURN =
"The lloyd's beacon is successfully set at your current location, now you can return here anytime.";
private static final String TXT_INFO =
"Lloyd's beacon is an intricate magic device, which grants the user control of teleportation magics.\n" +
"\n" +
"The beacon can be used to return to a set location, but can also expel bursts of random teleportation " +
"magic once it has charged from being equipped. This magic can be directed at a target or at the user themselves.";
private static final String TXT_SET =
"\n\nThis beacon was set somewhere on the level %d of Pixel Dungeon.";
public static final float TIME_TO_USE = 1;
public static final String AC_ZAP = "ZAP";
@@ -132,13 +114,13 @@ public class LloydsBeacon extends Artifact {
if (Dungeon.bossLevel()) {
hero.spend( LloydsBeacon.TIME_TO_USE );
GLog.w( TXT_PREVENTING );
GLog.w( Messages.get(this, "preventing") );
return;
}
for (int i=0; i < Level.NEIGHBOURS8.length; i++) {
if (Actor.findChar( hero.pos + Level.NEIGHBOURS8[i] ) != null) {
GLog.w( TXT_CREATURES );
GLog.w( Messages.get(this, "creatures") );
return;
}
}
@@ -149,8 +131,8 @@ public class LloydsBeacon extends Artifact {
curUser = hero;
int chargesToUse = Dungeon.depth > 20 ? 2 : 1;
if (!isEquipped( hero )) GLog.i("You need to equip the beacon to do that.");
else if (charge < chargesToUse) GLog.i("Your beacon does not have enough energy right now.");
if (!isEquipped( hero )) GLog.i( Messages.get(Artifact.class, "need_to_equip") );
else if (charge < chargesToUse) GLog.i( Messages.get(this, "no_charge") );
else {
GameScene.selectCell(zapper);
}
@@ -166,7 +148,7 @@ public class LloydsBeacon extends Artifact {
hero.sprite.operate( hero.pos );
Sample.INSTANCE.play( Assets.SND_BEACON );
GLog.i( TXT_RETURN );
GLog.i( Messages.get(this, "return") );
} else if (action == AC_RETURN) {
@@ -243,7 +225,7 @@ public class LloydsBeacon extends Artifact {
} else if (ch.properties().contains(Char.Property.IMMOVABLE)) {
GLog.w("The teleportation magic fails.");
GLog.w( Messages.get(this, "tele_fail") );
} else {
@@ -266,7 +248,7 @@ public class LloydsBeacon extends Artifact {
@Override
public String prompt() {
return "Choose a location to zap.";
return Messages.get(this, "prompt");
}
};
@@ -277,14 +259,19 @@ public class LloydsBeacon extends Artifact {
@Override
public Item upgrade() {
if (level() == levelCap) return this;
chargeCap ++;
GLog.p( Messages.get(this, "levelup") );
return super.upgrade();
}
@Override
public String desc() {
return TXT_INFO + (returnDepth == -1 ? "" : Utils.format( TXT_SET, returnDepth ) );
String desc = super.desc();
if (returnDepth != -1){
desc += "\n\n" + Messages.get(this, "desc_set", returnDepth);
}
return desc;
}
public void reset() {
@@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.items.artifacts;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.watabou.utils.Random;
@@ -43,13 +44,10 @@ public class MasterThievesArmband extends Artifact {
@Override
public String desc() {
String desc = "This purple velvet armband bears the mark of a master thief. This doesn't belong to you, but " +
"you doubt it belonged to the person you took it from either.";
String desc = super.desc();
if ( isEquipped (Dungeon.hero) )
desc += "\n\nWith the armband around your wrist you feel more dexterous and cunning. Every piece of gold " +
"you find makes you desire others property more. " +
"You wonder if Pixel Mart accepts the five finger discount...";
desc += "\n\n" + Messages.get(this, "desc_worn");
return desc;
}
@@ -79,7 +79,7 @@ public class SandalsOfNature extends Artifact {
GameScene.selectItem(itemSelector, mode, inventoryTitle);
} else if (action.equals(AC_ROOT) && level() > 0){
if (!isEquipped( hero )) GLog.i("You need to equip them to do that.");
if (!isEquipped( hero )) GLog.i( Messages.get(Artifact.class, "need_to_equip") );
else if (charge == 0) GLog.i("They have no energy right now.");
else {
Buff.prolong(hero, Roots.class, 5);
@@ -101,39 +101,23 @@ public class SandalsOfNature extends Artifact {
public String desc() {
String desc = "";
if (level() == 0)
desc += "What initially seem like sandals made of twine are actually two plants! The footwear moves ever " +
"so slightly when being held. They seem very weak and pale, perhaps they need to be given nutrients?";
desc += "What initially seem like sandals made of twine are actually two plants! They seem very weak and pale, perhaps they need to be given nutrients?";
else if (level() == 1)
desc += "The footwear has grown and now more closely resemble two tailored shoes. They seem to match the " +
"contours of your feet exactly. Some colour has returned to them, perhaps they can still grow further?";
desc += "The footwear has grown and now more closely resemble two tailored shoes. Some colour has returned to them, perhaps they can still grow further?";
else if (level() == 2)
desc += "The plants have grown again and now resembles a pair of solid tall boots. They appear to be made" +
" of solid bark more than vine now, yet are still very flexible. The plants seem to have " +
desc += "The plants have grown again and now resembles a pair of solid boots made from bark.The plants seem to have " +
"regained their strength, but perhaps they can still grow further";
else
desc += "Now almost tall enough to make full pants, the bark-mesh artifact seems to have reached its " +
"maximum size. Perhaps the two plants don't want to merge together? The greaves are a deep brown " +
desc += "The plants seem to have reached their maximum size, they resemble a pair of armored greaves. The greaves are a deep brown " +
"and resemble a very sturdy tree.";
if ( isEquipped ( Dungeon.hero ) ){
desc += "\n\n";
if (level() == 0) {
if (!cursed)
desc += "The sandals wrap snugly around your feet, they seem happy to be worn.";
else
desc += "The cursed sandals wrap tightly around your feet.";
}
else if (level() == 1)
desc += "The shoes fit on loosely but quickly tighten to make a perfect fit.";
else if (level() == 2)
desc += "The boots fit snugly and add a nice heft to your step.";
else
desc += "The greaves are thick and weighty, but very easy to move in, as if they are moving with you.";
if (!cursed)
desc += " You feel more attuned with nature while wearing them.";
desc += " You feel more attuned with nature while wearing this artifact.";
else
desc += " They are blocking any attunement with nature.";
desc += " The cursed sandals are blocking any attunement with nature.";
if (level() > 0)
desc += "\n\nThe footwear has gained the ability to form up into a sort of immobile natural armour, " +
@@ -169,7 +153,6 @@ public class SandalsOfNature extends Artifact {
private static final String SEEDS = "seeds";
private static final String NAME = "name";
@Override
public void storeInBundle( Bundle bundle ) {
@@ -200,7 +183,7 @@ public class SandalsOfNature extends Artifact {
public void onSelect( Item item ) {
if (item != null && item instanceof Plant.Seed) {
if (seeds.contains(item.name())){
GLog.w("Your " + name + " have already gained nutrients from that seed recently.");
GLog.w("Your footwear have already gained nutrients from that seed recently.");
} else {
seeds.add(item.name());
@@ -217,7 +200,7 @@ public class SandalsOfNature extends Artifact {
}
} else {
GLog.i("Your " + name + " absorb the seed, they seem healthier.");
GLog.i("The footwear absorbs the seed, they seem healthier.");
}
item.detach(hero.belongings.backpack);
}
@@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
@@ -66,8 +67,8 @@ public class TalismanOfForesight extends Artifact {
super.execute(hero, action);
if (action.equals(AC_SCRY)){
if (!isEquipped(hero)) GLog.i("You need to equip your talisman to do that.");
else if (charge != chargeCap) GLog.i("Your talisman isn't full charged yet.");
if (!isEquipped(hero)) GLog.i( Messages.get(Artifact.class, "need_to_equip") );
else if (charge != chargeCap) GLog.i( Messages.get(this, "no_charge") );
else {
hero.sprite.operate(hero.pos);
hero.busy();
@@ -86,7 +87,7 @@ public class TalismanOfForesight extends Artifact {
}
}
GLog.p("The Talisman floods your mind with knowledge about the current floor.");
GLog.p( Messages.get(this, "scry") );
Buff.affect(hero, Awareness.class, Awareness.DURATION);
Dungeon.observe();
@@ -101,16 +102,14 @@ public class TalismanOfForesight extends Artifact {
@Override
public String desc() {
String desc = "A smooth stone, almost too big for your pocket or hand, with strange engravings on it. " +
"You feel like it's watching you, assessing your every move.";
String desc = super.desc();
if ( isEquipped( Dungeon.hero ) ){
if (!cursed) {
desc += "\n\nWhen you hold the talisman you feel like your senses are heightened.";
if (charge == chargeCap)
desc += "\n\nThe talisman is radiating energy, prodding at your mind. You wonder what would " +
"happen if you let it in.";
desc += "\n\n" + Messages.get(this, "desc_worn");
} else {
desc += "\n\nThe cursed talisman is intently staring into you, making it impossible to concentrate.";
desc += "\n\n" + Messages.get(this, "desc_cursed");
}
}
@@ -157,7 +156,7 @@ public class TalismanOfForesight extends Artifact {
if (smthFound && !cursed){
if (warn == 0){
GLog.w("You feel uneasy.");
GLog.w( Messages.get(this, "uneasy") );
if (target instanceof Hero){
((Hero)target).interrupt();
}
@@ -180,7 +179,7 @@ public class TalismanOfForesight extends Artifact {
charge++;
} else if (charge >= chargeCap) {
partialCharge = 0;
GLog.p("Your Talisman is fully charged!");
GLog.p( Messages.get(this, "full_charge") );
}
}
@@ -192,19 +191,19 @@ public class TalismanOfForesight extends Artifact {
exp++;
if (exp >= 4 && level() < levelCap) {
upgrade();
GLog.p("Your Talisman grows stronger!");
GLog.p( Messages.get(this, "levelup") );
exp -= 4;
}
}
@Override
public String toString() {
return "Foresight";
return Messages.get(this, "name");
}
@Override
public String desc() {
return "You feel very nervous, as if there is nearby unseen danger.";
return Messages.get(this, "desc");
}
@Override
@@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
@@ -41,14 +42,6 @@ import java.util.ArrayList;
public class TimekeepersHourglass extends Artifact {
private static final String TXT_HGLASS = "Timekeeper's Hourglass";
private static final String TXT_STASIS = "Put myself in stasis";
private static final String TXT_FREEZE = "Freeze time around me";
private static final String TXT_DESC =
"How would you like to use the hourglass's magic?\n\n" +
"While in stasis, time will move normally while you are frozen and completely invulnerable.\n\n" +
"When time is frozen, you can move as if your actions take no time. Note that attacking will break this.";
{
image = ItemSpriteSheet.ARTIFACT_HOURGLASS;
@@ -78,23 +71,26 @@ public class TimekeepersHourglass extends Artifact {
public void execute( Hero hero, String action ) {
if (action.equals(AC_ACTIVATE)){
if (!isEquipped( hero )) GLog.i("You need to equip your hourglass to do that.");
else if (activeBuff != null) GLog.i("Your hourglass is already in use.");
else if (charge <= 1) GLog.i("Your hourglass hasn't recharged enough to be usable yet.");
else if (cursed) GLog.i("You cannot use a cursed hourglass.");
if (!isEquipped( hero )) GLog.i( Messages.get(Artifact.class, "need_to_equip") );
else if (activeBuff != null) GLog.i( Messages.get(this, "in_use") );
else if (charge <= 1) GLog.i( Messages.get(this, "no_charge") );
else if (cursed) GLog.i( Messages.get(this, "cursed") );
else GameScene.show(
new WndOptions(TXT_HGLASS, TXT_DESC, TXT_STASIS, TXT_FREEZE) {
new WndOptions( Messages.get(this, "name"),
Messages.get(this, "prompt"),
Messages.get(this, "stasis"),
Messages.get(this, "freeze")) {
@Override
protected void onSelect(int index) {
if (index == 0) {
GLog.i("The world seems to shift around you in an instant.");
GLog.i( Messages.get(this, "onstasis") );
GameScene.flash(0xFFFFFF);
Sample.INSTANCE.play(Assets.SND_TELEPORT);
activeBuff = new timeStasis();
activeBuff.attachTo(Dungeon.hero);
} else if (index == 1) {
GLog.i("everything around you suddenly freezes.");
GLog.i( Messages.get(this, "onfreeze") );
GameScene.flash(0xFFFFFF);
Sample.INSTANCE.play(Assets.SND_TELEPORT);
@@ -145,22 +141,15 @@ public class TimekeepersHourglass extends Artifact {
@Override
public String desc() {
String desc =
"This large ornate hourglass looks fairly unassuming, but you feel a great power in its finely carved" +
" frame. As you rotate the hourglass and watch the sand pour you can feel its magic tugging at you, " +
"surely invoking this magic would give you some power over time.";
String desc = super.desc();
if (isEquipped( Dungeon.hero )){
if (!cursed) {
desc += "\n\nThe hourglass rests at your side, the whisper of steadily pouring sand is reassuring.";
if (level() < levelCap )
desc +=
"\n\nThe hourglass seems to have lost some sand with age. While there are no cracks, " +
"there is a port on the top of the hourglass to pour sand in, if only you could find some...";
}else
desc += "\n\nThe cursed hourglass is locked to your side, " +
"you can feel it trying to manipulate your flow of time.";
desc += "\n\n" + Messages.get(this, "desc_hint");
} else
desc += "\n\n" + Messages.get(this, "desc_cursed");
}
return desc;
}
@@ -366,23 +355,17 @@ public class TimekeepersHourglass extends Artifact {
hourglass.upgrade();
Sample.INSTANCE.play( Assets.SND_DEWDROP );
if (hourglass.level() == hourglass.levelCap)
GLog.p("Your hourglass is filled with magical sand!");
GLog.p( Messages.get(this, "maxlevel") );
else
GLog.i("you add the sand to your hourglass.");
GLog.i( Messages.get(this, "levelup") );
hero.spendAndNext(TIME_TO_PICK_UP);
return true;
} else {
GLog.w("You have no hourglass to place this sand into.");
GLog.w( Messages.get(this, "no_hourglass") );
return false;
}
}
@Override
public String desc(){
return "This small bag of finely ground sand should work perfectly with your hourglass.\n\n" +
"It seems odd that the shopkeeper would have this specific item right when you need it.";
}
@Override
public int price() {
return 20;
@@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfIdentify;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRemoveCurse;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
@@ -95,7 +96,7 @@ public class UnstableSpellbook extends Artifact {
if (action.equals( AC_READ )) {
if (hero.buff( Blindness.class ) != null) GLog.w("You cannot read from the book while blinded.");
else if (!isEquipped( hero )) GLog.i("You need to equip your spellbook to do that.");
else if (!isEquipped( hero )) GLog.i( Messages.get(Artifact.class, "need_to_equip") );
else if (charge == 0) GLog.i("Your spellbook is out of energy for now.");
else if (cursed) GLog.i("Your cannot read from a cursed spellbook.");
else {