More work on end game skills

This commit is contained in:
nossr50
2023-02-18 23:44:01 -08:00
parent 12fb4a3679
commit e4470fd061
10 changed files with 57 additions and 37 deletions

View File

@ -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) {

View File

@ -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) : ""));

View File

@ -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); }

View File

@ -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);
}

View File

@ -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;