Ticket #3792: stackable.2.diff
File stackable.2.diff, 2.7 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/simulation/components/Auras.js
Auras.prototype.Init = function() 23 23 }; 24 24 25 25 // We can modify identifier if we want stackable auras in some case. 26 26 Auras.prototype.GetModifierIdentifier = function(name) 27 27 { 28 return name; 28 if (this.auras[name].stackable) 29 return name + this.entity; 30 return name; 29 31 }; 30 32 31 33 Auras.prototype.GetDescriptions = function() 32 34 { 33 35 let auraNames = this.GetAuraNames(); … … Auras.prototype.RemoveGarrisonBonus = fu 302 304 this.RemoveBonus(name, [structure]); 303 305 }; 304 306 305 307 Auras.prototype.RemoveTemplateBonus = function(name) 306 308 { 307 if (!this.CanApply(name))308 return;309 309 if (!this.IsGlobalAura(name)) 310 310 return; 311 311 312 312 var modifications = this.GetModifications(name); 313 313 var cmpAuraManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_AuraManager); … … Auras.prototype.RemoveBonus = function(n 353 353 if (!validEnts.length) 354 354 return; 355 355 356 356 this[name].targetUnits = this[name].targetUnits.filter(v => validEnts.indexOf(v) == -1); 357 357 358 if (!this.CanApply(name))359 return;360 361 358 var modifications = this.GetModifications(name); 362 359 var cmpAuraManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_AuraManager); 363 360 364 361 for (let mod of modifications) 365 362 cmpAuraManager.RemoveBonus(mod.value, validEnts, this.GetModifierIdentifier(name)); -
binaries/data/mods/public/simulation/data/auras/wonder_pop_1.json
1 1 { 2 2 "type": "global", 3 3 "affects": ["Player"], 4 4 "modifications": [ { "value": "Player/MaxPopulation", "add": 10 } ], 5 5 "auraName": "Wonder Aura", 6 "auraDescription": "+10 max. population cap" 6 "auraDescription": "+10 max. population cap", 7 "stackable": true 7 8 } -
binaries/data/mods/public/simulation/data/auras/wonder_pop_2.json
2 2 "type": "global", 3 3 "affects": ["Player"], 4 4 "modifications": [ { "value": "Player/MaxPopulation", "add": 40 } ], 5 5 "auraName": "Wonder Aura", 6 6 "auraDescription": "+40 extra max. population cap (requires \"Glorious Expansion\" tech)", 7 "requiredTechnology": "pop_wonder" 7 "requiredTechnology": "pop_wonder", 8 "stackable": true 8 9 }