1
0
forked from 0ad/0ad

Fixed qbot for the scout tower to defense tower rename and updated the build restriction for the defense tower for consistent naming.

This was SVN commit r11024.
This commit is contained in:
Jonathan Waller 2012-02-04 23:42:55 +00:00
parent a61a682e2a
commit 867df2e6c1
5 changed files with 9 additions and 9 deletions

View File

@ -448,17 +448,17 @@ MilitaryAttackManager.prototype.measureEnemyStrength = function(gameState){
// Adds towers to the defenceBuilding queue
MilitaryAttackManager.prototype.buildDefences = function(gameState, queues){
if (gameState.countEntitiesAndQueuedWithType(gameState.applyCiv('structures/{civ}_scout_tower'))
+ queues.defenceBuilding.totalLength() < gameState.getBuildLimits()["ScoutTower"]) {
if (gameState.countEntitiesAndQueuedWithType(gameState.applyCiv('structures/{civ}_defense_tower'))
+ queues.defenceBuilding.totalLength() < gameState.getBuildLimits()["DefenseTower"]) {
gameState.getOwnEntities().forEach(function(dropsiteEnt) {
if (dropsiteEnt.resourceDropsiteTypes() && dropsiteEnt.getMetadata("scoutTower") !== true){
if (dropsiteEnt.resourceDropsiteTypes() && dropsiteEnt.getMetadata("defenseTower") !== true){
var position = dropsiteEnt.position();
if (position){
queues.defenceBuilding.addItem(new BuildingConstructionPlan(gameState, 'structures/{civ}_scout_tower', position));
queues.defenceBuilding.addItem(new BuildingConstructionPlan(gameState, 'structures/{civ}_defense_tower', position));
}
dropsiteEnt.setMetadata("scoutTower", true);
dropsiteEnt.setMetadata("defenseTower", true);
}
});
}

View File

@ -5,7 +5,7 @@ BuildLimits.prototype.Schema =
"<a:example>" +
"<Limits>" +
"<CivilCentre/>" +
"<ScoutTower>25</ScoutTower>" +
"<DefenseTower>25</DefenseTower>" +
"<Fortress>10</Fortress>" +
"<Special>" +
"<LimitPerCivCentre>1</LimitPerCivCentre>" +

View File

@ -35,7 +35,7 @@ BuildRestrictions.prototype.Schema =
"<choice>" +
"<value>CivilCentre</value>" +
"<value>House</value>" +
"<value>ScoutTower</value>" +
"<value>DefenseTower</value>" +
"<value>Farmstead</value>" +
"<value>Market</value>" +
"<value>Barracks</value>" +

View File

@ -4,7 +4,7 @@
<LimitMultiplier>1.0</LimitMultiplier>
<Limits>
<CivilCentre/>
<ScoutTower>25</ScoutTower>
<DefenseTower>25</DefenseTower>
<Fortress>10</Fortress>
</Limits>
</BuildLimits>

View File

@ -22,7 +22,7 @@
<GarrisonArrowMultiplier>1</GarrisonArrowMultiplier>
</BuildingAI>
<BuildRestrictions>
<Category>ScoutTower</Category>
<Category>DefenseTower</Category>
</BuildRestrictions>
<Cost>
<BuildTime>120</BuildTime>