Wire up special combat XP multipliers

This commit is contained in:
nossr50 2019-04-30 00:57:50 -07:00
parent 6932abc9d8
commit 06016f4ada
5 changed files with 16 additions and 20 deletions

View File

@ -128,18 +128,6 @@ public class ExperienceConfig extends ConfigValidated {
}*/ }*/
/* PVP modifier */ /* PVP modifier */
public double getPlayerVersusPlayerXP() {
return getDoubleValue(EXPERIENCE_FORMULA, MULTIPLIER, PVP);
}
/* Spawned Mob modifier */
public double getSpawnedMobXpMultiplier() {
return getDoubleValue(EXPERIENCE_FORMULA, MOBSPAWNERS, MULTIPLIER);
}
public double getBredMobXpMultiplier() {
return getDoubleValue(EXPERIENCE_FORMULA, BREEDING, MULTIPLIER);
}
/* Skill modifiers */ /* Skill modifiers */
public double getFormulaSkillModifier(PrimarySkillType skill) { public double getFormulaSkillModifier(PrimarySkillType skill) {
@ -186,10 +174,6 @@ public class ExperienceConfig extends ConfigValidated {
return getDoubleValue(EXPERIENCE, COMBAT, MULTIPLIER, StringUtils.getEntityConfigName(entity)); return getDoubleValue(EXPERIENCE, COMBAT, MULTIPLIER, StringUtils.getEntityConfigName(entity));
} }
public double getAnimalsXP() {
return getDoubleValue(EXPERIENCE, COMBAT, MULTIPLIER, ANIMALS);
}
public boolean hasCombatXP(EntityType entity) { public boolean hasCombatXP(EntityType entity) {
return hasNode(EXPERIENCE, COMBAT, MULTIPLIER, StringUtils.getEntityConfigName(entity)); return hasNode(EXPERIENCE, COMBAT, MULTIPLIER, StringUtils.getEntityConfigName(entity));
} }

View File

@ -177,6 +177,10 @@ public class ConfigExperience {
return getConfigExperienceSkills().getSpawnedMobXPMult(); return getConfigExperienceSkills().getSpawnedMobXPMult();
} }
public double getPlayerBredMobsXPMult() {
return getExperienceCombat().getPlayerBredMobsXPMult();
}
public double getPVPXPMult() { public double getPVPXPMult() {
return getConfigExperienceSkills().getPVPXPMult(); return getConfigExperienceSkills().getPVPXPMult();
} }

View File

@ -112,4 +112,8 @@ public class ConfigExperienceCombat {
public double getAnimalsXPMult() { public double getAnimalsXPMult() {
return specialCombatExperienceMap.get("animals"); return specialCombatExperienceMap.get("animals");
} }
public double getPlayerBredMobsXPMult() {
return specialCombatExperienceMap.get("player-bred-mobs");
}
} }

View File

@ -47,6 +47,10 @@ public class ConfigExperienceSkills {
* BOILER PLATE GETTERS * BOILER PLATE GETTERS
*/ */
public double getPlayerBredMobsXPMult() {
return experienceCombat.getPlayerBredMobsXPMult();
}
public ConfigExperienceAcrobatics getExperienceAcrobatics() { public ConfigExperienceAcrobatics getExperienceAcrobatics() {
return experienceAcrobatics; return experienceAcrobatics;
} }

View File

@ -543,7 +543,7 @@ public final class CombatUtils {
Player defender = (Player) target; Player defender = (Player) target;
if (defender.isOnline() && SkillUtils.cooldownExpired(mcMMOPlayer.getRespawnATS(), Misc.PLAYER_RESPAWN_COOLDOWN_SECONDS)) { if (defender.isOnline() && SkillUtils.cooldownExpired(mcMMOPlayer.getRespawnATS(), Misc.PLAYER_RESPAWN_COOLDOWN_SECONDS)) {
baseXP = 20 * ExperienceConfig.getInstance().getPlayerVersusPlayerXP(); baseXP = 20 * mcMMO.getConfigManager().getConfigExperience().getPVPXPMult();
} }
} else { } else {
/*if (mcMMO.getModManager().isCustomEntity(target)) { /*if (mcMMO.getModManager().isCustomEntity(target)) {
@ -552,7 +552,7 @@ public final class CombatUtils {
//else if (target instanceof Animals) { //else if (target instanceof Animals) {
if (target instanceof Animals) { if (target instanceof Animals) {
EntityType type = target.getType(); EntityType type = target.getType();
baseXP = ExperienceConfig.getInstance().getAnimalsXP(type); baseXP = mcMMO.getConfigManager().getConfigExperience().getAnimalsXPMult();
} else if (target instanceof Monster) { } else if (target instanceof Monster) {
EntityType type = target.getType(); EntityType type = target.getType();
baseXP = ExperienceConfig.getInstance().getCombatXP(type); baseXP = ExperienceConfig.getInstance().getCombatXP(type);
@ -574,11 +574,11 @@ public final class CombatUtils {
} }
if (target.hasMetadata(mcMMO.entityMetadataKey)) { if (target.hasMetadata(mcMMO.entityMetadataKey)) {
baseXP *= ExperienceConfig.getInstance().getSpawnedMobXpMultiplier(); baseXP *= mcMMO.getConfigManager().getConfigExperience().getSpawnedMobXPMult();
} }
if (target.hasMetadata(mcMMO.bredMetadataKey)) { if (target.hasMetadata(mcMMO.bredMetadataKey)) {
baseXP *= ExperienceConfig.getInstance().getBredMobXpMultiplier(); baseXP *= mcMMO.getConfigManager().getConfigExperience().getPlayerBredMobsXPMult();
} }
xpGainReason = XPGainReason.PVE; xpGainReason = XPGainReason.PVE;