diff --git a/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java index fac1f0415..9e90bbbbb 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java @@ -57,19 +57,22 @@ public class AcrobaticsCommand extends SkillCommand { if(abstractSubSkill != null) { - double maxBonusLevel = Config.getInstance().getIsRetroMode() ? AdvancedConfig.getInstance().getMaxBonusLevel(abstractSubSkill) * 10 : AdvancedConfig.getInstance().getMaxBonusLevel(abstractSubSkill); + double maxBonusLevel = AdvancedConfig.getInstance().getMaxBonusLevel(abstractSubSkill); double maxChance = AdvancedConfig.getInstance().getMaxChance(abstractSubSkill); double rollChance = SkillUtils.getChanceOfSuccess(skillValue, maxBonusLevel, maxChance); double graceChance = SkillUtils.getChanceOfSuccess(skillValue, maxBonusLevel, maxChance / 2); - String rollChanceLucky = isLucky ? percent.format(Math.min(rollChance * 1.3333D, 100.0D) / 100.0D) : null; - String graceChanceLucky = isLucky ? percent.format(Math.min(rollChance * 1.3333D, 100.0D) / 100.0D) : null; + rollChance = Math.min(100.0D, rollChance); + graceChance = Math.min(100.0D, graceChance); + String rollChanceLucky = isLucky ? percent.format(Math.min(100.0D, (rollChance * 1.3333D) / 100.0D)) : null; + String graceChanceLucky = isLucky ? percent.format(Math.min(100.0D, (graceChance * 1.3333D) / 100.0D)) : null; - messages.add(getStatMessage(SubSkillType.ACROBATICS_ROLL, percent.format(rollChance)) - + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", rollChanceLucky) : "")); - messages.add(getStatMessage(true, false, SubSkillType.ACROBATICS_ROLL, percent.format(graceChance)) - + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", graceChanceLucky) : "")); + messages.add(getStatMessage(SubSkillType.ACROBATICS_ROLL, percent.format(rollChance) + + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", rollChanceLucky) : ""))); + + messages.add(getStatMessage(true, false, SubSkillType.ACROBATICS_ROLL, percent.format(graceChance) + + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", graceChanceLucky) : ""))); } } diff --git a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java index ad6a14c31..72c8f99e8 100644 --- a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java +++ b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java @@ -711,7 +711,12 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { public double getMaxChance(SubSkillType subSkillType) { return config.getDouble(subSkillType.getAdvConfigAddress() + ".ChanceMax", 100.0D);} public int getMaxBonusLevel(AbstractSubSkill abstractSubSkill) { - return config.getInt("Skills."+abstractSubSkill.getPrimaryKeyName()+"."+abstractSubSkill.getConfigKeyName()+".MaxBonusLevel"); + int maxBonusLevel = config.getInt("Skills."+abstractSubSkill.getPrimaryKeyName()+"."+abstractSubSkill.getConfigKeyName()+".MaxBonusLevel"); + + if(mcMMO.isRetroModeEnabled()) + maxBonusLevel *= 10; + + return maxBonusLevel; } public double getMaxChance(AbstractSubSkill abstractSubSkill)