diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/DewVial.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/DewVial.java index 3c6043571..0d9b2db2f 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/DewVial.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/DewVial.java @@ -154,9 +154,5 @@ public class DewVial extends Item { public String status() { return Messages.format( TXT_STATUS, volume, MAX_VOLUME ); } - - @Override - public String toString() { - return super.toString() + " (" + status() + ")" ; - } + } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/Item.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/Item.java index d93edfd4c..7028eb303 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/Item.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/Item.java @@ -51,11 +51,9 @@ import java.util.Collections; import java.util.Comparator; public class Item implements Bundlable { - - private static final String TXT_TO_STRING = "%s"; + + private static final String TXT_TO_STRING_LVL = "%s %+d"; private static final String TXT_TO_STRING_X = "%s x%d"; - private static final String TXT_TO_STRING_LVL = "%s%+d"; - private static final String TXT_TO_STRING_LVL_X = "%s%+d x%d"; protected static final float TIME_TO_THROW = 1.0f; protected static final float TIME_TO_PICK_UP = 1.0f; @@ -345,20 +343,17 @@ public class Item implements Bundlable { @Override public String toString() { - - if (levelKnown && level != 0) { - if (quantity > 1) { - return Messages.format( TXT_TO_STRING_LVL_X, name(), level, quantity ); - } else { - return Messages.format( TXT_TO_STRING_LVL, name(), level ); - } - } else { - if (quantity > 1) { - return Messages.format( TXT_TO_STRING_X, name(), quantity ); - } else { - return Messages.format( TXT_TO_STRING, name() ); - } - } + + String name = name(); + + if (levelKnown && level != 0) + name = Messages.format( TXT_TO_STRING_LVL, name, level ); + + if (quantity > 1) + name = Messages.format( TXT_TO_STRING_X, name, quantity ); + + return name; + } public String name() { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java index a4d67a472..016079ced 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java @@ -254,11 +254,7 @@ public class Armor extends EquipableItem { return damage; } - - @Override - public String toString() { - return levelKnown ? Messages.format( TXT_TO_STRING, super.toString(), STRReq() ) : super.toString(); - } + @Override public String name() { @@ -270,7 +266,7 @@ public class Armor extends EquipableItem { String info = desc(); if (levelKnown) { - info += "\n\n" + Messages.get(Armor.class, "curr_absorb", Math.max( DR(), 0 )); + info += "\n\n" + Messages.get(Armor.class, "curr_absorb", DR(), STRReq()); if (STRReq() > Dungeon.hero.STR()) { info += "\n\n" + Messages.get(Armor.class, "too_heavy"); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java index 7d033632f..cbc16e403 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java @@ -33,11 +33,6 @@ import com.watabou.utils.Random; public class Artifact extends KindofMisc { - private static final String TXT_TO_STRING = "%s"; - private static final String TXT_TO_STRING_CHARGE = "%s (%d/%d)"; - private static final String TXT_TO_STRING_LVL = "%s%+d"; - private static final String TXT_TO_STRING_LVL_CHARGE = "%s%+d (%d/%d)"; - protected Buff passiveBuff; protected Buff activeBuff; @@ -139,24 +134,6 @@ public class Artifact extends KindofMisc { } } - @Override - public String toString() { - - if (levelKnown && level()/levelCap != 0) { - if (chargeCap > 0) { - return Messages.format( TXT_TO_STRING_LVL_CHARGE, name(), visiblyUpgraded(), charge, chargeCap ); - } else { - return Messages.format( TXT_TO_STRING_LVL, name(), visiblyUpgraded() ); - } - } else { - if (chargeCap > 0) { - return Messages.format( TXT_TO_STRING_CHARGE, name(), charge, chargeCap ); - } else { - return Messages.format( TXT_TO_STRING, name() ); - } - } - } - @Override public String status() { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java index d4c94aa2d..40a2d6adb 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java @@ -160,19 +160,6 @@ public abstract class Wand extends Item { return this; } - - @Override - public String toString() { - - StringBuilder sb = new StringBuilder( super.toString() ); - - String status = status(); - if (status != null) { - sb.append( " (" + status + ")" ); - } - - return sb.toString(); - } @Override public String info() { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java index b5b01da41..ba2d34bc6 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java @@ -193,11 +193,6 @@ abstract public class Weapon extends KindOfWeapon { return super.upgrade(); } - @Override - public String toString() { - return levelKnown ? Messages.format( TXT_TO_STRING, super.toString(), STRReq() ) : super.toString(); - } - @Override public String name() { return enchantment == null ? super.name() : enchantment.name( super.name() ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java index 03a13f6cc..b9bf0cd0f 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java @@ -59,21 +59,14 @@ public class MeleeWeapon extends Weapon { @Override public String info() { - String name = name(); - + String info = desc(); - info += "\n\n" + Messages.get(MeleeWeapon.class, "tier", tier); - if (levelKnown) { - int min = min(); - int max = max(); float dmgfactor = (imbue == Imbue.LIGHT ? 0.7f : imbue == Imbue.HEAVY ? 1.5f : 1); - info += " " + Messages.get(Weapon.class, "avg_dmg", Math.round((min + (max - min) / 2)*dmgfactor)); + info += "\n\n" + Messages.get(MeleeWeapon.class, "stats_known", tier, Math.round(min()*dmgfactor), Math.round(max()*dmgfactor), STRReq()); } else { - int min = min(0); - int max = max(0); - info += " " + Messages.get(MeleeWeapon.class, "unknown", (min + (max - min) / 2), STRReq(0)); + info += "\n\n" + Messages.get(MeleeWeapon.class, "stats_unknown", tier, min(0), max(0), STRReq(0)); if (STRReq(0) > Dungeon.hero.STR()) { info += " " + Messages.get(MeleeWeapon.class, "probably_too_heavy"); } @@ -89,7 +82,8 @@ public class MeleeWeapon extends Weapon { case NONE: } - String stats_desc = Messages.get(this, "stats_desc"); + //defense-granting weapons include the DR amount, otherwise the value is discarded. + String stats_desc = Messages.get(this, "stats_desc", defenceFactor(Dungeon.hero)); if (!stats_desc.equals("")) info+= "\n\n" + stats_desc; if (levelKnown && STRReq() > Dungeon.hero.STR()) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java index 674e1744c..a8bfd5b8c 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java @@ -145,10 +145,10 @@ abstract public class MissileWeapon extends Weapon { String info = desc(); - info += "\n\n" + Messages.get( Weapon.class, "avg_dmg",(min() + (max() - min()) / 2)); + info += "\n\n" + Messages.get( MissileWeapon.class, "stats", min(), max(), STRReq()); if (STRReq() > Dungeon.hero.STR()) { - info += Messages.get(Weapon.class, "too_heavy"); + info += " " + Messages.get(Weapon.class, "too_heavy"); } info += "\n\n" + Messages.get(MissileWeapon.class, "distance"); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index ec3f6552a..23015fb33 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -48,11 +48,11 @@ items.armor.armor.detach_seal=You detach the seal from your armor. items.armor.armor.equip_cursed=The armor constricts around you painfully. items.armor.armor.identify=you are now familiar enough with your %s to identify it. It is %s. items.armor.armor.incompatible=Interaction of different types of magic has erased the glyph on this armor! -items.armor.armor.curr_absorb=This armor provides damage absorption up to %d points per attack. -items.armor.armor.avg_absorb=Typically this armor provides damage absorption up to %d points per attack and requires %d points of strength. -items.armor.armor.too_heavy=Because of your inadequate strength wearing this armor will decrease your movement speed and defense skill. +items.armor.armor.curr_absorb=This armor blocks up to _%d damage_ and requires _%d strength_ to use properly. +items.armor.armor.avg_absorb=Typically this armor blocks up to _%d damage_ and requires _%d strength_ to use properly. +items.armor.armor.too_heavy=Because of your inadequate strength wearing this armor will decrease your ability to move and evade. items.armor.armor.probably_too_heavy=Probably this armor is too heavy for you. -items.armor.armor.inscribed=It is inscribed with a %s. +items.armor.armor.inscribed=It is inscribed with a _%s._ items.armor.armor.cursed_worn=Because this armor is cursed, you are powerless to remove it. items.armor.armor.cursed=You can feel a malevolent magic lurking within this armor. items.armor.armor.seal_attached=The Warrior's broken seal is attached to this armor. @@ -730,7 +730,7 @@ items.weapon.melee.greataxe.stats_desc=This weapon is incredibly heavy. items.weapon.melee.greataxe.desc=Meant to be weilded over the shoulder, this titanic axe is a powerful as it is heavy. items.weapon.melee.greatshield.name=greatshield -items.weapon.melee.greatshield.stats_desc=This weapon grants tremendous damage absorbtion. +items.weapon.melee.greatshield.stats_desc=This weapon blocks up to %d damage. items.weapon.melee.greatshield.desc=More like a mobile wall than a shield, this giantic mass of metal aids defence, but doesn't leave much room for attacking. items.weapon.melee.greatsword.name=greatsword @@ -765,8 +765,8 @@ items.weapon.melee.magesstaff.no=No, I changed my mind items.weapon.melee.magesstaff.desc=Crafted by the mage himself, this staff is a one of a kind magical weapon. Rather than having an innate magic in it, this staff is instead imbued with magical energy from a wand, granting it new power. items.weapon.melee.magesstaff.no_wand=The staff currently has no magic in it, it must be _imbued with a wand's power_ before it can be used to cast spells. -items.weapon.melee.meleeweapon.tier=This is a tier-%d melee weapon. -items.weapon.melee.meleeweapon.unknown=Its typical average damage per hit is %d and usually it requires %d points of strength. +items.weapon.melee.meleeweapon.stats_known=This _tier-%d_ melee weapon deals _%d-%d damage_ and requires _%d strength_ to use properly. +items.weapon.melee.meleeweapon.stats_unknown=Typically this _tier-%d_ melee weapon deals _%d-%d damage_ and requires _%d strength_ to use properly. items.weapon.melee.meleeweapon.probably_too_heavy=Probably this weapon is too heavy for you. items.weapon.melee.meleeweapon.stats_desc= items.weapon.melee.meleeweapon.cursed_worn=Because this weapon is cursed, you are powerless to remove it. @@ -776,11 +776,11 @@ items.weapon.melee.newshortsword.name=shortsword items.weapon.melee.newshortsword.desc=A quite short sword, only a few inches longer than a dagger. items.weapon.melee.quarterstaff.name=quarterstaff -items.weapon.melee.quarterstaff.stats_desc=This weapon grants some damage absorbtion. +items.weapon.melee.quarterstaff.stats_desc=This weapon blocks up to %d damage. items.weapon.melee.quarterstaff.desc=A staff of hardwood, its ends are shod with iron. items.weapon.melee.roundshield.name=round shield -items.weapon.melee.roundshield.stats_desc=This weapon grants considerable damage absorbtion. +items.weapon.melee.roundshield.stats_desc=This weapon blocks up to %d damage. items.weapon.melee.roundshield.desc=This large shield effectively blocks attacks and makes a decent weapon in a pinch. items.weapon.melee.runicblade.name=runic blade @@ -788,7 +788,7 @@ items.weapon.melee.runicblade.stats_desc=This weapon benefits more from upgrades items.weapon.melee.runicblade.desc=A mysterious weapon from a distant land, with a bright blue blade. items.weapon.melee.sai.name=sai -items.weapon.melee.sai.stats_desc=This is a very fast weapon.\nThis weapon grants some damage absorbtion. +items.weapon.melee.sai.stats_desc=This is a very fast weapon.\nThis weapon blocks up to %d damage. items.weapon.melee.sai.desc=Two thin blades meant to be weilded in one hand each. Excellent for parrying and swift cuts alike. items.weapon.melee.scimitar.name=scimitar @@ -830,6 +830,7 @@ items.weapon.missiles.incendiarydart.desc=The spike on each of these darts is de items.weapon.missiles.javelin.name=javelin items.weapon.missiles.javelin.desc=This length of metal is weighted to keep the spike at its tip foremost as it sails through the air. +items.weapon.missiles.missileweapon.stats=This missile weapon deals _%d-%d damage_ and requires _%d strength_ to use properly. items.weapon.missiles.missileweapon.distance=This weapon is designed to be used at a distance, it is much less accurate at melee range. items.weapon.missiles.shuriken.name=shuriken @@ -840,7 +841,6 @@ items.weapon.missiles.tamahawk.desc=This throwing axe is not that heavy, but it items.weapon.weapon.identify=You are now familiar enough with your %s to identify it. It is %s. -items.weapon.weapon.avg_dmg=Its average damage per hit is %d. items.weapon.weapon.too_heavy=Because of your inadequate strength the accuracy and speed of your attack with this weapon will be decreased. items.weapon.weapon.incompatible=Interaction of different types of magic has negated the enchantment on this weapon! items.weapon.weapon.lighter=It was balanced to be lighter.