Ticket #3522: 3522.3.diff

File 3522.3.diff, 6.9 KB (added by fatherbushido, 4 years ago)

missing space, purging old json file

  • 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));
     147    return Math.round(ApplyValueModificationsToPlayer("Player/MaxPopulation", this.maxPop, this.entity, this.playerID));
    148148};
    149149
    150150Player.prototype.SetGatherRateMultiplier = function(value)
    151151{
    152152    this.gatherRateMultiplier = value;
  • binaries/data/mods/public/simulation/data/technologies/pop_wonder.json

     
    1 {
    2     "genericName": "Glorious Expansion",
    3     "specificName": {
    4         "mace": "Peristyle",
    5         "spart": "Peristyle",
    6         "athen": "Peristyle",
    7         "sele": "Peristyle",
    8         "ptol": "Peristyle",
    9         "rome": "Peristyle",
    10         "pers": "Paradise"
    11     },
    12     "description": "The wonder attracts many more people to your civilization.",
    13     "cost": {"food": 3000, "wood": 3000, "stone": 500, "metal": 500},
    14     "requirements": {"tech": "phase_city"},
    15     "requirementsTooltip": "Unlocked in City Phase.",
    16     "icon": "special_treasure.png",
    17     "researchTime": 40,
    18     "tooltip": "+50 maximum population cap.",
    19     "modifications": [{"value": "Player/MaxPopulation", "add": 50}],
    20     "soundComplete": "interface/alarm/alarm_upgradearmory.xml"
    21 }
  • binaries/data/mods/public/simulation/helpers/ValueModification.js

     
    1 // Little helper functions to make applying technology more convenient
     1// Little helper functions to make applying technology and auras more convenient
    22
    33function ApplyValueModificationsToEntity(tech_type, current_value, entity)
    44{
    55    let value = current_value;
    66    let cmpTechnologyManager = QueryOwnerInterface(entity, IID_TechnologyManager);
    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, player_entity)
     16function ApplyValueModificationsToPlayer(tech_type, current_value, playerEntity,playerID)
    1717{
    18     let cmpTechnologyManager = Engine.QueryInterface(player_entity, IID_TechnologyManager);
    19 
    20     if (!cmpTechnologyManager)
    21         return current_value;
    22 
    23     return cmpTechnologyManager.ApplyModifications(tech_type, current_value, player_entity);
     18    let value = current_value;
     19    let cmpTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager);
     20    let entityTemplateName = cmpTemplateManager.GetCurrentTemplateName(playerEntity);
     21    let entityTemplate = cmpTemplateManager.GetTemplate(entityTemplateName);
     22    let cmpTechnologyManager = QueryPlayerIDInterface(playerID, IID_TechnologyManager);
     23    if (cmpTechnologyManager)
     24        value = cmpTechnologyManager.ApplyModificationsTemplate(tech_type, current_value, entityTemplate);
     25    let cmpAuraManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_AuraManager);
     26    if (!cmpAuraManager)
     27        return value;
     28    return cmpAuraManager.ApplyTemplateModifications(tech_type, value, playerID, entityTemplate);
    2429}
    2530
    2631function ApplyValueModificationsToTemplate(tech_type, current_value, playerID, template)
    2732{
    2833    let value = current_value;
  • 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>
    5156  <Player>
    52     <SharedLosTech>unlock_shared_los</SharedLosTech>
     57    <SharedLosTech>unlock_shared_los</SharedLosTech>
    5358  </Player>
    5459  <StatisticsTracker/>
    5560  <TechnologyManager/>
    5661</Entity>
  • 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>50</Add> </Player.MaxPopulation>
     19      </Modifications>
     20      <AuraName>Glorious Expansion</AuraName>
     21      <AuraDescription>+50 maximum population cap.</AuraDescription>
     22    </Aura1>
     23  </Auras>
    1324  <BuildRestrictions>
    1425    <Category>Wonder</Category>
    1526  </BuildRestrictions>
    1627  <Capturable>
    17     <CapturePoints>1500</CapturePoints>
     28    <CapturePoints>2000</CapturePoints>
    1829    <RegenRate>5.0</RegenRate>
    1930  </Capturable>
    2031  <Cost>
    2132    <BuildTime>1000</BuildTime>
    2233    <Resources>
    23       <food>0</food>
    24       <wood>1000</wood>
    25       <stone>1000</stone>
    26       <metal>1000</metal>
     34      <food>3000</food>
     35      <wood>4000</wood>
     36      <stone>1500</stone>
     37      <metal>1500</metal>
    2738    </Resources>
    2839  </Cost>
    2940  <Footprint>
    3041    <Square width="34.0" depth="34.0"/>
    3142    <Height>10.0</Height>
     
    3950    <GenericName>Wonder</GenericName>
    4051    <Tooltip>Bring glory to your civilization and add large tracts of land to your empire.</Tooltip>
    4152    <Classes datatype="tokens">
    4253      City
    4354      Wonder
    44     </Classes>
     55    </Classes>
    4556    <Icon>structures/wonder.png</Icon>
    4657    <RequiredTechnology>phase_city</RequiredTechnology>
    4758  </Identity>
    4859  <Loot>
    4960    <xp>200</xp>
     
    5364    <metal>100</metal>
    5465  </Loot>
    5566  <Obstruction>
    5667    <Static width="30.0" depth="30.0"/>
    5768  </Obstruction>
    58   <ProductionQueue>
    59     <BatchTimeModifier>0.7</BatchTimeModifier>
    60     <Technologies datatype="tokens">
    61       pop_wonder
    62     </Technologies>
    63   </ProductionQueue>
    6469  <RallyPoint disable=""/>
    6570  <Sound>
    6671    <SoundGroups>
    6772      <select>interface/select/building/sel_wonder.xml</select>
    6873      <constructed>interface/complete/building/complete_wonder.xml</constructed>