Ticket #2445: teambonus_withauras.7.diff
File teambonus_withauras.7.diff, 6.4 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/simulation/components/Auras.js
Auras.prototype.GetAffectedPlayers = fun 85 85 Auras.prototype.CalculateAffectedPlayers = function(name) 86 86 { 87 87 var affectedPlayers = this.auras[name].affectedPlayers || ["Player"]; 88 88 this.affectedPlayers[name] = []; 89 89 90 var cmpPlayer = QueryOwnerInterface(this.entity); 90 var cmpPlayer = Engine.QueryInterface(this.entity, IID_Player); 91 if (!cmpPlayer) 92 cmpPlayer = QueryOwnerInterface(this.entity); 91 93 if (!cmpPlayer) 92 94 return; 93 95 94 96 var numPlayers = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).GetNumPlayers(); 95 97 for (var i = 0; i < numPlayers; ++i) … … Auras.prototype.OnOwnershipChanged = fun 384 386 this.Clean(); 385 387 }; 386 388 387 389 Auras.prototype.OnDiplomacyChanged = function(msg) 388 390 { 389 var cmpOwnership = Engine.QueryInterface(this.entity, IID_Ownership); 390 if (cmpOwnership && cmpOwnership.GetOwner() == msg.player) 391 var cmpPlayer = Engine.QueryInterface(this.entity, IID_Player); 392 if (cmpPlayer && (cmpPlayer.GetPlayerID() == msg.player || cmpPlayer.GetPlayerID() == msg.otherPlayer) || 393 IsOwnedByPlayer(msg.player, this.entity) || 394 IsOwnedByPlayer(msg.otherPlayer, this.entity)) 391 395 this.Clean(); 392 396 }; 393 397 394 398 Auras.prototype.OnGlobalResearchFinished = function(msg) 395 399 { 396 let cmpOwnership = Engine.QueryInterface(this.entity, IID_Ownership);397 if ( !cmpOwnership || cmpOwnership.GetOwner() != msg.player)400 var cmpPlayer = Engine.QueryInterface(this.entity, IID_Player); 401 if ((!cmpPlayer || cmpPlayer.GetPlayerID() != msg.player) && !IsOwnedByPlayer(msg.player, this.entity)) 398 402 return; 399 403 let auraNames = this.GetAuraNames(); 400 404 let needsClean = false; 401 405 for (let name of auraNames) 402 406 { -
binaries/data/mods/public/simulation/components/Player.js
Player.prototype.SetTeam = function(team 387 387 388 388 this.SetAlly(i); 389 389 cmpPlayer.SetAlly(this.playerID); 390 390 } 391 391 392 Engine.BroadcastMessage(MT_DiplomacyChanged, { "player": this.playerID });392 Engine.BroadcastMessage(MT_DiplomacyChanged, { "player": this.playerID, "otherPlayer": null }); 393 393 }; 394 394 395 395 Player.prototype.SetLockTeams = function(value) 396 396 { 397 397 this.teamsLocked = value; … … Player.prototype.GetDiplomacy = function 408 408 }; 409 409 410 410 Player.prototype.SetDiplomacy = function(dipl) 411 411 { 412 412 this.diplomacy = dipl; 413 Engine.BroadcastMessage(MT_DiplomacyChanged, { "player": this.playerID });413 Engine.BroadcastMessage(MT_DiplomacyChanged, { "player": this.playerID, "otherPlayer": null }); 414 414 }; 415 415 416 416 Player.prototype.SetDiplomacyIndex = function(idx, value) 417 417 { 418 418 var cmpPlayerManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager); … … Player.prototype.SetDiplomacyIndex = fun 425 425 426 426 if (this.state != "active" || cmpPlayer.state != "active") 427 427 return; 428 428 429 429 this.diplomacy[idx] = value; 430 Engine.BroadcastMessage(MT_DiplomacyChanged, { "player": this.playerID });430 Engine.BroadcastMessage(MT_DiplomacyChanged, { "player": this.playerID, "otherPlayer": cmpPlayer.GetPlayerID() }); 431 431 432 432 // Mutual worsening of relations 433 433 if (cmpPlayer.diplomacy[this.playerID] > value) 434 434 cmpPlayer.SetDiplomacyIndex(this.playerID, value); 435 435 }; -
binaries/data/mods/public/simulation/data/technologies/hellenes/teambonus_athen_delian_league.json
1 {2 "genericName": "Delian League",3 "autoResearch": true,4 "description": "Shortly after the great naval victories at Salamis and Mycale, the Greek city-states instituted the so-called Delian League in 478 BC, whose purpose was to push the Persians out of the Aegean region. The allied states contributed ships and money, while the Athenians offered their entire navy.",5 "requirements": {"civ": "athen"},6 "modifications": [{"value": "Cost/BuildTime", "multiply": 0.75}],7 "affects": ["Warship"]8 }9 Pas de fin de ligne à la fin du fichier -
binaries/data/mods/public/simulation/templates/special/player_athen.xml
Modification de propriétés sur binaries/data/mods/public/simulation/data/technologies/hellenes/teambonus_athen_delian_league.json ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property
1 <?xml version="1.0" encoding="utf-8"?> 2 <Entity parent="special/player"> 3 <Auras datatype="tokens">teambonuses/athen_player_teambonus</Auras> 4 </Entity> -
binaries/data/mods/public/simulation/templates/special/player_iber.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <Entity parent="special/player"> 3 <Auras datatype="tokens">teambonuses/iber_player_teambonus</Auras> 4 </Entity> -
binaries/data/mods/public/simulation/templates/special/player_sele.xml
1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <Entity parent="special/player"> 3 <Auras datatype="tokens">teambonuses/sele_player_teambonus</Auras> 3 4 <EntityLimits> 4 5 <LimitRemovers> 5 6 <CivilCentre> 6 7 <RequiredTechs datatype="tokens">phase_town</RequiredTechs> 7 8 <RequiredClasses datatype="tokens">Hero</RequiredClasses>