home commit

This commit is contained in:
Pan 2019-04-16 19:50:44 +12:00
parent 75b4ecfda1
commit 282c0dde07
4 changed files with 15 additions and 8 deletions

View File

@ -364,7 +364,7 @@ public class combatManagerAI {
//check if the player force has become stronger than the AI during the marching towards attack position //check if the player force has become stronger than the AI during the marching towards attack position
//System.out.println("distanceToTarget: " + distanceToTarget); //System.out.println("distanceToTarget: " + distanceToTarget);
if(checkIfAIHasBiggerForce(1.2f) == false && distanceToTarget > 5){ if(checkIfAIHasBiggerForce(1.5f) == false && distanceToTarget > 5){
playerHasBecomeStrongerThanAIDuringMarching = true; playerHasBecomeStrongerThanAIDuringMarching = true;
} }
@ -711,7 +711,7 @@ public class combatManagerAI {
double playerForceStrength = unrevealedPlayerForceStrength + numberOfLightTanks_player + 0.75f*numberOfRocketTanks_player + 1.5*numberOfStealthTanks_player + 3* numberOfHeavyTanks_player; double playerForceStrength = unrevealedPlayerForceStrength + numberOfLightTanks_player + 0.75f*numberOfRocketTanks_player + 1.5*numberOfStealthTanks_player + 3* numberOfHeavyTanks_player;
//System.out.println("unrevealedPlayerForceStrength" + unrevealedPlayerForceStrength + " " + "enemyAIForceStrength " + enemyAIForceStrength + " " + "playerForceStrength" + playerForceStrength); System.out.println("unrevealedPlayerForceStrength" + unrevealedPlayerForceStrength + " " + "enemyAIForceStrength " + enemyAIForceStrength + " " + "playerForceStrength" + playerForceStrength);
return enemyAIForceStrength > 0 && playerForceStrength/enemyAIForceStrength < ratio; return enemyAIForceStrength > 0 && playerForceStrength/enemyAIForceStrength < ratio;
} }

View File

@ -216,7 +216,7 @@ public class defenseManagerAI {
majorThreatCooldown = 20; majorThreatCooldown = 20;
majorThreatLocation.set(mainPlayerForceLocation); majorThreatLocation.set(mainPlayerForceLocation);
} }
/*
else { else {
float d = playerForceIsMovingTwoardsBase(mainPlayerForceLocation, mainPlayerForceDirection); float d = playerForceIsMovingTwoardsBase(mainPlayerForceLocation, mainPlayerForceDirection);
if(d != -1) { if(d != -1) {
@ -226,7 +226,7 @@ public class defenseManagerAI {
majorThreatLocation.add(mainPlayerForceDirection, d); majorThreatLocation.add(mainPlayerForceDirection, d);
} }
} }
*/
} }
@ -403,7 +403,7 @@ public class defenseManagerAI {
//find deploy location of gun turret //find deploy location of gun turret
if(threatX != 0 && distanceToThreat < 4.75 && numOfGunTurretNearThreat < (float)mainPlayerForceSize/3) { if(threatX != 0 && distanceToThreat < 4.75 && numOfGunTurretNearThreat < (float)mainPlayerForceSize/3) {
float d = 1.75f; //minimum deploy distance from conyard float d = 1.85f; //minimum deploy distance from conyard
if(distanceToThreat > d + gunTurret.attackRange) if(distanceToThreat > d + gunTurret.attackRange)
d = distanceToThreat - gunTurret.attackRange; d = distanceToThreat - gunTurret.attackRange;
@ -416,7 +416,7 @@ public class defenseManagerAI {
//find deploy location of missile turret //find deploy location of missile turret
if(threatX != 0 && distanceToThreat < 5.15 && (numOfMissileTurretNearThreat < mainPlayerForceSize/6 || !gunTurretAlreadyInQueue)) { if(threatX != 0 && distanceToThreat < 5.15 && (numOfMissileTurretNearThreat < mainPlayerForceSize/6 || !gunTurretAlreadyInQueue)) {
float d = 1.35f; //minimum deploy distance from conyard float d = 1.65f; //minimum deploy distance from conyard
if(distanceToThreat > d + missileTurret.attackRange) if(distanceToThreat > d + missileTurret.attackRange)
d = distanceToThreat - missileTurret.attackRange; d = distanceToThreat - missileTurret.attackRange;
@ -500,7 +500,7 @@ public class defenseManagerAI {
threatToBaseDirection.unit(); threatToBaseDirection.unit();
if(threatToBaseDirection.dot(direction) > 0.8) { if(threatToBaseDirection.dot(direction) > 0.8) {
float currentThreatDistance = Math.max(3f, d - 3f); float currentThreatDistance = Math.max(3f, d - 2f);
if(currentThreatDistance < threatDistance) if(currentThreatDistance < threatDistance)
threatDistance = currentThreatDistance; threatDistance = currentThreatDistance;

View File

@ -194,7 +194,7 @@ public class unitProductionAI {
} }
} }
if(mainThread.ec.theEconomyManagerAI.numberOfharvesters > 6 && theBaseInfo.currentCredit > 1500) { if(mainThread.ec.theEconomyManagerAI.numberOfharvesters >= 6 && theBaseInfo.currentCredit > 1500) {
if(!communicationCenter.harvesterSpeedResearched_enemy) { if(!communicationCenter.harvesterSpeedResearched_enemy) {
if(communicationCenter.harvesterSpeedResearchProgress_enemy == 255){ if(communicationCenter.harvesterSpeedResearchProgress_enemy == 255){
communicationCenter.researchHarvesterSpeed(1); communicationCenter.researchHarvesterSpeed(1);

View File

@ -284,6 +284,13 @@ public class goldMine extends solidObject{
for(int i = 0; i < polygons.length; i++) for(int i = 0; i < polygons.length; i++)
polygons[i].myTexture = mainThread.textures[textureIndex]; polygons[i].myTexture = mainThread.textures[textureIndex];
} }
}else {
if(textureIndex == 41 && goldDeposite == maxDeposite) {
textureIndex = 39;
for(int i = 0; i < polygons.length; i++) {
polygons[i].myTexture = mainThread.textures[textureIndex];
}
}
} }