From e4470fd0614194a2032ebcfa327368f04a145622 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 18 Feb 2023 23:44:01 -0800 Subject: [PATCH] More work on end game skills --- Changelog.txt | 33 ++++++++----------- .../commands/skills/HerbalismCommand.java | 7 ++++ .../commands/skills/MiningCommand.java | 9 +++-- .../datatypes/skills/SubSkillType.java | 4 +-- .../nossr50/skills/mining/MiningManager.java | 2 +- .../gmail/nossr50/util/skills/RankUtils.java | 5 ++- src/main/resources/advanced.yml | 11 +++++-- .../resources/locale/locale_en_US.properties | 9 +++-- src/main/resources/plugin.yml | 4 +-- src/main/resources/skillranks.yml | 10 ++++++ 10 files changed, 57 insertions(+), 37 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index adacbc2e8..49e7d1422 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,29 +1,16 @@ Version 2.2.000 - Updated Adventure (our text dependency) fixes some errors when using color codes in party/admin chat (thanks TheBusyBiscuit) - Added some support for negative Y values in anticipation of 1.17 world height changes (thanks t00thpick1) (API) Many skills with RNG elements now send out a SubSkillEvent (which can be used to modify probability or cancel the results), some skills without RNG still send out this event when activated, this event is cancellable so it can be used to make a skill fail Treasure drop rate from Shake, Fishing, Hylian, and Excavation now benefit from the Luck perk - Added a setting to chat.yml to toggle sending party or admin chat messages to console + Added 'Send_To_Console' settings to chat.yml to toggle sending party or admin chat messages to console Added a set of "mastery" subskills meant for end game progression Added the mastery subskill 'Mother Lode' to Mining Added the mastery subskill 'Clean Cuts' to Woodcutting + Added the mastery subskill 'Verdant Bounty' to Herbalism + All new skills have had settings added to advanced.yml Added /mmopower command (aliases /mmopowerlevel /powerlevel) Added 'mcmmo.commands.mmopower' permission node - Added 'mcmmo.ability.acrobatics.mastery' permission node - Added 'mcmmo.ability.alchemy.mastery' permission node - Added 'mcmmo.ability.archery.mastery' permission node - Added 'mcmmo.ability.axes.mastery' permission node - Added 'mcmmo.ability.excavation.mastery' permission node - Added 'mcmmo.ability.fishing.mastery' permission node - Added 'mcmmo.ability.herbalism.mastery' permission node + Added 'mcmmo.ability.herbalism.verdantbounty' permission node Added 'mcmmo.ability.mining.motherlode' permission node - Added 'mcmmo.ability.repair.mastery' permission node - Added 'mcmmo.ability.salvage.mastery' permission node - Added 'mcmmo.ability.smelting.mastery' permission node - Added 'mcmmo.ability.salvage.mastery' permission node - Added 'mcmmo.ability.swords.mastery' permission node - Added 'mcmmo.ability.taming.mastery' permission node - Added 'mcmmo.ability.unarmed.mastery' permission node Added 'mcmmo.ability.woodcutting.cleancuts' permission node Added 'Mining.SubSkill.MotherLode.Name' to locale Added 'Mining.SubSkill.MotherLode.Stat' to locale @@ -31,9 +18,12 @@ Version 2.2.000 Added 'Woodcutting.SubSkill.CleanCuts.Name' to locale Added 'Woodcutting.SubSkill.CleanCuts.Stat' to locale Added 'Woodcutting.SubSkill.CleanCuts.Description' to locale - (Codebase) Major refactoring for how random chance was handled in the code + Added 'Herbalism.SubSkill.VerdantBounty.Name' to locale + Added 'Herbalism.SubSkill.VerdantBounty.Stat' to locale + Added 'Herbalism.SubSkill.VerdantBounty.Description' to locale + (Codebase) Major rewrite for how random chance was handled in the code - Added 'General.PowerLevel.Skill_Mastery.Enabled' to config.yml which is used to enable or disable the mastery skills (will also disable the new power level command) + Added 'General.PowerLevel.Skill_Mastery.Enabled' to config.yml which is used to enable or disable the mastery skills wholesale (will also disable the new power level command) NOTES: The goal of this update is to provide a small benefit to each skill and a reason to grind past the "maximum", ideally for a long while. @@ -47,12 +37,15 @@ Version 2.2.000 Mastery Skills Mining / Mother Lode: With default settings, when players hit level 1,000 they will unlock this sub-skill, it will add a 1% chance to get triple drops while mining (this can be edited in advanced.yml), this skill maxes out at 10.0% chance at level 10,000. This skill respects double drop settings from the config files. - Double Drops only occur if the Triple Drops fail, these two skills do not stack. + Double drops will only get checked if the Triple Drops fail for players that have Mother Lode unlocked, these two skills do not stack. Woodcutting / Clean Cuts: With default settings, when players hit level 1,000 they will unlock this sub-skill, it will add a 1% chance to get triple drops while woodcutting or using Tree Feller (this can be edited in advanced.yml), this skill maxes out at 10.0% chance at level 10,000. This skill respects double drop settings from the config files. Double Drops (Harvest Lumber) will only get checked if the Triple Drops fail for players that have Clean Cuts unlocked, these two skills do not stack. + Herbalism / Verdant Bounty: With default settings, when players hit level 1,000 they will unlock this sub-skill, it will add a 1% chance to get triple drops when harvesting crops (this can be edited in advanced.yml), this skill maxes out at 10.0% chance at level 10,000. + This skill respects double drop settings from the config files. + Double Drops only occur if the Triple Drops fail, these two skills do not stack. New Power Level Command This power level command gives you a view of all your current masteries, it also provides a summary of your power level. diff --git a/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java index 3df385974..eeb1bdd59 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java @@ -35,6 +35,7 @@ public class HerbalismCommand extends SkillCommand { private boolean canGreenThumbBlocks; private boolean canFarmersDiet; private boolean canDoubleDrop; + private boolean canTripleDrop; private boolean canShroomThumb; public HerbalismCommand() { @@ -50,6 +51,12 @@ public class HerbalismCommand extends SkillCommand { doubleDropChance = doubleDropStrings[0]; doubleDropChanceLucky = doubleDropStrings[1]; } + + if (canTripleDrop) { + String[] tripleDropStrings = ProbabilityUtil.getRNGDisplayValues(player, SubSkillType.HERBALISM_VERDANT_BOUNTY); + doubleDropChance = tripleDropStrings[0]; + doubleDropChanceLucky = tripleDropStrings[1]; + } // FARMERS DIET if (canFarmersDiet) { diff --git a/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java index 72be89643..b756dd282 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java @@ -32,7 +32,7 @@ public class MiningCommand extends SkillCommand { private boolean canSuperBreaker; private boolean canDoubleDrop; - private boolean canMotherLode; + private boolean canTripleDrop; private boolean canBlast; private boolean canBiggerBombs; private boolean canDemoExpert; @@ -56,7 +56,7 @@ public class MiningCommand extends SkillCommand { } // Mastery TRIPLE DROPS - if (canMotherLode) { + if (canTripleDrop) { String[] masteryTripleDropStrings = ProbabilityUtil.getRNGDisplayValues(player, SubSkillType.MINING_MOTHER_LODE); tripleDropChance = masteryTripleDropStrings[0]; tripleDropChanceLucky = masteryTripleDropStrings[1]; @@ -83,7 +83,7 @@ public class MiningCommand extends SkillCommand { canBlast = RankUtils.hasUnlockedSubskill(player, SubSkillType.MINING_BLAST_MINING) && Permissions.remoteDetonation(player); canDemoExpert = RankUtils.hasUnlockedSubskill(player, SubSkillType.MINING_DEMOLITIONS_EXPERTISE) && Permissions.demolitionsExpertise(player); canDoubleDrop = Permissions.canUseSubSkill(player, SubSkillType.MINING_DOUBLE_DROPS); - canMotherLode = Permissions.canUseSubSkill(player, SubSkillType.MINING_MOTHER_LODE); + canTripleDrop = Permissions.canUseSubSkill(player, SubSkillType.MINING_MOTHER_LODE); canSuperBreaker = RankUtils.hasUnlockedSubskill(player, SubSkillType.MINING_SUPER_BREAKER) && Permissions.superBreaker(player); } @@ -112,12 +112,11 @@ public class MiningCommand extends SkillCommand { //messages.add(LocaleLoader.getString("Mining.Effect.DropChance", doubleDropChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : "")); } - if(canMotherLode) { + if(canTripleDrop) { messages.add(getStatMessage(SubSkillType.MINING_MOTHER_LODE, tripleDropChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", tripleDropChanceLucky) : "")); } - if (canSuperBreaker) { messages.add(getStatMessage(SubSkillType.MINING_SUPER_BREAKER, superBreakerLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", superBreakerLengthEndurance) : "")); 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 c5d95445a..c8f4cc926 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/SubSkillType.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/SubSkillType.java @@ -38,7 +38,6 @@ public enum SubSkillType { /* Excavation */ EXCAVATION_ARCHAEOLOGY(8), EXCAVATION_GIGA_DRILL_BREAKER(1), - EXCAVATION_MASTERY(1), /* Fishing */ FISHING_FISHERMANS_DIET(5), @@ -51,6 +50,7 @@ public enum SubSkillType { /* Herbalism */ HERBALISM_DOUBLE_DROPS(1), + HERBALISM_VERDANT_BOUNTY(1), HERBALISM_FARMERS_DIET(5), HERBALISM_GREEN_TERRA(1), HERBALISM_GREEN_THUMB(4), @@ -147,7 +147,7 @@ public enum SubSkillType { /** * !!! This relies on the immutable lists in PrimarySkillType being populated !!! * If we add skills, those immutable lists need to be updated - * @return + * @return the parent skill of this subskill */ public PrimarySkillType getParentSkill() { return mcMMO.p.getSkillTools().getPrimarySkillBySubSkill(this); } diff --git a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java index 91197cc03..a9e6e3b82 100644 --- a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java +++ b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java @@ -35,7 +35,7 @@ public class MiningManager extends SkillManager { public static final String BUDDING_AMETHYST = "budding_amethyst"; - public MiningManager(McMMOPlayer mcMMOPlayer) { + public MiningManager(@NotNull McMMOPlayer mcMMOPlayer) { super(mcMMOPlayer, PrimarySkillType.MINING); } diff --git a/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java b/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java index c36821cc7..6d8b31066 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java @@ -24,7 +24,7 @@ public class RankUtils { * * @param plugin plugin instance ref * @param mcMMOPlayer target player - * @param primarySkillType + * @param primarySkillType the skill to check * @param newLevel the new level of this skill */ public static void executeSkillUnlockNotifications(Plugin plugin, McMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType, int newLevel) @@ -55,6 +55,9 @@ public class RankUtils { } } + /** + * Reset the interval between skill unlock notifications + */ public static void resetUnlockDelayTimer() { count = 0; diff --git a/src/main/resources/advanced.yml b/src/main/resources/advanced.yml index 3fe4585de..087445f52 100644 --- a/src/main/resources/advanced.yml +++ b/src/main/resources/advanced.yml @@ -257,6 +257,11 @@ Skills: MaxBonusLevel: Standard: 100 RetroMode: 1000 + VerdantBounty: + ChanceMax: 15.0 + MaxBonusLevel: + Standard: 1000 + RetroMode: 10000 HylianLuck: # ChanceMax: Maximum chance of Hylian Luck when on or higher @@ -281,7 +286,7 @@ Skills: MaxBonusLevel: Standard: 1000 RetroMode: 10000 - ChanceMax: 10.0 + ChanceMax: 15.0 SuperBreaker: AllowTripleDrops: true DoubleDrops: @@ -606,9 +611,9 @@ Skills: # Triple Drops CleanCuts: - # ChanceMax: Maximum chance of receiving double drops (100 = 100%) + # ChanceMax: Maximum chance of receiving triple drops (100 = 100%) # MaxBonusLevel: Level when the maximum chance of receiving double drops is reached - ChanceMax: 10.0 + ChanceMax: 15.0 MaxBonusLevel: Standard: 1000 RetroMode: 10000 diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index 6b0886b12..35ec18c3c 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -285,8 +285,11 @@ Herbalism.SubSkill.FarmersDiet.Name=Farmer's Diet Herbalism.SubSkill.FarmersDiet.Description=Improves hunger restored from farmed foods Herbalism.SubSkill.FarmersDiet.Stat=Farmer's Diet: &aRank {0} Herbalism.SubSkill.DoubleDrops.Name=Double Drops -Herbalism.SubSkill.DoubleDrops.Description=Double the normal loot +Herbalism.SubSkill.DoubleDrops.Description=Skillfully harvest double the loot Herbalism.SubSkill.DoubleDrops.Stat=Double Drop Chance +Herbalism.SubSkill.VerdantBounty.Name=Verdant Bounty +Herbalism.SubSkill.VerdantBounty.Description=Masterfully harvest triple the loot +Herbalism.SubSkill.VerdantBounty.Stat=Triple Drop Chance Herbalism.SubSkill.HylianLuck.Name=Hylian Luck Herbalism.SubSkill.HylianLuck.Description=Gives a small chance of finding rare items Herbalism.SubSkill.HylianLuck.Stat=Hylian Luck Chance @@ -311,10 +314,10 @@ Mining.SubSkill.SuperBreaker.Name=Super Breaker Mining.SubSkill.SuperBreaker.Description=Speed+, Triple Drop Chance Mining.SubSkill.SuperBreaker.Stat=Super Breaker Length Mining.SubSkill.DoubleDrops.Name=Double Drops -Mining.SubSkill.DoubleDrops.Description=Double the normal loot +Mining.SubSkill.DoubleDrops.Description=Skillfully mine double the loot Mining.SubSkill.DoubleDrops.Stat=Double Drop Chance Mining.SubSkill.MotherLode.Name=Mother Lode -Mining.SubSkill.MotherLode.Description=Triple the normal loot +Mining.SubSkill.MotherLode.Description=Masterfully mine triple the loot Mining.SubSkill.MotherLode.Stat=Triple Drop Chance Mining.SubSkill.BlastMining.Name=Blast Mining Mining.SubSkill.BlastMining.Description=Bonuses to mining with TNT diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index b6b190b66..41bfa187a 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -397,8 +397,8 @@ permissions: mcmmo.ability.herbalism.greenthumb.all: true mcmmo.ability.herbalism.hylianluck: true mcmmo.ability.herbalism.shroomthumb: true - mcmmo.ability.herbalism.mastery: true - mcmmo.ability.herbalism.mastery: + mcmmo.ability.herbalism.verdantbounty: true + mcmmo.ability.herbalism.verdantbounty: description: Allows access to end game progression for Herbalism mcmmo.ability.herbalism.doubledrops: description: Allows double drop chance from Herbalism diff --git a/src/main/resources/skillranks.yml b/src/main/resources/skillranks.yml index df742e81a..fa300973b 100644 --- a/src/main/resources/skillranks.yml +++ b/src/main/resources/skillranks.yml @@ -413,6 +413,11 @@ Herbalism: Rank_1: 1 RetroMode: Rank_1: 1 + VerdantBounty: + Standard: + Rank_1: 100 + RetroMode: + Rank_1: 1000 GreenTerra: Standard: Rank_1: 5 @@ -688,6 +693,11 @@ Woodcutting: Rank_1: 1 RetroMode: Rank_1: 1 + CleanCuts: + Standard: + Rank_1: 100 + RetroMode: + Rank_1: 1000 KnockOnWood: Standard: Rank_1: 30