Ticket #3522: 3522.4.diff

File 3522.4.diff, 14.6 KB (added by fatherbushido, 8 years ago)

linked to #3792 patch

  • 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/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 cmpTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager);
     19    let entityTemplateName = cmpTemplateManager.GetCurrentTemplateName(playerEntity);
     20    let entityTemplate = cmpTemplateManager.GetTemplate(entityTemplateName);
     21    return ApplyValueModificationsToTemplate(tech_type, current_value, playerID, entityTemplate)
    2422}
    2523
    2624function ApplyValueModificationsToTemplate(tech_type, current_value, playerID, template)
    2725{
    2826    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/structures/athen_wonder.xml

     
    22<Entity parent="template_structure_wonder">
    33  <Footprint>
    44    <Square width="28.0" depth="58.0"/>
    55    <Height>12.0</Height>
    66  </Footprint>
    7   <GarrisonHolder>
    8     <Max>30</Max>
    9     <EjectHealth>0.1</EjectHealth>
    10     <EjectClassesOnDestroy datatype="tokens">Unit</EjectClassesOnDestroy>
    11     <List datatype="tokens">Support Infantry Cavalry</List>
    12     <BuffHeal>3</BuffHeal>
    13     <LoadingRange>2</LoadingRange>
    14   </GarrisonHolder>
    157  <Identity>
    168    <Civ>athen</Civ>
    179    <SpecificName>Naós Parthenṓn</SpecificName>
    1810    <History>The Hellenes built marvelous temples in order to honour their polytheistic pantheon. While all gods were venerated, a specific patron deity was supposed to watch over each polis.</History>
    1911    <Tooltip>Bring glory to your civilization and add large tracts of land to your empire. Garrison up to 30 units to heal them at a quick rate.</Tooltip>
  • binaries/data/mods/public/simulation/templates/structures/cart_wonder.xml

     
    22<Entity parent="template_structure_wonder">
    33  <Footprint>
    44    <Square width="29.0" depth="59.0"/>
    55    <Height>12.0</Height>
    66  </Footprint>
    7   <GarrisonHolder>
    8     <Max>30</Max>
    9     <EjectHealth>0.1</EjectHealth>
    10     <EjectClassesOnDestroy datatype="tokens">Unit</EjectClassesOnDestroy>
    11     <List datatype="tokens">Support Infantry Cavalry</List>
    12     <BuffHeal>3</BuffHeal>
    13     <LoadingRange>2</LoadingRange>
    14   </GarrisonHolder>
    157  <Identity>
    168   <Civ>cart</Civ>
    179    <SpecificName>Temple of Ba'al Hammon</SpecificName>
    1810    <History>Dating from the 2nd Century BC, the Mausoleum of Atban in northern Tunisia is over twenty metres high and was built by the inhabitants of Dougga for a Numidian prince.</History>
    1911  </Identity>
  • binaries/data/mods/public/simulation/templates/structures/iber_wonder.xml

     
    22<Entity parent="template_structure_wonder">
    33  <Footprint>
    44    <Square width="43.0" depth="43.0"/>
    55    <Height>14.0</Height>
    66  </Footprint>
    7   <GarrisonHolder>
    8     <Max>30</Max>
    9     <EjectHealth>0.1</EjectHealth>
    10     <EjectClassesOnDestroy datatype="tokens">Unit</EjectClassesOnDestroy>
    11     <List datatype="tokens">Support Infantry Cavalry</List>
    12     <BuffHeal>3</BuffHeal>
    13     <LoadingRange>2</LoadingRange>
    14   </GarrisonHolder>
    157  <Identity>
    168    <Civ>iber</Civ>
    179    <SpecificName>Cancho Roano</SpecificName>
    1810    <History>ToDo</History>
    1911  </Identity>
  • binaries/data/mods/public/simulation/templates/structures/mace_wonder.xml

     
    22<Entity parent="template_structure_wonder">
    33  <Footprint>
    44    <Square width="28.0" depth="58.0"/>
    55    <Height>12.0</Height>
    66  </Footprint>
    7   <GarrisonHolder>
    8     <Max>30</Max>
    9     <EjectHealth>0.1</EjectHealth>
    10     <EjectClassesOnDestroy datatype="tokens">Unit</EjectClassesOnDestroy>
    11     <List datatype="tokens">Support Infantry Cavalry</List>
    12     <BuffHeal>3</BuffHeal>
    13     <LoadingRange>2</LoadingRange>
    14   </GarrisonHolder>
    157  <Identity>
    168    <Civ>mace</Civ>
    179    <SpecificName>Naós Parthenṓn</SpecificName>
    1810    <History>The Hellenes built marvelous temples in order to honour their polytheistic pantheon. While all gods were venerated, a specific patron deity was supposed to watch over each polis.</History>
    1911    <Tooltip>Bring glory to your civilization and add large tracts of land to your empire. Garrison up to 30 units to heal them at a quick rate.</Tooltip>
  • binaries/data/mods/public/simulation/templates/structures/pers_wonder.xml

     
    1010  <Identity>
    1111    <Civ>pers</Civ>
    1212    <SpecificName>Hanging Gardens of Babylon</SpecificName>
    1313    <History>A magnificent structure built in the 6th century BC by the Neo-Babylonian king Nebuchadnezzar II in order to please his wife Amytis of Media, who was homesick for the gardens and mountains of her homeland.</History>
    1414  </Identity>
    15   <Loot>
    16     <xp>200</xp>
    17   </Loot>
    1815  <Obstruction>
    1916    <Static width="59.0" depth="59.0"/>
    2017  </Obstruction>
    2118  <StatusBars>
    2219    <BarWidth>6.0</BarWidth>
  • binaries/data/mods/public/simulation/templates/structures/ptol_wonder.xml

     
    22<Entity parent="template_structure_wonder">
    33  <Footprint>
    44    <Square width="48.0" depth="66.0"/>
    55    <Height>20.0</Height>
    66  </Footprint>
    7   <GarrisonHolder>
    8     <Max>30</Max>
    9     <EjectHealth>0.1</EjectHealth>
    10     <EjectClassesOnDestroy datatype="tokens">Unit</EjectClassesOnDestroy>
    11     <List datatype="tokens">Support Infantry Cavalry</List>
    12     <BuffHeal>3</BuffHeal>
    13     <LoadingRange>2</LoadingRange>
    14   </GarrisonHolder>
    157  <Identity>
    168    <Civ>ptol</Civ>
    179    <SpecificName>Temple of Edfu</SpecificName>
    1810    <History>The Temple of Edfu is an ancient Egyptian temple located on the west bank of the Nile in the city of Edfu which was known in Greco-Roman times as Apollonopolis Magna, after the chief god Horus-Apollo.The temple, dedicated to the falcon god Horus, was built in the Ptolemaic period between 237 and 57 BCE. In modern times, it is one of the best preserved temples of Egypt.</History>
    1911  </Identity>
  • binaries/data/mods/public/simulation/templates/structures/rome_wonder.xml

     
    22<Entity parent="template_structure_wonder">
    33  <Footprint>
    44    <Square width="24.0" depth="44.0"/>
    55    <Height>12.0</Height>
    66  </Footprint>
    7   <GarrisonHolder>
    8     <Max>30</Max>
    9     <EjectHealth>0.1</EjectHealth>
    10     <EjectClassesOnDestroy datatype="tokens">Unit</EjectClassesOnDestroy>
    11     <List datatype="tokens">Support Infantry Cavalry</List>
    12     <BuffHeal>3</BuffHeal>
    13     <LoadingRange>2</LoadingRange>
    14   </GarrisonHolder>
    157  <Identity>
    168    <Civ>rome</Civ>
    179    <SpecificName>Aedes Iovis Optimi Maximi</SpecificName>
    1810    <History>.</History>
    1911  </Identity>
  • binaries/data/mods/public/simulation/templates/structures/spart_wonder.xml

     
    22<Entity parent="template_structure_wonder">
    33  <Footprint>
    44    <Square width="28.0" depth="58.0"/>
    55    <Height>12.0</Height>
    66  </Footprint>
    7   <GarrisonHolder>
    8     <Max>30</Max>
    9     <EjectHealth>0.1</EjectHealth>
    10     <EjectClassesOnDestroy datatype="tokens">Unit</EjectClassesOnDestroy>
    11     <List datatype="tokens">Support Infantry Cavalry</List>
    12     <BuffHeal>3</BuffHeal>
    13     <LoadingRange>2</LoadingRange>
    14   </GarrisonHolder>
    157  <Identity>
    168    <Civ>spart</Civ>
    179    <SpecificName>Naós Parthenṓn</SpecificName>
    1810    <History>The Hellenes built marvelous temples in order to honour their polytheistic pantheon. While all gods were venerated, a specific patron deity was supposed to watch over each polis.</History>
    1911    <Tooltip>Bring glory to your civilization and add large tracts of land to your empire. Garrison up to 30 units to heal them at a quick rate.</Tooltip>
  • 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      <Stackable>true</Stackable>
     23    </Aura1>
     24  </Auras>
    1325  <BuildRestrictions>
    1426    <Category>Wonder</Category>
    1527  </BuildRestrictions>
    1628  <Capturable>
    17     <CapturePoints>1500</CapturePoints>
     29    <CapturePoints>2000</CapturePoints>
    1830    <RegenRate>5.0</RegenRate>
    1931  </Capturable>
    2032  <Cost>
    2133    <BuildTime>1000</BuildTime>
    2234    <Resources>
    23       <food>0</food>
    24       <wood>1000</wood>
    25       <stone>1000</stone>
    26       <metal>1000</metal>
     35      <food>3000</food>
     36      <wood>4000</wood>
     37      <stone>1500</stone>
     38      <metal>1500</metal>
    2739    </Resources>
    2840  </Cost>
    2941  <Footprint>
    3042    <Square width="34.0" depth="34.0"/>
    3143    <Height>10.0</Height>
    3244  </Footprint>
    33   <GarrisonHolder disable=""/>
     45  <GarrisonHolder>
     46    <Max>30</Max>
     47    <EjectHealth>0.1</EjectHealth>
     48    <EjectClassesOnDestroy datatype="tokens">Unit</EjectClassesOnDestroy>
     49    <List datatype="tokens">Support Infantry Cavalry</List>
     50    <BuffHeal>3</BuffHeal>
     51    <LoadingRange>2</LoadingRange>
     52  </GarrisonHolder>
    3453  <Health>
    3554    <Max>5000</Max>
    3655    <SpawnEntityOnDeath>rubble/rubble_stone_6x6</SpawnEntityOnDeath>
    3756  </Health>
    3857  <Identity>
    3958    <GenericName>Wonder</GenericName>
    4059    <Tooltip>Bring glory to your civilization and add large tracts of land to your empire.</Tooltip>
    4160    <Classes datatype="tokens">
    4261      City
    4362      Wonder
    44     </Classes>
     63    </Classes>
    4564    <Icon>structures/wonder.png</Icon>
    4665    <RequiredTechnology>phase_city</RequiredTechnology>
    4766  </Identity>
    4867  <Loot>
    4968    <xp>200</xp>
     
    5372    <metal>100</metal>
    5473  </Loot>
    5574  <Obstruction>
    5675    <Static width="30.0" depth="30.0"/>
    5776  </Obstruction>
    58   <ProductionQueue>
    59     <BatchTimeModifier>0.7</BatchTimeModifier>
    60     <Technologies datatype="tokens">
    61       pop_wonder
    62     </Technologies>
    63   </ProductionQueue>
    6477  <RallyPoint disable=""/>
    6578  <Sound>
    6679    <SoundGroups>
    6780      <select>interface/select/building/sel_wonder.xml</select>
    6881      <constructed>interface/complete/building/complete_wonder.xml</constructed>