diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java index f7a7b97e2..e28c1e61a 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java @@ -202,31 +202,30 @@ public class Armor extends EquipableItem { @Override public String info() { - String name = name(); String info = desc(); if (levelKnown) { - info += Messages.get(Armor.class, "curr_absorb", name, Math.max( DR(), 0 )); + info += "\n\n" + Messages.get(Armor.class, "curr_absorb", Math.max( DR(), 0 )); if (STR > Dungeon.hero.STR()) { - info += Messages.get(Armor.class, "too_heavy"); + info += "\n\n" + Messages.get(Armor.class, "too_heavy"); } } else { - info += Messages.get(Armor.class, "avg_absorb", name, typicalDR(), typicalSTR()); + info += "\n\n" + Messages.get(Armor.class, "avg_absorb", typicalDR(), typicalSTR()); if (typicalSTR() > Dungeon.hero.STR()) { - info += Messages.get(Armor.class, "probably_too_heavy"); + info += "\n\n" + Messages.get(Armor.class, "probably_too_heavy"); } } if (glyph != null) { - info += Messages.get(Armor.class, "inscribed", glyph.name()); + info += "\n\n" + Messages.get(Armor.class, "inscribed", glyph.name()); } if (cursed && isEquipped( Dungeon.hero )) { - info += Messages.get(Armor.class, "cursed_word"); + info += "\n\n" + Messages.get(Armor.class, "cursed_worn"); } else if (cursedKnown && cursed) { - info += Messages.get(Armor.class, "cursed"); + info += "\n\n" + Messages.get(Armor.class, "cursed"); } return info; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java index 4fd9ba460..92e96f0ab 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java @@ -242,12 +242,12 @@ public class Ring extends KindofMisc { if (isEquipped( Dungeon.hero )) { - desc += Messages.get(Ring.class, "on_finger", name()); - if (cursed) desc += Messages.get(Ring.class, "cursed_worn"); + desc += "\n\n" + Messages.get(Ring.class, "on_finger", name()); + if (cursed) desc += " " + Messages.get(Ring.class, "cursed_worn"); } else if (cursed && cursedKnown) { - desc += Messages.get(Ring.class, "curse_known", name()); + desc += "\n\n" + Messages.get(Ring.class, "curse_known", name()); } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java index 687b5e164..62b2f9e20 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java @@ -179,7 +179,7 @@ public abstract class Wand extends Item { @Override public String info() { return (cursed && cursedKnown) ? - desc() + Messages.get(Wand.class, "cursed") : + desc() + "\n\n" + Messages.get(Wand.class, "cursed") : desc(); } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java index cf684483b..4636fb1c6 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java @@ -44,10 +44,6 @@ abstract public class Weapon extends KindOfWeapon { private static final int HITS_TO_KNOW = 20; - 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_INCOMPATIBLE = - "Interaction of different types of magic has negated the enchantment on this weapon!"; private static final String TXT_TO_STRING = "%s :%d"; public int STR = 10; @@ -73,7 +69,7 @@ abstract public class Weapon extends KindOfWeapon { if (!levelKnown) { if (--hitsToKnow <= 0) { levelKnown = true; - GLog.i( TXT_IDENTIFY, name(), toString() ); + GLog.i( Messages.get(Weapon.class, "identify", name(), toString()) ); Badges.validateItemLevelAquired( this ); } } @@ -167,7 +163,7 @@ abstract public class Weapon extends KindOfWeapon { public Item upgrade( boolean enchant ) { if (enchantment != null) { if (!enchant && Random.Int( level() ) > 0) { - GLog.w( TXT_INCOMPATIBLE ); + GLog.w( Messages.get(Weapon.class, "incompatible") ); enchant( null ); } } else { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/BattleAxe.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/BattleAxe.java index f9f87ce2a..ab3e38f94 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/BattleAxe.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/BattleAxe.java @@ -31,9 +31,5 @@ public class BattleAxe extends MeleeWeapon { public BattleAxe() { super( 4, 1.2f, 1f ); } - - @Override - public String desc() { - return "The enormous steel head of this battle axe puts considerable heft behind each stroke."; - } + } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Dagger.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Dagger.java index 2527a478e..a37722ec6 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Dagger.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Dagger.java @@ -31,9 +31,5 @@ public class Dagger extends MeleeWeapon { public Dagger() { super( 1, 1.2f, 1f ); } - - @Override - public String desc() { - return "A simple iron dagger with a well worn wooden handle."; - } + } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Glaive.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Glaive.java index a33ef02cd..fe04fe8f8 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Glaive.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Glaive.java @@ -31,9 +31,5 @@ public class Glaive extends MeleeWeapon { public Glaive() { super( 5, 1f, 1f ); } - - @Override - public String desc() { - return "A polearm consisting of a sword blade on the end of a pole."; - } + } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Knuckles.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Knuckles.java index 2a32aa823..eb11275bb 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Knuckles.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Knuckles.java @@ -31,9 +31,5 @@ public class Knuckles extends MeleeWeapon { public Knuckles() { super( 1, 1f, 0.5f ); } - - @Override - public String desc() { - return "A piece of iron shaped to fit around the knuckles."; - } + } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Longsword.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Longsword.java index 546ae227f..277f3b504 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Longsword.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Longsword.java @@ -31,9 +31,5 @@ public class Longsword extends MeleeWeapon { public Longsword() { super( 4, 1f, 1f ); } - - @Override - public String desc() { - return "This towering blade inflicts heavy damage by investing its heft into every cut."; - } + } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Mace.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Mace.java index 30f1750d6..c5ef4da13 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Mace.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Mace.java @@ -31,9 +31,5 @@ public class Mace extends MeleeWeapon { public Mace() { super( 3, 1f, 0.8f ); } - - @Override - public String desc() { - return "The iron head of this weapon inflicts substantial damage."; - } + } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MagesStaff.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MagesStaff.java index 71e17cecf..92ddf458b 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MagesStaff.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MagesStaff.java @@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade; import com.shatteredpixel.shatteredpixeldungeon.items.wands.*; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -52,12 +53,9 @@ public class MagesStaff extends MeleeWeapon { public static final String AC_IMBUE = "IMBUE"; public static final String AC_ZAP = "ZAP"; - private static final String TXT_SELECT_WAND = "Select a wand to consume"; - private static final float STAFF_SCALE_FACTOR = 0.75f; { - name = "mage's staff"; image = ItemSpriteSheet.MAGES_STAFF; defaultAction = AC_ZAP; @@ -86,7 +84,7 @@ public class MagesStaff extends MeleeWeapon { this.wand = wand; wand.maxCharges = Math.min(wand.maxCharges + 1, 10); wand.curCharges = wand.maxCharges; - name = wand.name().replace("Wand", "Staff"); + name = wand.name().replace(Messages.get(this, "wand"), Messages.get(this, "staff")); } @Override @@ -109,7 +107,7 @@ public class MagesStaff extends MeleeWeapon { if (action.equals(AC_IMBUE)) { curUser = hero; - GameScene.selectItem(itemSelector, WndBag.Mode.WAND, TXT_SELECT_WAND); + GameScene.selectItem(itemSelector, WndBag.Mode.WAND, Messages.get(this, "prompt")); } else if (action.equals(AC_ZAP)){ if (wand == null) @@ -151,10 +149,10 @@ public class MagesStaff extends MeleeWeapon { this.wand = null; - GLog.p("You imbue your staff with the " + wand.name()); + GLog.p( Messages.get(this, "imbue", wand.name())); if (enchantment != null) { - GLog.w("The conflicting magics erase the enchantment on your staff."); + GLog.w( Messages.get(this, "conflict") ); enchant(null); } @@ -180,12 +178,11 @@ public class MagesStaff extends MeleeWeapon { wand.cursed = false; wand.charge(owner); - name = wand.name().replace("Wand", "Staff"); + name = wand.name().replace(Messages.get(this, "wand"), Messages.get(this, "staff")); updateQuickslot(); return this; - } @Override @@ -259,64 +256,28 @@ 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(Messages.get(this, "wand"), Messages.get(this, "staff")); } } - @Override - public String desc() { - String result = "Crafted by the mage himself, this extraordinary staff is a one of a kind multi-purpose magical weapon.\n" + - "\n" + - "Rather than having an innate magic in it, this staff is instead imbued with magical energy from a wand, permanently granting it new power.\n" + - "\n"; - - if (wand == null) { - result += "The staff is currently a slightly magical stick, it needs a wand!"; - } else if (wand instanceof WandOfMagicMissile){ - result += "The staff radiates consistent magical energy from the wand it is imbued with."; - } else if (wand instanceof WandOfFireblast){ - result += "The staff burns and sizzles with fiery energy from the wand it is imbued with."; - } else if (wand instanceof WandOfLightning){ - result += "The staff fizzes and crackles with electrical energy from the wand it is imbued with."; - } else if (wand instanceof WandOfDisintegration){ - result += "The staff hums with deep and powerful energy from the wand it is imbued with."; - } else if (wand instanceof WandOfVenom){ - result += "The staff drips and hisses with corrosive energy from the wand it is imbued with."; - } else if (wand instanceof WandOfPrismaticLight){ - result += "The staff glows and shimmers with bright energy from the wand it is imbued with."; - } else if (wand instanceof WandOfFrost){ - result += "The staff chills the air with the cold energy from the wand it is imbued with."; - } else if (wand instanceof WandOfBlastWave){ - result += "The staff pops and crackles with explosive energy from the wand it is imbued with."; - } else if (wand instanceof WandOfRegrowth){ - result += "The staff flourishes and grows with natural energy from the wand it is imbued with."; - } else if (wand instanceof WandOfTransfusion){ - result += "The staff courses and flows with life energy from the wand it is imbued with."; - } - - return result; - } - private final WndBag.Listener itemSelector = new WndBag.Listener() { @Override public void onSelect( final Item item ) { if (item != null) { if (!item.isIdentified()) { - GLog.w("You'll need to identify this wand first."); + GLog.w(Messages.get(this, "id_first")); return; } else if (item.cursed){ - GLog.w("You can't use a cursed wand."); + GLog.w(Messages.get(this, "cursed")); return; } GameScene.show( new WndOptions("", - "Are you sure you want to imbue your staff with this " + item.name() + "?\n\n" + - "Your staff will inherit the highest level between it and the wand, " + - "and all magic currently affecting the staff will be lost.", - "Yes, i'm sure.", - "No, I changed my mind") { + Messages.get(this, "warning"), + Messages.get(this, "yes"), + Messages.get(this, "no")) { @Override protected void onSelect(int index) { if (index == 0) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java index 79cad20e4..7efd4977c 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java @@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.utils.Utils; import com.watabou.utils.Random; @@ -88,87 +89,49 @@ public class MeleeWeapon extends Weapon { @Override public String info() { String name = name(); - final String p = "\n\n"; - StringBuilder info = new StringBuilder( desc() ); - - String quality = levelKnown && level() != 0 ? (level() > 0 ? "upgraded" : "degraded") : ""; - info.append( p ); - info.append( "This " + name + " is " + Utils.indefinite( quality ) ); - info.append( " tier-" + tier + " melee weapon. " ); + String info = desc(); + + info += "\n\n" + Messages.get(MeleeWeapon.class, "tier", tier); if (levelKnown) { int min = min(); int max = max(); - info.append( "Its average damage is " + - Math.round((min + (max - min) / 2)*(imbue == Imbue.LIGHT ? 0.7f : (imbue == Imbue.HEAVY ? 1.5f : 1))) - + " points per hit. " ); + 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)); } else { int min = minBase(); int max = maxBase(); - info.append( - "Its typical average damage is " + (min + (max - min) / 2) + " points per hit " + - "and usually it requires " + typicalSTR() + " points of strength. " ); + info += " " + Messages.get(MeleeWeapon.class, "unknown", (min + (max - min) / 2), typicalSTR()); if (typicalSTR() > Dungeon.hero.STR()) { - info.append( "Probably this weapon is too heavy for you. " ); + info += " " + Messages.get(MeleeWeapon.class, "probably_too_heavy"); } } - - if (DLY != 1f) { - info.append( "This is a rather " + (DLY < 1f ? "fast" : "slow") ); - if (ACU != 1f) { - if ((ACU > 1f) == (DLY < 1f)) { - info.append( " and "); - } else { - info.append( " but "); - } - info.append( ACU > 1f ? "accurate" : "inaccurate" ); - } - info.append( " weapon. "); - } else if (ACU != 1f) { - info.append( "This is a rather " + (ACU > 1f ? "accurate" : "inaccurate") + " weapon. " ); - } + switch (imbue) { case LIGHT: - info.append( "It was balanced to be lighter. " ); + info += " " + Messages.get(Weapon.class, "lighter"); break; case HEAVY: - info.append( "It was balanced to be heavier. " ); + info += " " + Messages.get(Weapon.class, "heavier"); break; case NONE: } - - if (enchantment != null) { - info.append( "It is enchanted." ); + + String stats_desc = Messages.get(this, "stats_desc"); + if (!stats_desc.equals("")) info+= "\n\n" + stats_desc; + + if (levelKnown && STR > Dungeon.hero.STR()) { + info += "\n\n" + Messages.get(Weapon.class, "too_heavy"); + } + + if (cursed && isEquipped( Dungeon.hero )) { + info += "\n\n" + Messages.get(MeleeWeapon.class, "cursed_worn"); + } else if (cursedKnown && cursed) { + info += "\n\n" + Messages.get(MeleeWeapon.class, "cursed"); } - if (levelKnown && Dungeon.hero.belongings.backpack.items.contains( this )) { - if (STR > Dungeon.hero.STR()) { - info.append( p ); - info.append( - "Because of your inadequate strength the accuracy and speed " + - "of your attack with this " + name + " is decreased." ); - } - if (STR < Dungeon.hero.STR()) { - info.append( p ); - info.append( - "Because of your excess strength the damage " + - "of your attack with this " + name + " is increased." ); - } - } - - if (isEquipped( Dungeon.hero )) { - info.append( p ); - info.append( "You hold the " + name + " at the ready" + - (cursed ? ", and because it is cursed, you are powerless to let go." : ".") ); - } else { - if (cursedKnown && cursed) { - info.append( p ); - info.append( "You can feel a malevolent magic lurking within the " + name +"." ); - } - } - - return info.toString(); + return info; } @Override diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Quarterstaff.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Quarterstaff.java index f7c82c701..297881c9f 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Quarterstaff.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Quarterstaff.java @@ -31,9 +31,5 @@ public class Quarterstaff extends MeleeWeapon { public Quarterstaff() { super( 2, 1f, 1f ); } - - @Override - public String desc() { - return "A staff of hardwood, its ends are shod with iron."; - } + } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/ShortSword.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/ShortSword.java index e38df3db8..4a6f2ec30 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/ShortSword.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/ShortSword.java @@ -99,12 +99,6 @@ public class ShortSword extends MeleeWeapon { } } - @Override - public String desc() { - return - "It is indeed quite short, just a few inches longer, than a dagger."; - } - private final WndBag.Listener itemSelector = new WndBag.Listener() { @Override public void onSelect( Item item ) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Spear.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Spear.java index 60421217e..82b7b3112 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Spear.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Spear.java @@ -31,9 +31,5 @@ public class Spear extends MeleeWeapon { public Spear() { super( 2, 1f, 1.5f ); } - - @Override - public String desc() { - return "A slender wooden rod tipped with sharpened iron."; - } + } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Sword.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Sword.java index 83e9d26ba..7ce857c84 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Sword.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Sword.java @@ -31,9 +31,5 @@ public class Sword extends MeleeWeapon { public Sword() { super( 3, 1f, 1f ); } - - @Override - public String desc() { - return "The razor-sharp length of steel blade shines reassuringly."; - } + } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/WarHammer.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/WarHammer.java index 6b92ebbd1..ed16fd0b1 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/WarHammer.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/WarHammer.java @@ -31,11 +31,5 @@ public class WarHammer extends MeleeWeapon { public WarHammer() { super( 5, 1.2f, 1f ); } - - @Override - public String desc() { - return - "Few creatures can withstand the crushing blow of this towering mass of lead and steel, " + - "but only the strongest of adventurers can use it effectively."; - } + } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Boomerang.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Boomerang.java index d97efd5b4..dd862aec5 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Boomerang.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Boomerang.java @@ -24,6 +24,8 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.MissileSprite; @@ -113,14 +115,13 @@ public class Boomerang extends MissileWeapon { @Override public String desc() { - String info = - "Thrown to the enemy this flat curved wooden missile will return to the hands of its thrower."; + String info = super.desc(); switch (imbue) { case LIGHT: - info += "\n\nIt was balanced to be lighter. "; + info += "\n\n" + Messages.get(Weapon.class, "lighter"); break; case HEAVY: - info += "\n\nIt was balanced to be heavier. "; + info += "\n\n" + Messages.get(Weapon.class, "heavier"); break; case NONE: } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/CurareDart.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/CurareDart.java index 36edaf1cc..424226875 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/CurareDart.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/CurareDart.java @@ -62,13 +62,6 @@ public class CurareDart extends MissileWeapon { super.proc( attacker, defender, damage ); } - @Override - public String desc() { - return - "These little evil darts don't do much damage but they can paralyze " + - "the target leaving it helpless and motionless for some time."; - } - @Override public Item random() { quantity = Random.Int( 2, 5 ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Dart.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Dart.java index cb5765adb..689bad2b1 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Dart.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Dart.java @@ -51,13 +51,6 @@ public class Dart extends MissileWeapon { quantity = number; } - @Override - public String desc() { - return - "These simple metal spikes are weighted to fly true and " + - "sting their prey with a flick of the wrist."; - } - @Override public Item random() { quantity = Random.Int( 5, 15 ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/IncendiaryDart.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/IncendiaryDart.java index 1dc04ef98..e4b0c320e 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/IncendiaryDart.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/IncendiaryDart.java @@ -76,13 +76,6 @@ public class IncendiaryDart extends MissileWeapon { super.proc( attacker, defender, damage ); } - @Override - public String desc() { - return - "The spike on each of these darts is designed to pin it to its target " + - "while the unstable compounds strapped to its length burst into brilliant flames."; - } - @Override public Item random() { quantity = Random.Int( 3, 6 ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Javelin.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Javelin.java index 14c682fd6..abdb576c5 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Javelin.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Javelin.java @@ -60,13 +60,6 @@ public class Javelin extends MissileWeapon { Buff.prolong( defender, Cripple.class, Cripple.DURATION ); } - @Override - public String desc() { - return - "This length of metal is weighted to keep the spike " + - "at its tip foremost as it sails through the air."; - } - @Override public Item random() { quantity = Random.Int( 5, 15 ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java index d6ea3dfdd..87c822f7e 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java @@ -32,18 +32,13 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfSharpshooting; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; import com.watabou.utils.Random; abstract public class MissileWeapon extends Weapon { - private static final String TXT_MISSILES = "Missile weapon"; - private static final String TXT_YES = "Yes, I know what I'm doing"; - private static final String TXT_NO = "No, I changed my mind"; - private static final String TXT_R_U_SURE = - "Do you really want to equip it as a melee weapon?"; - { stackable = true; levelKnown = true; @@ -55,8 +50,8 @@ abstract public class MissileWeapon extends Weapon { @Override public ArrayList actions( Hero hero ) { ArrayList actions = super.actions( hero ); - if (hero.heroClass != HeroClass.HUNTRESS && hero.heroClass != HeroClass.ROGUE) { - actions.remove( AC_EQUIP ); + actions.remove( AC_EQUIP ); + if (!isEquipped( hero )) { actions.remove( AC_UNEQUIP ); } return actions; @@ -114,22 +109,6 @@ abstract public class MissileWeapon extends Weapon { } } - @Override - public boolean doEquip( final Hero hero ) { - GameScene.show( - new WndOptions( TXT_MISSILES, TXT_R_U_SURE, TXT_YES, TXT_NO ) { - @Override - protected void onSelect(int index) { - if (index == 0) { - MissileWeapon.super.doEquip( hero ); - } - }; - } - ); - - return false; - } - @Override public Item random() { return this; @@ -148,30 +127,16 @@ abstract public class MissileWeapon extends Weapon { @Override public String info() { - String name = name(); - StringBuilder info = new StringBuilder( desc() ); + String info = desc(); - info.append( "\n\nAverage damage of this weapon equals to " + (min() + (max() - min()) / 2) + " points per hit. " ); - - if (Dungeon.hero.belongings.backpack.items.contains( this )) { - if (STR > Dungeon.hero.STR()) { - info.append( - "\n\nBecause of your inadequate strength the accuracy and speed " + - "of your attack with this " + name + " is decreased." ); - } - if (STR < Dungeon.hero.STR() && Dungeon.hero.heroClass == HeroClass.HUNTRESS) { - info.append( - "\n\nBecause of your excess strength the damage " + - "of your attack with this " + name + " is increased." ); - } + info += "\n\n" + Messages.get( Weapon.class, "avg_dmg",(min() + (max() - min()) / 2)); + + if (STR > Dungeon.hero.STR()) { + info += Messages.get(Weapon.class, "too_heavy"); } - info.append( "\n\nAs this weapon is designed to be used at a distance, it is much less accurate if used at melee range."); + info += "\n\n" + Messages.get(MissileWeapon.class, "distance"); - if (isEquipped( Dungeon.hero )) { - info.append( "\n\nYou hold the " + name + " at the ready." ); - } - - return info.toString(); + return info; } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Shuriken.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Shuriken.java index 551aa1d0b..f218cb0ff 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Shuriken.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Shuriken.java @@ -53,13 +53,6 @@ public class Shuriken extends MissileWeapon { quantity = number; } - @Override - public String desc() { - return - "Star-shaped pieces of metal with razor-sharp blades do significant damage " + - "when they hit a target. They can be thrown at very high rate."; - } - @Override public Item random() { quantity = Random.Int( 5, 15 ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Tamahawk.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Tamahawk.java index df0a9633b..98bba16a2 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Tamahawk.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Tamahawk.java @@ -60,13 +60,6 @@ public class Tamahawk extends MissileWeapon { Buff.affect( defender, Bleeding.class ).set( damage ); } - @Override - public String desc() { - return - "This throwing axe is not that heavy, but it still " + - "requires significant strength to be used effectively."; - } - @Override public Item random() { quantity = Random.Int( 5, 12 ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/messages/messages.properties b/src/com/shatteredpixel/shatteredpixeldungeon/messages/messages.properties index b75dc6f94..f85dc7c80 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/messages/messages.properties +++ b/src/com/shatteredpixel/shatteredpixeldungeon/messages/messages.properties @@ -415,13 +415,13 @@ items.armor.glyphs.viscosity$defereddamage.desc=While your armor's glyph has pro items.armor.armor.equip_cursed=your %s 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=\n\nThis %s provides damage absorption up to %s points per attack. -items.armor.armor.avg_absorb=\n\nTypical %s provides damage absorption up to %d points per attack and requires %d points of strength. -items.armor.armor.too_heavy=\n\nBecause of your inadequate strength wearing this armor will decrease your movement speed and defense skill. -items.armor.armor.probably_too_heavy=\n\nProbably this armor is too heavy for you. -items.armor.armor.inscribed=\n\nIt is inscribed with a %s. -items.armor.armor.cursed_word=\n\nBecause this armor is cursed, you are powerless to remove it. -items.armor.armor.cursed=\n\nYou can feel a malevolent magic lurking within 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.probably_too_heavy=Probably this armor is too heavy for you. +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$glyph.glyph=glyph items.armor.armor$glyph.killed=%s killed you... items.armor.classarmor.low_hp=Your health is too low! @@ -632,9 +632,9 @@ items.rings.ring.unknown_name=%s ring items.rings.ring.unknown_desc=This metal band is adorned with a large %s gem that glitters in the darkness. Who knows what effect it has when worn? items.rings.ring.known=This is a %s items.rings.ring.identify=You are now familiar enough with your %s to identify it. It is %s. -items.rings.ring.on_finger=\n\nThe %s is on your finger. +items.rings.ring.on_finger=The %s is on your finger. items.rings.ring.cursed_worn=Because it is cursed, you are powerless to remove it. -items.rings.ring.curse_known=\n\nYou can feel a malevolent magic lurking within the %s. +items.rings.ring.curse_known=You can feel a malevolent magic lurking within the %s. items.rings.ring.unequip_title=Unequip one item items.rings.ring.unequip_message=You can only wear two misc items at a time. items.rings.ringofaccuracy.name=ring of accuracy @@ -743,7 +743,7 @@ items.wands.cursedwand.transmogrify=your wand transmogrifies into a different it items.wands.wand.fizzles=your wand fizzles; it must not have enough charge. items.wands.wand.self_target=You can't target yourself items.wands.wand.identify=You are now familiar with your %s. -items.wands.wand.cursed=\n\nThis wand is cursed, making its magic chaotic and random. +items.wands.wand.cursed=This wand is cursed, making its magic chaotic and random. items.wands.wand.curse_discover=This %s is cursed! items.wands.wand.prompt=Choose a location to zap items.wands.wandofblastwave.name=wand of blast wave @@ -791,24 +791,72 @@ items.weapon.enchantment.poison.name=venomous %s items.weapon.enchantment.shock.name=shocking %s items.weapon.enchantment.slow.name=chilling %s items.weapon.melee.battleaxe.name=battle axe +items.weapon.melee.battleaxe.stats_desc=This is a rather accurate weapon. +items.weapon.melee.battleaxe.desc=The enormous steel head of this battle axe puts considerable heft behind each stroke. items.weapon.melee.dagger.name=dagger +items.weapon.melee.dagger.stats_desc=This is a rather accurate weapon. +items.weapon.melee.dagger.desc=A simple iron dagger with a well worn wooden handle. items.weapon.melee.glaive.name=glaive +items.weapon.melee.glaive.desc=A polearm consisting of a sword blade on the end of a pole. items.weapon.melee.knuckles.name=knuckleduster +items.weapon.melee.knuckles.stats_desc=This is a rather fast weapon. +items.weapon.melee.knuckles.desc=A piece of iron shaped to fit around the knuckles. items.weapon.melee.longsword.name=longsword +items.weapon.melee.longsword.desc=This towering blade inflicts heavy damage by investing its heft into every cut. items.weapon.melee.mace.name=mace -#items.weapon.melee.magesstaff.name= +items.weapon.melee.mace.stats_desc=This is a slightly fast weapon. +items.weapon.melee.mace.desc=The iron head of this weapon inflicts substantial damage. +items.weapon.melee.magesstaff.name=mage's staff +items.weapon.melee.magesstaff.wand=wand +items.weapon.melee.magesstaff.staff=staff +items.weapon.melee.magesstaff.prompt=Select a wand to consume +items.weapon.melee.magesstaff.imbue=You imbue your staff with the %s. +items.weapon.melee.magesstaff.conflict=The conflicting magics erase the enchantment on your staff. +items.weapon.melee.magesstaff.id_first=You'll need to identify this wand first. +items.weapon.melee.magesstaff.cursed=You can't use a cursed wand. +items.weapon.melee.magesstaff.warning=Are you sure you want to imbue your staff with this wand?\n\nYour staff will inherit the highest level between it and the wand, and all magic currently affecting the staff will be lost. +items.weapon.melee.magesstaff.yes=Yes, I'm sure. +items.weapon.melee.magesstaff.no=No, I changed my mind +items.weapon.melee.magesstaff.desc=Crafted by the mage himself, this extraordinary staff is a one of a kind multi-purpose 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.meleeweapon.tier=This 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.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. +items.weapon.melee.meleeweapon.cursed=You can feel a malevolent magic lurking within this weapon. items.weapon.melee.quarterstaff.name=quarterstaff +items.weapon.melee.quarterstaff.desc=A staff of hardwood, its ends are shod with iron. items.weapon.melee.shortsword.name=short sword +items.weapon.melee.shortsword.desc=It is indeed quite short, just a few inches longer, than a dagger. items.weapon.melee.spear.name=spear +items.weapon.melee.spear.stats_desc=This is a rather slow weapon. +items.weapon.melee.spear.desc=A slender wooden rod tipped with sharpened iron. items.weapon.melee.sword.name=sword +items.weapon.melee.sword.desc=The razor-sharp length of steel blade shines reassuringly. items.weapon.melee.warhammer.name=war hammer +items.weapon.melee.warhammer.stats_desc=This is a rather accurate weapon. +items.weapon.melee.warhammer.desc=Few creatures can withstand the crushing blow of this towering mass of lead and steel, but only the strongest of adventurers can use it effectively. items.weapon.missiles.boomerang.name=boomerang +items.weapon.missiles.boomerang.desc=Thrown to the enemy this flat curved wooden missile will return to the hands of its thrower. items.weapon.missiles.curaredart.name=curare dart +items.weapon.missiles.curaredart.desc=These little evil darts don't do much damage but they can paralyze the target leaving it helpless and motionless for some time. items.weapon.missiles.dart.name=dart -items.weapon.weapon.missiles.incendiarydart.name=incendiary dart +items.weapon.missiles.dart.desc=These simple metal spikes are weighted to fly true and sting their prey with a flick of the wrist. +items.weapon.missiles.incendiarydart.name=incendiary dart +items.weapon.missiles.incendiarydart.desc=The spike on each of these darts is designed to pin it to its target while the unstable compounds strapped to its length burst into brilliant flames. 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.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 +items.weapon.missiles.shuriken.desc=Star-shaped pieces of metal with razor-sharp blades do significant damage when they hit a target. They can be thrown at very high rate. items.weapon.missiles.tamahawk.name=tomahawk +items.weapon.missiles.tamahawk.desc=This throwing axe is not that heavy, but it still requires significant strength to be used effectively. +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. +items.weapon.weapon.heavier=It was balanced to be heavier. items.amulet.name=amulet of yendor items.ankh.name=ankh