This commit is contained in:
simon 2017-12-28 20:33:57 -05:00
parent dab5cab602
commit 2fb7d2f73e
3 changed files with 8 additions and 2 deletions

View File

@ -149,6 +149,10 @@ public class Cubot extends GameObject implements Updatable, ControllableUnit {
return lastAction;
}
public Action getCurrentAction() {
return currentAction;
}
public void setHologram(char hologram) {
this.hologram = hologram;
}

View File

@ -42,7 +42,7 @@ public class CubotDrill extends CpuHardware {
} else if (a == GATHER_SLOW || a == GATHER_FAST) {
if (cubot.spendEnergy(1400)) {
if (cubot.getAction() == Action.IDLE) {
if (cubot.getCurrentAction() == Action.IDLE) {
int tile = cubot.getWorld().getTileMap().getTileAt(cubot.getX(), cubot.getY());
if (tile == TileMap.IRON_TILE) {

View File

@ -49,7 +49,7 @@ public class CubotLaser extends CpuHardware {
ArrayList<GameObject> objects = cubot.getWorld().getGameObjectsAt(frontTile.x, frontTile.y);
if (cubot.getAction() == Action.IDLE && objects.size() > 0) {
if (cubot.getCurrentAction() == Action.IDLE && objects.size() > 0) {
//FIXME: Problem here if more than 1 object
if (objects.get(0) instanceof InventoryHolder) {
if (((InventoryHolder) objects.get(0)).canTakeItem(b)) {
@ -62,6 +62,8 @@ public class CubotLaser extends CpuHardware {
}
}
}
} else {
System.out.println("\n\n\n\n\n It did it");
}