Ticket #3522: 3522.3.diff
File 3522.3.diff, 6.9 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/simulation/components/Player.js
Player.prototype.SetMaxPopulation = func 142 142 this.maxPop = max; 143 143 }; 144 144 145 145 Player.prototype.GetMaxPopulation = function() 146 146 { 147 return Math.round(ApplyValueModificationsToPlayer("Player/MaxPopulation", this.maxPop, this.entity ));147 return Math.round(ApplyValueModificationsToPlayer("Player/MaxPopulation", this.maxPop, this.entity, this.playerID)); 148 148 }; 149 149 150 150 Player.prototype.SetGatherRateMultiplier = function(value) 151 151 { 152 152 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 convenient1 // Little helper functions to make applying technology and auras more convenient 2 2 3 3 function ApplyValueModificationsToEntity(tech_type, current_value, entity) 4 4 { 5 5 let value = current_value; 6 6 let cmpTechnologyManager = QueryOwnerInterface(entity, IID_TechnologyManager); … … function ApplyValueModificationsToEntity 11 11 if (!cmpAuraManager) 12 12 return value; 13 13 return cmpAuraManager.ApplyModifications(tech_type, value, entity); 14 14 } 15 15 16 function ApplyValueModificationsToPlayer(tech_type, current_value, player _entity)16 function ApplyValueModificationsToPlayer(tech_type, current_value, playerEntity,playerID) 17 17 { 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); 24 29 } 25 30 26 31 function ApplyValueModificationsToTemplate(tech_type, current_value, playerID, template) 27 32 { 28 33 let value = current_value; -
binaries/data/mods/public/simulation/templates/special/player.xml
46 46 <CivilCentre> 47 47 <RequiredTechs datatype="tokens">phase_town</RequiredTechs> 48 48 </CivilCentre> 49 49 </LimitRemovers> 50 50 </EntityLimits> 51 <Identity> 52 <Civ></Civ> 53 <GenericName>Player</GenericName> 54 <Classes datatype="tokens">Player</Classes> 55 </Identity> 51 56 <Player> 52 57 <SharedLosTech>unlock_shared_los</SharedLosTech> 53 58 </Player> 54 59 <StatisticsTracker/> 55 60 <TechnologyManager/> 56 61 </Entity> -
binaries/data/mods/public/simulation/templates/template_structure_wonder.xml
8 8 <Hack>2</Hack> 9 9 <Pierce>10</Pierce> 10 10 <Crush>2</Crush> 11 11 </Foundation> 12 12 </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> 13 24 <BuildRestrictions> 14 25 <Category>Wonder</Category> 15 26 </BuildRestrictions> 16 27 <Capturable> 17 <CapturePoints> 1500</CapturePoints>28 <CapturePoints>2000</CapturePoints> 18 29 <RegenRate>5.0</RegenRate> 19 30 </Capturable> 20 31 <Cost> 21 32 <BuildTime>1000</BuildTime> 22 33 <Resources> 23 <food> 0</food>24 <wood> 1000</wood>25 <stone>1 000</stone>26 <metal>1 000</metal>34 <food>3000</food> 35 <wood>4000</wood> 36 <stone>1500</stone> 37 <metal>1500</metal> 27 38 </Resources> 28 39 </Cost> 29 40 <Footprint> 30 41 <Square width="34.0" depth="34.0"/> 31 42 <Height>10.0</Height> … … 39 50 <GenericName>Wonder</GenericName> 40 51 <Tooltip>Bring glory to your civilization and add large tracts of land to your empire.</Tooltip> 41 52 <Classes datatype="tokens"> 42 53 City 43 54 Wonder 44 55 </Classes> 45 56 <Icon>structures/wonder.png</Icon> 46 57 <RequiredTechnology>phase_city</RequiredTechnology> 47 58 </Identity> 48 59 <Loot> 49 60 <xp>200</xp> … … 53 64 <metal>100</metal> 54 65 </Loot> 55 66 <Obstruction> 56 67 <Static width="30.0" depth="30.0"/> 57 68 </Obstruction> 58 <ProductionQueue>59 <BatchTimeModifier>0.7</BatchTimeModifier>60 <Technologies datatype="tokens">61 pop_wonder62 </Technologies>63 </ProductionQueue>64 69 <RallyPoint disable=""/> 65 70 <Sound> 66 71 <SoundGroups> 67 72 <select>interface/select/building/sel_wonder.xml</select> 68 73 <constructed>interface/complete/building/complete_wonder.xml</constructed>