Ticket #3792: stackable.2.diff

File stackable.2.diff, 2.7 KB (added by fatherbushido, 8 years ago)
  • binaries/data/mods/public/simulation/components/Auras.js

    Auras.prototype.Init = function()  
    2323};
    2424
    2525// We can modify identifier if we want stackable auras in some case.
    2626Auras.prototype.GetModifierIdentifier = function(name)
    2727{
    28         return name;
     28    if (this.auras[name].stackable)
     29        return name + this.entity;
     30    return name;
    2931};
    3032
    3133Auras.prototype.GetDescriptions = function()
    3234{
    3335    let auraNames = this.GetAuraNames();
    Auras.prototype.RemoveGarrisonBonus = fu  
    302304        this.RemoveBonus(name, [structure]);
    303305};
    304306
    305307Auras.prototype.RemoveTemplateBonus = function(name)
    306308{
    307     if (!this.CanApply(name))
    308         return;
    309309    if (!this.IsGlobalAura(name))
    310310        return;
    311311
    312312    var modifications = this.GetModifications(name);
    313313    var cmpAuraManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_AuraManager);
    Auras.prototype.RemoveBonus = function(n  
    353353    if (!validEnts.length)
    354354        return;
    355355
    356356    this[name].targetUnits = this[name].targetUnits.filter(v => validEnts.indexOf(v) == -1);
    357357
    358     if (!this.CanApply(name))
    359         return;
    360 
    361358    var modifications = this.GetModifications(name);
    362359    var cmpAuraManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_AuraManager);
    363360
    364361    for (let mod of modifications)
    365362        cmpAuraManager.RemoveBonus(mod.value, validEnts, this.GetModifierIdentifier(name));
  • binaries/data/mods/public/simulation/data/auras/wonder_pop_1.json

     
    11{
    22    "type": "global",
    33    "affects": ["Player"],
    44    "modifications": [ { "value": "Player/MaxPopulation", "add": 10 } ],
    55    "auraName": "Wonder Aura",
    6     "auraDescription": "+10 max. population cap"
     6    "auraDescription": "+10 max. population cap",
     7    "stackable": true
    78}
  • binaries/data/mods/public/simulation/data/auras/wonder_pop_2.json

     
    22    "type": "global",
    33    "affects": ["Player"],
    44    "modifications": [ { "value": "Player/MaxPopulation", "add": 40 } ],
    55    "auraName": "Wonder Aura",
    66    "auraDescription": "+40 extra max. population cap (requires \"Glorious Expansion\" tech)",
    7     "requiredTechnology": "pop_wonder"
     7    "requiredTechnology": "pop_wonder",
     8    "stackable": true
    89}