Ticket #2757: 2757.2.patch
File 2757.2.patch, 2.4 KB (added by , 9 years ago) |
---|
-
binaries/data/mods/public/simulation/ai/petra/chatHelper.js
106 106 Engine.PostCommand(PlayerID, chat); 107 107 }; 108 108 109 m.chatNewPhase = function(gameState, phase, started) 110 { 111 if(started) 112 var message = "/team " + markForTranslation("I am advancing to the %(_phase_)s phase."); 113 else 114 var message = "/team " + markForTranslation("I have reached the %(_phase_)s phase."); 115 116 var chat = { 117 "type" : "aichat", 118 "message" : message, 119 "translateMessage" : true, 120 "translateParameters" : ["_phase_"], 121 "parameters" : { "_phase_" : phase } 122 }; 123 Engine.PostCommand(PlayerID, chat); 124 }; 125 126 109 127 return m; 110 128 }(PETRA); -
binaries/data/mods/public/simulation/ai/petra/headquarters.js
20 20 21 21 this.econState = "growth"; // existing values: growth, townPhasing. 22 22 this.phaseStarted = undefined; 23 this.currentPhase = undefined; 23 24 24 25 // cache the rates. 25 26 this.wantedRates = { "food": 0, "wood": 0, "stone":0, "metal": 0 }; … … 71 72 return false; 72 73 }); 73 74 this.treasures.registerUpdates(); 75 this.currentPhase = gameState.currentPhase(); 74 76 }; 75 77 76 78 /** … … 281 283 this.femaleRatio = 0.4; 282 284 283 285 this.phaseStarted = 2; 286 m.chatNewPhase(gameState, "town", true); 284 287 }; 285 288 286 289 // Called by the "city phase" research plan once it's started … … 290 293 this.femaleRatio = 0.3; 291 294 292 295 this.phaseStarted = 3; 296 m.chatNewPhase(gameState, "city", true); 293 297 }; 294 298 295 299 // This code trains females and citizen workers, trying to keep close to a ratio of females/CS … … 1722 1726 m.HQ.prototype.update = function(gameState, queues, events) 1723 1727 { 1724 1728 Engine.ProfileStart("Headquarters update"); 1729 1730 if(this.currentPhase != gameState.currentPhase()) 1731 { 1732 this.currentPhase = gameState.currentPhase(); 1733 1734 if(this.currentPhase == 2) 1735 m.chatNewPhase(gameState, "town", false); 1736 else if(this.currentPhase == 3) 1737 m.chatNewPhase(gameState, "city", false); 1738 } 1725 1739 1726 1740 this.territoryMap = m.createTerritoryMap(gameState); 1727 1741