Ejemplo n.º 1
0
  private void microAwayFromZombies() throws GameActionException {
    if (attackableZombies.length == 0
        || !rc.isCoreReady()
        || !RobotUtil.anyCanAttack(attackableZombies)) {
      return;
    }

    tryMove(DirectionUtil.getDirectionAwayFrom(attackableZombies, currentLocation));
  }
Ejemplo n.º 2
0
  private void moveAwayFromArchon() throws GameActionException {
    if (!rc.isCoreReady()) {
      return;
    }

    RobotInfo archon = RobotUtil.getRobotOfType(adjacentTeammates, RobotType.ARCHON);
    if (archon != null) {
      tryMove(archon.location.directionTo(currentLocation));
    }
  }
Ejemplo n.º 3
0
  private void shootEnemies() throws GameActionException {
    if (!rc.isWeaponReady() || attackableEnemies.length == 0) {
      return;
    }

    RobotInfo lowestHealthEnemy = RobotUtil.getLowestHealthRobot(attackableEnemies);
    if (lowestHealthEnemy == null) {
      return;
    }

    rc.attackLocation(lowestHealthEnemy.location);
  }