Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/headquarters.js
Context not available. | |||||
/** Called by the "town phase" research plan once it's started */ | /** Called by the "town phase" research plan once it's started */ | ||||
m.HQ.prototype.OnTownPhase = function(gameState) | m.HQ.prototype.OnTownPhase = function(gameState) | ||||
mimo: how can it work if you remove that function? see line 30 of researchManager.js
You must either… | |||||
Not Done Inline ActionsThanks for the feedback mimo! (I didn't look at the petra code at all before), that helps deciding on what to do with the remains. elexis: Thanks for the feedback mimo! (I didn't look at the petra code at all before), that helps… | |||||
{ | { | ||||
let phaseName = gameState.getTemplate(gameState.townPhase()).name(); | |||||
m.chatNewPhase(gameState, phaseName, "started"); | |||||
}; | }; | ||||
/** Called by the "city phase" research plan once it's started */ | /** Called by the "city phase" research plan once it's started */ | ||||
m.HQ.prototype.OnCityPhase = function(gameState) | m.HQ.prototype.OnCityPhase = function(gameState) | ||||
Done Inline Actionssame comment with line 49 of researchManager.js mimo: same comment with line 49 of researchManager.js | |||||
{ | { | ||||
let phaseName = gameState.getTemplate(gameState.cityPhase()).name(); | |||||
m.chatNewPhase(gameState, phaseName, "started"); | |||||
}; | }; | ||||
/** This code trains citizen workers, trying to keep close to a ratio of worker/soldiers */ | /** This code trains citizen workers, trying to keep close to a ratio of worker/soldiers */ | ||||
Context not available. | |||||
// TODO find a better way to update | // TODO find a better way to update | ||||
if (this.currentPhase != gameState.currentPhase()) | if (this.currentPhase != gameState.currentPhase()) | ||||
Done Inline Actionsthis line as well as line 2218 must be kept otherwise the currentPhase is not updated. mimo: this line as well as line 2218 must be kept otherwise the currentPhase is not updated. | |||||
{ | |||||
this.currentPhase = gameState.currentPhase(); | this.currentPhase = gameState.currentPhase(); | ||||
let phaseName = "Unknown Phase"; | |||||
if (this.currentPhase == 2) | |||||
phaseName = gameState.getTemplate(gameState.townPhase()).name(); | |||||
else if (this.currentPhase == 3) | |||||
phaseName = gameState.getTemplate(gameState.cityPhase()).name(); | |||||
m.chatNewPhase(gameState, phaseName, "completed"); | |||||
} | |||||
if (this.numActiveBase() > 0) | if (this.numActiveBase() > 0) | ||||
{ | { | ||||
this.trainMoreWorkers(gameState, queues); | this.trainMoreWorkers(gameState, queues); | ||||
Context not available. |
Wildfire Games · Phabricator
how can it work if you remove that function? see line 30 of researchManager.js
You must either keep this function with an empty body , or remove that line from researchManager.
I'd keep an empty function in case of future need (as an illustration of how we can do such thing in the ai).