1
0
forked from 0ad/0ad

Stops qBot training heroes and makes it build a market after abuot 10 minutes.

This was SVN commit r11557.
This commit is contained in:
Jonathan Waller 2012-04-18 20:54:14 +00:00
parent 769350a3e7
commit a9475c3854
2 changed files with 14 additions and 2 deletions

View File

@ -355,11 +355,21 @@ EconomyManager.prototype.checkResourceConcentrations = function(gameState, resou
return count;
};
EconomyManager.prototype.buildMarket = function(gameState, queues){
if (gameState.getTimeElapsed() > 600 * 1000){
if (queues.economicBuilding.totalLength() === 0 &&
gameState.countEntitiesAndQueuedByType(gameState.applyCiv("structures/{civ}_market")) === 0){
//only ever build one mill/CC/market at a time
queues.economicBuilding.addItem(new BuildingConstructionPlan(gameState, "structures/{civ}_market"));
}
}
};
EconomyManager.prototype.buildDropsites = function(gameState, queues){
if (queues.economicBuilding.totalLength() === 0 &&
gameState.countFoundationsWithType(gameState.applyCiv("structures/{civ}_mill")) === 0 &&
gameState.countFoundationsWithType(gameState.applyCiv("structures/{civ}_civil_centre")) === 0){
//only ever build one mill/CC at a time
//only ever build one mill/CC/market at a time
if (gameState.getTimeElapsed() > 30 * 1000){
for (var resource in this.dropsiteNumbers){
if (this.checkResourceConcentrations(gameState, resource) < this.dropsiteNumbers[resource]){
@ -423,6 +433,8 @@ EconomyManager.prototype.update = function(gameState, queues, events) {
this.buildDropsites(gameState, queues);
Engine.ProfileStop();
this.buildMarket(gameState, queues);
// TODO: implement a timer based system for this
this.setCount += 1;
if (this.setCount >= 20){

View File

@ -93,7 +93,7 @@ MilitaryAttackManager.prototype.findTrainableUnits = function(gameState, soldier
MilitaryAttackManager.prototype.getSoldierType = function(ent){
if (ent.hasClass("CitizenSoldier") && !ent.hasClass("Cavalry")){
return "citizenSoldier";
}else if (ent.hasClass("Super") || ent.hasClass("Hero") || ent.hasClass("CitizenSoldier")){
}else if (ent.hasClass("Super") || ent.hasClass("CitizenSoldier")){
return "advanced";
}else if (ent.hasClass("Siege")){
return "siege";