2012-01-09 20:00:13 +01:00
|
|
|
package com.gmail.nossr50.commands.skills;
|
|
|
|
|
2012-05-31 20:18:03 +02:00
|
|
|
import com.gmail.nossr50.commands.SkillCommand;
|
2012-01-09 20:00:13 +01:00
|
|
|
import com.gmail.nossr50.datatypes.SkillType;
|
2012-04-27 11:47:11 +02:00
|
|
|
import com.gmail.nossr50.locale.LocaleLoader;
|
2012-01-09 20:00:13 +01:00
|
|
|
|
2012-05-31 20:18:03 +02:00
|
|
|
public class ExcavationCommand extends SkillCommand {
|
2012-04-24 15:21:21 +02:00
|
|
|
private String gigaDrillBreakerLength;
|
|
|
|
|
2012-04-30 13:51:02 +02:00
|
|
|
private boolean canGigaDrill;
|
|
|
|
private boolean canTreasureHunt;
|
|
|
|
|
2012-05-31 20:18:03 +02:00
|
|
|
public ExcavationCommand() {
|
|
|
|
super(SkillType.EXCAVATION);
|
|
|
|
}
|
2012-04-24 15:21:21 +02:00
|
|
|
|
2012-05-31 20:18:03 +02:00
|
|
|
@Override
|
|
|
|
protected void dataCalculations() {
|
|
|
|
gigaDrillBreakerLength = String.valueOf(2 + ((int) skillValue / 50));
|
|
|
|
}
|
2012-04-24 15:21:21 +02:00
|
|
|
|
2012-05-31 20:18:03 +02:00
|
|
|
@Override
|
|
|
|
protected void permissionsCheck() {
|
|
|
|
canGigaDrill = permInstance.gigaDrillBreaker(player);
|
|
|
|
canTreasureHunt = permInstance.excavationTreasures(player);
|
|
|
|
}
|
2012-04-24 15:21:21 +02:00
|
|
|
|
2012-05-31 20:18:03 +02:00
|
|
|
@Override
|
|
|
|
protected boolean effectsHeaderPermissions() {
|
|
|
|
return canGigaDrill || canTreasureHunt;
|
|
|
|
}
|
2012-04-30 13:51:02 +02:00
|
|
|
|
2012-05-31 20:18:03 +02:00
|
|
|
@Override
|
|
|
|
protected void effectsDisplay() {
|
2012-04-30 13:51:02 +02:00
|
|
|
if (canGigaDrill) {
|
|
|
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Excavation.Effect.0"), LocaleLoader.getString("Excavation.Effect.1") }));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (canTreasureHunt) {
|
|
|
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Excavation.Effect.2"), LocaleLoader.getString("Excavation.Effect.3") }));
|
|
|
|
}
|
2012-04-24 15:21:21 +02:00
|
|
|
}
|
|
|
|
|
2012-05-31 20:18:03 +02:00
|
|
|
@Override
|
|
|
|
protected boolean statsHeaderPermissions() {
|
|
|
|
return canGigaDrill;
|
2012-04-24 15:21:21 +02:00
|
|
|
}
|
2012-04-30 13:51:02 +02:00
|
|
|
|
2012-05-31 20:18:03 +02:00
|
|
|
@Override
|
|
|
|
protected void statsDisplay() {
|
|
|
|
if (canGigaDrill) {
|
|
|
|
player.sendMessage(LocaleLoader.getString("Excavation.Effect.Length", new Object[] { gigaDrillBreakerLength }));
|
|
|
|
}
|
2012-04-30 13:51:02 +02:00
|
|
|
}
|
2012-01-09 20:00:13 +01:00
|
|
|
}
|