Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/startingStrategy.js
Show All 21 Lines | PETRA.HQ.prototype.gameAnalysis = function(gameState) | ||||
this.basesManager.init(gameState); | this.basesManager.init(gameState); | ||||
this.updateTerritories(gameState); | this.updateTerritories(gameState); | ||||
// Assign entities and resources in the different bases | // Assign entities and resources in the different bases | ||||
this.assignStartingEntities(gameState); | this.assignStartingEntities(gameState); | ||||
// Sandbox difficulty should not try to expand | // Sandbox difficulty should not try to expand | ||||
this.canExpand = this.Config.difficulty != 0; | this.canExpand = this.Config.difficulty != PETRA.DIFFICULTY_SANDBOX; | ||||
// If no base yet, check if we can construct one. If not, dispatch our units to possible tasks/attacks | // If no base yet, check if we can construct one. If not, dispatch our units to possible tasks/attacks | ||||
this.canBuildUnits = true; | this.canBuildUnits = true; | ||||
if (!gameState.getOwnStructures().filter(API3.Filters.byClass("CivCentre")).hasEntities()) | if (!gameState.getOwnStructures().filter(API3.Filters.byClass("CivCentre")).hasEntities()) | ||||
{ | { | ||||
let template = gameState.applyCiv("structures/{civ}/civil_centre"); | let template = gameState.applyCiv("structures/{civ}/civil_centre"); | ||||
if (!gameState.isTemplateAvailable(template) || !gameState.getTemplate(template).available(gameState)) | if (!gameState.isTemplateAvailable(template) || !gameState.getTemplate(template).available(gameState)) | ||||
{ | { | ||||
if (this.Config.debug > 1) | if (this.Config.debug > 1) | ||||
▲ Show 20 Lines • Show All 470 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator