From a2a22e76a77c277da28d3793c965b6b339800537 Mon Sep 17 00:00:00 2001 From: vilasopher Date: Mon, 11 Jan 2016 21:30:10 -0500 Subject: [PATCH] Update RobotPlayer.java --- RobotPlayer.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/RobotPlayer.java b/RobotPlayer.java index 86f8316..abf068e 100644 --- a/RobotPlayer.java +++ b/RobotPlayer.java @@ -127,6 +127,7 @@ public void run() { RESOURCE_FUNCTIONS.BUG(RESOURCE_FUNCTIONS.mostRecentEnemyArchonLocation()); }*/ + Clock.yield(); } catch (Exception e) { e.printStackTrace(); } @@ -273,8 +274,17 @@ public void run(){ RobotType type = RESOURCE_FUNCTIONS.chooseRobotType(); if(RESOURCE_FUNCTIONS.tryBuild(type)){ //See function in RESOURCE_FUNCTIONS to know what it does //After building scout, waits a turn, then signals it the location, so it has a good idea of where base is + //Also signals the scout which type to become Clock.yield(); Triple scoutType = getScoutInitType(); + int roundNum = rc.getRoundNum(); + boolean isCloseToZombieRound = false; + for (int i = 0; i < zombieRounds.length && !isCloseToZombieRound; i++) { + isCloseToZombieRound = (Math.abs(roundNum - zombieRounds[i]) < 5); + } + if (isCloseToZombieRound) { + scoutType = getScoutHerdingType(); + } FancyMessage.sendMessage(0,scoutType.first | scoutType.second,scoutType.third,3); } } @@ -288,6 +298,10 @@ public void run(){ public Triple getScoutInitType(){ return new Triple(0,0,0); } + + public Triple getScoutHerdingType(){ + return new Triple(1,1,1); + } } /** @@ -341,6 +355,7 @@ public void run(){ if(x.bits[2]){ mostRecentArchonLocation = new MapLocation(x.ints.first >> 16,x.ints.second); } + System.out.println("Running as zombie herder"); runAsZombieHerder(); }else if((x.ints.first & 3) == 2){ runAsTurretSights(x.ints.second); @@ -413,6 +428,7 @@ public void runAsTurretSights(int turretID){ while(true){ try{ + Clock.yield(); }catch(Exception e){ e.printStackTrace(); } @@ -431,6 +447,7 @@ public void runAsZombieBomber(){ }else{ runAsArchonSearcher(); } + Clock.yield(); }catch(Exception e){ e.printStackTrace(); }