Minor config change

This commit is contained in:
nossr50 2019-01-13 00:31:58 -08:00
parent 351abae475
commit c3bacd8de6
7 changed files with 24 additions and 13 deletions

View File

@ -201,7 +201,8 @@ public abstract class SkillCommand implements TabExecutor {
protected String[] calculateLengthDisplayValues(Player player, float skillValue) { protected String[] calculateLengthDisplayValues(Player player, float skillValue) {
int maxLength = skill.getAbility().getMaxLength(); int maxLength = skill.getAbility().getMaxLength();
int length = 2 + (int) (skillValue / AdvancedConfig.getInstance().getAbilityLength()); int abilityLengthVar = Config.getInstance().getIsRetroMode() ? AdvancedConfig.getInstance().getAbilityLengthRetro() : AdvancedConfig.getInstance().getAbilityLengthStandard();
int length = 2 + (int) (skillValue / abilityLengthVar);
int enduranceLength = PerksUtils.handleActivationPerks(player, length, maxLength); int enduranceLength = PerksUtils.handleActivationPerks(player, length, maxLength);
if (maxLength != 0) { if (maxLength != 0) {

View File

@ -43,8 +43,12 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
checkKeys(reason); checkKeys(reason);
/* GENERAL */ /* GENERAL */
if (getAbilityLength() < 1) { if (getAbilityLengthRetro() < 1) {
reason.add("Skills.General.Ability.IncreaseLevel should be at least 1!"); reason.add("Skills.General.Ability.Length.RetroMode.IncreaseLevel should be at least 1!");
}
if (getAbilityLengthStandard() < 1) {
reason.add("Skills.General.Ability.Length.Standard.IncreaseLevel should be at least 1!");
} }
if (getEnchantBuff() < 1) { if (getEnchantBuff() < 1) {
@ -676,7 +680,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
protected void loadKeys() {} protected void loadKeys() {}
/* GENERAL */ /* GENERAL */
public int getAbilityLength() { return config.getInt("Skills.General.Ability.IncreaseLevel", 50); } public int getAbilityLengthStandard() { return config.getInt("Skills.General.Ability.Length.Standard.IncreaseLevel", 5); }
public int getAbilityLengthRetro() { return config.getInt("Skills.General.Ability.Length.RetroMode.IncreaseLevel", 50); }
public int getEnchantBuff() { return config.getInt("Skills.General.Ability.EnchantBuff", 5); } public int getEnchantBuff() { return config.getInt("Skills.General.Ability.EnchantBuff", 5); }
public int getMaxBonusLevel(SubSkillType subSkillType) { return config.getInt(subSkillType.getAdvConfigAddress() + ".MaxBonusLevel"); } public int getMaxBonusLevel(SubSkillType subSkillType) { return config.getInt(subSkillType.getAdvConfigAddress() + ".MaxBonusLevel"); }

View File

@ -246,7 +246,7 @@ public class Config extends AutoUpdateConfigLoader {
/* General Settings */ /* General Settings */
//Classic mode will default the value to true if the config file doesn't contain the entry (server is from a previous mcMMO install) //Classic mode will default the value to true if the config file doesn't contain the entry (server is from a previous mcMMO install)
public boolean getUseOldLevelScaling() { return config.getBoolean("General.RetroMode", true); } public boolean getIsRetroMode() { return config.getBoolean("General.RetroMode", true); }
//XP needed to level is multiplied by this when using classic mode //XP needed to level is multiplied by this when using classic mode
public int getClassicModeXPFormulaFactor() { return config.getInt("General.Skill_Scaling.RetroMode_XP_Formula_Factor", 1); } public int getClassicModeXPFormulaFactor() { return config.getInt("General.Skill_Scaling.RetroMode_XP_Formula_Factor", 1); }

View File

@ -772,7 +772,8 @@ public class McMMOPlayer {
return; return;
} }
int ticks = PerksUtils.handleActivationPerks(player, 2 + (getSkillLevel(skill) / AdvancedConfig.getInstance().getAbilityLength()), ability.getMaxLength()); int abilityLengthVar = Config.getInstance().getIsRetroMode() ? AdvancedConfig.getInstance().getAbilityLengthRetro() : AdvancedConfig.getInstance().getAbilityLengthStandard();
int ticks = PerksUtils.handleActivationPerks(player, 2 + (getSkillLevel(skill) / abilityLengthVar), ability.getMaxLength());
// Notify people that ability has been activated // Notify people that ability has been activated
ParticleEffectUtils.playAbilityEnabledEffect(player); ParticleEffectUtils.playAbilityEnabledEffect(player);

View File

@ -27,7 +27,7 @@ public class FormulaManager {
public FormulaManager() { public FormulaManager() {
/* Setting for Classic Mode (Scales a lot of stuff up by * 10) */ /* Setting for Classic Mode (Scales a lot of stuff up by * 10) */
classicModeEnabled = Config.getInstance().getUseOldLevelScaling(); classicModeEnabled = Config.getInstance().getIsRetroMode();
classicModeXPFormulaFactor = Config.getInstance().getClassicModeXPFormulaFactor(); classicModeXPFormulaFactor = Config.getInstance().getClassicModeXPFormulaFactor();
loadFormula(); loadFormula();
} }

View File

@ -67,7 +67,8 @@ public class SkillUtils {
public static String[] calculateLengthDisplayValues(Player player, float skillValue, PrimarySkillType skill) { public static String[] calculateLengthDisplayValues(Player player, float skillValue, PrimarySkillType skill) {
int maxLength = skill.getAbility().getMaxLength(); int maxLength = skill.getAbility().getMaxLength();
int length = 2 + (int) (skillValue / AdvancedConfig.getInstance().getAbilityLength()); int abilityLengthVar = Config.getInstance().getIsRetroMode() ? AdvancedConfig.getInstance().getAbilityLengthRetro() : AdvancedConfig.getInstance().getAbilityLengthStandard();
int length = 2 + (int) (skillValue / abilityLengthVar);
int enduranceLength = PerksUtils.handleActivationPerks(player, length, maxLength); int enduranceLength = PerksUtils.handleActivationPerks(player, length, maxLength);
if (maxLength != 0) { if (maxLength != 0) {
@ -180,7 +181,8 @@ public class SkillUtils {
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
PrimarySkillType skill = mcMMOPlayer.getAbilityMode(SuperAbilityType.SUPER_BREAKER) ? PrimarySkillType.MINING : PrimarySkillType.EXCAVATION; PrimarySkillType skill = mcMMOPlayer.getAbilityMode(SuperAbilityType.SUPER_BREAKER) ? PrimarySkillType.MINING : PrimarySkillType.EXCAVATION;
int ticks = PerksUtils.handleActivationPerks(player, 2 + (mcMMOPlayer.getSkillLevel(skill) / AdvancedConfig.getInstance().getAbilityLength()), skill.getAbility().getMaxLength()) * Misc.TICK_CONVERSION_FACTOR; int abilityLengthVar = Config.getInstance().getIsRetroMode() ? AdvancedConfig.getInstance().getAbilityLengthRetro() : AdvancedConfig.getInstance().getAbilityLengthStandard();
int ticks = PerksUtils.handleActivationPerks(player, 2 + (mcMMOPlayer.getSkillLevel(skill) / abilityLengthVar), skill.getAbility().getMaxLength()) * Misc.TICK_CONVERSION_FACTOR;
PotionEffect abilityBuff = new PotionEffect(PotionEffectType.FAST_DIGGING, duration + ticks, amplifier + 10); PotionEffect abilityBuff = new PotionEffect(PotionEffectType.FAST_DIGGING, duration + ticks, amplifier + 10);
player.addPotionEffect(abilityBuff, true); player.addPotionEffect(abilityBuff, true);

View File

@ -30,13 +30,15 @@ Skills:
ExperienceGain: true ExperienceGain: true
General: General:
Ability: Ability:
Length:
Standard:
IncreaseLevel: 5
RetroMode:
IncreaseLevel: 50
EnchantBuff: 5 EnchantBuff: 5
# IncreaseLevel: This setting will determine when the length of every ability gets longer with 1 second # IncreaseLevel: This setting will determine when the length of every ability gets longer with 1 second
# EnchantBuff: This setting determines how many enchant levels to use when buffing Super Breaker & Giga Drill Breaker # EnchantBuff: This setting determines how many enchant levels to use when buffing Super Breaker & Giga Drill Breaker
Standard:
IncreaseLevel: 50
RetroMode:
IncreaseLevel: 5
# #
# Settings for Acrobatics # Settings for Acrobatics