Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/common-api/gamestate.js
Show All 17 Lines | m.GameState.prototype.init = function(SharedScript, state, player) | ||||
this.templates = SharedScript._templates; | this.templates = SharedScript._templates; | ||||
this.entities = SharedScript.entities; | this.entities = SharedScript.entities; | ||||
this.player = player; | this.player = player; | ||||
this.playerData = SharedScript.playersData[this.player]; | this.playerData = SharedScript.playersData[this.player]; | ||||
this.victoryConditions = SharedScript.victoryConditions; | this.victoryConditions = SharedScript.victoryConditions; | ||||
this.alliedVictory = SharedScript.alliedVictory; | this.alliedVictory = SharedScript.alliedVictory; | ||||
this.ceasefireActive = SharedScript.ceasefireActive; | this.ceasefireActive = SharedScript.ceasefireActive; | ||||
this.ceasefireTimeRemaining = SharedScript.ceasefireTimeRemaining; | this.ceasefireTimeRemaining = SharedScript.ceasefireTimeRemaining; | ||||
this.emergencyState = new Map(); | |||||
JCWasmx86: I'm not sure this is needed. But I think gameState is global and not bound to one AI. | |||||
FreagarachUnsubmitted Done Inline ActionsCorrect. Freagarach: Correct. | |||||
// get the list of possible phases for this civ: | // get the list of possible phases for this civ: | ||||
// we assume all of them are researchable from the civil center | // we assume all of them are researchable from the civil center | ||||
this.phases = []; | this.phases = []; | ||||
let cctemplate = this.getTemplate(this.applyCiv("structures/{civ}/civil_centre")); | let cctemplate = this.getTemplate(this.applyCiv("structures/{civ}/civil_centre")); | ||||
if (!cctemplate) | if (!cctemplate) | ||||
return; | return; | ||||
let civ = this.getPlayerCiv(); | let civ = this.getPlayerCiv(); | ||||
let techs = cctemplate.researchableTechs(this, civ); | let techs = cctemplate.researchableTechs(this, civ); | ||||
▲ Show 20 Lines • Show All 897 Lines • ▼ Show 20 Lines | if (supportTraderTemplate) | ||||
ret.landGainMultiplier = norm * supportTraderTemplate.gainMultiplier(); | ret.landGainMultiplier = norm * supportTraderTemplate.gainMultiplier(); | ||||
if (shipMerchantTemplate) | if (shipMerchantTemplate) | ||||
ret.navalGainMultiplier = norm * shipMerchantTemplate.gainMultiplier(); | ret.navalGainMultiplier = norm * shipMerchantTemplate.gainMultiplier(); | ||||
return ret; | return ret; | ||||
}; | }; | ||||
return m; | return m; | ||||
}(API3); | }(API3); | ||||
Lint: no-use-before-define 'API3' was used before it was defined. Lint: no-use-before-define: 'API3' was used before it was defined. | |||||
Wildfire Games · Phabricator
I'm not sure this is needed. But I think gameState is global and not bound to one AI.