diff --git a/enemyAI/combatManagerAI.java b/enemyAI/combatManagerAI.java index bc6412a..bad324b 100644 --- a/enemyAI/combatManagerAI.java +++ b/enemyAI/combatManagerAI.java @@ -143,12 +143,9 @@ public class combatManagerAI { if(currentState == booming){ //enemy AI compares its own force with player's force, then make a decision whether it should attack or not - //only start comparing after 6 minutes mark, or player is rushing with light tank delay attack mark to around 10 minutes mark - int attackTime = 360; - if(mainThread.ec.theMapAwarenessAI.playerIsRushingLightTank) - attackTime = 540; - else - attackTime = 360; + int attackTime = 540; + if(mainThread.ec.theMapAwarenessAI.canRushPlayer) + attackTime = 300; int targetPlayerExpension = mainThread.ec.theMapAwarenessAI.targetPlayerExpension; diff --git a/enemyAI/mapAwarenessAI.java b/enemyAI/mapAwarenessAI.java index 81e2ae3..084ee37 100644 --- a/enemyAI/mapAwarenessAI.java +++ b/enemyAI/mapAwarenessAI.java @@ -477,8 +477,23 @@ public class mapAwarenessAI { //determine if a rush is feasible against the player canRushPlayer = false; - if(frameAI > 270 && frameAI < 300) { + if(frameAI > 300 && frameAI < 360) { + if(totalNumberOfPlayerUnits < 3) + canRushPlayer = true; + for(int i = 0; i < playerStructures.length; i++) { + if(playerStructures[i] != null && playerStructures[i].currentHP > 0) { + float x1 = playerStructures[i].centre.x; + float z1 = playerStructures[i].centre.z; + float x2 = playerNaturalLocation.x; + float z2 = playerNaturalLocation.z; + + if(Math.sqrt((x1-x2)*(x1-x2) + (z1-z2)*(z1-z2)) < 3.5f) { + canRushPlayer = true; + break; + } + } + } } diff --git a/enemyAI/unitProductionAI.java b/enemyAI/unitProductionAI.java index 9d7c3a3..e6f68d1 100644 --- a/enemyAI/unitProductionAI.java +++ b/enemyAI/unitProductionAI.java @@ -51,19 +51,14 @@ public class unitProductionAI { this.theBaseInfo = theBaseInfo; rallyPoint = new vector(0,0,0); - if(gameData.getRandom() < 341) { + if(gameData.getRandom() < 512) { rushRallyPointX = 9.5f+2; rushRallyPointZ = 5.5f+2; - }else if(gameData.getRandom() < 682) { + }else { rushRallyPointX = 9.5f-2.75f; rushRallyPointZ = 5.5f+2; - }else { - rushRallyPointX = 9.5f+3.5f; - rushRallyPointZ = 5.5f-0.5f; } - rushRallyPointX = 9.5f+2; - rushRallyPointZ = 5.5f+2; lightTanksControlledByCombatAI = new lightTank[192]; rocketTanksControlledByCombatAI = new rocketTank[72];