Ticket #2757: 2757.patch
File 2757.patch, 2.2 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 " + phase + "."); 113 else 114 var message = "/team " + markForTranslation("I have reached the phase " + phase + "."); 115 116 var chat = { 117 "type" : "aichat", 118 "message" : message, 119 "translateMessage" : true 120 }; 121 Engine.PostCommand(PlayerID, chat); 122 }; 123 124 109 125 return m; 110 126 }(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, 2, 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, 3, 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 m.chatNewPhase(gameState, this.currentPhase, false); 1734 } 1725 1735 1726 1736 this.territoryMap = m.createTerritoryMap(gameState); 1727 1737