Public Repository for the Magicbane Shadowbane Emulator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.0 KiB

// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.devcmd.cmds;
import engine.devcmd.AbstractDevCmd;
import engine.gameManager.BuildingManager;
import engine.objects.AbstractGameObject;
import engine.objects.Building;
import engine.objects.Mine;
import engine.objects.PlayerCharacter;
import engine.workthreads.HourlyJobThread;
/**
*
*/
public class MineActiveCmd extends AbstractDevCmd {
public MineActiveCmd() {
super("mineactive");
}
@Override
protected void _doCmd(PlayerCharacter pcSender, String[] args,
AbstractGameObject target) {
Building mineBuilding = BuildingManager.getBuilding(target.getObjectUUID());
if (mineBuilding == null)
return;
Mine mine = Mine.getMineFromTower(mineBuilding.getObjectUUID());
if (mine == null)
return;
String trigger = args[0];
switch (trigger){
case "true":
HourlyJobThread.handleStartMineWindow(mine);
Mine.setLastChange(System.currentTimeMillis());
break;
case "false":
HourlyJobThread.handleEndMineWindow(mine);
Mine.setLastChange(System.currentTimeMillis());
break;
default:
this.sendUsage(pcSender);
break;
}
}
@Override
protected String _getUsageString() {
return "' /mineactive true|false";
}
@Override
protected String _getHelpString() {
return "Temporarily add visual effects to Character";
}
}