v0.3.4: externalized misc item strings

This commit is contained in:
Evan Debenham 2016-01-03 19:43:24 -05:00 committed by Evan Debenham
parent 106ec11708
commit 95ab06888c
19 changed files with 98 additions and 207 deletions

View File

@ -1218,7 +1218,7 @@ public class Hero extends Char {
ankh.detach(belongings.backpack); ankh.detach(belongings.backpack);
Sample.INSTANCE.play( Assets.SND_TELEPORT ); Sample.INSTANCE.play( Assets.SND_TELEPORT );
GLog.w( ankh.TXT_REVIVE ); GLog.w( Messages.get(this, "revive") );
Statistics.ankhsUsed++; Statistics.ankhsUsed++;
return; return;

View File

@ -97,10 +97,4 @@ public class Amulet extends Item {
return false; return false;
} }
@Override
public String info() {
return
"The Amulet of Yendor is the most powerful known artifact of unknown origin. It is said that the amulet " +
"is able to fulfil any wish if its owner's will-power is strong enough to \"persuade\" it to do it.";
}
} }

View File

@ -24,6 +24,8 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
@ -36,16 +38,6 @@ public class Ankh extends Item {
public static final String AC_BLESS = "BLESS"; public static final String AC_BLESS = "BLESS";
public static final String TXT_DESC_NOBLESS = "Upon resurrection all non-equipped items are lost. " +
"Using a full dew vial, the ankh can be blessed with extra strength.";
public static final String TXT_DESC_BLESSED = "The ankh has been blessed and is now much stronger. " +
"The Ankh will sacrifice itself to save you in a moment of deadly peril.";
public static final String TXT_BLESS = "You bless the ankh with clean water.";
public static final String TXT_REVIVE = "The ankh explodes with life-giving energy!";
{ {
image = ItemSpriteSheet.ANKH; image = ItemSpriteSheet.ANKH;
@ -83,7 +75,7 @@ public class Ankh extends Item {
if (vial != null){ if (vial != null){
blessed = true; blessed = true;
vial.empty(); vial.empty();
GLog.p( TXT_BLESS ); GLog.p( Messages.get(this, "bless") );
hero.spend( 1f ); hero.spend( 1f );
hero.busy(); hero.busy();
@ -101,15 +93,11 @@ public class Ankh extends Item {
} }
@Override @Override
public String info() { public String desc() {
if (blessed) if (blessed)
return return Messages.get(this, "desc_blessed");
"This ancient symbol of immortality grants the ability to return to life after death. " +
TXT_DESC_BLESSED;
else else
return return super.desc();
"This ancient symbol of immortality grants the ability to return to life after death. " +
TXT_DESC_NOBLESS;
} }
public Boolean isBlessed(){ public Boolean isBlessed(){

View File

@ -22,6 +22,8 @@ package com.shatteredpixel.shatteredpixeldungeon.items;
import java.util.ArrayList; import java.util.ArrayList;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
@ -36,7 +38,6 @@ import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
public class ArmorKit extends Item { public class ArmorKit extends Item {
private static final String TXT_SELECT_ARMOR = "Select an armor to upgrade";
private static final String TXT_UPGRADED = "you applied the armor kit to upgrade your %s"; private static final String TXT_UPGRADED = "you applied the armor kit to upgrade your %s";
private static final float TIME_TO_UPGRADE = 2; private static final float TIME_TO_UPGRADE = 2;
@ -61,7 +62,7 @@ public class ArmorKit extends Item {
if (action == AC_APPLY) { if (action == AC_APPLY) {
curUser = hero; curUser = hero;
GameScene.selectItem( itemSelector, WndBag.Mode.ARMOR, TXT_SELECT_ARMOR ); GameScene.selectItem( itemSelector, WndBag.Mode.ARMOR, Messages.get(this, "prompt") );
} else { } else {
@ -88,7 +89,7 @@ public class ArmorKit extends Item {
curUser.spend( TIME_TO_UPGRADE ); curUser.spend( TIME_TO_UPGRADE );
curUser.busy(); curUser.busy();
GLog.w( TXT_UPGRADED, armor.name() ); GLog.w( Messages.get(this, "upgraded", armor.name()) );
ClassArmor classArmor = ClassArmor.upgrade( curUser, armor ); ClassArmor classArmor = ClassArmor.upgrade( curUser, armor );
if (curUser.belongings.armor == armor) { if (curUser.belongings.armor == armor) {
@ -107,14 +108,6 @@ public class ArmorKit extends Item {
Sample.INSTANCE.play( Assets.SND_EVOKE ); Sample.INSTANCE.play( Assets.SND_EVOKE );
} }
@Override
public String info() {
return
"Using this kit of small tools and materials anybody can transform any armor into an \"epic armor\", " +
"which will keep all properties of the original armor, but will also provide its wearer a special ability " +
"depending on his class. No skills in tailoring, leatherworking or blacksmithing are required.";
}
private final WndBag.Listener itemSelector = new WndBag.Listener() { private final WndBag.Listener itemSelector = new WndBag.Listener() {
@Override @Override
public void onSelect( Item item ) { public void onSelect( Item item ) {

View File

@ -21,6 +21,8 @@
package com.shatteredpixel.shatteredpixeldungeon.items; package com.shatteredpixel.shatteredpixeldungeon.items;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
@ -100,7 +102,7 @@ public class Bomb extends Item {
@Override @Override
public boolean doPickUp(Hero hero) { public boolean doPickUp(Hero hero) {
if (fuse != null) { if (fuse != null) {
GLog.w("You quickly snuff the bomb's fuse."); GLog.w( Messages.get(this, "snuff_fuse") );
fuse = null; fuse = null;
} }
return super.doPickUp(hero); return super.doPickUp(hero);
@ -147,7 +149,7 @@ public class Bomb extends Item {
} }
if (ch == Dungeon.hero && !ch.isAlive()) if (ch == Dungeon.hero && !ch.isAlive())
Dungeon.fail("Killed by an explosion"); Dungeon.fail( Messages.get(this, "ondeath") );
} }
} }
} }
@ -189,11 +191,11 @@ public class Bomb extends Item {
} }
@Override @Override
public String info() { public String desc() {
return if (fuse == null)
"A fairly hefty black powder bomb. An explosion from this would certainly do damage to anything nearby." + return super.desc();
(fuse != null ? "\n\nThe bomb's fuse is burning away, keep your distance or put it out!" : else
"\n\nIt looks like the fuse will take a couple rounds to burn down once it is lit."); return Messages.get(this, "desc_burning");
} }
private static final String FUSE = "fuse"; private static final String FUSE = "fuse";
@ -261,18 +263,13 @@ public class Bomb extends Item {
stackable = false; stackable = false;
} }
@Override
public String info() {
return
"A stack of two hefty black powder bombs, looks like you get one free!";
}
@Override @Override
public boolean doPickUp(Hero hero) { public boolean doPickUp(Hero hero) {
Bomb bomb = new Bomb(); Bomb bomb = new Bomb();
bomb.quantity(2); bomb.quantity(2);
if (bomb.doPickUp(hero)) { if (bomb.doPickUp(hero)) {
//isaaaaac.... //isaaaaac.... (don't bother doing this when not in english)
if (Messages.get(this, "name").equals("two bombs"))
hero.sprite.showStatus(CharSprite.NEUTRAL, "1+1 free!"); hero.sprite.showStatus(CharSprite.NEUTRAL, "1+1 free!");
return true; return true;
} }

View File

@ -24,6 +24,7 @@ import java.util.ArrayList;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
@ -42,14 +43,8 @@ public class DewVial extends Item {
private static final float TIME_TO_DRINK = 1f; private static final float TIME_TO_DRINK = 1f;
private static final String TXT_VALUE = "%+dHP";
private static final String TXT_STATUS = "%d/%d"; private static final String TXT_STATUS = "%d/%d";
private static final String TXT_AUTO_DRINK = "The dew vial was emptied to heal your wounds.";
private static final String TXT_COLLECTED = "You collected a dewdrop into your dew vial.";
private static final String TXT_FULL = "Your dew vial is full!";
private static final String TXT_EMPTY = "Your dew vial is empty!";
{ {
image = ItemSpriteSheet.VIAL; image = ItemSpriteSheet.VIAL;
@ -99,7 +94,7 @@ public class DewVial extends Item {
if (effect > 0) { if (effect > 0) {
hero.HP += effect; hero.HP += effect;
hero.sprite.emitter().burst( Speck.factory( Speck.HEALING ), volume > 5 ? 2 : 1 ); hero.sprite.emitter().burst( Speck.factory( Speck.HEALING ), volume > 5 ? 2 : 1 );
hero.sprite.showStatus( CharSprite.POSITIVE, TXT_VALUE, effect ); hero.sprite.showStatus( CharSprite.POSITIVE, Messages.get(this, "value", effect) );
} }
volume = 0; volume = 0;
@ -114,7 +109,7 @@ public class DewVial extends Item {
} else { } else {
GLog.w( TXT_EMPTY ); GLog.w( Messages.get(this, "empty") );
} }
} else { } else {
@ -142,11 +137,11 @@ public class DewVial extends Item {
public void collectDew( Dewdrop dew ) { public void collectDew( Dewdrop dew ) {
GLog.i( TXT_COLLECTED ); GLog.i( Messages.get(this, "collected") );
volume += dew.quantity; volume += dew.quantity;
if (volume >= MAX_VOLUME) { if (volume >= MAX_VOLUME) {
volume = MAX_VOLUME; volume = MAX_VOLUME;
GLog.p( TXT_FULL ); GLog.p( Messages.get(this, "full") );
} }
updateQuickslot(); updateQuickslot();
@ -157,31 +152,11 @@ public class DewVial extends Item {
updateQuickslot(); updateQuickslot();
} }
//removed as people need a bigger distinction to realize the dew vial doesn't revive.
/*
private static final Glowing WHITE = new Glowing( 0xFFFFCC );
@Override
public Glowing glowing() {
return isFull() ? WHITE : null;
}*/
@Override @Override
public String status() { public String status() {
return Utils.format( TXT_STATUS, volume, MAX_VOLUME ); return Utils.format( TXT_STATUS, volume, MAX_VOLUME );
} }
@Override
public String info() {
return
"You can store excess dew in this tiny vessel for drinking it later. " +
"The more full the vial is, the more each dew drop will heal you. " +
"A full vial is as strong as a potion of healing." +
"\n\nVials like this one used to be imbued with revival magic, " +
"but that power has faded. There still seems to be some residual power " +
"left, perhaps a full vial can bless another revival item.";
}
@Override @Override
public String toString() { public String toString() {
return super.toString() + " (" + status() + ")" ; return super.toString() + " (" + status() + ")" ;

View File

@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.items; package com.shatteredpixel.shatteredpixeldungeon.items;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Assets;
@ -33,8 +34,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Dewdrop extends Item { public class Dewdrop extends Item {
private static final String TXT_VALUE = "%+dHP";
{ {
image = ItemSpriteSheet.DEWDROP; image = ItemSpriteSheet.DEWDROP;
@ -57,9 +56,9 @@ public class Dewdrop extends Item {
if (effect > 0) { if (effect > 0) {
hero.HP += effect; hero.HP += effect;
hero.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); hero.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 );
hero.sprite.showStatus( CharSprite.POSITIVE, TXT_VALUE, effect ); hero.sprite.showStatus( CharSprite.POSITIVE, Messages.get(this, "value", effect) );
} else { } else {
GLog.i("You already have full health."); GLog.i( Messages.get(this, "already_full") );
return false; return false;
} }
@ -82,8 +81,4 @@ public class Dewdrop extends Item {
return this; return this;
} }
@Override
public String info() {
return "A crystal clear dewdrop.\n\nDue to the magic of this place, pure water has minor restorative properties.";
}
} }

View File

@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.items; package com.shatteredpixel.shatteredpixeldungeon.items;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Assets;
@ -29,8 +30,6 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle
public abstract class EquipableItem extends Item { public abstract class EquipableItem extends Item {
private static final String TXT_UNEQUIP_CURSED = "You can't remove cursed %s!";
public static final String AC_EQUIP = "EQUIP"; public static final String AC_EQUIP = "EQUIP";
public static final String AC_UNEQUIP = "UNEQUIP"; public static final String AC_UNEQUIP = "UNEQUIP";
@ -89,7 +88,7 @@ public abstract class EquipableItem extends Item {
public boolean doUnequip( Hero hero, boolean collect, boolean single ) { public boolean doUnequip( Hero hero, boolean collect, boolean single ) {
if (cursed) { if (cursed) {
GLog.w(TXT_UNEQUIP_CURSED, name()); GLog.w(Messages.get(EquipableItem.class, "unequip_cursed"));
return false; return false;
} }

View File

@ -38,9 +38,6 @@ import com.watabou.utils.Random;
public class Gold extends Item { public class Gold extends Item {
private static final String TXT_COLLECT = "Collect gold coins to spend them later in a shop.";
private static final String TXT_INFO = "A pile of %d gold coins. " + TXT_COLLECT;
private static final String TXT_INFO_1 = "One gold coin. " + TXT_COLLECT;
private static final String TXT_VALUE = "%+d"; private static final String TXT_VALUE = "%+d";
{ {
@ -91,18 +88,6 @@ public class Gold extends Item {
return true; return true;
} }
@Override
public String info() {
switch (quantity) {
case 0:
return TXT_COLLECT;
case 1:
return TXT_INFO_1;
default:
return Utils.format( TXT_INFO, quantity );
}
}
@Override @Override
public Item random() { public Item random() {
quantity = Random.Int( 30 + Dungeon.depth * 10, 60 + Dungeon.depth * 20 ); quantity = Random.Int( 30 + Dungeon.depth * 10, 60 + Dungeon.depth * 20 );

View File

@ -62,8 +62,6 @@ import java.util.LinkedList;
public class Heap implements Bundlable { public class Heap implements Bundlable {
private static final String TXT_MIMIC = "This is a mimic!";
private static final int SEEDS_TO_POTION = 3; private static final int SEEDS_TO_POTION = 3;
public enum Type { public enum Type {
@ -117,7 +115,6 @@ public class Heap implements Bundlable {
switch (type) { switch (type) {
case MIMIC: case MIMIC:
if (Mimic.spawnAt(pos, items) != null) { if (Mimic.spawnAt(pos, items) != null) {
GLog.n(TXT_MIMIC);
destroy(); destroy();
} else { } else {
type = Type.CHEST; type = Type.CHEST;

View File

@ -141,16 +141,6 @@ public class Honeypot extends Item {
return 30 * quantity; return 30 * quantity;
} }
@Override
public String info() {
return
"This large honeypot is only really lined with honey, instead it houses a giant bee! " +
"These sorts of massive bees usually stay in their hives, perhaps the pot is some sort of specialized trapper's cage? " +
"The bee seems pretty content inside the pot with its honey, and buzzes at you warily when you look at it.";
}
//The bee's broken 'home', all this item does is let its bee know where it is, and who owns it (if anyone). //The bee's broken 'home', all this item does is let its bee know where it is, and who owns it (if anyone).
public static class ShatteredPot extends Item { public static class ShatteredPot extends Item {
@ -217,19 +207,6 @@ public class Honeypot extends Item {
return true; return true;
} }
@Override
public String info() {
String info =
"The pot has been shattered, only the sticky honey that lines its walls is holding it together, and it is slowly coming apart.";
if (Actor.findById( myBee ) != null)
info += "\n\nDespite its broken state, the bee still seems quite fond of the pot, and is understandably quite mad.";
else
info += "\n\nNow that its bee is gone, you can't think of a use for this wad of broken clay and drying honey.";
return info;
}
private static final String MYBEE = "mybee"; private static final String MYBEE = "mybee";
private static final String BEEDEPTH = "beedepth"; private static final String BEEDEPTH = "beedepth";

View File

@ -25,13 +25,12 @@ import java.util.ArrayList;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.utils.Random; import com.watabou.utils.Random;
abstract public class KindOfWeapon extends EquipableItem { abstract public class KindOfWeapon extends EquipableItem {
private static final String TXT_EQUIP_CURSED = "you wince as your grip involuntarily tightens around your %s";
protected static final float TIME_TO_EQUIP = 1f; protected static final float TIME_TO_EQUIP = 1f;
@Override @Override
@ -61,7 +60,7 @@ abstract public class KindOfWeapon extends EquipableItem {
cursedKnown = true; cursedKnown = true;
if (cursed) { if (cursed) {
equipCursed( hero ); equipCursed( hero );
GLog.n( TXT_EQUIP_CURSED, name() ); GLog.n( Messages.get(KindOfWeapon.class, "cursed", name()) );
} }
hero.spendAndNext( TIME_TO_EQUIP ); hero.spendAndNext( TIME_TO_EQUIP );

View File

@ -75,11 +75,4 @@ public class MerchantsBeacon extends Item {
return 5 * quantity; return 5 * quantity;
} }
@Override
public String info() {
return "This odd piece of dwarven technology allows you to communicate from great distances." +
"\n\nAfter being activated, this beacon will let you sell items to Pixel Mart from anywhere in the dungeon." +
"\n\nHowever, the magic within the beacon will only last for one session, so use it wisely.";
}
} }

View File

@ -25,6 +25,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.Enchanting; import com.shatteredpixel.shatteredpixeldungeon.effects.Enchanting;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.PurpleParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.PurpleParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
@ -35,9 +37,6 @@ import java.util.ArrayList;
public class Stylus extends Item { public class Stylus extends Item {
private static final String TXT_SELECT_ARMOR = "Select an armor to inscribe";
private static final String TXT_INSCRIBED = "you inscribed your %s with the stylus";
private static final float TIME_TO_INSCRIBE = 2; private static final float TIME_TO_INSCRIBE = 2;
private static final String AC_INSCRIBE = "INSCRIBE"; private static final String AC_INSCRIBE = "INSCRIBE";
@ -59,10 +58,10 @@ public class Stylus extends Item {
@Override @Override
public void execute( Hero hero, String action ) { public void execute( Hero hero, String action ) {
if (action == AC_INSCRIBE) { if (action.equals(AC_INSCRIBE)) {
curUser = hero; curUser = hero;
GameScene.selectItem( itemSelector, WndBag.Mode.ARMOR, TXT_SELECT_ARMOR ); GameScene.selectItem( itemSelector, WndBag.Mode.ARMOR, Messages.get(this, "prompt") );
} else { } else {
@ -85,7 +84,7 @@ public class Stylus extends Item {
detach(curUser.belongings.backpack); detach(curUser.belongings.backpack);
GLog.w(TXT_INSCRIBED, armor.name()); GLog.w( Messages.get(this, "inscribed"));
armor.inscribe(); armor.inscribe();
@ -103,14 +102,6 @@ public class Stylus extends Item {
return 30 * quantity; return 30 * quantity;
} }
@Override
public String info() {
return
"This arcane stylus is made of some dark, very hard stone. Using it you can inscribe " +
"a magical glyph on your armor, but you have no power over choosing what glyph it will be, " +
"the stylus will decide it for you.";
}
private final WndBag.Listener itemSelector = new WndBag.Listener() { private final WndBag.Listener itemSelector = new WndBag.Listener() {
@Override @Override
public void onSelect( Item item ) { public void onSelect( Item item ) {

View File

@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items;
import java.util.ArrayList; import java.util.ArrayList;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Badges;
@ -40,8 +41,6 @@ import com.shatteredpixel.shatteredpixeldungeon.windows.WndChooseWay;
public class TomeOfMastery extends Item { public class TomeOfMastery extends Item {
private static final String TXT_BLINDED = "You can't read while blinded";
public static final float TIME_TO_READ = 10; public static final float TIME_TO_READ = 10;
public static final String AC_READ = "READ"; public static final String AC_READ = "READ";
@ -64,11 +63,6 @@ public class TomeOfMastery extends Item {
public void execute( Hero hero, String action ) { public void execute( Hero hero, String action ) {
if (action.equals( AC_READ )) { if (action.equals( AC_READ )) {
if (hero.buff( Blindness.class ) != null) {
GLog.w( TXT_BLINDED );
return;
}
curUser = hero; curUser = hero;
HeroSubClass way1 = null; HeroSubClass way1 = null;
@ -116,14 +110,6 @@ public class TomeOfMastery extends Item {
return true; return true;
} }
@Override
public String info() {
return
"This worn leather book is not that thick, but you feel somehow, " +
"that you can gather a lot from it. Remember though that reading " +
"this tome may require some time.";
}
public void choose( HeroSubClass way ) { public void choose( HeroSubClass way ) {
detach( curUser.belongings.backpack ); detach( curUser.belongings.backpack );
@ -138,7 +124,7 @@ public class TomeOfMastery extends Item {
SpellSprite.show( curUser, SpellSprite.MASTERY ); SpellSprite.show( curUser, SpellSprite.MASTERY );
curUser.sprite.emitter().burst( Speck.factory( Speck.MASTERY ), 12 ); curUser.sprite.emitter().burst( Speck.factory( Speck.MASTERY ), 12 );
GLog.w( "You have chosen the way of the %s!", Utils.capitalize( way.title() ) ); GLog.w( Messages.get(this, "way", way.title()) );
if (way == HeroSubClass.BERSERKER && curUser.HP <= curUser.HT * Fury.LEVEL) { if (way == HeroSubClass.BERSERKER && curUser.HP <= curUser.HT * Fury.LEVEL) {
Buff.affect( curUser, Fury.class ); Buff.affect( curUser, Fury.class );

View File

@ -88,9 +88,4 @@ public class Torch extends Item {
return 10 * quantity; return 10 * quantity;
} }
@Override
public String info() {
return
"An adventuring staple, when a dungeon goes dark, a torch can help lead the way.";
}
} }

View File

@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items;
import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
@ -39,10 +40,6 @@ import java.util.ArrayList;
public class Weightstone extends Item { public class Weightstone extends Item {
private static final String TXT_SELECT_WEAPON = "Select a weapon to balance";
private static final String TXT_LIGHT = "you balanced your %s to make it lighter";
private static final String TXT_HEAVY = "you balanced your %s to make it heavier";
private static final float TIME_TO_APPLY = 2; private static final float TIME_TO_APPLY = 2;
private static final String AC_APPLY = "APPLY"; private static final String AC_APPLY = "APPLY";
@ -67,7 +64,7 @@ public class Weightstone extends Item {
if (action == AC_APPLY) { if (action == AC_APPLY) {
curUser = hero; curUser = hero;
GameScene.selectItem( itemSelector, WndBag.Mode.WEAPON, TXT_SELECT_WEAPON ); GameScene.selectItem( itemSelector, WndBag.Mode.WEAPON, Messages.get(this, "select") );
} else { } else {
@ -92,10 +89,10 @@ public class Weightstone extends Item {
if (forSpeed) { if (forSpeed) {
weapon.imbue = Weapon.Imbue.LIGHT; weapon.imbue = Weapon.Imbue.LIGHT;
GLog.p( TXT_LIGHT, weapon.name() ); GLog.p( Messages.get(this, "light") );
} else { } else {
weapon.imbue = Weapon.Imbue.HEAVY; weapon.imbue = Weapon.Imbue.HEAVY;
GLog.p( TXT_HEAVY, weapon.name() ); GLog.p( Messages.get(this, "heavy") );
} }
curUser.sprite.operate( curUser.pos ); curUser.sprite.operate( curUser.pos );
@ -110,13 +107,6 @@ public class Weightstone extends Item {
return 40 * quantity; return 40 * quantity;
} }
@Override
public String info() {
return
"Using a weightstone, you can balance your melee weapon to make it lighter or heavier, " +
"increasing either speed or damage at the expense of the other.";
}
private final WndBag.Listener itemSelector = new WndBag.Listener() { private final WndBag.Listener itemSelector = new WndBag.Listener() {
@Override @Override
public void onSelect( Item item ) { public void onSelect( Item item ) {
@ -128,12 +118,6 @@ public class Weightstone extends Item {
public class WndBalance extends Window { public class WndBalance extends Window {
private static final String TXT_CHOICE = "How would you like to balance your %s?";
private static final String TXT_LIGHT = "Lighter";
private static final String TXT_HEAVY = "Heavier";
private static final String TXT_CANCEL = "Never mind";
private static final int WIDTH = 120; private static final int WIDTH = 120;
private static final int MARGIN = 2; private static final int MARGIN = 2;
private static final int BUTTON_WIDTH = WIDTH - MARGIN * 2; private static final int BUTTON_WIDTH = WIDTH - MARGIN * 2;
@ -146,7 +130,7 @@ public class Weightstone extends Item {
titlebar.setRect( 0, 0, WIDTH, 0 ); titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar ); add( titlebar );
BitmapTextMultiline tfMesage = PixelScene.createMultiline( Utils.format( TXT_CHOICE, weapon.name() ), 8 ); BitmapTextMultiline tfMesage = PixelScene.createMultiline( Messages.get(this, "choice"), 8 );
tfMesage.maxWidth = WIDTH - MARGIN * 2; tfMesage.maxWidth = WIDTH - MARGIN * 2;
tfMesage.measure(); tfMesage.measure();
tfMesage.x = MARGIN; tfMesage.x = MARGIN;
@ -156,7 +140,7 @@ public class Weightstone extends Item {
float pos = tfMesage.y + tfMesage.height(); float pos = tfMesage.y + tfMesage.height();
if (weapon.imbue != Weapon.Imbue.LIGHT) { if (weapon.imbue != Weapon.Imbue.LIGHT) {
RedButton btnSpeed = new RedButton( TXT_LIGHT ) { RedButton btnSpeed = new RedButton( Messages.get(this, "light") ) {
@Override @Override
protected void onClick() { protected void onClick() {
hide(); hide();
@ -170,7 +154,7 @@ public class Weightstone extends Item {
} }
if (weapon.imbue != Weapon.Imbue.HEAVY) { if (weapon.imbue != Weapon.Imbue.HEAVY) {
RedButton btnAccuracy = new RedButton( TXT_HEAVY ) { RedButton btnAccuracy = new RedButton( Messages.get(this, "heavy") ) {
@Override @Override
protected void onClick() { protected void onClick() {
hide(); hide();
@ -183,7 +167,7 @@ public class Weightstone extends Item {
pos = btnAccuracy.bottom(); pos = btnAccuracy.bottom();
} }
RedButton btnCancel = new RedButton( TXT_CANCEL ) { RedButton btnCancel = new RedButton( Messages.get(this, "cancel") ) {
@Override @Override
protected void onClick() { protected void onClick() {
hide(); hide();

View File

@ -190,6 +190,7 @@ actors.hero.hero.wait=...
actors.hero.hero.search=search actors.hero.hero.search=search
actors.hero.hero.search_distracted=You can't concentrate, searching takes a while actors.hero.hero.search_distracted=You can't concentrate, searching takes a while
actors.hero.hero.pain_resist=The pain helps you resist the urge to sleep actors.hero.hero.pain_resist=The pain helps you resist the urge to sleep
actors.hero.hero.revive=The ankh explodes with life-giving energy!
actors.hero.heroclass.warrior=warrior actors.hero.heroclass.warrior=warrior
actors.hero.heroclass.warrior_perk1=The Warrior starts with 11 points of Strength. actors.hero.heroclass.warrior_perk1=The Warrior starts with 11 points of Strength.

View File

@ -629,32 +629,74 @@ items.weapon.weapon.heavier=It was balanced to be heavier.
###misc items ###misc items
items.amulet.name=amulet of yendor items.amulet.name=amulet of yendor
items.amulet.desc=The Amulet of Yendor is the most powerful known artifact of unknown origin. It is said that the amulet is able to fulfil any wish if its owner's will-power is strong enough to "persuade" it to do it.
items.ankh.name=ankh items.ankh.name=ankh
items.ankh.bless=You bless the ankh with clean water.
items.ankh.desc=This ancient symbol of immortality grants the ability to return to life after death. Upon resurrection all non-equipped items are lost. Using a full dew vial, the ankh can be blessed with extra strength.
items.ankh.desc_blessed=This ancient symbol of immortality grants the ability to return to life after death. The ankh has been blessed and is now much stronger. The Ankh will sacrifice itself to save you in a moment of deadly peril.
items.armorkit.name=armor kit items.armorkit.name=armor kit
items.armorkit.prompt=Select an armor to upgrade
items.armorkit.upgraded=You applied the armor kit to upgrade your %s
items.armorkit.desc=Using this kit of small tools and materials anybody can transform any armor into an "epic armor", which will keep all properties of the original armor, but will also provide its wearer a special ability depending on his class. No skills in tailoring, leatherworking or blacksmithing are required.
items.bomb.name=bomb items.bomb.name=bomb
items.bomb.snuff_fuse=You quickly snuff the bomb's fuse.
items.bomb.ondeath=Killed by an explosion
items.bomb.desc=A fairly hefty black powder bomb. An explosion from this would certainly do damage to anything nearby.\n\nIt looks like the fuse will take a couple rounds to burn down once it is lit.
items.bomb.desc_burning=A fairly hefty black powder bomb. An explosion from this would certainly do damage to anything nearby.\n\nThe bomb's fuse is burning away, keep your distance or put it out!
items.bomb$doublebomb.name=two bombs items.bomb$doublebomb.name=two bombs
items.bomb$doublebomb.desc=A stack of two hefty black powder bombs, looks like you get one free!
items.dewdrop.name=dewdrop items.dewdrop.name=dewdrop
items.dewdrop.value=%+dHP
items.dewdrop.already_full=You already have full health.
items.dewdrop.desc=A crystal clear dewdrop.\n\nDue to the magic of this place, pure water has minor restorative properties.
items.dewvial.name=dew vial items.dewvial.name=dew vial
items.dewvial.value=%+dHP
items.dewvial.collected=You collected a dewdrop into your dew vial.
items.dewvial.full=Your dew vial is full!
items.dewvial.empty=Your dew vial is empty!
items.dewvial.desc=You can store excess dew in this tiny vessel for drinking it later. The more full the vial is, the more each dew drop will heal you. A full vial is as strong as a potion of healing.\n\nVials like this one used to be imbued with revival magic, but that power has faded. There still seems to be some residual power left, perhaps a full vial can bless another revival item.
items.equipableitem.unequip_cursed=You can't remove a cursed item!
items.gold.name=gold items.gold.name=gold
items.gold.desc=A pile of gold coins. Collect gold coins to spend them later in a shop.
items.honeypot.name=honeypot items.honeypot.name=honeypot
items.honeypot.desc=This large honeypot is only really lined with honey, instead it houses a giant bee! These sorts of massive bees usually stay in their hives, perhaps the pot is some sort of specialized trapper's cage? The bee seems pretty content inside the pot with its honey, and buzzes at you warily when you look at it.
items.honeypot$shatteredpot.name=shattered honeypot items.honeypot$shatteredpot.name=shattered honeypot
items.honeypot$shatteredpot.desc=The pot has been shattered, only the sticky honey that lines its walls is holding it together, and it is slowly coming apart.\n\nDespite its broken state, the bee still seems to want to protect the pot.
items.item.pack_full=Your pack is too full for the %s items.item.pack_full=Your pack is too full for the %s
items.item.prompt=Choose direction of throw items.item.prompt=Choose direction of throw
items.kindofweapon.cursed=you wince as your grip involuntarily tightens around your %s
items.merchantsbeacon.name=merchant's beacon items.merchantsbeacon.name=merchant's beacon
items.merchantsbeacon.desc=This odd piece of dwarven technology allows you to communicate from great distances.\n\nAfter being activated, this beacon will let you sell items to Pixel Mart from anywhere in the dungeon.\n\nHowever, the magic within the beacon will only last for one session, so use it wisely.
items.stylus.name=arcane stylus items.stylus.name=arcane stylus
items.stylus.prompt=Select an armor to inscribe
items.stylus.inscribed=You inscribed your armor with the stylus
items.stylus.desc=This arcane stylus is made of some dark, very hard stone. Using it you can inscribe a magical glyph on your armor, but you have no power over choosing what glyph it will be, the stylus will decide it for you.
items.tomeofmastery.name=Tome of Mastery items.tomeofmastery.name=Tome of Mastery
items.tomeofmastery.way=You have chosen the way of the %s!
items.tomeofmastery.desc=This worn leather book is not that thick, but you feel somehow, that you can gather a lot from it. Remember though that reading this tome may require some time.
items.torch.name=torch items.torch.name=torch
items.torch.desc=An adventuring staple, when a dungeon goes dark, a torch can help lead the way.
items.weightstone.name=weightstone items.weightstone.name=weightstone
items.weightstone.select=Select a weapon to balance
items.weightstone.light=you balanced your weapon to make it lighter
items.weightstone.heavy=you balanced your weapon to make it heavier
items.weightstone.desc=Using a weightstone, you can balance your melee weapon to make it lighter or heavier, increasing either speed or damage at the expense of the other.
items.weightstone$wndbalance.choice=How would you like to balance your weapon?
items.weightstone$wndbalance.light=Lighter
items.weightstone$wndbalance.heavy=Heavier
items.weightstone$wndbalance.cancel=Never mind