nossr50 6 лет назад
Родитель
Сommit
c3bacd8de6

+ 2 - 1
src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java

@@ -201,7 +201,8 @@ public abstract class SkillCommand implements TabExecutor {
 
     protected String[] calculateLengthDisplayValues(Player player, float skillValue) {
         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);
 
         if (maxLength != 0) {

+ 8 - 3
src/main/java/com/gmail/nossr50/config/AdvancedConfig.java

@@ -43,8 +43,12 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
         checkKeys(reason);
 
         /* GENERAL */
-        if (getAbilityLength() < 1) {
-            reason.add("Skills.General.Ability.IncreaseLevel should be at least 1!");
+        if (getAbilityLengthRetro() < 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) {
@@ -676,7 +680,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
     protected void loadKeys() {}
 
     /* 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 getMaxBonusLevel(SubSkillType subSkillType) { return config.getInt(subSkillType.getAdvConfigAddress() + ".MaxBonusLevel"); }

+ 1 - 1
src/main/java/com/gmail/nossr50/config/Config.java

@@ -246,7 +246,7 @@ public class Config extends AutoUpdateConfigLoader {
     /* 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)
-    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
     public int getClassicModeXPFormulaFactor() { return config.getInt("General.Skill_Scaling.RetroMode_XP_Formula_Factor", 1); }

+ 2 - 1
src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java

@@ -772,7 +772,8 @@ public class McMMOPlayer {
             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
         ParticleEffectUtils.playAbilityEnabledEffect(player);

+ 1 - 1
src/main/java/com/gmail/nossr50/util/experience/FormulaManager.java

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

+ 4 - 2
src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java

@@ -67,7 +67,8 @@ public class SkillUtils {
 
     public static String[] calculateLengthDisplayValues(Player player, float skillValue, PrimarySkillType skill) {
         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);
 
         if (maxLength != 0) {
@@ -180,7 +181,8 @@ public class SkillUtils {
 
             McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
             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);
             player.addPotionEffect(abilityBuff, true);

+ 6 - 4
src/main/resources/advanced.yml

@@ -30,13 +30,15 @@ Skills:
             ExperienceGain: true
     General:
         Ability:
+            Length:
+                Standard:
+                    IncreaseLevel: 5
+                RetroMode:
+                    IncreaseLevel: 50
             EnchantBuff: 5
             # 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
-            Standard:
-                IncreaseLevel: 50
-            RetroMode:
-                IncreaseLevel: 5
+
 
     #
     #  Settings for Acrobatics