Fixing some issues with the new skill system and retro mode

This commit is contained in:
nossr50 2019-01-23 16:44:51 -08:00
parent 96b46d31cf
commit bb64221c6b
2 changed files with 16 additions and 8 deletions

View File

@ -57,19 +57,22 @@ public class AcrobaticsCommand extends SkillCommand {
if(abstractSubSkill != null) 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 maxChance = AdvancedConfig.getInstance().getMaxChance(abstractSubSkill);
double rollChance = SkillUtils.getChanceOfSuccess(skillValue, maxBonusLevel, maxChance); double rollChance = SkillUtils.getChanceOfSuccess(skillValue, maxBonusLevel, maxChance);
double graceChance = SkillUtils.getChanceOfSuccess(skillValue, maxBonusLevel, maxChance / 2); double graceChance = SkillUtils.getChanceOfSuccess(skillValue, maxBonusLevel, maxChance / 2);
String rollChanceLucky = isLucky ? percent.format(Math.min(rollChance * 1.3333D, 100.0D) / 100.0D) : null; rollChance = Math.min(100.0D, rollChance);
String graceChanceLucky = isLucky ? percent.format(Math.min(rollChance * 1.3333D, 100.0D) / 100.0D) : null; 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)) messages.add(getStatMessage(SubSkillType.ACROBATICS_ROLL, percent.format(rollChance)
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", rollChanceLucky) : "")); + (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(true, false, SubSkillType.ACROBATICS_ROLL, percent.format(graceChance)
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", graceChanceLucky) : "")));
} }
} }

View File

@ -711,7 +711,12 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
public double getMaxChance(SubSkillType subSkillType) { return config.getDouble(subSkillType.getAdvConfigAddress() + ".ChanceMax", 100.0D);} public double getMaxChance(SubSkillType subSkillType) { return config.getDouble(subSkillType.getAdvConfigAddress() + ".ChanceMax", 100.0D);}
public int getMaxBonusLevel(AbstractSubSkill abstractSubSkill) { 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) public double getMaxChance(AbstractSubSkill abstractSubSkill)