mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
tweak Archaeology rewards
This commit is contained in:
parent
2dda0bf27a
commit
ee2a1b332e
@ -3,8 +3,10 @@ package com.gmail.nossr50.commands.skills;
|
|||||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
import com.gmail.nossr50.skills.excavation.ExcavationManager;
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import com.gmail.nossr50.util.TextComponentFactory;
|
import com.gmail.nossr50.util.TextComponentFactory;
|
||||||
|
import com.gmail.nossr50.util.player.UserManager;
|
||||||
import com.gmail.nossr50.util.skills.RankUtils;
|
import com.gmail.nossr50.util.skills.RankUtils;
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -43,6 +45,9 @@ public class ExcavationCommand extends SkillCommand {
|
|||||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||||
List<String> messages = new ArrayList<String>();
|
List<String> messages = new ArrayList<String>();
|
||||||
|
|
||||||
|
|
||||||
|
ExcavationManager excavationManager = UserManager.getPlayer(player).getExcavationManager();
|
||||||
|
|
||||||
if (canGigaDrill) {
|
if (canGigaDrill) {
|
||||||
messages.add(getStatMessage(SubSkillType.EXCAVATION_GIGA_DRILL_BREAKER, gigaDrillBreakerLength)
|
messages.add(getStatMessage(SubSkillType.EXCAVATION_GIGA_DRILL_BREAKER, gigaDrillBreakerLength)
|
||||||
+ (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", gigaDrillBreakerLengthEndurance) : ""));
|
+ (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", gigaDrillBreakerLengthEndurance) : ""));
|
||||||
@ -50,9 +55,8 @@ public class ExcavationCommand extends SkillCommand {
|
|||||||
//messages.add(LocaleLoader.getString("Excavation.Effect.Length", gigaDrillBreakerLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", gigaDrillBreakerLengthEndurance) : ""));
|
//messages.add(LocaleLoader.getString("Excavation.Effect.Length", gigaDrillBreakerLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", gigaDrillBreakerLengthEndurance) : ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Permissions.isSubSkillEnabled(player, SubSkillType.EXCAVATION_ARCHAEOLOGY)) {
|
if(canUseSubskill(player, SubSkillType.EXCAVATION_ARCHAEOLOGY)) {
|
||||||
String rank = String.valueOf(RankUtils.getRank(player, SubSkillType.EXCAVATION_ARCHAEOLOGY));
|
messages.add(getStatMessage(SubSkillType.EXCAVATION_ARCHAEOLOGY, percent.format(excavationManager.getArchaelogyExperienceOrbChance()), String.valueOf(excavationManager.getExperienceOrbsReward())));
|
||||||
messages.add(getStatMessage(SubSkillType.EXCAVATION_ARCHAEOLOGY, rank, rank));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return messages;
|
return messages;
|
||||||
|
@ -44,12 +44,10 @@ public class ExcavationManager extends SkillManager {
|
|||||||
if (skillLevel >= treasure.getDropLevel()
|
if (skillLevel >= treasure.getDropLevel()
|
||||||
&& RandomChanceUtil.checkRandomChanceExecutionSuccess(getPlayer(), PrimarySkillType.EXCAVATION, treasure.getDropChance())) {
|
&& RandomChanceUtil.checkRandomChanceExecutionSuccess(getPlayer(), PrimarySkillType.EXCAVATION, treasure.getDropChance())) {
|
||||||
|
|
||||||
int rank = RankUtils.getRank(getPlayer(), SubSkillType.EXCAVATION_ARCHAEOLOGY);
|
|
||||||
|
|
||||||
//Spawn Vanilla XP orbs if a dice roll succeeds
|
//Spawn Vanilla XP orbs if a dice roll succeeds
|
||||||
if(RandomChanceUtil.rollDice(rank, 100)) {
|
if(RandomChanceUtil.rollDice(getArchaelogyExperienceOrbChance(), 100)) {
|
||||||
ExperienceOrb experienceOrb = (ExperienceOrb) getPlayer().getWorld().spawnEntity(location, EntityType.EXPERIENCE_ORB);
|
ExperienceOrb experienceOrb = (ExperienceOrb) getPlayer().getWorld().spawnEntity(location, EntityType.EXPERIENCE_ORB);
|
||||||
experienceOrb.setExperience(rank);
|
experienceOrb.setExperience(getExperienceOrbsReward());
|
||||||
}
|
}
|
||||||
|
|
||||||
xp += treasure.getXp();
|
xp += treasure.getXp();
|
||||||
@ -62,6 +60,18 @@ public class ExcavationManager extends SkillManager {
|
|||||||
applyXpGain(xp, XPGainReason.PVE);
|
applyXpGain(xp, XPGainReason.PVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getExperienceOrbsReward() {
|
||||||
|
return 5 * getArchaeologyRank();
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getArchaelogyExperienceOrbChance() {
|
||||||
|
return getArchaeologyRank() * 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getArchaeologyRank() {
|
||||||
|
return RankUtils.getRank(getPlayer(), SubSkillType.EXCAVATION_ARCHAEOLOGY);
|
||||||
|
}
|
||||||
|
|
||||||
public void printExcavationDebug(Player player, BlockState blockState)
|
public void printExcavationDebug(Player player, BlockState blockState)
|
||||||
{
|
{
|
||||||
if (Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.EXCAVATION_ARCHAEOLOGY)) {
|
if (Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.EXCAVATION_ARCHAEOLOGY)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user