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
29 changes: 22 additions & 7 deletions RobotPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public class RobotPlayer{
*/
static RobotController rc;
static Random randall;
static Team ourTeam;
static Team opponentTeam;

/**
* run
Expand All @@ -25,6 +27,14 @@ public static void run(RobotController r){
rc = r;
randall = new Random(rc.getID());
RobotType selftype = rc.getType();
if(rc.getTeam() ==Team.A) {
ourTeam = Team.A;
opponentTeam = Team.B;
}
if(rc.getTeam() == Team.B) {
ourTeam = Team.B;
opponentTeam = Team.A;
}
if(selftype == RobotType.ARCHON){
Archon s = new RobotPlayer().new Archon();
s.run();
Expand Down Expand Up @@ -184,14 +194,7 @@ public boolean stillHerding(){
* Finds enemy Archon
*/
public boolean scanArchon() {
Team opponentTeam = Team.ZOMBIE;
RobotInfo[] robots;
if(rc.getTeam() ==Team.A) {
opponentTeam = Team.B;
}
if(rc.getTeam() == Team.B) {
opponentTeam = Team.A;
}
robots = rc.senseNearbyRobots(RobotType.SCOUT.sensorRadiusSquared, opponentTeam);
for(int i = 0; i < robots.length; i++) {
if(robots[i].type == RobotType.ARCHON) {
Expand All @@ -201,6 +204,18 @@ public boolean scanArchon() {
return false;
}
}

public MapLocation scanArchonLocation() {
RobotInfo[] robots;
robots = rc.senseNearbyRobots(RobotType.SCOUT.sensorRadiusSquared, opponentTeam);
int pos = 0;
for(int i = 0; i < robots.length; i++) {
if(robots[i].type == RobotType.ARCHON) {
pos = i;
}
}
return robots[pos].location;
}

/**
* $class RESOURCE_FUNCTIONS
Expand Down