From 969db4cf19daffc16188964d604798efff31418a Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 6 Jun 2016 03:36:12 -0400 Subject: [PATCH] v0.4.0: added descriptions for enchants --- .../items/weapon/Weapon.java | 12 +++++-- .../items/weapon/melee/MeleeWeapon.java | 32 +++++++++++-------- .../items/weapon/missiles/Boomerang.java | 1 + .../items/weapon/missiles/MissileWeapon.java | 11 +++++++ .../messages/items/items.properties | 26 +++++++++++---- 5 files changed, 60 insertions(+), 22 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java index ba2d34bc6..ecf7f0ee3 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java @@ -255,11 +255,19 @@ abstract public class Weapon extends KindOfWeapon { 2, 2, 2 }; public abstract int proc( Weapon weapon, Char attacker, Char defender, int damage ); - + + public String name() { + return name( Messages.get(this, "enchant")); + } + public String name( String weaponName ) { return Messages.get(this, "name", weaponName); } - + + public String desc() { + return Messages.get(this, "desc"); + } + @Override public void restoreFromBundle( Bundle bundle ) { } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java index b9bf0cd0f..64970ba58 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java @@ -65,6 +65,9 @@ public class MeleeWeapon extends Weapon { if (levelKnown) { float dmgfactor = (imbue == Imbue.LIGHT ? 0.7f : imbue == Imbue.HEAVY ? 1.5f : 1); info += "\n\n" + Messages.get(MeleeWeapon.class, "stats_known", tier, Math.round(min()*dmgfactor), Math.round(max()*dmgfactor), STRReq()); + if (STRReq() > Dungeon.hero.STR()) { + info += " " + Messages.get(Weapon.class, "too_heavy"); + } } else { info += "\n\n" + Messages.get(MeleeWeapon.class, "stats_unknown", tier, min(0), max(0), STRReq(0)); if (STRReq(0) > Dungeon.hero.STR()) { @@ -72,28 +75,29 @@ public class MeleeWeapon extends Weapon { } } - switch (imbue) { - case LIGHT: - info += " " + Messages.get(Weapon.class, "lighter"); - break; - case HEAVY: - info += " " + Messages.get(Weapon.class, "heavier"); - break; - case NONE: - } - //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()) { - info += "\n\n" + Messages.get(Weapon.class, "too_heavy"); + switch (imbue) { + case LIGHT: + info += "\n\n" + Messages.get(Weapon.class, "lighter"); + break; + case HEAVY: + info += "\n\n" + Messages.get(Weapon.class, "heavier"); + break; + case NONE: + } + + if (enchantment != null){ + info += "\n\n" + Messages.get(Weapon.class, "enchanted", enchantment.name()); + info += " " + Messages.get(enchantment, "desc"); } if (cursed && isEquipped( Dungeon.hero )) { - info += "\n\n" + Messages.get(MeleeWeapon.class, "cursed_worn"); + info += "\n\n" + Messages.get(Weapon.class, "cursed_worn"); } else if (cursedKnown && cursed) { - info += "\n\n" + Messages.get(MeleeWeapon.class, "cursed"); + info += "\n\n" + Messages.get(Weapon.class, "cursed"); } return info; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Boomerang.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Boomerang.java index 9ef082ebd..130e5e1fa 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Boomerang.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Boomerang.java @@ -142,6 +142,7 @@ public class Boomerang extends MissileWeapon { break; case NONE: } + return info; } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java index a8bfd5b8c..6f9e4937a 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java @@ -151,6 +151,17 @@ abstract public class MissileWeapon extends Weapon { info += " " + Messages.get(Weapon.class, "too_heavy"); } + if (enchantment != null){ + info += "\n\n" + Messages.get(Weapon.class, "enchanted", enchantment.name()); + info += " " + Messages.get(enchantment, "desc"); + } + + if (cursed && isEquipped( Dungeon.hero )) { + info += "\n\n" + Messages.get(Weapon.class, "cursed_worn"); + } else if (cursedKnown && cursed) { + info += "\n\n" + Messages.get(Weapon.class, "cursed"); + } + info += "\n\n" + Messages.get(MissileWeapon.class, "distance"); return info; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index 5acd62688..92d86d07f 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -691,30 +691,43 @@ items.wands.wandofvenom.desc=This wand has a purple body which opens to a brilli ###enchantments items.weapon.enchantments.blazing.name=blazing %s +items.weapon.enchantments.blazing.desc=This enchantment causes flames to spit forth from a weapon, burning enemies and terrain alike. items.weapon.enchantments.chilling.name=chilling %s +items.weapon.enchantments.chilling.desc=Enemies struck with this enchantment are chilled, slowing their movement and attacks. items.weapon.enchantments.dazzling.name=dazzling %s +items.weapon.enchantments.dazzling.desc=This enchantment dazes enemies when they are struck, rendering them blind for a short time. items.weapon.enchantments.eldritch.name=eldritch %s +items.weapon.enchantments.eldritch.desc=Eldritch weapons strike fear into enemies, causing them to flee from the attacker. items.weapon.enchantments.grim.name=grim %s +items.weapon.enchantments.grim.desc=This powerful enchantment posses the power to instantly execute an enemy. The effect is more likely to occur the weaker the enemy is. items.weapon.enchantments.lucky.name=lucky %s +items.weapon.enchantments.lucky.desc=With this enchantment a weapon will either deal its maximum or minimum damage, never an amount in between. items.weapon.enchantments.projecting.name=projecting %s +items.weapon.enchantments.projecting.desc=With this enchantment melee weapons will gain extra reach. Ranged weapons will be able to penetrate nearby walls. items.weapon.enchantments.shocking.name=shocking %s +items.weapon.enchantments.shocking.desc=Electricity arcs from a shocking weapon, dealing extra damage to all nearby enemies. items.weapon.enchantments.stunning.name=stunning %s +items.weapon.enchantments.stunning.desc=This powerful enchantment immobilizes enemies when they are struck, rendering them helpless against further attacks. items.weapon.enchantments.unstable.name=unstable %s +items.weapon.enchantments.unstable.desc=This enchantment radiates chaotic energy, acting as a different enchantment with each hit. items.weapon.enchantments.vampiric.name=vampiric %s +items.weapon.enchantments.vampiric.desc=This poweful enchantment leeches life force from enemies with each blow, funneling it back into the wearer. items.weapon.enchantments.venomous.name=venomous %s +items.weapon.enchantments.venomous.desc=Venemous weapons inflict enemies with deadly poison, which becomes more severe with each hit. items.weapon.enchantments.vorpal.name=vorpal %s +items.weapon.enchantments.vorpal.desc=Vorpal weapons are especially deadly, causing enemies to bleed when struck. ###melee weapons @@ -786,8 +799,6 @@ items.weapon.melee.meleeweapon.stats_known=This _tier-%d_ melee weapon deals _%d 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. -items.weapon.melee.meleeweapon.cursed=You can feel a malevolent magic lurking within this weapon. items.weapon.melee.newshortsword.name=shortsword items.weapon.melee.newshortsword.desc=A quite short sword, only a few inches longer than a dagger. @@ -858,11 +869,14 @@ 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.too_heavy=Because of your inadequate strength the accuracy and speed of your attack with this weapon will be decreased. +items.weapon.weapon.too_heavy=Because of your inadequate strength you will use this weapon with decreased attack speed and accuracy. 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.weapon.weapon.cursed_worn=Because this weapon is cursed, you are powerless to remove it. +items.weapon.weapon.cursed=You can feel a malevolent magic lurking within this weapon. +items.weapon.weapon.lighter=It was balanced to be _lighter._ +items.weapon.weapon.heavier=It was balanced to be _heavier._ +items.weapon.weapon.enchanted=It has a _%s._ +items.weapon.weapon$enchantment.enchant=enchantment ###misc items