Ticket #1649: wonderVictory.diff
File wonderVictory.diff, 3.0 KB (added by , 11 years ago) |
---|
-
binaries/data/mods/public/gui/gamesetup/gamesetup.js
4 4 const DEFAULT_OFFLINE_MAP = "Acropolis 01"; 5 5 6 6 // TODO: Move these somewhere like simulation\data\game_types.json, Atlas needs them too 7 const VICTORY_TEXT = ["Conquest", " None"];8 const VICTORY_DATA = ["conquest", " endless"];7 const VICTORY_TEXT = ["Conquest", "Wonder", "None"]; 8 const VICTORY_DATA = ["conquest", "wonder", "endless"]; 9 9 const VICTORY_DEFAULTIDX = 0; 10 10 const POPULATION_CAP = ["50", "100", "150", "200", "250", "300", "Unlimited"]; 11 11 const POPULATION_CAP_DATA = [50, 100, 150, 200, 250, 300, 10000]; -
binaries/data/mods/public/simulation/components/EndGameManager.js
53 53 } 54 54 }; 55 55 56 EndGameManager.prototype.RegisterWonder = function(entity) 57 { 58 var cmpWon = QueryOwnerInterface(entity, IID_Player); 59 cmpWon.SetState("won"); 60 61 var cmpPlayerManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager); 62 var numPlayers = cmpPlayerManager.GetNumPlayers(); 63 for (var i = 1; i < numPlayers; i++) 64 { 65 var playerEntityId = cmpPlayerManager.GetPlayerByID(i); 66 var cmpPlayer = Engine.QueryInterface(playerEntityId, IID_Player); 67 if (cmpPlayer.GetState() != "active") 68 continue; 69 if (this.alliedVictory && cmpPlayer.IsMutualAlly(cmpWon.GetPlayerID())) 70 cmpPlayer.SetState("won") 71 else 72 Engine.PostMessage(playerEntityId, MT_PlayerDefeated, { "playerId": i-1 } ); 73 } 74 75 } 76 56 77 EndGameManager.prototype.ProgressTimeout = function(data) 57 78 { 58 79 this.UpdatePlayerStates(); … … 67 88 var cmpPlayerManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager); 68 89 switch (this.gameType) 69 90 { 91 case "wonder": 70 92 case "conquest": 71 93 72 94 // Ignore gaia -
binaries/data/mods/public/simulation/components/Foundation.js
317 317 var cmpIdentity = Engine.QueryInterface(building, IID_Identity); 318 318 if (cmpIdentity.GetClassesList().indexOf("CivCentre") != -1) 319 319 cmpPlayerStatisticsTracker.IncreaseBuiltCivCentresCounter(); 320 if (cmpIdentity.GetClassesList().indexOf("Wonder") != -1) 321 { 322 var cmpEndGameManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_EndGameManager); 323 cmpEndGameManager.RegisterWonder(this.entity); 324 } 320 325 321 326 var cmpHealth = Engine.QueryInterface(this.entity, IID_Health); 322 327 var cmpBuildingHealth = Engine.QueryInterface(building, IID_Health);