private void microAwayFromZombies() throws GameActionException { if (attackableZombies.length == 0 || !rc.isCoreReady() || !RobotUtil.anyCanAttack(attackableZombies)) { return; } tryMove(DirectionUtil.getDirectionAwayFrom(attackableZombies, currentLocation)); }
private void moveAwayFromArchon() throws GameActionException { if (!rc.isCoreReady()) { return; } RobotInfo archon = RobotUtil.getRobotOfType(adjacentTeammates, RobotType.ARCHON); if (archon != null) { tryMove(archon.location.directionTo(currentLocation)); } }
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); }