From 36932e397de116e307e45c6cf397a2295c0c38cf Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 8 Jul 2019 07:57:07 -0700 Subject: [PATCH] 2.1.96 --- Changelog.txt | 4 ++++ pom.xml | 2 +- .../nossr50/commands/skills/SkillCommand.java | 8 +++++++ .../gmail/nossr50/config/AdvancedConfig.java | 2 ++ .../nossr50/util/skills/CombatUtils.java | 22 ++++++++++++------- src/main/resources/advanced.yml | 2 ++ .../resources/locale/locale_en_US.properties | 18 +++++++-------- 7 files changed, 40 insertions(+), 18 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 78edc7283..3e246c26d 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,8 +1,12 @@ Version 2.1.96 + Added the setting 'Skills.General.LimitBreak.AllowPVE' to advanced.yml to allow Limit Break damage bonus to apply in PVE again, defaults to false + Updated Limit Break locale strings + Fixed a few more places where 'Archaeology' was misspelled in the locale Added the setting 'ExploitFix.PistonCheating' to experience.yml at the request of a user Added a missing 's' to Nether_Bricks (thanks Sikatsu) in experience.yml NOTES: + The Skill Tooltips are a bit limited right now, in the future they will be more flexible. In order to reflect that Limit Break doesn't always work in PVE (now up to server settings) I added a crappy note to its hover window tip. I'll be fixing this in the future. You shouldn't need to update you config entry for Nether_Bricks, I believe that file updates automatically (the old config system is a bit janky, some stuff updates, some other stuff doesn't.) PistonCheating prevents blocks from being marked "natural" once they've been moved, we've never had an option for this before. A discord user requested it, its a strange request but I added it anyways. diff --git a/pom.xml b/pom.xml index fe53d7384..c4f3466af 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.96-SNAPSHOT + 2.1.96 mcMMO https://github.com/mcMMO-Dev/mcMMO 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 2fbea687a..6b4b1c19f 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java @@ -274,6 +274,14 @@ public abstract class SkillCommand implements TabExecutor { } } + protected String getLimitBreakDescriptionParameter() { + if(AdvancedConfig.getInstance().canApplyLimitBreakPVE()) { + return "(PVP/PVE)"; + } else { + return "(PVP)"; + } + } + protected abstract void dataCalculations(Player player, float skillValue); protected abstract void permissionsCheck(Player player); diff --git a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java index fe9a9f46f..dccd1a4c8 100644 --- a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java +++ b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java @@ -636,6 +636,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { protected void loadKeys() {} /* GENERAL */ + + public boolean canApplyLimitBreakPVE() { return config.getBoolean("Skills.General.LimitBreak.AllowPVE", false); } public int getStartingLevel() { return config.getInt("Skills.General.StartingLevel", 1); } public boolean allowPlayerTips() { diff --git a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java index 636289935..1ee0cff4b 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -1,5 +1,6 @@ package com.gmail.nossr50.util.skills; +import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.datatypes.experience.XPGainReason; import com.gmail.nossr50.datatypes.interactions.NotificationType; @@ -76,7 +77,7 @@ public final class CombatUtils { if(canUseLimitBreak(player, target, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK)) { - finalDamage+=getLimitBreakDamage(player, (Player) target, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK); + finalDamage+=getLimitBreakDamage(player, target, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK); } applyScaledModifiers(initialDamage, finalDamage, event); @@ -120,7 +121,7 @@ public final class CombatUtils { if(canUseLimitBreak(player, target, SubSkillType.AXES_AXES_LIMIT_BREAK)) { - finalDamage+=getLimitBreakDamage(player, (Player) target, SubSkillType.AXES_AXES_LIMIT_BREAK); + finalDamage+=getLimitBreakDamage(player, target, SubSkillType.AXES_AXES_LIMIT_BREAK); } applyScaledModifiers(initialDamage, finalDamage, event); @@ -159,7 +160,7 @@ public final class CombatUtils { if(canUseLimitBreak(player, target, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK)) { - finalDamage+=getLimitBreakDamage(player, (Player) target, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK); + finalDamage+=getLimitBreakDamage(player, target, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK); } } @@ -227,7 +228,7 @@ public final class CombatUtils { if(canUseLimitBreak(player, target, SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK)) { - finalDamage+=getLimitBreakDamage(player, (Player) target, SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK); + finalDamage+=getLimitBreakDamage(player, target, SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK); } double distanceMultiplier = archeryManager.distanceXpBonusMultiplier(target, arrow); @@ -383,8 +384,13 @@ public final class CombatUtils { } } - public static int getLimitBreakDamage(Player player, Player defender, SubSkillType subSkillType) { - return getLimitBreakDamageAgainstQuality(player, subSkillType, getArmorQualityLevel(defender)); + public static int getLimitBreakDamage(Player player, LivingEntity defender, SubSkillType subSkillType) { + if(defender instanceof Player) { + Player playerDefender = (Player) defender; + return getLimitBreakDamageAgainstQuality(player, subSkillType, getArmorQualityLevel(playerDefender)); + } else { + return getLimitBreakDamageAgainstQuality(player, subSkillType, 1000); + } } public static int getLimitBreakDamageAgainstQuality(Player player, SubSkillType subSkillType, int armorQualityLevel) { @@ -445,11 +451,11 @@ public final class CombatUtils { /** * Checks if player has access to their weapons limit break - * @param player target player + * @param player target entity * @return true if the player has access to the limit break */ public static boolean canUseLimitBreak(Player player, LivingEntity target, SubSkillType subSkillType) { - if(target instanceof Player) { + if(target instanceof Player || AdvancedConfig.getInstance().canApplyLimitBreakPVE()) { return RankUtils.hasUnlockedSubskill(player, subSkillType) && Permissions.isSubSkillEnabled(player, subSkillType); } else { diff --git a/src/main/resources/advanced.yml b/src/main/resources/advanced.yml index b6c98834e..6648a3dc7 100644 --- a/src/main/resources/advanced.yml +++ b/src/main/resources/advanced.yml @@ -77,6 +77,8 @@ Feedback: SendCopyOfMessageToChat: true Skills: General: + LimitBreak: + AllowPVE: false StartingLevel: 0 Ability: Length: diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index e269a8007..a695e141e 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -171,8 +171,8 @@ Archery.SubSkill.ArrowRetrieval.Name=Arrow Retrieval Archery.SubSkill.ArrowRetrieval.Description=Chance to retrieve arrows from corpses Archery.SubSkill.ArrowRetrieval.Stat=Arrow Recovery Chance Archery.SubSkill.ArcheryLimitBreak.Name=Archery Limit Break -Archery.SubSkill.ArcheryLimitBreak.Description=Breaking your limits. Increased damage against tough opponents. (PVP Only) -Archery.SubSkill.ArcheryLimitBreak.Stat=Limit Break PVP Max DMG +Archery.SubSkill.ArcheryLimitBreak.Description=Breaking your limits. Increased damage against tough opponents. Intended for PVP, up to server settings for whether or not it will boost damage in PVE. +Archery.SubSkill.ArcheryLimitBreak.Stat=Limit Break Max DMG Archery.Listener=Archery: Archery.SkillName=ARCHERY #AXES @@ -198,8 +198,8 @@ Axes.SubSkill.CriticalStrikes.Stat=Critical Strike Chance Axes.SubSkill.AxeMastery.Name=Axe Mastery Axes.SubSkill.AxeMastery.Description=Adds bonus DMG Axes.SubSkill.AxesLimitBreak.Name=Axes Limit Break -Axes.SubSkill.AxesLimitBreak.Description=Breaking your limits. Increased damage against tough opponents. (PVP Only) -Axes.SubSkill.AxesLimitBreak.Stat=Limit Break PVP Max DMG +Axes.SubSkill.AxesLimitBreak.Description=Breaking your limits. Increased damage against tough opponents. Intended for PVP, up to server settings for whether or not it will boost damage in PVE. +Axes.SubSkill.AxesLimitBreak.Stat=Limit Break Max DMG Axes.SubSkill.ArmorImpact.Name=Armor Impact Axes.SubSkill.ArmorImpact.Description=Strike with enough force to shatter armor Axes.SubSkill.GreaterImpact.Name=Greater Impact @@ -219,7 +219,7 @@ Excavation.SubSkill.GigaDrillBreaker.Description=3x Drop Rate, 3x EXP, +Speed Excavation.SubSkill.GigaDrillBreaker.Stat=Giga Drill Breaker Duration Excavation.SubSkill.Archaeology.Name=Archaeology Excavation.SubSkill.Archaeology.Description=Unearth the secrets of the land! High skill levels increase your odds of finding experience orbs when you find treasure! -Excavation.SubSkill.Archaeology.Stat=Archaelogy Experience Orb Chance +Excavation.SubSkill.Archaeology.Stat=Archaeology Experience Orb Chance Excavation.SubSkill.Archaeology.Stat.Extra=Archaeology Experience Orb Amount Excavation.Listener=Excavation: Excavation.SkillName=EXCAVATION @@ -423,8 +423,8 @@ Swords.SubSkill.Stab.Name=Stab Swords.SubSkill.Stab.Description=Adds bonus damage to your attacks. Swords.SubSkill.Stab.Stat=Stab Damage Swords.SubSkill.SwordsLimitBreak.Name=Swords Limit Break -Swords.SubSkill.SwordsLimitBreak.Description=Breaking your limits. Increased damage against tough opponents. (PVP Only) -Swords.SubSkill.SwordsLimitBreak.Stat=Limit Break PVP Max DMG +Swords.SubSkill.SwordsLimitBreak.Description=Breaking your limits. Increased damage against tough opponents. Intended for PVP, up to server settings for whether or not it will boost damage in PVE. +Swords.SubSkill.SwordsLimitBreak.Stat=Limit Break Max DMG Swords.SubSkill.Rupture.Stat=Rupture Chance Swords.SubSkill.Rupture.Stat.Extra=Rupture: [[GREEN]]{0} ticks [{1} DMG vs Player] [{2} DMG vs Mobs] Swords.Effect.4=Serrated Strikes Rupture+ @@ -502,8 +502,8 @@ Unarmed.SubSkill.Disarm.Name=Disarm Unarmed.SubSkill.Disarm.Description=Drops the foes item held in hand Unarmed.SubSkill.Disarm.Stat=Disarm Chance Unarmed.SubSkill.UnarmedLimitBreak.Name=Unarmed Limit Break -Unarmed.SubSkill.UnarmedLimitBreak.Description=Breaking your limits. Increased damage against tough opponents. (PVP Only) -Unarmed.SubSkill.UnarmedLimitBreak.Stat=Limit Break PVP Max DMG +Unarmed.SubSkill.UnarmedLimitBreak.Description=Breaking your limits. Increased damage against tough opponents. Intended for PVP, up to server settings for whether or not it will boost damage in PVE. +Unarmed.SubSkill.UnarmedLimitBreak.Stat=Limit Break Max DMG Unarmed.SubSkill.IronArmStyle.Name=Iron Arm Style Unarmed.SubSkill.IronArmStyle.Description=Hardens your arm over time Unarmed.SubSkill.ArrowDeflect.Name=Arrow Deflect