home
This commit is contained in:
parent
f734c09fc6
commit
6ecad7b40f
@ -405,7 +405,7 @@ public class playerCommander {
|
||||
|
||||
if(selectedConyardID != -1) {
|
||||
for(int i = 0; i < constructionYards.length; i++) {
|
||||
if(constructionYards[i].ID == selectedConyardID) {
|
||||
if(constructionYards[i] != null && constructionYards[i].ID == selectedConyardID) {
|
||||
conyardIndex = i;
|
||||
break;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package enemyAI;
|
||||
|
||||
import core.baseInfo;
|
||||
import core.gameData;
|
||||
import core.mainThread;
|
||||
import core.vector;
|
||||
import entity.goldMine;
|
||||
@ -67,7 +68,7 @@ public class combatManagerAI {
|
||||
this.theBaseInfo = mainThread.ec.theBaseInfo;
|
||||
|
||||
standardAttackTime = 600;
|
||||
rushAttackTime = 300;
|
||||
rushAttackTime = 330 + gameData.getRandom()/4;
|
||||
|
||||
goldMines = mainThread.theAssetManager.goldMines;
|
||||
|
||||
|
@ -65,7 +65,7 @@ public class enemyCommander {
|
||||
thinkHardLikeHumanPlayer();
|
||||
|
||||
|
||||
drawVisionMap();
|
||||
//drawVisionMap();
|
||||
|
||||
//reset tempBitmap;
|
||||
for(int i = 0 ;i < tempBitmap.length; i++){
|
||||
|
@ -26,7 +26,8 @@ public class harassmentAI {
|
||||
miniFrameAI++;
|
||||
frameAI = mainThread.ec.frameAI;
|
||||
|
||||
|
||||
if(miniFrameAI%30 == 29)
|
||||
System.out.println(frameAI + " " + mainThread.ec.theCombatManagerAI.rushAttackTime);
|
||||
|
||||
|
||||
}
|
||||
|
@ -516,24 +516,7 @@ public class mapAwarenessAI {
|
||||
|
||||
if(playerIsFastExpanding) {
|
||||
|
||||
//check if there is any static defense around player's natural
|
||||
boolean staticDefenceNearPlayerExpansion = false;
|
||||
solidObject[] playerStaticDefence = mainThread.ec.theMapAwarenessAI.playerStaticDefenceInMinimap;
|
||||
for(int i = 0; i < playerStaticDefence.length; i++) {
|
||||
if(playerStaticDefence[i] != null && playerStaticDefence[i].currentHP > 0) {
|
||||
float x1 = playerStaticDefence[i].centre.x;
|
||||
float z1 = playerStaticDefence[i].centre.z;
|
||||
float x2 = playerNaturalLocation.x;
|
||||
float z2 = playerNaturalLocation.z;
|
||||
|
||||
if(Math.sqrt((x1-x2)*(x1-x2) + (z1-z2)*(z1-z2)) < 3f) {
|
||||
staticDefenceNearPlayerExpansion = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!staticDefenceNearPlayerExpansion)
|
||||
if(mainThread.ec.theCombatManagerAI.checkIfAIHasBiggerForce(0.5f))
|
||||
canRushPlayer = true;
|
||||
}
|
||||
|
||||
|
@ -122,9 +122,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(mainThread.ec.theMapAwarenessAI.canRushPlayer && frameAI < 360 && mainThread.ec.theCombatManagerAI.checkIfAIHasBiggerForce(1f)) {
|
||||
rallyPoint.set(rushRallyPointX, 0, rushRallyPointZ);
|
||||
}
|
||||
//if(mainThread.ec.theMapAwarenessAI.canRushPlayer && frameAI < 360 && mainThread.ec.theCombatManagerAI.checkIfAIHasBiggerForce(0.75f)) {
|
||||
// rallyPoint.set(rushRallyPointX, 0, rushRallyPointZ);
|
||||
//}
|
||||
|
||||
//make sure not to over produce when the resource is running low
|
||||
int maxNumOfUnitCanBeProduced = theBaseInfo.currentCredit / 500 + 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user