Beispiel #1
0
 public void spawnTeleporter() {
   // there were no towers in range ever, so lets just build a new one:
   towerSpawnLocation = spawning.getTowerSpawnLocation();
   if (towerSpawnLocation == null) {
     pa("WTF.  There is nowhere to spawn the tower.");
     return;
   }
   towerSpawnFromLocation =
       towerSpawnLocation.subtract(controller.getLocation().directionTo(towerSpawnLocation));
   navigation.changeToLocationGoal(towerSpawnFromLocation, true);
   controller.setIndicatorString(2, towerSpawnFromLocation.toString());
   setGoal(Goal.placingTeleporter);
 }
Beispiel #2
0
  public void step() {
    spawning.changeModeToAttacking();

    if (moveTurns > 0) {
      if (navigation.simpleMove(Direction.SOUTH_EAST) == Status.success) moveTurns--;
    }

    // try to spawn a new dude every turn
    if (turnsSinceLastSpawn > 2) {
      int status = spawning.spawnRobot();
      if (status == Status.success) {
        turnsSinceLastSpawn = -1;
        try {
          messaging.sendFollowRequest(
              controller.getLocation(),
              controller.senseGroundRobotAtLocation(spawning.spawnLocation).getID());
        } catch (Exception e) {
          pa("----Exception Caught in sendFollowRequest()");
        }
      }
    }
    turnsSinceLastSpawn++;
    if (archonNumber == 1) messaging.sendMessageForEnemyRobots();
  }