v0.3.4: externalized almost all item names

This commit is contained in:
Evan Debenham
2015-12-31 23:49:49 -05:00
committed by Evan Debenham
parent 0ca46e72cc
commit c1aca208b4
144 changed files with 191 additions and 337 deletions
@@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.*;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
@@ -90,7 +91,7 @@ public class Armor extends EquipableItem {
actions.add(isEquipped(hero) ? AC_UNEQUIP : AC_EQUIP);
return actions;
}
@Override
public boolean doEquip( Hero hero ) {
@@ -347,11 +348,11 @@ public class Armor extends EquipableItem {
public abstract int proc( Armor armor, Char attacker, Char defender, int damage );
public String name() {
return name( "glyph" );
return name( Messages.get(this, "glyph") );
}
public String name( String armorName ) {
return armorName;
return Messages.get(this, "name", armorName);
}
@Override
@@ -370,7 +371,7 @@ public class Armor extends EquipableItem {
if (!owner.isAlive() && owner instanceof Hero) {
Dungeon.fail( Utils.format( ResultDescriptions.GLYPH, name() ) );
GLog.n( "%s killed you...", name() );
GLog.n( Messages.get(this, "killed", name()) );
Badges.validateDeathFromGlyph();
return true;
@@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class ClothArmor extends Armor {
{
name = "cloth armor";
image = ItemSpriteSheet.ARMOR_CLOTH;
bones = false; //Finding them in bones would be semi-frequent and disappointing.
@@ -42,7 +42,6 @@ public class HuntressArmor extends ClassArmor {
private static final String AC_SPECIAL = "SPECTRAL BLADES";
{
name = "huntress cloak";
image = ItemSpriteSheet.ARMOR_HUNTRESS;
}
@@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class LeatherArmor extends Armor {
{
name = "leather armor";
image = ItemSpriteSheet.ARMOR_LEATHER;
}
@@ -42,7 +42,6 @@ public class MageArmor extends ClassArmor {
private static final String TXT_NOT_MAGE = "Only mages can use this armor!";
{
name = "mage robe";
image = ItemSpriteSheet.ARMOR_MAGE;
}
@@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class MailArmor extends Armor {
{
name = "mail armor";
image = ItemSpriteSheet.ARMOR_MAIL;
}
@@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class PlateArmor extends Armor {
{
name = "plate armor";
image = ItemSpriteSheet.ARMOR_PLATE;
}
@@ -46,7 +46,6 @@ public class RogueArmor extends ClassArmor {
private static final String AC_SPECIAL = "SMOKE BOMB";
{
name = "rogue garb";
image = ItemSpriteSheet.ARMOR_ROGUE;
}
@@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class ScaleArmor extends Armor {
{
name = "scale armor";
image = ItemSpriteSheet.ARMOR_SCALE;
}
@@ -49,7 +49,6 @@ public class WarriorArmor extends ClassArmor {
private static final String TXT_NOT_WARRIOR = "Only warriors can use this armor!";
{
name = "warrior suit of armor";
image = ItemSpriteSheet.ARMOR_WARRIOR;
}
@@ -33,8 +33,6 @@ import com.watabou.utils.GameMath;
import com.watabou.utils.Random;
public class Affection extends Glyph {
private static final String TXT_AFFECTION = "%s of affection";
private static ItemSprite.Glowing PINK = new ItemSprite.Glowing( 0xFF4488 );
@@ -58,11 +56,6 @@ public class Affection extends Glyph {
return damage;
}
@Override
public String name( String weaponName) {
return String.format( TXT_AFFECTION, weaponName );
}
@Override
public Glowing glowing() {
@@ -35,8 +35,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
import com.watabou.utils.Random;
public class AntiEntropy extends Glyph {
private static final String TXT_ANTI_ENTROPY = "%s of anti-entropy";
private static ItemSprite.Glowing BLUE = new ItemSprite.Glowing( 0x0000FF );
@@ -57,11 +55,6 @@ public class AntiEntropy extends Glyph {
return damage;
}
@Override
public String name( String weaponName) {
return String.format( TXT_ANTI_ENTROPY, weaponName );
}
@Override
public Glowing glowing() {
@@ -31,8 +31,6 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.watabou.utils.Random;
public class Bounce extends Glyph {
private static final String TXT_BOUNCE = "%s of bounce";
@Override
public int proc( Armor armor, Char attacker, Char defender, int damage) {
@@ -68,10 +66,5 @@ public class Bounce extends Glyph {
return damage;
}
@Override
public String name( String weaponName) {
return String.format( TXT_BOUNCE, weaponName );
}
}
@@ -32,8 +32,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
import com.watabou.utils.Random;
public class Displacement extends Glyph {
private static final String TXT_DISPLACEMENT = "%s of displacement";
private static ItemSprite.Glowing BLUE = new ItemSprite.Glowing( 0x66AAFF );
@@ -59,11 +57,6 @@ public class Displacement extends Glyph {
return damage;
}
@Override
public String name( String weaponName) {
return String.format( TXT_DISPLACEMENT, weaponName );
}
@Override
public Glowing glowing() {
@@ -34,8 +34,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
import com.watabou.utils.Random;
public class Entanglement extends Glyph {
private static final String TXT_ENTANGLEMENT = "%s of entanglement";
private static ItemSprite.Glowing GREEN = new ItemSprite.Glowing( 0x448822 );
@@ -55,11 +53,6 @@ public class Entanglement extends Glyph {
return damage;
}
@Override
public String name( String weaponName) {
return String.format( TXT_ENTANGLEMENT, weaponName );
}
@Override
public Glowing glowing() {
@@ -32,8 +32,6 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Random;
public class Metabolism extends Glyph {
private static final String TXT_METABOLISM = "%s of metabolism";
private static ItemSprite.Glowing RED = new ItemSprite.Glowing( 0xCC0000 );
@@ -64,11 +62,6 @@ public class Metabolism extends Glyph {
return damage;
}
@Override
public String name( String weaponName) {
return String.format( TXT_METABOLISM, weaponName );
}
@Override
public Glowing glowing() {
@@ -36,8 +36,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
import com.watabou.utils.Random;
public class Multiplicity extends Glyph {
private static final String TXT_MULTIPLICITY = "%s of multiplicity";
private static ItemSprite.Glowing PINK = new ItemSprite.Glowing( 0xCCAA88 );
@@ -71,11 +69,6 @@ public class Multiplicity extends Glyph {
return damage;
}
@Override
public String name( String weaponName) {
return String.format( TXT_MULTIPLICITY, weaponName );
}
@Override
public Glowing glowing() {
@@ -33,8 +33,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
import com.watabou.utils.Random;
public class Potential extends Glyph {
private static final String TXT_POTENTIAL = "%s of potential";
private static ItemSprite.Glowing BLUE = new ItemSprite.Glowing( 0x66CCEE );
@@ -61,11 +59,6 @@ public class Potential extends Glyph {
return damage;
}
@Override
public String name( String weaponName) {
return String.format( TXT_POTENTIAL, weaponName );
}
@Override
public Glowing glowing() {
@@ -32,8 +32,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
import com.watabou.utils.Random;
public class Stench extends Glyph {
private static final String TXT_STENCH = "%s of stench";
private static ItemSprite.Glowing GREEN = new ItemSprite.Glowing( 0x22CC44 );
@@ -51,11 +49,6 @@ public class Stench extends Glyph {
return damage;
}
@Override
public String name( String weaponName) {
return String.format( TXT_STENCH, weaponName );
}
@Override
public Glowing glowing() {
return GREEN;
@@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor.Glyph;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
@@ -37,8 +38,6 @@ import com.watabou.utils.Bundle;
import com.watabou.utils.Random;
public class Viscosity extends Glyph {
private static final String TXT_VISCOSITY = "%s of viscosity";
private static ItemSprite.Glowing PURPLE = new ItemSprite.Glowing( 0x8844CC );
@@ -60,7 +59,7 @@ public class Viscosity extends Glyph {
}
debuff.prolong( damage );
defender.sprite.showStatus( CharSprite.WARNING, "deferred %d", damage );
defender.sprite.showStatus( CharSprite.WARNING, Messages.get(this, "deferred", damage) );
return 0;
@@ -68,11 +67,6 @@ public class Viscosity extends Glyph {
return damage;
}
}
@Override
public String name( String weaponName) {
return String.format( TXT_VISCOSITY, weaponName );
}
@Override
public Glowing glowing() {
@@ -119,7 +113,7 @@ public class Viscosity extends Glyph {
@Override
public String toString() {
return Utils.format( "Defered damage", damage );
return Messages.get(this, "name");
}
@Override
@@ -131,7 +125,7 @@ public class Viscosity extends Glyph {
Glyph glyph = new Viscosity();
Dungeon.fail( Utils.format( ResultDescriptions.GLYPH, glyph.name() ) );
GLog.n( "%s killed you...", glyph.name() );
GLog.n( Messages.get(Glyph.class, "killed", glyph.name()) );
Badges.validateDeathFromGlyph();
}
@@ -152,12 +146,7 @@ public class Viscosity extends Glyph {
@Override
public String desc() {
return "While your armor's glyph has protected you from damage, it seems to be slowly paying you back for it.\n" +
"\n" +
"Damage is being dealt to you over time instead of immediately. " +
"You will take one damage per turn until there is no damage left.\n" +
"\n" +
"There is " + damage + " deffered damage left.";
return Messages.get(this, "desc", damage);
}
}
}