Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/startingStrategy.js
var PETRA = function(m) | (function(m) | ||||
{ | { | ||||
/** | /** | ||||
* determines the strategy to adopt when starting a new game, depending on the initial conditions | * determines the strategy to adopt when starting a new game, depending on the initial conditions | ||||
*/ | */ | ||||
m.HQ.prototype.gameAnalysis = function(gameState) | m.HQ.prototype.gameAnalysis = function(gameState) | ||||
{ | { | ||||
// Analysis of the terrain and the different access regions | // Analysis of the terrain and the different access regions | ||||
▲ Show 20 Lines • Show All 558 Lines • ▼ Show 20 Lines | m.HQ.prototype.configFirstBase = function(gameState) | ||||
if (this.needCorral) | if (this.needCorral) | ||||
{ | { | ||||
template = gameState.applyCiv("structures/{civ}_corral"); | template = gameState.applyCiv("structures/{civ}_corral"); | ||||
if (!gameState.getOwnEntitiesByClass("Corral", true).hasEntities() && this.canBuild(gameState, template)) | if (!gameState.getOwnEntitiesByClass("Corral", true).hasEntities() && this.canBuild(gameState, template)) | ||||
gameState.ai.queues.corral.addPlan(new m.ConstructionPlan(gameState, template, { "base": this.baseManagers[1].ID })); | gameState.ai.queues.corral.addPlan(new m.ConstructionPlan(gameState, template, { "base": this.baseManagers[1].ID })); | ||||
} | } | ||||
}; | }; | ||||
return m; | }(PETRA)); | ||||
}(PETRA); |
Wildfire Games · Phabricator