Skills which used to unlock at level 5 now unlock at level 1 and some

tweaks to  ranks of other skills, and length scaling for super
abilities. Early game boost has also been modified.
This commit is contained in:
nossr50
2019-06-24 20:17:35 -07:00
parent 764b4c20f5
commit 68ad507be3
10 changed files with 153 additions and 101 deletions

View File

@ -138,7 +138,6 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
}
public boolean isEarlyGameBoostEnabled() { return config.getBoolean("EarlyGameBoost.Enabled", true); }
public double getEarlyGameBoostMultiplier() { return config.getDouble("EarlyGameBoost.MaxLevelMultiplier", 0.05D); }
/*
* FORMULA SETTINGS
@ -151,6 +150,7 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
public boolean isFishingExploitingPrevented() { return config.getBoolean("ExploitFix.Fishing", true); }
public boolean isAcrobaticsExploitingPrevented() { return config.getBoolean("ExploitFix.Acrobatics", true); }
public boolean isTreeFellerXPReduced() { return config.getBoolean("ExploitFix.TreeFellerReducedXP", true); }
/* Curve settings */
public FormulaType getFormulaType() { return FormulaType.getFormulaType(config.getString("Experience_Formula.Curve")); }

View File

@ -41,7 +41,7 @@ public enum SubSkillType {
FISHING_SHAKE(1),
/* Herbalism */
HERBALISM_DOUBLE_DROPS,
HERBALISM_DOUBLE_DROPS(1),
HERBALISM_FARMERS_DIET(5),
HERBALISM_GREEN_TERRA(1),
HERBALISM_GREEN_THUMB(4),
@ -52,7 +52,7 @@ public enum SubSkillType {
MINING_BIGGER_BOMBS(1),
MINING_BLAST_MINING(8),
MINING_DEMOLITIONS_EXPERTISE(1),
MINING_DOUBLE_DROPS,
MINING_DOUBLE_DROPS(1),
MINING_SUPER_BREAKER(1),
/* Repair */

View File

@ -10,7 +10,6 @@ import com.gmail.nossr50.util.skills.SkillUtils;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
import java.util.ArrayList;
@ -19,25 +18,17 @@ import java.util.Set;
public final class Woodcutting {
public static int treeFellerThreshold = Config.getInstance().getTreeFellerThreshold();
protected static boolean treeFellerReachedThreshold = false;
protected enum ExperienceGainMethod {
DEFAULT,
TREE_FELLER,
}
private Woodcutting() {}
/**
* Retrieves the experience reward from a log
*
* @param blockState Log being broken
* @param experienceGainMethod How the log is being broken
* @return Amount of experience
*/
protected static int getExperienceFromLog(BlockState blockState, ExperienceGainMethod experienceGainMethod) {
protected static int getExperienceFromLog(BlockState blockState) {
if (mcMMO.getModManager().isCustomLog(blockState)) {
return mcMMO.getModManager().getBlock(blockState).getXpGain();
}
@ -45,6 +36,33 @@ public final class Woodcutting {
return ExperienceConfig.getInstance().getXp(PrimarySkillType.WOODCUTTING, blockState.getType());
}
/**
* Retrieves the experience reward from logging via Tree Feller
* Experience is reduced per log processed so far
* Experience is only reduced if the config option to reduce Tree Feller XP is set
* Experience per log will not fall below 1 unless the experience for that log is set to 0 in the config
*
* @param blockState Log being broken
* @param woodCount how many logs have given out XP for this tree feller so far
* @return Amount of experience
*/
protected static int processTreeFellerXPGains(BlockState blockState, int woodCount) {
int rawXP = ExperienceConfig.getInstance().getXp(PrimarySkillType.WOODCUTTING, blockState.getType());
if(rawXP <= 0)
return 0;
if(ExperienceConfig.getInstance().isTreeFellerXPReduced()) {
int reducedXP = 1 + (woodCount * 5);
rawXP = Math.max(1, rawXP - reducedXP);
return rawXP;
} else {
return ExperienceConfig.getInstance().getXp(PrimarySkillType.WOODCUTTING, blockState.getType());
}
}
/**
* Checks for double drops
*

View File

@ -9,7 +9,6 @@ import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.SkillManager;
import com.gmail.nossr50.skills.woodcutting.Woodcutting.ExperienceGainMethod;
import com.gmail.nossr50.util.*;
import com.gmail.nossr50.util.player.NotificationManager;
import com.gmail.nossr50.util.random.RandomChanceUtil;
@ -54,7 +53,7 @@ public class WoodcuttingManager extends SkillManager {
* @param blockState Block being broken
*/
public void woodcuttingBlockCheck(BlockState blockState) {
int xp = Woodcutting.getExperienceFromLog(blockState, ExperienceGainMethod.DEFAULT);
int xp = Woodcutting.getExperienceFromLog(blockState);
switch (blockState.getType()) {
case BROWN_MUSHROOM_BLOCK:
@ -116,6 +115,7 @@ public class WoodcuttingManager extends SkillManager {
private void dropBlocks(Set<BlockState> treeFellerBlocks) {
Player player = getPlayer();
int xp = 0;
int processedLogCount = 0;
for (BlockState blockState : treeFellerBlocks) {
Block block = blockState.getBlock();
@ -126,30 +126,18 @@ public class WoodcuttingManager extends SkillManager {
Material material = blockState.getType();
//TODO: Update this to drop the correct items/blocks via NMS
if (material == Material.BROWN_MUSHROOM_BLOCK || material == Material.RED_MUSHROOM_BLOCK) {
xp += Woodcutting.getExperienceFromLog(blockState, ExperienceGainMethod.TREE_FELLER);
xp += Woodcutting.processTreeFellerXPGains(blockState, processedLogCount);
Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops());
}
else if (mcMMO.getModManager().isCustomLog(blockState)) {
if (canGetDoubleDrops()) {
Woodcutting.checkForDoubleDrop(blockState);
}
CustomBlock customBlock = mcMMO.getModManager().getBlock(blockState);
xp = customBlock.getXpGain();
} else if (mcMMO.getModManager().isCustomLeaf(blockState)) {
Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops());
}
else if (mcMMO.getModManager().isCustomLeaf(blockState)) {
Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops());
}
else {
} else {
if (BlockUtils.isLog(blockState)) {
if (canGetDoubleDrops()) {
Woodcutting.checkForDoubleDrop(blockState);
}
xp += Woodcutting.getExperienceFromLog(blockState, ExperienceGainMethod.TREE_FELLER);
xp += Woodcutting.processTreeFellerXPGains(blockState, processedLogCount);
Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops());
}
if (BlockUtils.isLeaves(blockState)) {
@ -159,6 +147,7 @@ public class WoodcuttingManager extends SkillManager {
blockState.setType(Material.AIR);
blockState.update(true);
processedLogCount+=1;
}
applyXpGain(xp, XPGainReason.PVE);

View File

@ -1,43 +1,38 @@
package com.gmail.nossr50.util.player;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import java.util.HashMap;
public class PlayerLevelUtils {
HashMap<PrimarySkillType, Integer> earlyGameBoostCutoffs;
public PlayerLevelUtils()
{
earlyGameBoostCutoffs = new HashMap<>();
calculateEarlyGameBoostCutoffs();
}
private void calculateEarlyGameBoostCutoffs()
{
for(PrimarySkillType primarySkillType : PrimarySkillType.values())
{
int levelCap = Config.getInstance().getLevelCap(primarySkillType);
int cap;
if(levelCap == Integer.MAX_VALUE || levelCap <= 0)
{
cap = Config.getInstance().getIsRetroMode() ? 50 : 5;
} else {
cap = (int) (levelCap * ExperienceConfig.getInstance().getEarlyGameBoostMultiplier());
}
earlyGameBoostCutoffs.put(primarySkillType, cap);
}
}
// HashMap<PrimarySkillType, Integer> earlyGameBoostCutoffs;
//
// public PlayerLevelUtils()
// {
// earlyGameBoostCutoffs = new HashMap<>();
// calculateEarlyGameBoostCutoffs();
// }
// private void calculateEarlyGameBoostCutoffs()
// {
// for(PrimarySkillType primarySkillType : PrimarySkillType.values())
// {
// int levelCap = Config.getInstance().getLevelCap(primarySkillType);
// int cap;
//
// if(levelCap == Integer.MAX_VALUE || levelCap <= 0)
// {
// cap = Config.getInstance().getIsRetroMode() ? 50 : 5;
// } else {
// cap = (int) (levelCap * ExperienceConfig.getInstance().getEarlyGameBoostMultiplier());
// }
//
// earlyGameBoostCutoffs.put(primarySkillType, cap);
// }
// }
public int getEarlyGameCutoff(PrimarySkillType primarySkillType)
{
return earlyGameBoostCutoffs.get(primarySkillType);
return 1;
}
/**

View File

@ -77,14 +77,14 @@ Feedback:
SendCopyOfMessageToChat: true
Skills:
General:
StartingLevel: 1
StartingLevel: 0
Ability:
Length:
Standard:
CapLevel: 50
CapLevel: 100
IncreaseLevel: 5
RetroMode:
CapLevel: 500
CapLevel: 1000
IncreaseLevel: 50
EnchantBuff: 5
# IncreaseLevel: This setting will determine when the length of every ability gets longer with 1 second

View File

@ -24,8 +24,6 @@
# The bar is one solid piece
EarlyGameBoost:
Enabled: true
#Used to determine the cap of the max boot, with default level cap it will be 5 on standard, and 50 on retro
MaxLevelMultiplier: 0.05
ExploitFix:
UnsafeEnchantments: false
# Prevent many exploits related to fishing
@ -33,6 +31,7 @@ ExploitFix:
EndermanEndermiteFarms: true
Acrobatics: true
LavaStoneAndCobbleFarming: true
TreeFellerReducedXP: true
Experience_Bars:
# Turn this to false if you wanna disable XP bars
Enable: true

View File

@ -14,7 +14,7 @@ Alchemy:
Concoctions:
Standard:
Rank_1: 0
Rank_2: 25
Rank_2: 1
Rank_3: 35
Rank_4: 50
Rank_5: 65
@ -23,7 +23,7 @@ Alchemy:
Rank_8: 100
RetroMode:
Rank_1: 0
Rank_2: 250
Rank_2: 1
Rank_3: 350
Rank_4: 500
Rank_5: 650
@ -56,12 +56,12 @@ Archery:
Rank_10: 1000
ArrowRetrieval:
Standard:
Rank_1: 2
Rank_1: 1
RetroMode:
Rank_1: 20
Rank_1: 1
SkillShot:
Standard:
Rank_1: 5
Rank_1: 1
Rank_2: 10
Rank_3: 15
Rank_4: 20
@ -82,7 +82,7 @@ Archery:
Rank_19: 95
Rank_20: 100
RetroMode:
Rank_1: 50
Rank_1: 1
Rank_2: 100
Rank_3: 150
Rank_4: 200
@ -105,9 +105,9 @@ Archery:
Acrobatics:
Dodge:
Standard:
Rank_1: 2
Rank_1: 1
RetroMode:
Rank_1: 20
Rank_1: 1
Axes:
AxesLimitBreak:
Standard:
@ -139,9 +139,9 @@ Axes:
Rank_1: 50
CriticalStrikes:
Standard:
Rank_1: 2
Rank_1: 1
RetroMode:
Rank_1: 20
Rank_1: 1
GreaterImpact:
Standard:
Rank_1: 25
@ -149,7 +149,7 @@ Axes:
Rank_1: 250
ArmorImpact:
Standard:
Rank_1: 5
Rank_1: 1
Rank_2: 10
Rank_3: 15
Rank_4: 20
@ -170,7 +170,7 @@ Axes:
Rank_19: 95
Rank_20: 100
RetroMode:
Rank_1: 50
Rank_1: 1
Rank_2: 100
Rank_3: 150
Rank_4: 200
@ -204,9 +204,9 @@ Axes:
Taming:
BeastLore:
Standard:
Rank_1: 2
Rank_1: 1
RetroMode:
Rank_1: 20
Rank_1: 1
Gore:
Standard:
Rank_1: 15
@ -214,9 +214,9 @@ Taming:
Rank_1: 150
CallOfTheWild:
Standard:
Rank_1: 5
Rank_1: 1
RetroMode:
Rank_1: 50
Rank_1: 1
Pummel:
Standard:
Rank_1: 20
@ -284,7 +284,7 @@ Smelting:
Salvage:
ScrapCollector:
Standard:
Rank_1: 2
Rank_1: 1
Rank_2: 10
Rank_3: 15
Rank_4: 20
@ -293,7 +293,7 @@ Salvage:
Rank_7: 35
Rank_8: 40
RetroMode:
Rank_1: 20
Rank_1: 1
Rank_2: 100
Rank_3: 150
Rank_4: 200
@ -321,6 +321,11 @@ Salvage:
Rank_7: 850
Rank_8: 1000
Mining:
DoubleDrops:
Standard:
Rank_1: 1
RetroMode:
Rank_1: 1
SuperBreaker:
Standard:
Rank_1: 5
@ -358,6 +363,11 @@ Mining:
Rank_7: 850
Rank_8: 1000
Herbalism:
DoubleDrops:
Standard:
Rank_1: 1
RetroMode:
Rank_1: 1
GreenTerra:
Standard:
Rank_1: 5
@ -423,7 +433,7 @@ Fishing:
Rank_5: 1000
TreasureHunter:
Standard:
Rank_1: 10
Rank_1: 1
Rank_2: 25
Rank_3: 35
Rank_4: 50
@ -432,7 +442,7 @@ Fishing:
Rank_7: 85
Rank_8: 100
RetroMode:
Rank_1: 100
Rank_1: 1
Rank_2: 250
Rank_3: 350
Rank_4: 500
@ -478,20 +488,20 @@ Swords:
Rank_1: 200
Rupture:
Standard:
Rank_1: 5
Rank_1: 1
Rank_2: 15
Rank_3: 75
Rank_4: 90
RetroMode:
Rank_1: 50
Rank_1: 1
Rank_2: 150
Rank_3: 750
Rank_4: 900
SerratedStrikes:
Standard:
Rank_1: 10
Rank_1: 5
RetroMode:
Rank_1: 100
Rank_1: 50
Unarmed:
UnarmedLimitBreak:
Standard:
@ -518,9 +528,9 @@ Unarmed:
Rank_10: 1000
Berserk:
Standard:
Rank_1: 10
Rank_1: 5
RetroMode:
Rank_1: 100
Rank_1: 50
ArrowDeflect:
Standard:
Rank_1: 20
@ -538,13 +548,13 @@ Unarmed:
Rank_1: 600
IronArmStyle:
Standard:
Rank_1: 2
Rank_1: 1
Rank_2: 25
Rank_3: 50
Rank_4: 75
Rank_5: 100
RetroMode:
Rank_1: 20
Rank_1: 1
Rank_2: 250
Rank_3: 500
Rank_4: 750
@ -595,7 +605,7 @@ Woodcutting:
Standard:
Rank_1: 1
RetroMode:
Rank_1: 10
Rank_1: 1
LeafBlower:
Standard:
Rank_1: 15
@ -613,7 +623,7 @@ Excavation:
Rank_1: 50
Archaeology:
Standard:
Rank_1: 5
Rank_1: 1
Rank_2: 25
Rank_3: 35
Rank_4: 50
@ -622,7 +632,7 @@ Excavation:
Rank_7: 85
Rank_8: 100
RetroMode:
Rank_1: 50
Rank_1: 1
Rank_2: 250
Rank_3: 350
Rank_4: 500
@ -633,9 +643,9 @@ Excavation:
Repair:
RepairMastery:
Standard:
Rank_1: 20
Rank_1: 1
RetroMode:
Rank_1: 200
Rank_1: 1
SuperRepair:
Standard:
Rank_1: 40