From 326743ed82458a0b2d564c73f25005d92cf1e44c Mon Sep 17 00:00:00 2001 From: vilasopher Date: Mon, 11 Jan 2016 22:09:45 -0500 Subject: [PATCH 1/2] Update RobotPlayer.java --- RobotPlayer.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/RobotPlayer.java b/RobotPlayer.java index abf068e..8428e8a 100644 --- a/RobotPlayer.java +++ b/RobotPlayer.java @@ -260,7 +260,7 @@ public void run(){ FancyMessage x = FancyMessage.getFromRecievedSignal(signals[i]); if(x.isMessage){ if(x.type == 2){ - mostRecentEnemyArchonLocations.add(new Triple(0,new MapLocation(x.ints.first,x.ints.second),rc.getRoundNum())); + mostRecentEnemyArchonLocations.add(new Triple(0,new MapLocation(x.ints.first - 16000,x.ints.second - 16000),rc.getRoundNum())); } } } @@ -277,12 +277,13 @@ public void run(){ //Also signals the scout which type to become Clock.yield(); Triple scoutType = getScoutInitType(); + //Check if near zombie round int roundNum = rc.getRoundNum(); boolean isCloseToZombieRound = false; for (int i = 0; i < zombieRounds.length && !isCloseToZombieRound; i++) { - isCloseToZombieRound = (Math.abs(roundNum - zombieRounds[i]) < 5); + isCloseToZombieRound = (Math.abs(roundNum - zombieRounds[i]) < 10); } - if (isCloseToZombieRound) { + if (mostRecentEnemyArchonLocations.size() != 0 && isCloseToZombieRound) { scoutType = getScoutHerdingType(); } FancyMessage.sendMessage(0,scoutType.first | scoutType.second,scoutType.third,3); @@ -300,7 +301,11 @@ public Triple getScoutInitType(){ } public Triple getScoutHerdingType(){ - return new Triple(1,1,1); + MapLocation enemyArchonLocation = RESOURCE_FUNCTIONS.mostRecentEnemyArchonLocation(); + System.out.println("enemyArchonLocation =" + enemyArchonLocation); + int xPosition = enemyArchonLocation.x << 4; + int yPosition = enemyArchonLocation.y; + return new Triple(1,xPosition,yPosition); } } @@ -353,9 +358,9 @@ public void run(){ runAsArchonSearcher(); }else if((x.ints.first & 3) == 1){ if(x.bits[2]){ - mostRecentArchonLocation = new MapLocation(x.ints.first >> 16,x.ints.second); + mostRecentArchonLocation = new MapLocation(x.ints.first >> 4,x.ints.second); } - System.out.println("Running as zombie herder"); + System.out.println("Running as zombie herder to archon at (" + mostRecentArchonLocation.x + "," + mostRecentArchonLocation.y + ")"); runAsZombieHerder(); }else if((x.ints.first & 3) == 2){ runAsTurretSights(x.ints.second); From 51e5117a5753bcf83a3ced4a02057d48f683305e Mon Sep 17 00:00:00 2001 From: vilasopher Date: Mon, 11 Jan 2016 22:26:43 -0500 Subject: [PATCH 2/2] Update RobotPlayer.java --- RobotPlayer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RobotPlayer.java b/RobotPlayer.java index 8428e8a..ebae454 100644 --- a/RobotPlayer.java +++ b/RobotPlayer.java @@ -303,7 +303,7 @@ public Triple getScoutInitType(){ public Triple getScoutHerdingType(){ MapLocation enemyArchonLocation = RESOURCE_FUNCTIONS.mostRecentEnemyArchonLocation(); System.out.println("enemyArchonLocation =" + enemyArchonLocation); - int xPosition = enemyArchonLocation.x << 4; + int xPosition = enemyArchonLocation.x << 2; int yPosition = enemyArchonLocation.y; return new Triple(1,xPosition,yPosition); } @@ -358,7 +358,7 @@ public void run(){ runAsArchonSearcher(); }else if((x.ints.first & 3) == 1){ if(x.bits[2]){ - mostRecentArchonLocation = new MapLocation(x.ints.first >> 4,x.ints.second); + mostRecentArchonLocation = new MapLocation(x.ints.first >> 2,x.ints.second); } System.out.println("Running as zombie herder to archon at (" + mostRecentArchonLocation.x + "," + mostRecentArchonLocation.y + ")"); runAsZombieHerder();