Ticket #2445: teambonus_withauras.2.diff
File teambonus_withauras.2.diff, 4.6 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/simulation/components/Auras.js
Auras.prototype.GetAffectedPlayers = fun 84 84 85 85 Auras.prototype.CalculateAffectedPlayers = function(name) 86 86 { 87 87 var affectedPlayers = this.auras[name].affectedPlayers || ["Player"]; 88 88 this.affectedPlayers[name] = []; 89 90 var cmpPlayer = QueryOwnerInterface(this.entity); 89 var cmpPlayer = QueryOwnerInterface(this.entity) || Engine.QueryInterface(this.entity, IID_Player); 91 90 if (!cmpPlayer) 92 91 return; 93 94 92 var numPlayers = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).GetNumPlayers(); 95 93 for (var i = 0; i < numPlayers; ++i) 96 94 { 97 95 for (let p of affectedPlayers) 98 96 { … … Auras.prototype.OnOwnershipChanged = fun 384 382 this.Clean(); 385 383 }; 386 384 387 385 Auras.prototype.OnDiplomacyChanged = function(msg) 388 386 { 389 var cmp Ownership = Engine.QueryInterface(this.entity, IID_Ownership);390 if (cmp Ownership && cmpOwnership.GetOwner() == msg.player)387 var cmpPlayer = Engine.QueryInterface(this.entity, IID_Player); 388 if (cmpPlayer && cmpPlayer.GetPlayerID() == msg.player || IsOwnedByPlayer(msg.player, this.entity)) 391 389 this.Clean(); 392 390 }; 393 391 394 392 Auras.prototype.OnGlobalResearchFinished = function(msg) 395 393 { 396 let cmpOwnership = Engine.QueryInterface(this.entity, IID_Ownership);397 if ( !cmpOwnership || cmpOwnership.GetOwner() != msg.player)394 var cmpPlayer = Engine.QueryInterface(this.entity, IID_Player); 395 if ((!cmpPlayer || cmpPlayer.GetPlayerID() != msg.player) && !IsOwnedByPlayer(msg.player, this.entity)) 398 396 return; 399 397 let auraNames = this.GetAuraNames(); 400 398 let needsClean = false; 401 399 for (let name of auraNames) 402 400 { -
binaries/data/mods/public/simulation/data/auras/iber_player_teambonus.json
1 { 2 "type": "global", 3 "affects": ["CitizenSoldier Javelin"], 4 "affectedPlayers": ["ExclusiveMutualAlly"], 5 "modifications": [ 6 { "value": "Cost/Resources/food", "multiply": 0.8 }, 7 { "value": "Cost/Resources/wood", "multiply": 0.8 }, 8 { "value": "Cost/Resources/metal", "multiply": 0.8 }, 9 { "value": "Cost/Resources/stone", "multiply": 0.8 } 10 ], 11 "auraName": "Saripeko", 12 "auraDescription": "Reduces the cost for citizen-soldier skirmishers with 20% for allies of Iberian players" 13 } -
binaries/data/mods/public/simulation/data/auras/sele_player_teambonus.json
1 { 2 "type": "global", 3 "affects": ["CivilCentre"], 4 "affectedPlayers": ["MutualAlly"], 5 "modifications": [ 6 { "value": "Cost/Resources/food", "multiply": 0.8 }, 7 { "value": "Cost/Resources/wood", "multiply": 0.8 }, 8 { "value": "Cost/Resources/metal", "multiply": 0.8 }, 9 { "value": "Cost/Resources/stone", "multiply": 0.8 } 10 ], 11 "auraName": "Syryan Tetrapolis", 12 "auraDescription": "Reduces the cost for civil centers with 20% for allies of Seleucid players" 13 } -
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">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">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>