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
52 changes: 52 additions & 0 deletions RobotPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,60 @@ else if(selftype == RobotType.SOLDIER) {
Soldier s = new RobotPlayer().new Soldier();
s.run();
}
else if(selftype == RobotType.VIPER){
Viper s = new RobotPlayer().new Viper();
s.run();
}
}

/**
*
* Class Viper
*
* The class outlining our viper bots
*
*/
private class Viper{
public MapLocation enemyArchonLocation;
public boolean goOffense;

public Viper() {
goOffense = false;
}

public void run() {
while(true) {
try {
// Use Guard AI (move out) until there are enough soldiers ammassed around, then go towards enemy archon and attack
Signal[] signals = rc.emptySignalQueue();
if (signals.length > 0) {
for (Signal s : signals) {
// receive a message containing enemy archon ID
if (s.getTeam() == ourTeam) {
FancyMessage f = FancyMessage.getFromRecievedSignal(s);
if(f.type == 2){
int xPos = f.ints.first;
int yPos = f.ints.second;
enemyArchonLocation = new MapLocation(xPos, yPos);
goOffense = true;
}
}
}
}
if(rc.isCoreReady() && goOffense){
RESOURCE_FUNCTIONS.BUG(enemyArchonLocation);
}
if(rc.isWeaponReady()){
RESOURCE_FUNCTIONS.attackWeakestEnemy();
}
Clock.yield();
} catch (Exception e) {
e.printStackTrace();
}
}
}

}
/**
*
* Class Turret
Expand Down