From 44511cf57726fe9e6fabb0ca04290f7c2558273b Mon Sep 17 00:00:00 2001 From: Pan Date: Mon, 14 Jan 2019 23:08:58 +1300 Subject: [PATCH] home commit 2 --- enemyAI/defenseManagerAI.java | 25 ++++++++++++++++++++++++- enemyAI/mapAwarenessAI.java | 2 +- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/enemyAI/defenseManagerAI.java b/enemyAI/defenseManagerAI.java index c50c44c..1f8bb59 100644 --- a/enemyAI/defenseManagerAI.java +++ b/enemyAI/defenseManagerAI.java @@ -20,14 +20,24 @@ public class defenseManagerAI { public solidObject[] stealthTanksControlledByCombatAI; + public solidObject[] defenders; + public vector direction; + public vector minorThreatLocation; + public vector majorThreatLocation; + public defenseManagerAI(baseInfo theBaseInfo){ this.theBaseInfo = theBaseInfo; observers = new solidObject[4]; + defenders = new solidObject[5]; + direction = new vector(0,0,0); + + minorThreatLocation = new vector(0,0,0); + majorThreatLocation = new vector(0,0,0); } @@ -107,11 +117,24 @@ public class defenseManagerAI { } } - //go through all the player units on the mini map and deal with them accordingly + //send units to deal with minor threat on the map if there is any + vector mainPlayerForceLocation = mainThread.ec.theMapAwarenessAI.mainPlayerForceLocation; + vector mainPlayerForceDirection = mainThread.ec.theMapAwarenessAI.mainPlayerForceDirection; + int mainPlayerForceSize = mainThread.ec.theMapAwarenessAI.mainPlayerForceSize; + + minorThreatLocation.reset(); + majorThreatLocation.reset(); + + // if the size of the player unit cluster is less than 5, and no heavy tanks in the cluster, then borrow some unites from combatAI to deal with the threat + //if(mainPlayerForceSize < 5 && playerForceContainsNoHeavyTank(mainPlayerForceLocation) && playerForceIsNearBase(mainPlayerForceLocation)) { + + //} } + + public boolean evadePlayerUnit(int observerIndex){ //scan for hostile unit int[] tileCheckList = stealthTank.tileCheckList; diff --git a/enemyAI/mapAwarenessAI.java b/enemyAI/mapAwarenessAI.java index 772bb89..bbf76a5 100644 --- a/enemyAI/mapAwarenessAI.java +++ b/enemyAI/mapAwarenessAI.java @@ -586,7 +586,7 @@ public class mapAwarenessAI { } } - System.out.println(mainPlayerForceSize + " " + mainPlayerForceLocation + " " + mainPlayerForceDirection); + //System.out.println(mainPlayerForceSize + " " + mainPlayerForceLocation + " " + mainPlayerForceDirection); }