Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions RobotPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public void run() {
RESOURCE_FUNCTIONS.BUG(RESOURCE_FUNCTIONS.mostRecentEnemyArchonLocation());
}*/

Clock.yield();
} catch (Exception e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -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<Integer,Integer,Integer> 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);
}
}
Expand All @@ -288,6 +298,10 @@ public void run(){
public Triple<Integer,Integer,Integer> getScoutInitType(){
return new Triple<Integer,Integer,Integer>(0,0,0);
}

public Triple<Integer, Integer, Integer> getScoutHerdingType(){
return new Triple<Integer, Integer, Integer>(1,1,1);
}
}

/**
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -413,6 +428,7 @@ public void runAsTurretSights(int turretID){
while(true){
try{

Clock.yield();
}catch(Exception e){
e.printStackTrace();
}
Expand All @@ -431,6 +447,7 @@ public void runAsZombieBomber(){
}else{
runAsArchonSearcher();
}
Clock.yield();
}catch(Exception e){
e.printStackTrace();
}
Expand Down