Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
Show First 20 Lines • Show All 1,918 Lines • ▼ Show 20 Lines | m.HQ.prototype.constructTrainingBuildings = function(gameState, queues) | ||||
if (this.saveResources && numBarracks != 0) | if (this.saveResources && numBarracks != 0) | ||||
return; | return; | ||||
let barracksTemplate = this.canBuild(gameState, "structures/{civ}_barracks") ? "structures/{civ}_barracks" : undefined; | let barracksTemplate = this.canBuild(gameState, "structures/{civ}_barracks") ? "structures/{civ}_barracks" : undefined; | ||||
let rangeTemplate = this.canBuild(gameState, "structures/{civ}_range") ? "structures/{civ}_range" : undefined; | let rangeTemplate = this.canBuild(gameState, "structures/{civ}_range") ? "structures/{civ}_range" : undefined; | ||||
let numRanges = gameState.getOwnEntitiesByClass("Range", true).length; | let numRanges = gameState.getOwnEntitiesByClass("Range", true).length; | ||||
let stableTemplate = this.canBuild(gameState, "structures/{civ}_stables") ? "structures/{civ}_stables" : | let stableTemplate = this.canBuild(gameState, "structures/{civ}_stable") ? "structures/{civ}_stable" : undefined; | ||||
this.canBuild(gameState, "structures/{civ}_stable") ? "structures/{civ}_stable" : undefined; | |||||
let numStables = gameState.getOwnEntitiesByClass("Stables", true).length; | let numStables = gameState.getOwnEntitiesByClass("Stables", true).length; | ||||
if (this.getAccountedPopulation(gameState) > this.Config.Military.popForBarracks1 || | if (this.getAccountedPopulation(gameState) > this.Config.Military.popForBarracks1 || | ||||
this.phasing == 2 && gameState.getOwnStructures().filter(API3.Filters.byClass("Village")).length < 5) | this.phasing == 2 && gameState.getOwnStructures().filter(API3.Filters.byClass("Village")).length < 5) | ||||
{ | { | ||||
// first barracks/range and stables. | // first barracks/range and stables. | ||||
if (numBarracks + numRanges == 0) | if (numBarracks + numRanges == 0) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 961 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator