Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/headquarters.js
Show First 20 Lines • Show All 1,916 Lines • ▼ Show 20 Lines | m.HQ.prototype.constructTrainingBuildings = function(gameState, queues) | ||||
let numBarracks = gameState.getOwnEntitiesByClass("Barracks", true).length; | let numBarracks = gameState.getOwnEntitiesByClass("Barracks", true).length; | ||||
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("Archery", true).length; | let numRanges = gameState.getOwnEntitiesByClass("Range", true).length; | ||||
numBarracks -= numRanges; | |||||
let stableTemplate = this.canBuild(gameState, "structures/{civ}_stables") ? "structures/{civ}_stables" : | let stableTemplate = this.canBuild(gameState, "structures/{civ}_stables") ? "structures/{civ}_stables" : | ||||
Silier: @Nescio we have pers_stables and *_stable, + *_elephant_stables. Are you up to task to unify… | |||||
NescioUnsubmitted Not Done Inline ActionsIt ought to be “stable” (singular, without s). Nescio: It ought to be “stable” (singular, without s).
Correcting it properly also involves renaming… | |||||
SilierAuthorUnsubmitted Done Inline ActionsI am speaking just about structure template names not every single one use in whole project :) Silier: I am speaking just about structure template names not every single one use in whole project :) | |||||
NescioUnsubmitted Not Done Inline ActionsSimply correcting Mauryans into Mauryas (D1342) required moving numerous art and other files, though. Nescio: Simply correcting Mauryans into Mauryas (D1342) required moving numerous art and other files… | |||||
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 962 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
@Nescio we have pers_stables and *_stable, + *_elephant_stables. Are you up to task to unify this (stable/stables) ? I would do myself but dont know which one is correct. (then this can be simplier)