v1.0.1: fixed class armors having odd text in the journal view

This commit is contained in:
Evan Debenham
2021-08-21 18:03:30 -04:00
parent 89385141c4
commit a66ab0743d
2 changed files with 14 additions and 11 deletions

View File

@@ -104,13 +104,13 @@ items.armor.clotharmor.desc=This lightweight armor offers basic protection.
items.armor.huntressarmor.name=hero's cloak items.armor.huntressarmor.name=hero's cloak
items.armor.huntressarmor.no_enemies=No enemies in sight items.armor.huntressarmor.no_enemies=No enemies in sight
items.armor.huntressarmor.desc=While wearing this cloak, the Huntress can perform a special ability: items.armor.huntressarmor.desc=While wearing this cloak, the Huntress can perform a special ability.
items.armor.leatherarmor.name=leather armor items.armor.leatherarmor.name=leather armor
items.armor.leatherarmor.desc=Armor made from tanned monster hide. Not as light as cloth armor but provides better protection. items.armor.leatherarmor.desc=Armor made from tanned monster hide. Not as light as cloth armor but provides better protection.
items.armor.magearmor.name=hero's robe items.armor.magearmor.name=hero's robe
items.armor.magearmor.desc=While wearing this gorgeous robe, the Mage can perform a special ability: items.armor.magearmor.desc=While wearing this gorgeous robe, the Mage can perform a special ability.
items.armor.mailarmor.name=mail armor items.armor.mailarmor.name=mail armor
items.armor.mailarmor.desc=Interlocking metal links make for a tough but flexible suit of armor. items.armor.mailarmor.desc=Interlocking metal links make for a tough but flexible suit of armor.
@@ -119,13 +119,13 @@ items.armor.platearmor.name=plate armor
items.armor.platearmor.desc=Enormous plates of metal are joined together into a suit that provides unmatched protection to any adventurer strong enough to bear its staggering weight. items.armor.platearmor.desc=Enormous plates of metal are joined together into a suit that provides unmatched protection to any adventurer strong enough to bear its staggering weight.
items.armor.roguearmor.name=hero's garb items.armor.roguearmor.name=hero's garb
items.armor.roguearmor.desc=When wearing this dark garb, the Rogue can perform a special ability: items.armor.roguearmor.desc=When wearing this dark garb, the Rogue can perform a special ability.
items.armor.scalearmor.name=scale armor items.armor.scalearmor.name=scale armor
items.armor.scalearmor.desc=The metal scales sewn onto a leather vest create a flexible, yet protective armor. items.armor.scalearmor.desc=The metal scales sewn onto a leather vest create a flexible, yet protective armor.
items.armor.warriorarmor.name=hero's armor items.armor.warriorarmor.name=hero's armor
items.armor.warriorarmor.desc=While this armor looks heavy, it allows the Warrior to perform a special ability: items.armor.warriorarmor.desc=While this armor looks heavy, it allows the Warrior to perform a special ability.

View File

@@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbili
import com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal; import com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTileSheet;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndChooseAbility; import com.shatteredpixel.shatteredpixeldungeon.windows.WndChooseAbility;
import com.watabou.utils.Bundle; import com.watabou.utils.Bundle;
@@ -184,13 +185,15 @@ abstract public class ClassArmor extends Armor {
public String desc() { public String desc() {
String desc = super.desc(); String desc = super.desc();
ArmorAbility ability = Dungeon.hero.armorAbility; if (Dungeon.hero.belongings.contains(this)) {
if (ability != null){ ArmorAbility ability = Dungeon.hero.armorAbility;
desc += "\n\n" + ability.shortDesc(); if (ability != null) {
float chargeUse = ability.chargeUse(Dungeon.hero); desc += "\n\n" + ability.shortDesc();
desc += " " + Messages.get(this, "charge_use", new DecimalFormat("#.##").format(chargeUse)); float chargeUse = ability.chargeUse(Dungeon.hero);
} else { desc += " " + Messages.get(this, "charge_use", new DecimalFormat("#.##").format(chargeUse));
desc += "\n\n" + "_" + Messages.get(this, "no_ability") + "_"; } else {
desc += "\n\n" + "_" + Messages.get(this, "no_ability") + "_";
}
} }
return desc; return desc;