File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,18 @@ public void run() throws GameActionException {
44
44
// break; // Spawn only one soldier
45
45
// }
46
46
// }
47
+ MapInfo [] infos = rc .senseNearbyMapInfos (-1 );
48
+ RobotInfo [] nearbyEnemies = rc .senseNearbyRobots (-1 , rc .getTeam ().opponent ());
49
+
50
+ int e_count = 0 ;
51
+ for (MapInfo mapInfo : infos ) {
52
+ if (mapInfo .getPaint ().isEnemy ()) {
53
+ e_count ++;
54
+ }
55
+ }
56
+ if (e_count >35 || nearbyEnemies .length > 3 ) {
57
+ rtype = 2 ;
58
+ }
47
59
48
60
// Pick a direction to build in.
49
61
Direction dir = directions [rng .nextInt (directions .length )];
@@ -64,7 +76,7 @@ public void run() throws GameActionException {
64
76
if (spawn_count [rtype ] >= target_count [rtype ]) {
65
77
rtype ++;
66
78
}
67
- if (rtype > 2 ) {
79
+ if (rtype == 2 ) {
68
80
rtype = 0 ;
69
81
spawn_count [0 ] = 0 ;
70
82
spawn_count [1 ] = 0 ;
@@ -83,7 +95,6 @@ public void run() throws GameActionException {
83
95
}
84
96
85
97
// Attack logic for Tower
86
- RobotInfo [] nearbyEnemies = rc .senseNearbyRobots (-1 , rc .getTeam ().opponent ());
87
98
88
99
// Perform Single Target Attack on the lowest HP priority target
89
100
if (nearbyEnemies .length > 0 ) {
You can’t perform that action at this time.
0 commit comments