Ticket #3830: ok.diff

File ok.diff, 5.7 KB (added by fatherbushido, 8 years ago)

workaround, remove wonder auras, restore the tech, revert possibility to modify Player/MaxPopulation

  • binaries/data/mods/public/simulation/components/Player.js

    Player.prototype.SetMaxPopulation = func  
    142142    this.maxPop = max;
    143143};
    144144
    145145Player.prototype.GetMaxPopulation = function()
    146146{
    147     return Math.round(ApplyValueModificationsToPlayer("Player/MaxPopulation", this.maxPop, this.entity, this.playerID));
     147    return Math.round(ApplyValueModificationsToPlayer("Player/MaxPopulation", this.maxPop, this.entity));
    148148};
    149149
    150150Player.prototype.SetGatherRateMultiplier = function(value)
    151151{
    152152    this.gatherRateMultiplier = value;
  • binaries/data/mods/public/simulation/data/technologies/pop_wonder.json

     
    88        "ptol": "Peristyle",
    99        "rome": "Peristyle",
    1010        "pers": "Paradise"
    1111    },
    1212    "description": "The wonder attracts many more people to your civilization.",
    13     "cost": { "food": 2000, "wood": 3000, "stone": 500, "metal": 500 },
     13    "cost": { "food": 3000, "wood": 3000, "stone": 500, "metal": 500 },
    1414    "requirements": { "tech": "phase_city" },
    1515    "requirementsTooltip": "Unlocked in City Phase.",
    1616    "icon": "special_treasure.png",
    1717    "researchTime": 40,
    18     "tooltip": "Increase the population bonus of the wonder by 40.",
    19     "modifications": [{ "value": "Auras/Aura1/Modifications/Player/MaxPopulation/Add", "add": 40 }],
    20     "affects": ["Wonder"],
     18    "tooltip": "+50 maximum population cap.",
     19    "modifications": [{ "value": "Player/MaxPopulation", "add": 50 }],
    2120    "soundComplete": "interface/alarm/alarm_upgradearmory.xml"
    2221}
  • binaries/data/mods/public/simulation/helpers/ValueModification.js

    function ApplyValueModificationsToEntity  
    1111    if (!cmpAuraManager)
    1212        return value;
    1313    return cmpAuraManager.ApplyModifications(tech_type, value, entity);
    1414}
    1515
    16 function ApplyValueModificationsToPlayer(tech_type, current_value, playerEntity, playerID)
     16function ApplyValueModificationsToPlayer(tech_type, current_value, playerEntity)
    1717{
    18     let cmpTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager);
    19     if (!cmpTemplateManager)
    20         return current_value;
    21     let entityTemplateName = cmpTemplateManager.GetCurrentTemplateName(playerEntity);
    22     let entityTemplate = cmpTemplateManager.GetTemplate(entityTemplateName);
    23     return ApplyValueModificationsToTemplate(tech_type, current_value, playerID, entityTemplate);
     18    return ApplyValueModificationsToEntity(tech_type, current_value, playerEntity);
    2419}
    2520
    2621function ApplyValueModificationsToTemplate(tech_type, current_value, playerID, template)
    2722{
    2823    let value = current_value;
    function ApplyValueModificationsToTempla  
    3025    if (cmpTechnologyManager)
    3126        value = cmpTechnologyManager.ApplyModificationsTemplate(tech_type, current_value, template);
    3227
    3328    let cmpAuraManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_AuraManager);
    3429    if (!cmpAuraManager)
    35         return value; 
     30        return value;
    3631    return cmpAuraManager.ApplyTemplateModifications(tech_type, value, playerID, template);
    3732}
    3833
    3934Engine.RegisterGlobal("ApplyValueModificationsToEntity", ApplyValueModificationsToEntity);
    4035Engine.RegisterGlobal("ApplyValueModificationsToPlayer", ApplyValueModificationsToPlayer);
  • binaries/data/mods/public/simulation/templates/special/player.xml

     
    4646      <CivilCentre>
    4747        <RequiredTechs datatype="tokens">phase_town</RequiredTechs>
    4848      </CivilCentre>
    4949    </LimitRemovers>
    5050  </EntityLimits>
    51   <Identity>
    52     <Civ></Civ>
    53     <GenericName>Player</GenericName>
    54     <Classes datatype="tokens">Player</Classes>
    55   </Identity>
    5651  <Player>
    5752    <SharedLosTech>unlock_shared_los</SharedLosTech>
    5853  </Player>
    5954  <StatisticsTracker/>
    6055  <TechnologyManager/>
  • binaries/data/mods/public/simulation/templates/template_structure_wonder.xml

     
    88      <Hack>2</Hack>
    99      <Pierce>10</Pierce>
    1010      <Crush>2</Crush>
    1111    </Foundation>
    1212  </Armour>
    13   <Auras>
    14     <Aura1>
    15       <Type>global</Type>
    16       <Affects>Player</Affects>
    17       <Modifications>
    18         <Player.MaxPopulation> <Add>10</Add> </Player.MaxPopulation>
    19       </Modifications>
    20       <AuraName>Wonder Aura</AuraName>
    21       <AuraDescription>+10 maximum population cap.</AuraDescription>
    22      </Aura1>
    23   </Auras>
    2413  <BuildRestrictions>
    2514    <Category>Wonder</Category>
    2615  </BuildRestrictions>
    2716  <Capturable>
    28     <CapturePoints>2000</CapturePoints>
     17    <CapturePoints>1500</CapturePoints>
    2918    <RegenRate>5.0</RegenRate>
    3019  </Capturable>
    3120  <Cost>
    3221    <BuildTime>1000</BuildTime>
    3322    <Resources>
    34       <food>1000</food>
     23      <food>0</food>
    3524      <wood>1000</wood>
    3625      <stone>1000</stone>
    3726      <metal>1000</metal>
    3827    </Resources>
    3928  </Cost>