From 5cd1419b21d60b7556cf74640fedc666717ce69d Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 7 Jul 2020 08:34:59 -0700 Subject: [PATCH] some work on limit break for tridents/xbows --- Changelog.txt | 11 +++++ .../datatypes/skills/PrimarySkillType.java | 4 +- .../datatypes/skills/SubSkillType.java | 4 +- .../nossr50/listeners/InventoryListener.java | 3 ++ .../resources/locale/locale_en_US.properties | 9 ++++ src/main/resources/plugin.yml | 6 +++ src/main/resources/skillranks.yml | 49 ++++++++++++++++++- 7 files changed, 81 insertions(+), 5 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 9f3b5fa08..f30f8639d 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -15,12 +15,23 @@ Version 2.1.133 New permission node 'mcmmo.skills.tridents' New permission node 'mcmmo.ability.tridents.all' New permission node 'mcmmo.ability.tridents.multitasking' + New permission node 'mcmmo.ability.tridents.tridentslimitbreak' + New permission node 'mcmmo.commands.crossbows' New permission node 'mcmmo.skills.crossbows' New permission node 'mcmmo.ability.crossbows.all' + New permission node 'mcmmo.ability.crossbows.crossbowslimitbreak' + New permission node 'mcmmo.ability.crossbows.coneofdeath' Added new locale string 'Overhaul.Name.Tridents' + Added new locale string 'Tridents.SubSkill.TridentsLimitBreak.Name' + Added new locale string 'Tridents.SubSkill.TridentsLimitBreak.Description' + Added new locale string 'Tridents.SubSkill.TridentsLimitBreak.Stat' + Added new locale string 'Overhaul.Name.Crossbows' + Added new locale string 'Crossbows.SubSkill.CrossbowsLimitBreak.Name' + Added new locale string 'Crossbows.SubSkill.CrossbowsLimitBreak.Description' + Added new locale string 'Crossbows.SubSkill.CrossbowsLimitBreak.Stat' Added XP bar settings for Tridents & Crossbows to experience.yml Changed some debug level logging to info level for convenience 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 9e5972202..b1ec8784a 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/PrimarySkillType.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/PrimarySkillType.java @@ -66,8 +66,8 @@ public enum PrimarySkillType { ImmutableList.of(SubSkillType.UNARMED_BERSERK, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK, SubSkillType.UNARMED_BLOCK_CRACKER, SubSkillType.UNARMED_ARROW_DEFLECT, SubSkillType.UNARMED_DISARM, SubSkillType.UNARMED_IRON_ARM_STYLE, SubSkillType.UNARMED_IRON_GRIP)), WOODCUTTING(WoodcuttingManager.class, Color.OLIVE, SuperAbilityType.TREE_FELLER, ToolType.AXE, ImmutableList.of(SubSkillType.WOODCUTTING_LEAF_BLOWER, SubSkillType.WOODCUTTING_TREE_FELLER, SubSkillType.WOODCUTTING_HARVEST_LUMBER)), - TRIDENTS(TridentManager.class, Color.TEAL, ImmutableList.of(SubSkillType.TRIDENTS_MULTI_TASKING)), - CROSSBOWS(CrossbowManager.class, Color.ORANGE, ImmutableList.of(SubSkillType.CROSSBOWS_CONE_OF_DEATH)); + TRIDENTS(TridentManager.class, Color.TEAL, ImmutableList.of(SubSkillType.TRIDENTS_MULTI_TASKING, SubSkillType.TRIDENTS_TRIDENTS_LIMIT_BREAK)), + CROSSBOWS(CrossbowManager.class, Color.ORANGE, ImmutableList.of(SubSkillType.CROSSBOWS_CONE_OF_DEATH, SubSkillType.CROSSBOWS_CROSSBOWS_LIMIT_BREAK)); private Class managerClass; private Color skillColor; 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 470f48b0a..e68c8c6c1 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/SubSkillType.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/SubSkillType.java @@ -109,10 +109,12 @@ public enum SubSkillType { /* TRIDENTS */ TRIDENTS_MULTI_TASKING(5), + TRIDENTS_TRIDENTS_LIMIT_BREAK(10), /* CROSSBOWS */ - CROSSBOWS_CONE_OF_DEATH(8); + CROSSBOWS_CONE_OF_DEATH(8), + CROSSBOWS_CROSSBOWS_LIMIT_BREAK(10); private final int numRanks; diff --git a/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java b/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java index b64246df2..70e69d430 100644 --- a/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java @@ -436,6 +436,9 @@ public class InventoryListener implements Listener { public void onInventoryClickEvent(InventoryClickEvent event) { SkillUtils.removeAbilityBuff(event.getCurrentItem()); if (event.getAction() == InventoryAction.HOTBAR_SWAP) { + PlayerInventory playerInventory = event.getWhoClicked().getInventory(); + + if(playerInventory.getSize()) if(event.getWhoClicked().getInventory().getItem(event.getHotbarButton()) != null) SkillUtils.removeAbilityBuff(event.getWhoClicked().getInventory().getItem(event.getHotbarButton())); } diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index 9e9b73baa..7001ff772 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -552,6 +552,15 @@ Woodcutting.Skills.TreeFeller.Other.Off=Tree Feller[[GREEN]] has worn off for [[ Woodcutting.Skills.TreeFeller.Other.On=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Tree Feller! Woodcutting.Skills.TreeFeller.Splinter=YOUR AXE SPLINTERS INTO DOZENS OF PIECES! Woodcutting.Skills.TreeFeller.Threshold=That tree is too large! +#TRIDENTS +Tridents.SubSkill.TridentsLimitBreak.Name=Tridents Limit Break +Tridents.SubSkill.TridentsLimitBreak.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. +Tridents.SubSkill.TridentsLimitBreak.Stat=Limit Break Max DMG +#CROSSBOWS +Crossbows.SubSkill.CrossbowsLimitBreak.Name=Crossbows Limit Break +Crossbows.SubSkill.CrossbowsLimitBreak.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. +Crossbows.SubSkill.CrossbowsLimitBreak.Stat=Limit Break Max DMG + #ABILITIY #COMBAT diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 1de9c8f4c..cefc00efa 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -726,6 +726,9 @@ permissions: description: Allows access to all Tridents abilities children: mcmmo.ability.tridents.multitasking: true + mcmmo.ability.tridents.tridentslimitbreak: true + mcmmo.ability.tridents.tridentslimitbreak: + description: Allows access to Tridents Limit Break sub-skill mcmmo.ability.tridents.multitasking: description: Allows access to Multitasking Trident sub-skill mcmmo.ability.crossbows.*: @@ -737,6 +740,9 @@ permissions: description: Allows access to Crossbow sub-skills children: mcmmo.ability.crossbows.coneofdeath: true + mcmmo.ability.crossbows.crossbowslimitbreak: true + mcmmo.ability.crossbows.crossbowslimitbreak: + description: Allows access to Crossbows Limit Break sub-skill mcmmo.ability.crossbows.coneofdeath: description: Allows access to Cone of Death sub-skill mcmmo.admin: diff --git a/src/main/resources/skillranks.yml b/src/main/resources/skillranks.yml index 131cc05f2..0a01728cb 100644 --- a/src/main/resources/skillranks.yml +++ b/src/main/resources/skillranks.yml @@ -558,8 +558,7 @@ Unarmed: Rank_2: 250 Rank_3: 500 Rank_4: 750 - Rank_5: 1000 - + Rank_5: 1000lo Woodcutting: Splinter: Standard: @@ -671,6 +670,29 @@ Repair: Rank_7: 850 Rank_8: 1000 Tridents: + TridentsLimitBreak: + Standard: + Rank_1: 10 + Rank_2: 20 + Rank_3: 30 + Rank_4: 40 + Rank_5: 50 + Rank_6: 60 + Rank_7: 70 + Rank_8: 80 + Rank_9: 90 + Rank_10: 100 + RetroMode: + Rank_1: 100 + Rank_2: 200 + Rank_3: 300 + Rank_4: 400 + Rank_5: 500 + Rank_6: 600 + Rank_7: 700 + Rank_8: 800 + Rank_9: 900 + Rank_10: 1000 MultiTasking: Standard: Rank_1: 5 @@ -685,6 +707,29 @@ Tridents: Rank_4: 600 Rank_5: 1000 Crossbows: + CrossbowsLimitBreak: + Standard: + Rank_1: 10 + Rank_2: 20 + Rank_3: 30 + Rank_4: 40 + Rank_5: 50 + Rank_6: 60 + Rank_7: 70 + Rank_8: 80 + Rank_9: 90 + Rank_10: 100 + RetroMode: + Rank_1: 100 + Rank_2: 200 + Rank_3: 300 + Rank_4: 400 + Rank_5: 500 + Rank_6: 600 + Rank_7: 700 + Rank_8: 800 + Rank_9: 900 + Rank_10: 1000 ConeOfDeath: Standard: Rank_1: 10