@@ -38,7 +38,7 @@ public boolean engageEnemyTower() throws GameActionException {
38
38
if (robot != null && robot .getTeam () != rc .getTeam ()) {
39
39
int currentDistance = rc .getLocation ().distanceSquaredTo (mapInfo .getMapLocation ());
40
40
if (currentDistance < minDistance ) {
41
- System .out .println ("We found something Boss! A tower?" );
41
+ // System.out.println("We found something Boss! A tower?");
42
42
minDistance = currentDistance ; // Update the minimum distance
43
43
enemyTowerLocation = mapInfo .getMapLocation (); // Update the closest tower
44
44
}
@@ -58,11 +58,11 @@ public boolean engageEnemyTower() throws GameActionException {
58
58
return false ; // Exit the function if no enemy tower is found
59
59
}
60
60
61
- System .out .println ("Enemy tower detected at: " + enemyTowerLocation );
61
+ // System.out.println("Enemy tower detected at: " + enemyTowerLocation);
62
62
63
63
// Check if the enemy tower is already a ruin
64
64
if (enemyLocations .contains (enemyTowerLocation ) && rc .senseRobotAtLocation (enemyTowerLocation ) == null ) {
65
- System .out .println ("Enemy tower has been destroyed (turned into a ruin)." );
65
+ // System.out.println("Enemy tower has been destroyed (turned into a ruin).");
66
66
enemyLocations .remove (enemyTowerLocation ); // Remove the tower's location from the HashSet
67
67
return false ; // Exit as there is no active enemy tower at this location
68
68
}
@@ -76,10 +76,10 @@ public boolean engageEnemyTower() throws GameActionException {
76
76
77
77
// Move one step towards the enemy tower if possible
78
78
// Check if the robot is outside the tower's attack range but can still see it
79
- System .out .println ("Debug Before Cooldown Check: Movement=" + rc .getMovementCooldownTurns () + ", Action=" + rc .getActionCooldownTurns ());
79
+ // System.out.println("Debug Before Cooldown Check: Movement=" + rc.getMovementCooldownTurns() + ", Action=" + rc.getActionCooldownTurns());
80
80
if (rc .getMovementCooldownTurns () > 0 || rc .getActionCooldownTurns () > 0 ) { //IMPORTANT RUNNING WITH 0 IS OPTIMAL BUT SHOUDL TWEAK LATER
81
- System .out .println ("Movement cooldown: " + rc .getMovementCooldownTurns ());
82
- System .out .println ("Cooldowns too high, skipping engagement. Action cooldown is:" + rc .getActionCooldownTurns ());
81
+ // System.out.println("Movement cooldown: " + rc.getMovementCooldownTurns());
82
+ // System.out.println("Cooldowns too high, skipping engagement. Action cooldown is:" + rc.getActionCooldownTurns());
83
83
return true ;
84
84
}
85
85
@@ -89,13 +89,13 @@ public boolean engageEnemyTower() throws GameActionException {
89
89
rc .getMovementCooldownTurns () == 0 && rc .getActionCooldownTurns () == 0 ) {
90
90
if (rc .canMove (towardsTower )) {
91
91
rc .move (towardsTower );
92
- System .out .println ("Moved towards enemy tower at: " + enemyTowerLocation );
92
+ // System.out.println("Moved towards enemy tower at: " + enemyTowerLocation);
93
93
94
94
//Attacking sequence added here:
95
95
// Attack the tower after moving closer
96
96
if (rc .canAttack (enemyTowerLocation )) {
97
97
rc .attack (enemyTowerLocation ); // Attack the tower
98
- System .out .println ("Attacked enemy tower after moving closer: " + enemyTowerLocation );
98
+ // System.out.println("Attacked enemy tower after moving closer: " + enemyTowerLocation);
99
99
}
100
100
101
101
return true ; // Exit after taking one step
@@ -111,11 +111,11 @@ public boolean engageEnemyTower() throws GameActionException {
111
111
112
112
if (rc .canAttack (enemyTowerLocation )) {
113
113
rc .attack (enemyTowerLocation ); // Attack the tower
114
- System .out .println ("Attacked enemy tower before retreating: " + enemyTowerLocation );
114
+ // System.out.println("Attacked enemy tower before retreating: " + enemyTowerLocation);
115
115
}
116
116
117
117
rc .move (awayFromTower );
118
- System .out .println ("Moved away from enemy tower to avoid attack." );
118
+ // System.out.println("Moved away from enemy tower to avoid attack.");
119
119
return true ; // Move away from the tower successfully
120
120
}
121
121
}
0 commit comments