v0.3.4: externalized armor strings
This commit is contained in:
committed by
Evan Debenham
parent
fb2c6e3307
commit
26b5fd7ac4
@@ -43,15 +43,8 @@ public class Armor extends EquipableItem {
|
||||
|
||||
private static final int HITS_TO_KNOW = 10;
|
||||
|
||||
private static final String TXT_EQUIP_CURSED = "your %s constricts around you painfully";
|
||||
|
||||
private static final String TXT_IDENTIFY = "you are now familiar enough with your %s to identify it. It is %s.";
|
||||
|
||||
private static final String TXT_TO_STRING = "%s :%d";
|
||||
|
||||
private static final String TXT_INCOMPATIBLE =
|
||||
"Interaction of different types of magic has erased the glyph on this armor!";
|
||||
|
||||
public int tier;
|
||||
|
||||
public int STR;
|
||||
@@ -104,7 +97,7 @@ public class Armor extends EquipableItem {
|
||||
cursedKnown = true;
|
||||
if (cursed) {
|
||||
equipCursed( hero );
|
||||
GLog.n( TXT_EQUIP_CURSED, toString() );
|
||||
GLog.n( Messages.get(Armor.class, "equip_cursed", toString()) );
|
||||
}
|
||||
|
||||
((HeroSprite)hero.sprite).updateArmor();
|
||||
@@ -159,7 +152,7 @@ public class Armor extends EquipableItem {
|
||||
|
||||
if (glyph != null) {
|
||||
if (!inscribe && Random.Int( level() ) > 0) {
|
||||
GLog.w( TXT_INCOMPATIBLE );
|
||||
GLog.w( Messages.get(Armor.class, "incompatible") );
|
||||
inscribe( null );
|
||||
}
|
||||
} else {
|
||||
@@ -189,7 +182,7 @@ public class Armor extends EquipableItem {
|
||||
if (!levelKnown) {
|
||||
if (--hitsToKnow <= 0) {
|
||||
levelKnown = true;
|
||||
GLog.w( TXT_IDENTIFY, name(), toString() );
|
||||
GLog.w( Messages.get(Armor.class, "identify", name(), toString()) );
|
||||
Badges.validateItemLevelAquired( this );
|
||||
}
|
||||
}
|
||||
@@ -210,49 +203,33 @@ public class Armor extends EquipableItem {
|
||||
@Override
|
||||
public String info() {
|
||||
String name = name();
|
||||
StringBuilder info = new StringBuilder( desc() );
|
||||
String info = desc();
|
||||
|
||||
if (levelKnown) {
|
||||
info.append(
|
||||
"\n\nThis " + name + " provides damage absorption up to " +
|
||||
"" + Math.max( DR(), 0 ) + " points per attack. " );
|
||||
info += Messages.get(Armor.class, "curr_absorb", name, Math.max( DR(), 0 ));
|
||||
|
||||
if (STR > Dungeon.hero.STR()) {
|
||||
|
||||
if (isEquipped( Dungeon.hero )) {
|
||||
info.append(
|
||||
"\n\nBecause of your inadequate strength your " +
|
||||
"movement speed and defense skill is decreased. " );
|
||||
} else {
|
||||
info.append(
|
||||
"\n\nBecause of your inadequate strength wearing this armor " +
|
||||
"will decrease your movement speed and defense skill. " );
|
||||
}
|
||||
|
||||
info += Messages.get(Armor.class, "too_heavy");
|
||||
}
|
||||
} else {
|
||||
info.append(
|
||||
"\n\nTypical " + name + " provides damage absorption up to " + typicalDR() + " points per attack " +
|
||||
" and requires " + typicalSTR() + " points of strength. " );
|
||||
info += Messages.get(Armor.class, "avg_absorb", name, typicalDR(), typicalSTR());
|
||||
|
||||
if (typicalSTR() > Dungeon.hero.STR()) {
|
||||
info.append( "Probably this armor is too heavy for you. " );
|
||||
info += Messages.get(Armor.class, "probably_too_heavy");
|
||||
}
|
||||
}
|
||||
|
||||
if (glyph != null) {
|
||||
info.append( "It is inscribed." );
|
||||
info += Messages.get(Armor.class, "inscribed", glyph.name());
|
||||
}
|
||||
|
||||
if (isEquipped( Dungeon.hero )) {
|
||||
info.append( "\n\nYou are wearing the " + name +
|
||||
(cursed ? ", and because it is cursed, you are powerless to remove it." : ".") );
|
||||
} else {
|
||||
if (cursedKnown && cursed) {
|
||||
info.append( "\n\nYou can feel a malevolent magic lurking within the " + name + "." );
|
||||
}
|
||||
if (cursed && isEquipped( Dungeon.hero )) {
|
||||
info += Messages.get(Armor.class, "cursed_word");
|
||||
} else if (cursedKnown && cursed) {
|
||||
info += Messages.get(Armor.class, "cursed");
|
||||
}
|
||||
|
||||
return info.toString();
|
||||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.armor;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.utils.Bundle;
|
||||
|
||||
@@ -104,9 +105,9 @@ abstract public class ClassArmor extends Armor {
|
||||
if (action == special()) {
|
||||
|
||||
if (hero.HP < 3) {
|
||||
GLog.w( TXT_LOW_HEALTH );
|
||||
GLog.w( Messages.get(this, "low_hp") );
|
||||
} else if (!isEquipped( hero )) {
|
||||
GLog.w( TXT_NOT_EQUIPPED );
|
||||
GLog.w( Messages.get(this, "not_equipped") );
|
||||
} else {
|
||||
curUser = hero;
|
||||
Invisibility.dispel();
|
||||
@@ -140,9 +141,5 @@ abstract public class ClassArmor extends Armor {
|
||||
public int price() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return "The thing looks awesome!";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,9 +33,5 @@ public class ClothArmor extends Armor {
|
||||
public ClothArmor() {
|
||||
super( 1 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return "This lightweight armor offers basic protection.";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Shuriken;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.MissileSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
@@ -36,9 +37,6 @@ import com.watabou.utils.Callback;
|
||||
|
||||
public class HuntressArmor extends ClassArmor {
|
||||
|
||||
private static final String TXT_NO_ENEMIES = "No enemies in sight";
|
||||
private static final String TXT_NOT_HUNTRESS = "Only huntresses can use this armor!";
|
||||
|
||||
private static final String AC_SPECIAL = "SPECTRAL BLADES";
|
||||
|
||||
{
|
||||
@@ -79,7 +77,7 @@ public class HuntressArmor extends ClassArmor {
|
||||
}
|
||||
|
||||
if (targets.size() == 0) {
|
||||
GLog.w( TXT_NO_ENEMIES );
|
||||
GLog.w( Messages.get(this, "no_enemies") );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -88,22 +86,5 @@ public class HuntressArmor extends ClassArmor {
|
||||
curUser.sprite.zap( curUser.pos );
|
||||
curUser.busy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doEquip( Hero hero ) {
|
||||
if (hero.heroClass == HeroClass.HUNTRESS) {
|
||||
return super.doEquip( hero );
|
||||
} else {
|
||||
GLog.w( TXT_NOT_HUNTRESS );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return
|
||||
"A huntress in such cloak can create a fan of spectral blades. Each of these blades " +
|
||||
"will target a single enemy in the huntress's field of view, inflicting damage depending " +
|
||||
"on her currently equipped melee weapon.";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -31,9 +31,5 @@ public class LeatherArmor extends Armor {
|
||||
public LeatherArmor() {
|
||||
super( 2 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return "Armor made from tanned monster hide. Not as light as cloth armor but provides better protection.";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -39,8 +39,6 @@ public class MageArmor extends ClassArmor {
|
||||
|
||||
private static final String AC_SPECIAL = "MOLTEN EARTH";
|
||||
|
||||
private static final String TXT_NOT_MAGE = "Only mages can use this armor!";
|
||||
|
||||
{
|
||||
image = ItemSpriteSheet.ARMOR_MAGE;
|
||||
}
|
||||
@@ -50,13 +48,6 @@ public class MageArmor extends ClassArmor {
|
||||
return AC_SPECIAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return
|
||||
"Wearing this gorgeous robe, a mage can cast a spell of molten earth: all the enemies " +
|
||||
"in his field of view will be set on fire and unable to move at the same time.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doSpecial() {
|
||||
|
||||
@@ -76,14 +67,5 @@ public class MageArmor extends ClassArmor {
|
||||
curUser.sprite.centerEmitter().start( ElmoParticle.FACTORY, 0.15f, 4 );
|
||||
Sample.INSTANCE.play( Assets.SND_READ );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doEquip( Hero hero ) {
|
||||
if (hero.heroClass == HeroClass.MAGE) {
|
||||
return super.doEquip( hero );
|
||||
} else {
|
||||
GLog.w( TXT_NOT_MAGE );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -32,9 +32,4 @@ public class MailArmor extends Armor {
|
||||
super( 3 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return
|
||||
"Interlocking metal links make for a tough but flexible suit of armor.";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,11 +31,5 @@ public class PlateArmor extends Armor {
|
||||
public PlateArmor() {
|
||||
super( 5 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return
|
||||
"Enormous plates of metal are joined together into a suit that provides " +
|
||||
"unmatched protection to any adventurer strong enough to bear its staggering weight.";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.armor;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
@@ -40,9 +41,6 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
|
||||
public class RogueArmor extends ClassArmor {
|
||||
|
||||
private static final String TXT_FOV = "You can only jump to an empty location in your field of view";
|
||||
private static final String TXT_NOT_ROGUE = "Only rogues can use this armor!";
|
||||
|
||||
private static final String AC_SPECIAL = "SMOKE BOMB";
|
||||
|
||||
{
|
||||
@@ -59,23 +57,6 @@ public class RogueArmor extends ClassArmor {
|
||||
GameScene.selectCell( teleporter );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doEquip( Hero hero ) {
|
||||
if (hero.heroClass == HeroClass.ROGUE) {
|
||||
return super.doEquip( hero );
|
||||
} else {
|
||||
GLog.w( TXT_NOT_ROGUE );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return
|
||||
"Wearing this dark garb, a rogue can perform a trick, that is called \"smoke bomb\" " +
|
||||
"(though no real explosives are used): he blinds enemies who could see him and jumps aside.";
|
||||
}
|
||||
|
||||
protected static CellSelector.Listener teleporter = new CellSelector.Listener() {
|
||||
|
||||
@Override
|
||||
@@ -86,7 +67,7 @@ public class RogueArmor extends ClassArmor {
|
||||
!(Level.passable[target] || Level.avoid[target]) ||
|
||||
Actor.findChar( target ) != null) {
|
||||
|
||||
GLog.w( TXT_FOV );
|
||||
GLog.w( Messages.get(RogueArmor.class, "fov") );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -112,7 +93,7 @@ public class RogueArmor extends ClassArmor {
|
||||
|
||||
@Override
|
||||
public String prompt() {
|
||||
return "Choose a location to jump to";
|
||||
return Messages.get(RogueArmor.class, "prompt");
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -31,10 +31,5 @@ public class ScaleArmor extends Armor {
|
||||
public ScaleArmor() {
|
||||
super( 4 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return
|
||||
"The metal scales sewn onto a leather vest create a flexible, yet protective armor.";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.armor;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
@@ -46,8 +47,6 @@ public class WarriorArmor extends ClassArmor {
|
||||
|
||||
private static final String AC_SPECIAL = "HEROIC LEAP";
|
||||
|
||||
private static final String TXT_NOT_WARRIOR = "Only warriors can use this armor!";
|
||||
|
||||
{
|
||||
image = ItemSpriteSheet.ARMOR_WARRIOR;
|
||||
}
|
||||
@@ -62,23 +61,6 @@ public class WarriorArmor extends ClassArmor {
|
||||
GameScene.selectCell( leaper );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doEquip( Hero hero ) {
|
||||
if (hero.heroClass == HeroClass.WARRIOR) {
|
||||
return super.doEquip( hero );
|
||||
} else {
|
||||
GLog.w( TXT_NOT_WARRIOR );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return
|
||||
"While this armor looks heavy, it allows a warrior to perform heroic leap towards " +
|
||||
"a targeted location, slamming down to stun all neighbouring enemies.";
|
||||
}
|
||||
|
||||
protected static CellSelector.Listener leaper = new CellSelector.Listener() {
|
||||
|
||||
@Override
|
||||
@@ -127,7 +109,7 @@ public class WarriorArmor extends ClassArmor {
|
||||
|
||||
@Override
|
||||
public String prompt() {
|
||||
return "Choose direction to leap";
|
||||
return Messages.get(WarriorArmor.class, "prompt");
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user