Skip to content

Commit

Permalink
Added dgun for striders, although atm it isn't working 100%. Currentl…
Browse files Browse the repository at this point in the history
…y fighting issues with random -3 errors when giving units orders, which is probably blocking it.

Also redid the cost model for mil.getTarget, although there's still plenty of work to be done with unit behavior.
  • Loading branch information
aeonios committed Nov 15, 2015
1 parent befac8d commit 10af1d0
Show file tree
Hide file tree
Showing 4 changed files with 216 additions and 173 deletions.
18 changes: 11 additions & 7 deletions src/zkgbai/economy/EconomyManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ private String getCloaky(){
if (rand > 0.9){
return "armpw";
}else if (rand > 0.6){
return "armham";
return "armrock";
}else if (rand > 0.4){
return "armzeus";
}else if (rand > 0.2) {
Expand Down Expand Up @@ -520,9 +520,7 @@ private String getGunship(){

private String getStrider(){
double rand = Math.random();
if (rand > 0.9) {
return "armraven";
}else if(rand > 0.75){
if(rand > 0.75){
return "scorpion";
}else{
return "dante";
Expand Down Expand Up @@ -884,7 +882,7 @@ void createWorkerTask(Worker worker){
// is there sufficient energy to cover metal income?
if ((mexes.size() * 1.5) - 1.5 > solars.size()+solarTasks.size()
|| (effectiveIncome > 30 && (mexes.size()*2) > solars.size()+solarTasks.size())
|| (effectiveIncome > 20 && metal > 200 && energy == 0)
|| (effectiveIncome > 15 && energy < 5 && solarTasks.size() < numWorkers)
|| (effectiveIncome > 30 && canBuildFusion(position))) {
createEnergyTask(worker);
}
Expand Down Expand Up @@ -978,8 +976,14 @@ void createFactoryTask( Worker worker){
position.x = position.x + 120;
position.z = position.z + 120;
if (factories.size() > 0) {
position = getNearestFac(position).getPos();
position = getRadialPoint(position, 800f);
boolean good = false;
AIFloat3 facpos = getNearestFac(position).getPos();
while (!good) {
position = getRadialPoint(facpos, 800f);
if (distance(facpos, position) > 500){
good = true;
}
}
}

if(factories.size() == 0){
Expand Down

0 comments on commit 10af1d0

Please sign in to comment.