瀏覽代碼

Swords stab damage is now config-driven
Fixes #5164

nossr50 2 月之前
父節點
當前提交
35785283ee

+ 8 - 0
Changelog.txt

@@ -1,3 +1,11 @@
+Version 2.2.035
+    Swords subskill Stab is now configurable in advanced.yml
+    Added 'Skills.Swords.Stab.Base_Damage' to advanced.yml
+    Added 'Skills.Swords.Stab.Per_Rank_Multiplier' to advanced.yml
+
+    NOTES:
+    The new config settings will be added automatically to advanced.yml
+
 Version 2.2.034
     Fixed bug where mcMMO would drop items in such a way that they get stuck in an adjacent block and float to the surface
     Fixed a rare edge case where null entities during chunk unload would cause a NullPointerException and potentially lead to server instability

+ 1 - 1
pom.xml

@@ -2,7 +2,7 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.gmail.nossr50.mcMMO</groupId>
     <artifactId>mcMMO</artifactId>
-    <version>2.2.034</version>
+    <version>2.2.035-SNAPSHOT</version>
     <name>mcMMO</name>
     <url>https://github.com/mcMMO-Dev/mcMMO</url>
     <scm>

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

@@ -575,35 +575,6 @@ public class AdvancedConfig extends BukkitConfig {
         return ChatColor.WHITE;
     }
 
-    /*public boolean isJSONStatHoverElementBold(StatType statType, boolean isPrefix) {
-        String keyAddress = isPrefix ? "Prefix" : "Value";
-        String keyLocation = "Style.JSON.Hover.Details." + StringUtils.getCapitalized(statType.toString()) +"."+keyAddress+".Bold";
-        return config.getBoolean(keyLocation);
-    }
-
-    public boolean isJSONStatHoverElementItalic(StatType statType, boolean isPrefix) {
-        String keyAddress = isPrefix ? "Prefix" : "Value";
-        String keyLocation = "Style.JSON.Hover.Details." + StringUtils.getCapitalized(statType.toString()) +"."+keyAddress+".Italics";
-        return config.getBoolean(keyLocation);
-    }
-
-    public boolean isJSONStatHoverElementUnderlined(StatType statType, boolean isPrefix) {
-        String keyAddress = isPrefix ? "Prefix" : "Value";
-        String keyLocation = "Style.JSON.Hover.Details." + StringUtils.getCapitalized(statType.toString()) +"."+keyAddress+".Underline";
-        return config.getBoolean(keyLocation);
-    }*/
-
-    /**
-     * Some SubSkills have the ability to retain classic functionality
-     *
-     * @param subSkillType SubSkillType with classic functionality
-     *
-     * @return true if the subskill is in classic mode
-     */
-    public boolean isSubSkillClassic(SubSkillType subSkillType) {
-        return config.getBoolean(subSkillType.getAdvConfigAddress() + ".Classic");
-    }
-
     /* ACROBATICS */
     public double getDodgeDamageModifier() {
         return config.getDouble("Skills.Acrobatics.Dodge.DamageModifier", 2.0D);
@@ -851,6 +822,14 @@ public class AdvancedConfig extends BukkitConfig {
     }
 
     /* SWORDS */
+    public double getStabBaseDamage() {
+        return config.getDouble("Skills.Swords.Stab.Base_Damage", 1.0D);
+    }
+
+    public double getStabPerRankMultiplier() {
+        return config.getDouble("Skills.Swords.Stab.Per_Rank_Multiplier", 1.5D);
+    }
+
     public double getRuptureTickDamage(boolean isTargetPlayer, int rank) {
         String root = "Skills.Swords.Rupture.Rupture_Mechanics.Tick_Interval_Damage.Against_";
         String targetType = isTargetPlayer ? "Players" : "Mobs";

+ 5 - 21
src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java

@@ -90,17 +90,13 @@ public class SwordsManager extends SkillManager {
                 }
             }
 
-            RuptureTask ruptureTask = new RuptureTask(mmoPlayer, target,
+            final RuptureTask ruptureTask = new RuptureTask(mmoPlayer, target,
                     mcMMO.p.getAdvancedConfig().getRuptureTickDamage(target instanceof Player, getRuptureRank()));
 
-            RuptureTaskMeta ruptureTaskMeta = new RuptureTaskMeta(mcMMO.p, ruptureTask);
+            final RuptureTaskMeta ruptureTaskMeta = new RuptureTaskMeta(mcMMO.p, ruptureTask);
 
             mcMMO.p.getFoliaLib().getScheduler().runAtEntityTimer(target, ruptureTask, 1, 1);
             target.setMetadata(MetadataConstants.METADATA_KEY_RUPTURE, ruptureTaskMeta);
-
-//            if (mmoPlayer.useChatNotifications()) {
-//                NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.Bleeding");
-//            }
         }
     }
 
@@ -112,25 +108,14 @@ public class SwordsManager extends SkillManager {
         int rank = RankUtils.getRank(getPlayer(), SubSkillType.SWORDS_STAB);
 
         if (rank > 0) {
-            return (1.0D + (rank * 1.5));
+            double baseDamage = mcMMO.p.getAdvancedConfig().getStabBaseDamage();
+            double rankMultiplier = mcMMO.p.getAdvancedConfig().getStabPerRankMultiplier();
+            return (baseDamage + (rank * rankMultiplier));
         }
 
         return 0;
     }
 
-    public int getToolTier(@NotNull ItemStack itemStack) {
-        if (ItemUtils.isNetheriteTool(itemStack))
-            return 5;
-        if (ItemUtils.isDiamondTool(itemStack))
-            return 4;
-        else if (ItemUtils.isIronTool(itemStack) || ItemUtils.isGoldTool(itemStack))
-            return 3;
-        else if (ItemUtils.isStoneTool(itemStack))
-            return 2;
-        else
-            return 1;
-    }
-
     /**
      * Handle the effects of the Counter Attack ability
      *
@@ -138,7 +123,6 @@ public class SwordsManager extends SkillManager {
      * @param damage The amount of damage initially dealt by the event
      */
     public void counterAttackChecks(@NotNull LivingEntity attacker, double damage) {
-
         if (ProbabilityUtil.isSkillRNGSuccessful(SubSkillType.SWORDS_COUNTER_ATTACK, mmoPlayer)) {
             CombatUtils.dealDamage(attacker, damage / Swords.counterAttackModifier, getPlayer());
 

+ 3 - 0
src/main/resources/advanced.yml

@@ -473,6 +473,9 @@ Skills:
     #  Settings for Swords
     ###
     Swords:
+        Stab:
+            Base_Damage: 1.0
+            Per_Rank_Multiplier: 1.5
         Rupture:
             Rupture_Mechanics:
                 # This is % chance, 15 would mean 15% percent of the time

+ 1 - 1
src/main/resources/locale/locale_en_US.properties

@@ -919,7 +919,7 @@ Commands.XPGain=&8XP GAIN: &f{0}
 Commands.xplock.locked=&6Your XP BAR is now locked to {0}!
 Commands.xplock.unlocked=&6Your XP BAR is now &aUNLOCKED&6!
 Commands.xprate.modified=&cThe XP RATE was modified to {0}
-Commands.xprate.over=&cmcMMO XP Rate Event is OVER!!
+Commands.xprate.over=&cmcMMO XP Rate Event is OVER!! 
 Commands.xprate.proper.0=&cProper usage to change the XP rate is /xprate <integer> <true/false>
 Commands.xprate.proper.1=&cProper usage to restore the XP rate to default is /xprate reset
 Commands.xprate.proper.2=&cPlease specify true or false to indicate if this is an xp event or not