diff --git a/Changelog.txt b/Changelog.txt index 9376aa35c..73a64950c 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -31,6 +31,7 @@ Version 2.1.0 + (Events) Starting an XP event will now use the title API (toggle this in advanced.yml) + (Sound) Volume and Pitch of sounds can now be configured in the new sounds.yml file + (MySQL) Added support for SSL for MySQL/MariaDB (On by default) + + (Skills) Ability Lengths now have a default skill cap at which they stop increasing in length, configurable in advanced.yml + (Skills) Added a new subskill to some skills 'Understanding The Art' this adds nothing new, but tracks benefits that increase together that seemed unrelated, which was previously a bit obfuscated. + (Skills) Tool alerts now are sent to the Action Bar + (Skills) Super Ability activation alerts are now sent to the Action Bar diff --git a/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java index e91bb1200..461c9bab0 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java @@ -224,7 +224,8 @@ public abstract class SkillCommand implements TabExecutor { protected String[] calculateLengthDisplayValues(Player player, float skillValue) { int maxLength = skill.getAbility().getMaxLength(); int abilityLengthVar = Config.getInstance().getIsRetroMode() ? AdvancedConfig.getInstance().getAbilityLengthRetro() : AdvancedConfig.getInstance().getAbilityLengthStandard(); - int length = 2 + (int) (skillValue / abilityLengthVar); + int abilityLengthCap = Config.getInstance().getIsRetroMode() ? AdvancedConfig.getInstance().getAbilityLengthCapRetro() : AdvancedConfig.getInstance().getAbilityLengthCapStandard(); + int length = 2 + (int) (Math.min(abilityLengthCap, skillValue) / abilityLengthVar); int enduranceLength = PerksUtils.handleActivationPerks(player, length, maxLength); if (maxLength != 0) { diff --git a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java index 3e6a138b1..2af38e850 100644 --- a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java +++ b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java @@ -668,6 +668,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { /* GENERAL */ public int getStartingLevel() { return config.getInt("Skills.General.StartingLevel", 1); } + public int getAbilityLengthCapStandard() { return config.getInt("Skills.General.Ability.Length.Standard.Cap", 50); } + public int getAbilityLengthCapRetro() { return config.getInt("Skills.General.Ability.Length.RetroMode.Cap", 500); } 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); } diff --git a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java index b3f9f648e..b90896a34 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java @@ -817,7 +817,8 @@ public class McMMOPlayer { } int abilityLengthVar = Config.getInstance().getIsRetroMode() ? AdvancedConfig.getInstance().getAbilityLengthRetro() : AdvancedConfig.getInstance().getAbilityLengthStandard(); - int ticks = PerksUtils.handleActivationPerks(player, 2 + (getSkillLevel(skill) / abilityLengthVar), ability.getMaxLength()); + int abilityLengthCap = Config.getInstance().getIsRetroMode() ? AdvancedConfig.getInstance().getAbilityLengthCapRetro() : AdvancedConfig.getInstance().getAbilityLengthCapStandard(); + int ticks = PerksUtils.handleActivationPerks(player, 2 + (Math.min(abilityLengthCap, getSkillLevel(skill)) / abilityLengthVar), ability.getMaxLength()); // Notify people that ability has been activated ParticleEffectUtils.playAbilityEnabledEffect(player); diff --git a/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java b/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java index 1031ba94c..8fd4e1ba8 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java @@ -188,7 +188,8 @@ public class SkillUtils { McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); PrimarySkillType skill = mcMMOPlayer.getAbilityMode(SuperAbilityType.SUPER_BREAKER) ? PrimarySkillType.MINING : PrimarySkillType.EXCAVATION; 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; + int abilityLengthCap = Config.getInstance().getIsRetroMode() ? AdvancedConfig.getInstance().getAbilityLengthCapRetro() : AdvancedConfig.getInstance().getAbilityLengthCapStandard(); + int ticks = PerksUtils.handleActivationPerks(player, 2 + (Math.min(abilityLengthCap, 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); diff --git a/src/main/resources/advanced.yml b/src/main/resources/advanced.yml index 2916b95ad..8c8ecf9fa 100644 --- a/src/main/resources/advanced.yml +++ b/src/main/resources/advanced.yml @@ -78,8 +78,10 @@ Skills: Ability: Length: Standard: + CapLevel: 50 IncreaseLevel: 5 RetroMode: + CapLevel: 500 IncreaseLevel: 50 EnchantBuff: 5 # IncreaseLevel: This setting will determine when the length of every ability gets longer with 1 second