From 93624cbda3e9fa85e54578cb4892eaa8df8f8683 Mon Sep 17 00:00:00 2001 From: Pan Date: Wed, 3 Apr 2019 21:49:33 +1300 Subject: [PATCH] home --- enemyAI/mapAwarenessAI.java | 5 ++++- enemyAI/scoutingManagerAI.java | 4 ++-- enemyAI/unitProductionAI.java | 20 +++++++++++++++++++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/enemyAI/mapAwarenessAI.java b/enemyAI/mapAwarenessAI.java index e5272f6..cdb434a 100644 --- a/enemyAI/mapAwarenessAI.java +++ b/enemyAI/mapAwarenessAI.java @@ -40,7 +40,6 @@ public class mapAwarenessAI { public int numberOfPlayerBuildingDestroyedPreviousFrame; public int playerAssetDestoryedCountDown; - public boolean playerHasMostlyLightTanks; public boolean playerHasMostlyHeavyTanks; public boolean playIsRushingHighTierUnits; @@ -49,6 +48,7 @@ public class mapAwarenessAI { public boolean playerIsRushingLightTank; public boolean playerHasManyLightTanksButNoHeavyTank; public boolean playerHasMostlyHeavyAndStealthTanks; + public boolean canRushPlayer; public solidObject[] mapAsset; public boolean[] visionMap; @@ -470,6 +470,9 @@ public class mapAwarenessAI { maxNumberOfStealthTanks_playerInLastFiveMinutes = 0; + //determine if a rush is feasible against the player + + findTheMostVulnerablePlayerBase(); findPlayerForceLocation(); diff --git a/enemyAI/scoutingManagerAI.java b/enemyAI/scoutingManagerAI.java index e501832..c59d058 100644 --- a/enemyAI/scoutingManagerAI.java +++ b/enemyAI/scoutingManagerAI.java @@ -335,8 +335,8 @@ public class scoutingManagerAI { if(scout != null && scout.currentHP > 0 && scout.type == 0){ mainThread.ec.theUnitProductionAI.addLightTank((lightTank)scout); scout.moveTo(mainThread.ec.theUnitProductionAI.rallyPoint.x, mainThread.ec.theUnitProductionAI.rallyPoint.z); - scout.currentCommand = solidObject.attackMove; - scout.secondaryCommand = solidObject.attackMove; + scout.currentCommand = solidObject.move; + scout.secondaryCommand = solidObject.StandBy; } destinationNode = 0; scout = o; diff --git a/enemyAI/unitProductionAI.java b/enemyAI/unitProductionAI.java index 489451e..df33a15 100644 --- a/enemyAI/unitProductionAI.java +++ b/enemyAI/unitProductionAI.java @@ -48,12 +48,28 @@ public class unitProductionAI { public solidObject[] unitInCombatRadius; public solidObject[] unitOutsideCombatRadius; + public float rushRallyPointX, rushRallyPointZ; + public int frameAI; public unitProductionAI(baseInfo theBaseInfo){ this.theBaseInfo = theBaseInfo; rallyPoint = new vector(0,0,0); + if(gameData.getRandom() < 341) { + rushRallyPointX = 9.5f+2; + rushRallyPointZ = 5.5f+2; + }else if(gameData.getRandom() < 682) { + 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]; stealthTanksControlledByCombatAI = new stealthTank[96]; @@ -117,7 +133,9 @@ public class unitProductionAI { //If the difficulty is set to normal or hard, set the rally point just outside of player's natural expansion. //So if the player is going for a fast expansion and don't have much units, the AI can perform a rush attack. - + if(frameAI < 360 && mainThread.ec.theCombatManagerAI.checkIfAIHasBiggerForce(1f)) { + rallyPoint.set(rushRallyPointX, 0, rushRallyPointZ); + } //make sure not to over produce when the resource is running low