mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-24 14:16:45 +01:00
Add Clean Cuts to Woodcutting
This commit is contained in:
parent
32b41b3fd3
commit
addf9b0431
@ -11,7 +11,7 @@ Version 2.1.175
|
||||
Added 'mcmmo.ability.excavation.mastery' permission node
|
||||
Added 'mcmmo.ability.fishing.mastery' permission node
|
||||
Added 'mcmmo.ability.herbalism.mastery' permission node
|
||||
Added 'mcmmo.ability.mining.mastery' 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
|
||||
@ -19,13 +19,13 @@ Version 2.1.175
|
||||
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.mastery' permission node
|
||||
Added 'mcmmo.ability.woodcutting.cleancuts' permission node
|
||||
Added 'Mining.SubSkill.MotherLode.Name' to locale
|
||||
Added 'Mining.SubSkill.MotherLode.Stat' to locale
|
||||
Added 'Mining.SubSkill.MotherLode.Description' to locale
|
||||
Added 'Woodcutting.SubSkill.Mastery.Name' to locale
|
||||
Added 'Woodcutting.SubSkill.Mastery.Stat' to locale
|
||||
Added 'Woodcutting.SubSkill.Mastery.Description' to locale
|
||||
Added 'Woodcutting.SubSkill.CleanCuts.Name' to locale
|
||||
Added 'Woodcutting.SubSkill.CleanCuts.Stat' to locale
|
||||
Added 'Woodcutting.SubSkill.CleanCuts.Description' to locale
|
||||
|
||||
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)
|
||||
|
||||
@ -39,10 +39,14 @@ Version 2.1.175
|
||||
The section below assumes RetroMode, if you are using Standard mode (1-100) just divide level examples by 10.
|
||||
|
||||
Mastery Skills
|
||||
Mining (Mastery Triple Drops): 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.
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
|
@ -18,8 +18,8 @@ import java.util.List;
|
||||
public class MiningCommand extends SkillCommand {
|
||||
private String doubleDropChance;
|
||||
private String doubleDropChanceLucky;
|
||||
private String masteryTripleDropChance;
|
||||
private String masteryTripleDropChanceLucky;
|
||||
private String tripleDropChance;
|
||||
private String tripleDropChanceLucky;
|
||||
private String superBreakerLength;
|
||||
private String superBreakerLengthEndurance;
|
||||
|
||||
@ -32,6 +32,7 @@ public class MiningCommand extends SkillCommand {
|
||||
|
||||
private boolean canSuperBreaker;
|
||||
private boolean canDoubleDrop;
|
||||
private boolean canTripleDrop;
|
||||
private boolean canBlast;
|
||||
private boolean canBiggerBombs;
|
||||
private boolean canDemoExpert;
|
||||
@ -55,10 +56,10 @@ public class MiningCommand extends SkillCommand {
|
||||
}
|
||||
|
||||
// Mastery TRIPLE DROPS
|
||||
if (Permissions.canUseSubSkill(player, SubSkillType.MINING_MOTHER_LODE)) {
|
||||
if (canTripleDrop) {
|
||||
String[] masteryTripleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.MINING_MOTHER_LODE);
|
||||
masteryTripleDropChance = masteryTripleDropStrings[0];
|
||||
masteryTripleDropChanceLucky = masteryTripleDropStrings[1];
|
||||
tripleDropChance = masteryTripleDropStrings[0];
|
||||
tripleDropChanceLucky = masteryTripleDropStrings[1];
|
||||
}
|
||||
|
||||
|
||||
@ -83,6 +84,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);
|
||||
canTripleDrop = Permissions.canUseSubSkill(player, SubSkillType.MINING_MOTHER_LODE);
|
||||
canSuperBreaker = RankUtils.hasUnlockedSubskill(player, SubSkillType.MINING_SUPER_BREAKER) && Permissions.superBreaker(player);
|
||||
}
|
||||
|
||||
@ -105,17 +107,18 @@ public class MiningCommand extends SkillCommand {
|
||||
//messages.add(LocaleLoader.getString("Mining.Effect.Decrease", blastDamageDecrease));
|
||||
}
|
||||
|
||||
if(Permissions.canUseSubSkill(player, SubSkillType.MINING_MOTHER_LODE)) {
|
||||
messages.add(getStatMessage(SubSkillType.MINING_MOTHER_LODE, masteryTripleDropChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", masteryTripleDropChanceLucky) : ""));
|
||||
}
|
||||
|
||||
if (canDoubleDrop) {
|
||||
messages.add(getStatMessage(SubSkillType.MINING_DOUBLE_DROPS, doubleDropChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : ""));
|
||||
//messages.add(LocaleLoader.getString("Mining.Effect.DropChance", doubleDropChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : ""));
|
||||
}
|
||||
|
||||
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) : ""));
|
||||
|
@ -17,15 +17,18 @@ public class WoodcuttingCommand extends SkillCommand {
|
||||
private String treeFellerLength;
|
||||
private String treeFellerLengthEndurance;
|
||||
private String doubleDropChance;
|
||||
private String tripleDropChance;
|
||||
private String doubleDropChanceLucky;
|
||||
private String tripleDropChanceLucky;
|
||||
|
||||
private boolean canTreeFell;
|
||||
private boolean canLeafBlow;
|
||||
private boolean canDoubleDrop;
|
||||
private boolean canTripleDrop;
|
||||
private boolean canKnockOnWood;
|
||||
private boolean canSplinter;
|
||||
private boolean canBarkSurgeon;
|
||||
private boolean canNaturesBounty;
|
||||
// private boolean canSplinter;
|
||||
// private boolean canBarkSurgeon;
|
||||
// private boolean canNaturesBounty;
|
||||
|
||||
public WoodcuttingCommand() {
|
||||
super(PrimarySkillType.WOODCUTTING);
|
||||
@ -38,6 +41,13 @@ public class WoodcuttingCommand extends SkillCommand {
|
||||
setDoubleDropClassicChanceStrings(player);
|
||||
}
|
||||
|
||||
//Clean Cuts
|
||||
if(canTripleDrop) {
|
||||
String[] tripleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.WOODCUTTING_CLEAN_CUTS);
|
||||
tripleDropChance = tripleDropStrings[0];
|
||||
tripleDropChanceLucky = tripleDropStrings[1];
|
||||
}
|
||||
|
||||
// TREE FELLER
|
||||
if (canTreeFell) {
|
||||
String[] treeFellerStrings = calculateLengthDisplayValues(player, skillValue);
|
||||
@ -55,7 +65,8 @@ public class WoodcuttingCommand extends SkillCommand {
|
||||
@Override
|
||||
protected void permissionsCheck(Player player) {
|
||||
canTreeFell = RankUtils.hasUnlockedSubskill(player, SubSkillType.WOODCUTTING_TREE_FELLER) && Permissions.treeFeller(player);
|
||||
canDoubleDrop = Permissions.canUseSubSkill(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) && !skill.getDoubleDropsDisabled() && RankUtils.getRank(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) >= 1;
|
||||
canDoubleDrop = Permissions.canUseSubSkill(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) && !skill.getDoubleDropsDisabled();
|
||||
canTripleDrop = Permissions.canUseSubSkill(player, SubSkillType.WOODCUTTING_CLEAN_CUTS) && !skill.getDoubleDropsDisabled();
|
||||
canLeafBlow = Permissions.canUseSubSkill(player, SubSkillType.WOODCUTTING_LEAF_BLOWER);
|
||||
canKnockOnWood = canTreeFell && Permissions.canUseSubSkill(player, SubSkillType.WOODCUTTING_KNOCK_ON_WOOD);
|
||||
/*canSplinter = canUseSubskill(player, SubSkillType.WOODCUTTING_SPLINTER);
|
||||
@ -72,6 +83,12 @@ public class WoodcuttingCommand extends SkillCommand {
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : ""));
|
||||
}
|
||||
|
||||
if(canTripleDrop) {
|
||||
messages.add(getStatMessage(SubSkillType.WOODCUTTING_CLEAN_CUTS, tripleDropChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", tripleDropChanceLucky) : ""));
|
||||
}
|
||||
|
||||
|
||||
if (canKnockOnWood) {
|
||||
String lootNote;
|
||||
|
||||
|
@ -63,7 +63,7 @@ public enum PrimarySkillType {
|
||||
UNARMED(UnarmedManager.class, Color.BLACK, SuperAbilityType.BERSERK, ToolType.FISTS,
|
||||
ImmutableList.of(SubSkillType.UNARMED_MASTERY, SubSkillType.UNARMED_BERSERK, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK, SubSkillType.UNARMED_BLOCK_CRACKER, SubSkillType.UNARMED_ARROW_DEFLECT, SubSkillType.UNARMED_DISARM, SubSkillType.UNARMED_STEEL_ARM_STYLE, SubSkillType.UNARMED_IRON_GRIP)),
|
||||
WOODCUTTING(WoodcuttingManager.class, Color.OLIVE, SuperAbilityType.TREE_FELLER, ToolType.AXE,
|
||||
ImmutableList.of(SubSkillType.WOODCUTTING_MASTERY, SubSkillType.WOODCUTTING_LEAF_BLOWER, SubSkillType.WOODCUTTING_TREE_FELLER, SubSkillType.WOODCUTTING_HARVEST_LUMBER, SubSkillType.WOODCUTTING_KNOCK_ON_WOOD));
|
||||
ImmutableList.of(SubSkillType.WOODCUTTING_CLEAN_CUTS, SubSkillType.WOODCUTTING_LEAF_BLOWER, SubSkillType.WOODCUTTING_TREE_FELLER, SubSkillType.WOODCUTTING_HARVEST_LUMBER, SubSkillType.WOODCUTTING_KNOCK_ON_WOOD));
|
||||
|
||||
private final Class<? extends SkillManager> managerClass;
|
||||
private final Color skillColor;
|
||||
|
@ -119,7 +119,7 @@ public enum SubSkillType {
|
||||
/* WOODCUTTING_NATURES_BOUNTY(3),
|
||||
WOODCUTTING_SPLINTER(3),*/
|
||||
WOODCUTTING_TREE_FELLER(1),
|
||||
WOODCUTTING_MASTERY(1);
|
||||
WOODCUTTING_CLEAN_CUTS(1);
|
||||
|
||||
private final int numRanks;
|
||||
//TODO: SuperAbilityType should also contain flags for active by default? Not sure if it should work that way.
|
||||
|
@ -358,7 +358,7 @@ public class BlockListener implements Listener {
|
||||
woodcuttingManager.processWoodcuttingBlockXP(blockState);
|
||||
|
||||
//Check for bonus drops
|
||||
woodcuttingManager.processHarvestLumber(blockState);
|
||||
woodcuttingManager.processBonusDropCheck(blockState);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
//TODO: Seems to not be using the item drop event for bonus drops, may want to change that.. or may not be able to be changed?
|
||||
public class WoodcuttingManager extends SkillManager {
|
||||
private boolean treeFellerReachedThreshold = false;
|
||||
private static int treeFellerThreshold; //TODO: Shared setting, will be removed in 2.2
|
||||
@ -68,21 +69,40 @@ public class WoodcuttingManager extends SkillManager {
|
||||
&& ItemUtils.isAxe(heldItem);
|
||||
}
|
||||
|
||||
private boolean checkHarvestLumberActivation(@NotNull Material material) {
|
||||
return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.WOODCUTTING_HARVEST_LUMBER)
|
||||
&& RankUtils.hasReachedRank(1, getPlayer(), SubSkillType.WOODCUTTING_HARVEST_LUMBER)
|
||||
&& RandomChanceUtil.isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.WOODCUTTING_HARVEST_LUMBER, getPlayer())
|
||||
&& Config.getInstance().getDoubleDropsEnabled(PrimarySkillType.WOODCUTTING, material);
|
||||
private boolean checkHarvestLumberActivation() {
|
||||
return RandomChanceUtil.isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.WOODCUTTING_HARVEST_LUMBER, getPlayer());
|
||||
}
|
||||
|
||||
private boolean checkCleanCutsActivation() {
|
||||
return RandomChanceUtil.isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.WOODCUTTING_CLEAN_CUTS, getPlayer());
|
||||
}
|
||||
|
||||
/**
|
||||
* Begins Woodcutting
|
||||
* Processes bonus drops for a block
|
||||
*
|
||||
* @param blockState Block being broken
|
||||
*/
|
||||
public void processHarvestLumber(@NotNull BlockState blockState) {
|
||||
if (checkHarvestLumberActivation(blockState.getType())) {
|
||||
spawnHarvestLumberBonusDrops(blockState);
|
||||
public void processBonusDropCheck(@NotNull BlockState blockState) {
|
||||
//TODO: Why isn't this using the item drop event? Potentially because of Tree Feller? This should be adjusted either way.
|
||||
if(Config.getInstance().getDoubleDropsEnabled(PrimarySkillType.WOODCUTTING, blockState.getType())) {
|
||||
//Mastery enabled for player
|
||||
if(Permissions.canUseSubSkill(getPlayer(), SubSkillType.WOODCUTTING_CLEAN_CUTS)) {
|
||||
if(checkCleanCutsActivation()) {
|
||||
//Triple drops
|
||||
spawnHarvestLumberBonusDrops(blockState);
|
||||
spawnHarvestLumberBonusDrops(blockState);
|
||||
} else {
|
||||
//Harvest Lumber Check
|
||||
if(checkHarvestLumberActivation()) {
|
||||
spawnHarvestLumberBonusDrops(blockState);
|
||||
}
|
||||
}
|
||||
//No Mastery (no Clean Cuts)
|
||||
} else if (Permissions.canUseSubSkill(getPlayer(), SubSkillType.WOODCUTTING_HARVEST_LUMBER)) {
|
||||
if(checkHarvestLumberActivation()) {
|
||||
spawnHarvestLumberBonusDrops(blockState);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -299,7 +319,7 @@ public class WoodcuttingManager extends SkillManager {
|
||||
Misc.spawnItemsFromCollection(Misc.getBlockCenter(blockState), block.getDrops(), ItemSpawnReason.TREE_FELLER_DISPLACED_BLOCK);
|
||||
|
||||
//Bonus Drops / Harvest lumber checks
|
||||
processHarvestLumber(blockState);
|
||||
processBonusDropCheck(blockState);
|
||||
} else if (BlockUtils.isNonWoodPartOfTree(blockState)) {
|
||||
//Drop displaced non-woodcutting XP blocks
|
||||
|
||||
|
@ -112,13 +112,6 @@ public class RandomChanceUtil {
|
||||
return rollDice(chanceOfSuccess, 100);
|
||||
}
|
||||
|
||||
|
||||
/*public static double getRandomChanceExecutionChance(RandomChanceSkill randomChance)
|
||||
{
|
||||
double chanceOfSuccess = calculateChanceOfSuccess(randomChance);
|
||||
return chanceOfSuccess;
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Gets the Static Chance for something to activate
|
||||
*
|
||||
@ -141,11 +134,6 @@ public class RandomChanceUtil {
|
||||
return chanceOfSuccess;
|
||||
}
|
||||
|
||||
/*private static double calculateChanceOfSuccess(RandomChanceStatic randomChance) {
|
||||
double chanceOfSuccess = getChanceOfSuccess(randomChance.getXPos(), randomChance.getProbabilityCap());
|
||||
return chanceOfSuccess;
|
||||
}*/
|
||||
|
||||
public static double calculateChanceOfSuccess(@NotNull RandomChanceSkill randomChance) {
|
||||
double skillLevel = randomChance.getSkillLevel();
|
||||
double maximumProbability = randomChance.getProbabilityCap();
|
||||
|
@ -590,9 +590,16 @@ Skills:
|
||||
Knock_On_Wood:
|
||||
Add_XP_Orbs_To_Drops: true
|
||||
|
||||
# Triple Drops
|
||||
CleanCuts:
|
||||
# ChanceMax: Maximum chance of receiving double drops (100 = 100%)
|
||||
# MaxBonusLevel: Level when the maximum chance of receiving double drops is reached
|
||||
ChanceMax: 10.0
|
||||
MaxBonusLevel:
|
||||
Standard: 1000
|
||||
RetroMode: 10000
|
||||
# Double Drops
|
||||
HarvestLumber:
|
||||
# ChanceMax & MaxBonusLevel are only used for Classic, I'll make that more clear in the future.
|
||||
# ChanceMax: Maximum chance of receiving double drops (100 = 100%)
|
||||
# MaxBonusLevel: Level when the maximum chance of receiving double drops is reached
|
||||
ChanceMax: 100.0
|
||||
|
@ -314,7 +314,7 @@ Mining.SubSkill.DoubleDrops.Description=Double the normal 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.Stat=Mother Lode Chance
|
||||
Mining.SubSkill.MotherLode.Stat=Triple Drop Chance
|
||||
Mining.SubSkill.BlastMining.Name=Blast Mining
|
||||
Mining.SubSkill.BlastMining.Description=Bonuses to mining with TNT
|
||||
Mining.SubSkill.BlastMining.Stat=Blast Mining:&a Rank {0}/{1} &7({2})
|
||||
@ -544,9 +544,9 @@ Woodcutting.SubSkill.KnockOnWood.Loot.Rank2=Standard loot from trees and experie
|
||||
Woodcutting.SubSkill.HarvestLumber.Name=Harvest Lumber
|
||||
Woodcutting.SubSkill.HarvestLumber.Description=Skillfully extract up to double the Lumber
|
||||
Woodcutting.SubSkill.HarvestLumber.Stat=Double Drop Chance
|
||||
Woodcutting.SubSkill.Mastery.Name=Clean Cuts
|
||||
Woodcutting.SubSkill.Mastery.Description=Masterfully extract up to triple the Lumber
|
||||
Woodcutting.SubSkill.Mastery.Stat=Triple Drop Chance
|
||||
Woodcutting.SubSkill.CleanCuts.Name=Clean Cuts
|
||||
Woodcutting.SubSkill.CleanCuts.Description=Masterfully extract up to triple the Lumber
|
||||
Woodcutting.SubSkill.CleanCuts.Stat=Triple Drop Chance
|
||||
Woodcutting.SubSkill.Splinter.Name=Splinter
|
||||
Woodcutting.SubSkill.Splinter.Description=Cut down trees more efficiently.
|
||||
Woodcutting.SubSkill.BarkSurgeon.Name=Bark Surgeon
|
||||
|
@ -768,8 +768,8 @@ permissions:
|
||||
mcmmo.ability.woodcutting.knockonwood: true
|
||||
mcmmo.ability.woodcutting.leafblower: true
|
||||
mcmmo.ability.woodcutting.treefeller: true
|
||||
mcmmo.ability.woodcutting.mastery: true
|
||||
mcmmo.ability.woodcutting.mastery:
|
||||
mcmmo.ability.woodcutting.cleancuts: true
|
||||
mcmmo.ability.woodcutting.cleancuts:
|
||||
description: Allows access to end game progression for Woodcutting
|
||||
mcmmo.ability.woodcutting.knockonwood:
|
||||
description: Allows access to Knock on Wood subskill
|
||||
|
Loading…
Reference in New Issue
Block a user