From ea0ad38fec1c493619382117d8043d4ab5f19b23 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 21 Jan 2019 11:31:02 -0800 Subject: [PATCH] Fixing styling on Repair --- .../nossr50/commands/skills/RepairCommand.java | 17 ++++++++--------- .../gmail/nossr50/util/skills/RankUtils.java | 5 +++++ .../resources/locale/locale_en_US.properties | 11 +++++------ 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java index c6799b3ae..b8ed9e6cb 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java @@ -134,24 +134,23 @@ public class RepairCommand extends SkillCommand { List messages = new ArrayList(); if (canMasterRepair) { - messages.add(LocaleLoader.getString("Repair.Skills.Mastery", repairMasteryBonus)); + messages.add(getStatMessage(false, true, SubSkillType.REPAIR_REPAIR_MASTERY, repairMasteryBonus)); } if (canSuperRepair) { - messages.add(LocaleLoader.getString("Repair.Skills.Super.Chance", superRepairChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", superRepairChanceLucky) : "")); + messages.add(getStatMessage(SubSkillType.REPAIR_SUPER_REPAIR, superRepairChance) + + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", superRepairChanceLucky) : "")); } if (canArcaneForge) { RepairManager repairManager = UserManager.getPlayer(player).getRepairManager(); - messages.add(LocaleLoader.getString("Repair.Arcane.Rank", repairManager.getArcaneForgingRank(), RankUtils.getHighestRank(SubSkillType.REPAIR_ARCANE_FORGING))); + messages.add(getStatMessage(false, true, SubSkillType.REPAIR_ARCANE_FORGING, RankUtils.getHighestRankStr(SubSkillType.REPAIR_ARCANE_FORGING))); - if (ArcaneForging.arcaneForgingEnchantLoss) { - messages.add(LocaleLoader.getString("Repair.Arcane.Chance.Success", (arcaneBypass ? 100 : repairManager.getKeepEnchantChance()))); - } - - if (ArcaneForging.arcaneForgingDowngrades) { - messages.add(LocaleLoader.getString("Repair.Arcane.Chance.Downgrade", (arcaneBypass ? 0 : repairManager.getDowngradeEnchantChance()))); + if (ArcaneForging.arcaneForgingEnchantLoss || ArcaneForging.arcaneForgingDowngrades) { + messages.add(getStatMessage(true, true, SubSkillType.REPAIR_ARCANE_FORGING, + String.valueOf(arcaneBypass ? 100 : repairManager.getKeepEnchantChance()), + String.valueOf(arcaneBypass ? 0 : repairManager.getDowngradeEnchantChance()))); //Jesus those parentheses } } diff --git a/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java b/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java index da6082fb3..21ba0a678 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java @@ -329,6 +329,11 @@ public class RankUtils { return subSkillType.getNumRanks(); } + public static String getHighestRankStr(SubSkillType subSkillType) + { + return String.valueOf(subSkillType.getNumRanks()); + } + /** * Get the highest rank of a subskill * @param abstractSubSkill target subskill diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index 584eb8423..b846a3839 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -327,12 +327,16 @@ Repair.SubSkill.StoneRepair.Name=Stone Repair ({0}+ SKILL) Repair.SubSkill.StoneRepair.Description=Repair Stone Tools Repair.SubSkill.RepairMastery.Name=Repair Mastery Repair.SubSkill.RepairMastery.Description=Increased repair amount +Repair.SubSkill.RepairMastery.Stat=Repair Mastery: [[GREEN]]Extra {0} durability restored Repair.SubSkill.SuperRepair.Name=Super Repair Repair.SubSkill.SuperRepair.Description=Double effectiveness +Repair.SubSkill.SuperRepair.Stat=Super Repair Chance Repair.SubSkill.DiamondRepair.Name=Diamond Repair ({0}+ SKILL) Repair.SubSkill.DiamondRepair.Description=Repair Diamond Tools & Armor Repair.SubSkill.ArcaneForging.Name=Arcane Forging Repair.SubSkill.ArcaneForging.Description=Repair magic items +Repair.SubSkill.ArcaneForging.Stat=Arcane Forging: [[YELLOW]]Rank {0}/{1} +Repair.SubSkill.ArcaneForging.Stat.Extra=[[DARK_AQUA]]Arcane Forging Odds:[[GRAY]] Success [[GREEN]]{0}[[GRAY]]%, Failure [[RED]]{1}[[GRAY]]% Repair.Error=[[DARK_RED]]mcMMO encountered an error attempting to repair this item! Repair.Listener.Anvil=[[DARK_RED]]You have placed an anvil, anvils can repair tools and armor. Repair.Listener=Repair: @@ -341,21 +345,16 @@ Repair.Skills.AdeptDiamond=[[DARK_RED]]You're not skilled enough to repair Diamo Repair.Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold. Repair.Skills.AdeptIron=[[DARK_RED]]You're not skilled enough to repair Iron. Repair.Skills.AdeptStone=[[DARK_RED]]You're not skilled enough to repair Stone. -Repair.Skills.Adept=You must be level [[YELLOW]]{0}[[RED]] to repair [[YELLOW]]{1} +Repair.Skills.Adept=[[RED]]You must be level [[YELLOW]]{0}[[RED]] to repair [[YELLOW]]{1} Repair.Skills.FeltEasy=[[GRAY]]That felt easy. Repair.Skills.FullDurability=[[GRAY]]That is at full durability. -Repair.Skills.Mastery=Repair Mastery: [[YELLOW]]Extra {0} durability restored Repair.Skills.StackedItems=[[DARK_RED]]You can't repair stacked items. -Repair.Skills.Super.Chance=Super Repair Chance: [[YELLOW]]{0} Repair.Pretty.Name=Repair #Arcane Forging -Repair.Arcane.Chance.Downgrade=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}% -Repair.Arcane.Chance.Success=[[GRAY]]AF Success Rate: [[YELLOW]]{0}% Repair.Arcane.Downgrade=Arcane power has decreased for this item. Repair.Arcane.Fail=Arcane power has permanently left the item. Repair.Arcane.Lost=You were not skilled enough to keep any enchantments. Repair.Arcane.Perfect=[[GREEN]]You have sustained the arcane energies in this item. -Repair.Arcane.Rank=Arcane Forging: [[YELLOW]]Rank {0}/{1} #SALVAGE Salvage.Pretty.Name=Salvage Salvage.SubSkill.UnderstandingTheArt.Name=Understanding The Art