From e0341f7ae787383f4f73ca7bc9811933481dc402 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 27 Mar 2019 12:11:11 -0700 Subject: [PATCH] Added new subskill to Swords, Stab --- Changelog.txt | 17 +++++++++++++++- .../datatypes/skills/PrimarySkillType.java | 2 +- .../datatypes/skills/SubSkillType.java | 1 + .../gmail/nossr50/skills/swords/Swords.java | 2 -- .../nossr50/skills/swords/SwordsManager.java | 20 +++++++++++++++++++ .../nossr50/util/skills/CombatUtils.java | 6 ++++++ .../resources/locale/locale_en_US.properties | 2 ++ src/main/resources/plugin.yml | 1 + src/main/resources/skillranks.yml | 7 +++++++ 9 files changed, 54 insertions(+), 4 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 03784e5ed..fd2214df3 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -7,6 +7,21 @@ Key: ! Change - Removal +Version 2.1.26 + Changed how Iron Arm damage is calculated (Rank 1 now effectively gives twice the damage bonus it used to, with a net result of 3 extra RAW damage before reductions) + Added a new subskill named Stab to Swords to help with lategame PVP combat + New permission node 'mcmmo.ability.swords.stab' + NOTE: Combat skills will be completely configurable in the upcoming 2.2 update, be patient <3 + + Notes: + These changes are meant to be minor tweaks to PVP, a dedicated PVP update where I do a lot more research and testing will happen after 2.3 + + Stab is unlocked at level 75/750, and ranks up again at level 100/1000 + Stab permanently adds small amounts of extra damage when attacking players with a sword. + Stab is meant to make up for Swords lackluster damage against fully geared opponents. + + Iron Arm got buffed because Unarmed was dealing lackluster damage compared to other skills. + Version 2.1.25 Shake now has an upper limit of damage (10) - Will be configurable in 2.2 which is coming in the near future Rank 1 of Catalysis & Concoctions are now available at level 0 by default (update skillranks.yml or delete it to regen a new one) @@ -17,7 +32,7 @@ Version 2.1.24 Version 2.1.23 Fixed a bug with Double Drops for Mining (Update your configs instructions below) - Fixed a 7 year old bug where damage in mcMMO from Skills was potentially getting reduced by damage reduction TWICE + Fixed a 7 year old bug where damage in mcMMO from SkillBs was potentially getting reduced by damage reduction TWICE Fixed a bug where killing entities with Rupture would not properly credit you as the killer Fixed a bug where Serrated Strikes was applying Rupture twice Players will now be ejected from Minecarts if they cast their fishing rod (anti-afk) diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/PrimarySkillType.java b/src/main/java/com/gmail/nossr50/datatypes/skills/PrimarySkillType.java index 1440ea9ff..6c40760ad 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/PrimarySkillType.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/PrimarySkillType.java @@ -58,7 +58,7 @@ public enum PrimarySkillType { SMELTING(SmeltingManager.class, Color.YELLOW, ImmutableList.of(SubSkillType.SMELTING_UNDERSTANDING_THE_ART, /*SubSkillType.SMELTING_FLUX_MINING,*/ SubSkillType.SMELTING_FUEL_EFFICIENCY, SubSkillType.SMELTING_SECOND_SMELT)), SWORDS(SwordsManager.class, Color.fromRGB(178, 34, 34), SuperAbilityType.SERRATED_STRIKES, ToolType.SWORD, - ImmutableList.of(SubSkillType.SWORDS_SERRATED_STRIKES, SubSkillType.SWORDS_RUPTURE, SubSkillType.SWORDS_COUNTER_ATTACK)), + ImmutableList.of(SubSkillType.SWORDS_SERRATED_STRIKES, SubSkillType.SWORDS_STAB, SubSkillType.SWORDS_RUPTURE, SubSkillType.SWORDS_COUNTER_ATTACK)), TAMING(TamingManager.class, Color.PURPLE, ImmutableList.of(SubSkillType.TAMING_BEAST_LORE, SubSkillType.TAMING_CALL_OF_THE_WILD, SubSkillType.TAMING_ENVIRONMENTALLY_AWARE, SubSkillType.TAMING_FAST_FOOD_SERVICE, SubSkillType.TAMING_GORE, SubSkillType.TAMING_HOLY_HOUND, SubSkillType.TAMING_SHARPENED_CLAWS, SubSkillType.TAMING_SHOCK_PROOF, SubSkillType.TAMING_THICK_FUR, SubSkillType.TAMING_PUMMEL)), UNARMED(UnarmedManager.class, Color.BLACK, SuperAbilityType.BERSERK, ToolType.FISTS, diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/SubSkillType.java b/src/main/java/com/gmail/nossr50/datatypes/skills/SubSkillType.java index c2d03f707..c743610cc 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/SubSkillType.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/SubSkillType.java @@ -71,6 +71,7 @@ public enum SubSkillType { SWORDS_COUNTER_ATTACK(1), SWORDS_RUPTURE(4), SWORDS_SERRATED_STRIKES(1), + SWORDS_STAB(2), /* Taming */ TAMING_BEAST_LORE(1), diff --git a/src/main/java/com/gmail/nossr50/skills/swords/Swords.java b/src/main/java/com/gmail/nossr50/skills/swords/Swords.java index c6d49eb5f..c15d05ab7 100644 --- a/src/main/java/com/gmail/nossr50/skills/swords/Swords.java +++ b/src/main/java/com/gmail/nossr50/skills/swords/Swords.java @@ -4,10 +4,8 @@ import com.gmail.nossr50.config.AdvancedConfig; public class Swords { public static int bleedMaxTicks = AdvancedConfig.getInstance().getRuptureMaxTicks(); - public static int bleedBaseTicks = AdvancedConfig.getInstance().getRuptureBaseTicks(); public static double counterAttackModifier = AdvancedConfig.getInstance().getCounterModifier(); public static double serratedStrikesModifier = AdvancedConfig.getInstance().getSerratedStrikesModifier(); - public static int serratedStrikesBleedTicks = AdvancedConfig.getInstance().getSerratedStrikesTicks(); } diff --git a/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java b/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java index 8303bae2f..14d3db3ab 100644 --- a/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java +++ b/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java @@ -33,6 +33,10 @@ public class SwordsManager extends SkillManager { return mcMMOPlayer.getToolPreparationMode(ToolType.SWORD) && Permissions.serratedStrikes(getPlayer()); } + public boolean canUseStab() { + return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.SWORDS_STAB) && RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.SWORDS_STAB); + } + public boolean canUseRupture() { return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.SWORDS_RUPTURE) && RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.SWORDS_RUPTURE); } @@ -80,6 +84,22 @@ public class SwordsManager extends SkillManager { } } + public double stabCheck(LivingEntity target) + { + if(!(target instanceof Player)) + return 0; + + int rank = RankUtils.getRank(getPlayer(), SubSkillType.SWORDS_STAB); + + if(rank > 0) + { + double stabDamage = 1.0D + (rank * 1.5); + return stabDamage; + } + + return 0; + } + public int getToolTier(ItemStack itemStack) { if(ItemUtils.isDiamondTool(itemStack)) 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 18236eda5..ff178c18d 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -61,6 +61,12 @@ public final class CombatUtils { } } + //Add Stab Damage + if(swordsManager.canUseStab()) + { + event.setDamage(swordsManager.stabCheck(target) + initialDamage); + } + if (swordsManager.canUseSerratedStrike()) { swordsManager.serratedStrikes(target, initialDamage, modifiers); } diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index 133ef89b7..8bb0a3081 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -404,6 +404,8 @@ Swords.SubSkill.SerratedStrikes.Description=Deal partial damage in an AOE with a Swords.SubSkill.SerratedStrikes.Stat=Serrated Strikes Length Swords.SubSkill.Rupture.Name=Rupture Swords.SubSkill.Rupture.Description=Apply a powerful bleed DoT +Swords.SubSkill.Stab.Name=Stab +Swords.SubSkill.Stab.Description=Adds {0} extra damage when attacking players. 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+ diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index b4c0e7eaa..d14618a08 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -561,6 +561,7 @@ permissions: description: Allows access to all Swords abilities children: mcmmo.ability.swords.rupture: true + mcmmo.ability.swords.stab: true mcmmo.ability.swords.counterattack: true mcmmo.ability.swords.serratedstrikes: true mcmmo.ability.swords.rupture: diff --git a/src/main/resources/skillranks.yml b/src/main/resources/skillranks.yml index a1422b9fd..09b68541c 100644 --- a/src/main/resources/skillranks.yml +++ b/src/main/resources/skillranks.yml @@ -381,6 +381,13 @@ Fishing: Rank_7: 850 Rank_8: 1000 Swords: + Stab: + Standard: + Rank_1: 75 + Rank_2: 100 + RetroMode: + Rank_1: 750 + Rank_2: 1000 CounterAttack: Standard: Rank_1: 20