mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 06:36:45 +01:00
Put special combat xp multipliers in their own section
This commit is contained in:
parent
ff8baecb54
commit
7f64fe11b8
@ -115,57 +115,6 @@ public class ExperienceConfig extends ConfigValidated {
|
|||||||
public List<String> validateKeys() {
|
public List<String> validateKeys() {
|
||||||
List<String> reason = new ArrayList<>();
|
List<String> reason = new ArrayList<>();
|
||||||
|
|
||||||
/*
|
|
||||||
* FORMULA SETTINGS
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Global modifier */
|
|
||||||
if (getExperienceGainsGlobalMultiplier() <= 0) {
|
|
||||||
reason.add(EXPERIENCE_FORMULA + "." + MULTIPLIER + "." + GLOBAL + " should be greater than 0!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* PVP modifier */
|
|
||||||
if (getPlayerVersusPlayerXP() < 0) {
|
|
||||||
reason.add(EXPERIENCE_FORMULA + "." + MULTIPLIER + "." + PVP + " should be at least 0!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Spawned Mob modifier */
|
|
||||||
if (getSpawnedMobXpMultiplier() < 0) {
|
|
||||||
reason.add(EXPERIENCE_FORMULA + "." + MOBSPAWNERS + "." + MULTIPLIER + " should be at least 0!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Bred Mob modifier */
|
|
||||||
if (getBredMobXpMultiplier() < 0) {
|
|
||||||
reason.add(EXPERIENCE_FORMULA + "." + BREEDING + "." + MULTIPLIER + " should be at least 0!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Conversion */
|
|
||||||
if (getExpModifier() <= 0) {
|
|
||||||
reason.add(CONVERSION + "." + EXP + MODIFIER + " should be greater than 0!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* XP SETTINGS
|
|
||||||
*/
|
|
||||||
/* Combat XP Multipliers */
|
|
||||||
if (getAnimalsXP() < 0) {
|
|
||||||
reason.add(EXPERIENCE + "." + COMBAT + "." + MULTIPLIER + "." + ANIMALS + " should be at least 0!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Repair */
|
|
||||||
if (getRepairXPBase() <= 0) {
|
|
||||||
reason.add(EXPERIENCE + "." + REPAIR + "." + BASE1 + " should be greater than 0!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Taming */
|
|
||||||
if (getTamingXP(EntityType.WOLF) <= 0) {
|
|
||||||
reason.add(EXPERIENCE + "." + TAMING + "." + ANIMAL_TAMING + "." + WOLF + " should be greater than 0!");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getTamingXP(EntityType.OCELOT) <= 0) {
|
|
||||||
reason.add(EXPERIENCE + "." + TAMING + "." + ANIMAL_TAMING + "." + OCELOT + " should be greater than 0!");
|
|
||||||
}
|
|
||||||
|
|
||||||
return reason;
|
return reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,11 +122,6 @@ public class ExperienceConfig extends ConfigValidated {
|
|||||||
* FORMULA SETTINGS
|
* FORMULA SETTINGS
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Curve settings */
|
|
||||||
public boolean getCumulativeCurveEnabled() {
|
|
||||||
return getBooleanValue(EXPERIENCE_FORMULA, CUMULATIVE + CURVE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Global modifier */
|
/* Global modifier */
|
||||||
public double getExperienceGainsGlobalMultiplier() {
|
public double getExperienceGainsGlobalMultiplier() {
|
||||||
return getDoubleValue(EXPERIENCE_FORMULA, MULTIPLIER, GLOBAL);
|
return getDoubleValue(EXPERIENCE_FORMULA, MULTIPLIER, GLOBAL);
|
||||||
|
@ -191,4 +191,16 @@ public class ConfigExperience {
|
|||||||
public int getShakeXP() {
|
public int getShakeXP() {
|
||||||
return experienceFishing.getShakeXP();
|
return experienceFishing.getShakeXP();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double getMobSpawnerXPMult() {
|
||||||
|
return experienceCombat.getMobSpawnerXPMult();
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getPVPXPMult() {
|
||||||
|
return experienceCombat.getPVPXPMult();
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getAnimalsXPMult() {
|
||||||
|
return experienceCombat.getAnimalsXPMult();
|
||||||
|
}
|
||||||
}
|
}
|
@ -9,12 +9,13 @@ import java.util.HashMap;
|
|||||||
public class ConfigExperienceCombat {
|
public class ConfigExperienceCombat {
|
||||||
|
|
||||||
private static final HashMap<String, Double> COMBAT_EXPERIENCE_DEFAULT;
|
private static final HashMap<String, Double> COMBAT_EXPERIENCE_DEFAULT;
|
||||||
|
private static final HashMap<String, Double> SPECIAL_COMBAT_EXPERIENCE_DEFAULT;
|
||||||
private static final boolean PVP_XP_ENABLED_DEFAULT = false;
|
private static final boolean PVP_XP_ENABLED_DEFAULT = false;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
COMBAT_EXPERIENCE_DEFAULT = new HashMap<>();
|
COMBAT_EXPERIENCE_DEFAULT = new HashMap<>();
|
||||||
|
|
||||||
COMBAT_EXPERIENCE_DEFAULT.put("animals", 1.0D); //TODO: this seems like a dumb config option
|
|
||||||
COMBAT_EXPERIENCE_DEFAULT.put("creeper", 4.0D);
|
COMBAT_EXPERIENCE_DEFAULT.put("creeper", 4.0D);
|
||||||
COMBAT_EXPERIENCE_DEFAULT.put("cat", 1.0D);
|
COMBAT_EXPERIENCE_DEFAULT.put("cat", 1.0D);
|
||||||
COMBAT_EXPERIENCE_DEFAULT.put("fox", 1.0D);
|
COMBAT_EXPERIENCE_DEFAULT.put("fox", 1.0D);
|
||||||
@ -72,11 +73,20 @@ public class ConfigExperienceCombat {
|
|||||||
COMBAT_EXPERIENCE_DEFAULT.put("drowned", 1.0D);
|
COMBAT_EXPERIENCE_DEFAULT.put("drowned", 1.0D);
|
||||||
COMBAT_EXPERIENCE_DEFAULT.put("dolphin", 1.0D);
|
COMBAT_EXPERIENCE_DEFAULT.put("dolphin", 1.0D);
|
||||||
COMBAT_EXPERIENCE_DEFAULT.put("phantom", 4.0D);
|
COMBAT_EXPERIENCE_DEFAULT.put("phantom", 4.0D);
|
||||||
|
|
||||||
|
//SPECIAL
|
||||||
|
SPECIAL_COMBAT_EXPERIENCE_DEFAULT = new HashMap<>();
|
||||||
|
SPECIAL_COMBAT_EXPERIENCE_DEFAULT.put("animals", 1.0D); //TODO: this seems like a dumb config option
|
||||||
|
SPECIAL_COMBAT_EXPERIENCE_DEFAULT.put("mobspawners", 0.0D);
|
||||||
|
SPECIAL_COMBAT_EXPERIENCE_DEFAULT.put("pvp", 1.0D);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Setting(value = "Combat-XP-Multipliers")
|
@Setting(value = "Combat-XP-Multipliers")
|
||||||
private HashMap<String, Double> combatExperienceMap = COMBAT_EXPERIENCE_DEFAULT;
|
private HashMap<String, Double> combatExperienceMap = COMBAT_EXPERIENCE_DEFAULT;
|
||||||
|
|
||||||
|
@Setting(value = "Special-Combat-XP-Multipliers")
|
||||||
|
private HashMap<String, Double> specialCombatExperienceMap = COMBAT_EXPERIENCE_DEFAULT;
|
||||||
|
|
||||||
@Setting(value = "PVP-XP", comment = "If true, players will gain XP from PVP interactions." +
|
@Setting(value = "PVP-XP", comment = "If true, players will gain XP from PVP interactions." +
|
||||||
"\nBe careful turning this on as this can potentially allow for unwanted behaviour from players." +
|
"\nBe careful turning this on as this can potentially allow for unwanted behaviour from players." +
|
||||||
"\nDefault value: " + PVP_XP_ENABLED_DEFAULT)
|
"\nDefault value: " + PVP_XP_ENABLED_DEFAULT)
|
||||||
@ -89,4 +99,16 @@ public class ConfigExperienceCombat {
|
|||||||
public HashMap<String, Double> getCombatExperienceMap() {
|
public HashMap<String, Double> getCombatExperienceMap() {
|
||||||
return combatExperienceMap;
|
return combatExperienceMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double getMobSpawnerXPMult() {
|
||||||
|
return specialCombatExperienceMap.get("mobspawners");
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getPVPXPMult() {
|
||||||
|
return specialCombatExperienceMap.get("pvp");
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getAnimalsXPMult() {
|
||||||
|
return specialCombatExperienceMap.get("animals");
|
||||||
|
}
|
||||||
}
|
}
|
@ -7,6 +7,8 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
|||||||
@ConfigSerializable
|
@ConfigSerializable
|
||||||
public class ConfigExperienceFormula {
|
public class ConfigExperienceFormula {
|
||||||
|
|
||||||
|
public static final boolean CUMULATIVE_CURVE_DEFAULT = false;
|
||||||
|
|
||||||
@Setting(value = "Player-XP-Formula-Type", comment = "Determines which formula is used to determine XP needed to level" +
|
@Setting(value = "Player-XP-Formula-Type", comment = "Determines which formula is used to determine XP needed to level" +
|
||||||
"\nDefault value: LINEAR")
|
"\nDefault value: LINEAR")
|
||||||
private FormulaType formulaType = FormulaType.LINEAR;
|
private FormulaType formulaType = FormulaType.LINEAR;
|
||||||
@ -19,6 +21,9 @@ public class ConfigExperienceFormula {
|
|||||||
"\nEXPONENTIAL Formula: multiplier * level ^ exponent + base")
|
"\nEXPONENTIAL Formula: multiplier * level ^ exponent + base")
|
||||||
private ConfigExperienceFormulaExponential configExperienceFormulaExponential = new ConfigExperienceFormulaExponential();
|
private ConfigExperienceFormulaExponential configExperienceFormulaExponential = new ConfigExperienceFormulaExponential();
|
||||||
|
|
||||||
|
@Setting(value = "Use-Cumulative-XP-Curve", comment = "")
|
||||||
|
private boolean cumulativeCurveEnabled = CUMULATIVE_CURVE_DEFAULT;
|
||||||
|
|
||||||
public FormulaType getFormulaType() {
|
public FormulaType getFormulaType() {
|
||||||
return formulaType;
|
return formulaType;
|
||||||
}
|
}
|
||||||
@ -27,6 +32,10 @@ public class ConfigExperienceFormula {
|
|||||||
return configExperienceFormulaLinear;
|
return configExperienceFormulaLinear;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isCumulativeCurveEnabled() {
|
||||||
|
return cumulativeCurveEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
public ConfigExperienceFormulaExponential getConfigExperienceFormulaExponential() {
|
public ConfigExperienceFormulaExponential getConfigExperienceFormulaExponential() {
|
||||||
return configExperienceFormulaExponential;
|
return configExperienceFormulaExponential;
|
||||||
}
|
}
|
||||||
|
@ -390,7 +390,7 @@ public class PlayerProfile {
|
|||||||
* @return the total amount of Xp until next level
|
* @return the total amount of Xp until next level
|
||||||
*/
|
*/
|
||||||
public int getXpToLevel(PrimarySkillType primarySkillType) {
|
public int getXpToLevel(PrimarySkillType primarySkillType) {
|
||||||
int level = (ExperienceConfig.getInstance().getCumulativeCurveEnabled()) ? UserManager.getPlayer(playerName).getPowerLevel() : skills.get(primarySkillType);
|
int level = (mcMMO.getConfigManager().getConfigLeveling().getConfigExperienceFormula().isCumulativeCurveEnabled()) ? UserManager.getPlayer(playerName).getPowerLevel() : skills.get(primarySkillType);
|
||||||
FormulaType formulaType = mcMMO.getConfigManager().getConfigLeveling().getFormulaType();
|
FormulaType formulaType = mcMMO.getConfigManager().getConfigLeveling().getFormulaType();
|
||||||
|
|
||||||
return mcMMO.getFormulaManager().getCachedXpToLevel(level, formulaType);
|
return mcMMO.getFormulaManager().getCachedXpToLevel(level, formulaType);
|
||||||
|
Loading…
Reference in New Issue
Block a user