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
@@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfSharpshooting;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.*;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
@@ -244,7 +245,7 @@ abstract public class Weapon extends KindOfWeapon {
public abstract boolean proc( Weapon weapon, Char attacker, Char defender, int damage );
public String name( String weaponName ) {
return weaponName;
return Messages.get(this, "name", weaponName);
}
@Override
@@ -30,8 +30,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
import com.watabou.utils.Random;
public class Death extends Weapon.Enchantment {
private static final String TXT_GRIM = "grim %s";
private static ItemSprite.Glowing BLACK = new ItemSprite.Glowing( 0x000000 );
@@ -64,10 +62,5 @@ public class Death extends Weapon.Enchantment {
public Glowing glowing() {
return BLACK;
}
@Override
public String name( String weaponName) {
return String.format( TXT_GRIM, weaponName );
}
}
@@ -31,8 +31,6 @@ import com.watabou.utils.Random;
public class Fire extends Weapon.Enchantment {
private static final String TXT_BLAZING = "blazing %s";
private static ItemSprite.Glowing ORANGE = new ItemSprite.Glowing( 0xFF4400 );
@Override
@@ -64,10 +62,4 @@ public class Fire extends Weapon.Enchantment {
public Glowing glowing() {
return ORANGE;
}
@Override
public String name( String weaponName ) {
return String.format( TXT_BLAZING, weaponName );
}
}
@@ -32,8 +32,6 @@ import com.watabou.utils.Random;
public class Horror extends Weapon.Enchantment {
private static final String TXT_ELDRITCH = "eldritch %s";
private static ItemSprite.Glowing GREY = new ItemSprite.Glowing( 0x222222 );
@Override
@@ -61,10 +59,4 @@ public class Horror extends Weapon.Enchantment {
public Glowing glowing() {
return GREY;
}
@Override
public String name( String weaponName) {
return String.format( TXT_ELDRITCH, weaponName );
}
}
@@ -26,17 +26,9 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon.Enchantment;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Boomerang;
public class Instability extends Weapon.Enchantment {
private static final String TXT_UNSTABLE = "unstable %s";
@Override
public boolean proc( Weapon weapon, Char attacker, Char defender, int damage ) {
return random().proc( weapon, attacker, defender, damage );
}
@Override
public String name( String weaponName) {
return String.format( TXT_UNSTABLE, weaponName );
}
}
@@ -30,8 +30,6 @@ import com.watabou.utils.Random;
public class Leech extends Weapon.Enchantment {
private static final String TXT_VAMPIRIC = "vampiric %s";
private static ItemSprite.Glowing RED = new ItemSprite.Glowing( 0x660022 );
@Override
@@ -62,10 +60,4 @@ public class Leech extends Weapon.Enchantment {
public Glowing glowing() {
return RED;
}
@Override
public String name( String weaponName ) {
return String.format( TXT_VAMPIRIC, weaponName );
}
}
@@ -27,8 +27,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
public class Luck extends Weapon.Enchantment {
private static final String TXT_LUCKY = "lucky %s";
private static ItemSprite.Glowing GREEN = new ItemSprite.Glowing( 0x00FF00 );
@Override
@@ -47,11 +45,6 @@ public class Luck extends Weapon.Enchantment {
return false;
}
}
@Override
public String name( String weaponName) {
return String.format( TXT_LUCKY, weaponName );
}
@Override
public Glowing glowing() {
@@ -28,8 +28,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
import com.watabou.utils.Random;
public class Paralysis extends Weapon.Enchantment {
private static final String TXT_STUNNING = "stunning %s";
private static ItemSprite.Glowing YELLOW = new ItemSprite.Glowing( 0xCCAA44 );
@@ -55,10 +53,4 @@ public class Paralysis extends Weapon.Enchantment {
public Glowing glowing() {
return YELLOW;
}
@Override
public String name( String weaponName) {
return String.format( TXT_STUNNING, weaponName );
}
}
@@ -29,8 +29,6 @@ import com.watabou.utils.Random;
public class Poison extends Weapon.Enchantment {
private static final String TXT_VENOMOUS = "venomous %s";
private static ItemSprite.Glowing PURPLE = new ItemSprite.Glowing( 0x4400AA );
@Override
@@ -55,10 +53,4 @@ public class Poison extends Weapon.Enchantment {
public Glowing glowing() {
return PURPLE;
}
@Override
public String name( String weaponName) {
return String.format( TXT_VENOMOUS, weaponName );
}
}
@@ -34,8 +34,6 @@ import com.watabou.utils.Random;
public class Shock extends Weapon.Enchantment {
private static final String TXT_SHOCKING = "shocking %s";
@Override
public boolean proc( Weapon weapon, Char attacker, Char defender, int damage ) {
// lvl 0 - 25%
@@ -62,11 +60,6 @@ public class Shock extends Weapon.Enchantment {
}
}
@Override
public String name( String weaponName ) {
return String.format( TXT_SHOCKING, weaponName );
}
private ArrayList<Char> affected = new ArrayList<>();
@@ -30,8 +30,6 @@ import com.watabou.utils.Random;
public class Slow extends Weapon.Enchantment {
private static final String TXT_CHILLING = "chilling %s";
private static ItemSprite.Glowing BLUE = new ItemSprite.Glowing( 0x0044FF );
@Override
@@ -56,10 +54,5 @@ public class Slow extends Weapon.Enchantment {
public Glowing glowing() {
return BLUE;
}
@Override
public String name( String weaponName) {
return String.format( TXT_CHILLING, weaponName );
}
}
@@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class BattleAxe extends MeleeWeapon {
{
name = "battle axe";
image = ItemSpriteSheet.BATTLE_AXE;
}
@@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Dagger extends MeleeWeapon {
{
name = "dagger";
image = ItemSpriteSheet.DAGGER;
}
@@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Glaive extends MeleeWeapon {
{
name = "glaive";
image = ItemSpriteSheet.GLAIVE;
}
@@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Knuckles extends MeleeWeapon {
{
name = "knuckleduster";
image = ItemSpriteSheet.KNUCKLEDUSTER;
}
@@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Longsword extends MeleeWeapon {
{
name = "longsword";
image = ItemSpriteSheet.LONG_SWORD;
}
@@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Mace extends MeleeWeapon {
{
name = "mace";
image = ItemSpriteSheet.MACE;
}
@@ -259,7 +259,7 @@ public class MagesStaff extends MeleeWeapon {
wand = (Wand) bundle.get(WAND);
if (wand != null) {
wand.maxCharges = Math.min(wand.maxCharges + 1, 10);
name = wand.name().replace("Wand", "Staff");
name = wand.name().replace("wand", "staff");
}
}
@@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Quarterstaff extends MeleeWeapon {
{
name = "quarterstaff";
image = ItemSpriteSheet.QUARTERSTAFF;
}
@@ -50,7 +50,6 @@ public class ShortSword extends MeleeWeapon {
private boolean equipped;
{
name = "short sword";
image = ItemSpriteSheet.SHORT_SWORD;
unique = true;
@@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Spear extends MeleeWeapon {
{
name = "spear";
image = ItemSpriteSheet.SPEAR;
}
@@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Sword extends MeleeWeapon {
{
name = "sword";
image = ItemSpriteSheet.SWORD;
}
@@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class WarHammer extends MeleeWeapon {
{
name = "war hammer";
image = ItemSpriteSheet.WAR_HAMMER;
}
@@ -30,7 +30,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.MissileSprite;
public class Boomerang extends MissileWeapon {
{
name = "boomerang";
image = ItemSpriteSheet.BOOMERANG;
STR = 10;
@@ -32,7 +32,6 @@ public class CurareDart extends MissileWeapon {
public static final float DURATION = 3f;
{
name = "curare dart";
image = ItemSpriteSheet.CURARE_DART;
STR = 14;
@@ -27,7 +27,6 @@ import com.watabou.utils.Random;
public class Dart extends MissileWeapon {
{
name = "dart";
image = ItemSpriteSheet.DART;
bones = false; //Finding them in bones would be semi-frequent and disappointing.
@@ -37,7 +37,6 @@ import com.watabou.utils.Random;
public class IncendiaryDart extends MissileWeapon {
{
name = "incendiary dart";
image = ItemSpriteSheet.INCENDIARY_DART;
STR = 12;
@@ -30,7 +30,6 @@ import com.watabou.utils.Random;
public class Javelin extends MissileWeapon {
{
name = "javelin";
image = ItemSpriteSheet.JAVELIN;
STR = 15;
@@ -27,7 +27,6 @@ import com.watabou.utils.Random;
public class Shuriken extends MissileWeapon {
{
name = "shuriken";
image = ItemSpriteSheet.SHURIKEN;
STR = 13;
@@ -30,7 +30,6 @@ import com.watabou.utils.Random;
public class Tamahawk extends MissileWeapon {
{
name = "tomahawk";
image = ItemSpriteSheet.TOMAHAWK;
STR = 17;