2013-01-01 22:01:51 +01:00
|
|
|
package com.gmail.nossr50.skills.mining;
|
2012-02-07 07:37:41 +01:00
|
|
|
|
2013-02-22 23:55:15 +01:00
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
2012-11-21 21:49:54 +01:00
|
|
|
import com.gmail.nossr50.config.AdvancedConfig;
|
2013-01-24 20:19:26 +01:00
|
|
|
import com.gmail.nossr50.config.Config;
|
2013-02-22 23:55:15 +01:00
|
|
|
import com.gmail.nossr50.skills.utilities.SkillTools;
|
|
|
|
import com.gmail.nossr50.skills.utilities.SkillType;
|
|
|
|
import com.gmail.nossr50.util.Permissions;
|
|
|
|
import com.gmail.nossr50.util.Users;
|
2012-02-07 07:37:41 +01:00
|
|
|
|
2012-03-12 22:28:13 +01:00
|
|
|
public class BlastMining {
|
2013-01-22 08:20:05 +01:00
|
|
|
public static int rank1 = AdvancedConfig.getInstance().getBlastMiningRank1();
|
|
|
|
public static int rank2 = AdvancedConfig.getInstance().getBlastMiningRank2();
|
|
|
|
public static int rank3 = AdvancedConfig.getInstance().getBlastMiningRank3();
|
|
|
|
public static int rank4 = AdvancedConfig.getInstance().getBlastMiningRank4();
|
|
|
|
public static int rank5 = AdvancedConfig.getInstance().getBlastMiningRank5();
|
|
|
|
public static int rank6 = AdvancedConfig.getInstance().getBlastMiningRank6();
|
|
|
|
public static int rank7 = AdvancedConfig.getInstance().getBlastMiningRank7();
|
|
|
|
public static int rank8 = AdvancedConfig.getInstance().getBlastMiningRank8();
|
2012-02-07 07:37:41 +01:00
|
|
|
|
2013-01-24 20:19:26 +01:00
|
|
|
public static int detonatorID = Config.getInstance().getDetonatorItemID();
|
|
|
|
|
2013-01-10 03:44:53 +01:00
|
|
|
public final static int MAXIMUM_REMOTE_DETONATION_DISTANCE = 100;
|
2013-02-22 23:55:15 +01:00
|
|
|
|
|
|
|
public static boolean canUseDemolitionsExpertise(Player player) {
|
|
|
|
return SkillTools.unlockLevelReached(player, SkillType.MINING, rank4) && Permissions.demolitionsExpertise(player);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static int processDemolitionsExpertise(Player player, int damage) {
|
|
|
|
int skillLevel = Users.getPlayer(player).getProfile().getSkillLevel(SkillType.MINING);
|
|
|
|
int modifiedDamage;
|
|
|
|
|
|
|
|
if (skillLevel >= BlastMining.rank8) {
|
|
|
|
modifiedDamage = 0;
|
|
|
|
}
|
|
|
|
else if (skillLevel >= BlastMining.rank6) {
|
|
|
|
modifiedDamage = damage / 4;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
modifiedDamage = damage / 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
return modifiedDamage;
|
|
|
|
}
|
2012-03-06 07:48:45 +01:00
|
|
|
}
|