Ticket #2445: teambonus_withauras.diff
File teambonus_withauras.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 = Engine.QueryInterface(this.entity, IID_Player); 90 if (!cmpPlayer) 91 cmpPlayer = QueryOwnerInterface(this.entity); 91 92 if (!cmpPlayer) 92 93 return; 93 94 94 var numPlayers = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).GetNumPlayers(); 95 95 for (var i = 0; i < numPlayers; ++i) 96 96 { 97 97 for (let p of affectedPlayers) 98 98 { … … Auras.prototype.OnOwnershipChanged = fun 384 384 this.Clean(); 385 385 }; 386 386 387 387 Auras.prototype.OnDiplomacyChanged = function(msg) 388 388 { 389 var cmp Ownership = Engine.QueryInterface(this.entity, IID_Ownership);390 if (cmp Ownership && cmpOwnership.GetOwner() == msg.player)389 var cmpPlayer = Engine.QueryInterface(this.entity, IID_Player); 390 if (cmpPlayer && cmpPlayer.GetPlayerID() == msg.player || IsOwnedByPlayer(msg.player, this.entity)) 391 391 this.Clean(); 392 392 }; 393 393 394 394 Auras.prototype.OnGlobalResearchFinished = function(msg) 395 395 { 396 let cmpOwnership = Engine.QueryInterface(this.entity, IID_Ownership);397 if ( !cmpOwnership || cmpOwnership.GetOwner() != msg.player)396 var cmpPlayer = Engine.QueryInterface(this.entity, IID_Player); 397 if ((!cmpPlayer || cmpPlayer.GetPlayerID() != msg.player) && !IsOwnedByPlayer(msg.player, this.entity)) 398 398 return; 399 399 let auraNames = this.GetAuraNames(); 400 400 let needsClean = false; 401 401 for (let name of auraNames) 402 402 { -
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>