mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 14:46:46 +01:00
Wire up special combat XP multipliers
This commit is contained in:
parent
6932abc9d8
commit
06016f4ada
@ -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));
|
||||||
}
|
}
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
@ -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");
|
||||||
|
}
|
||||||
}
|
}
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user