Clean up some stuff with our DATS.

This commit is contained in:
GJ 2013-06-12 19:20:05 -04:00
parent f2b2cd9cc0
commit 965dbda101
2 changed files with 3 additions and 15 deletions

View File

@ -284,10 +284,7 @@ public class MiningManager extends SkillManager {
private boolean blastMiningCooldownOver() {
Player player = getPlayer();
PlayerProfile profile = getProfile();
long oldTime = profile.getSkillDATS(AbilityType.BLAST_MINING) * Misc.TIME_CONVERSION_FACTOR;
int cooldown = AbilityType.BLAST_MINING.getCooldown();
int timeRemaining = SkillUtils.calculateTimeLeft(oldTime, cooldown, player);
int timeRemaining = SkillUtils.calculateTimeLeft(profile.getSkillDATS(AbilityType.BLAST_MINING) * Misc.TIME_CONVERSION_FACTOR, AbilityType.BLAST_MINING.getCooldown(), player);
if (timeRemaining > 0) {
player.sendMessage(LocaleLoader.getString("Skills.TooTired", timeRemaining));

View File

@ -392,14 +392,8 @@ public class SkillUtils {
}
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
int ticks = 0;
if (mcMMOPlayer.getAbilityMode(AbilityType.SUPER_BREAKER)) {
ticks = ((int) (mcMMOPlayer.getProfile().getSkillDATS(AbilityType.SUPER_BREAKER) - (System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR))) * 20;
}
else if (mcMMOPlayer.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER)) {
ticks = ((int) (mcMMOPlayer.getProfile().getSkillDATS(AbilityType.GIGA_DRILL_BREAKER) - (System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR))) * 20;
}
SkillType skill = mcMMOPlayer.getAbilityMode(AbilityType.SUPER_BREAKER) ? SkillType.MINING : SkillType.EXCAVATION;
int ticks = PerksUtils.handleActivationPerks(player, 2 + (mcMMOPlayer.getProfile().getSkillLevel(skill) / AdvancedConfig.getInstance().getAbilityLength()), skill.getAbility().getMaxTicks()) * 20;
PotionEffect abilityBuff = new PotionEffect(PotionEffectType.FAST_DIGGING, duration + ticks, amplifier + 10);
player.addPotionEffect(abilityBuff, true);
@ -415,9 +409,6 @@ public class SkillUtils {
playerInventory.setItem(i, removeAbilityBuff(item));
}
}
else {
player.removePotionEffect(PotionEffectType.FAST_DIGGING);
}
}
public static ItemStack removeAbilityBuff(ItemStack item) {