Ticket #3830: ok.diff
File ok.diff, 5.7 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 , this.playerID));147 return Math.round(ApplyValueModificationsToPlayer("Player/MaxPopulation", this.maxPop, this.entity)); 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
8 8 "ptol": "Peristyle", 9 9 "rome": "Peristyle", 10 10 "pers": "Paradise" 11 11 }, 12 12 "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 }, 14 14 "requirements": { "tech": "phase_city" }, 15 15 "requirementsTooltip": "Unlocked in City Phase.", 16 16 "icon": "special_treasure.png", 17 17 "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 }], 21 20 "soundComplete": "interface/alarm/alarm_upgradearmory.xml" 22 21 } -
binaries/data/mods/public/simulation/helpers/ValueModification.js
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, playerEntity , playerID)16 function ApplyValueModificationsToPlayer(tech_type, current_value, playerEntity) 17 17 { 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); 24 19 } 25 20 26 21 function ApplyValueModificationsToTemplate(tech_type, current_value, playerID, template) 27 22 { 28 23 let value = current_value; … … function ApplyValueModificationsToTempla 30 25 if (cmpTechnologyManager) 31 26 value = cmpTechnologyManager.ApplyModificationsTemplate(tech_type, current_value, template); 32 27 33 28 let cmpAuraManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_AuraManager); 34 29 if (!cmpAuraManager) 35 return value; 30 return value; 36 31 return cmpAuraManager.ApplyTemplateModifications(tech_type, value, playerID, template); 37 32 } 38 33 39 34 Engine.RegisterGlobal("ApplyValueModificationsToEntity", ApplyValueModificationsToEntity); 40 35 Engine.RegisterGlobal("ApplyValueModificationsToPlayer", ApplyValueModificationsToPlayer); -
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>56 51 <Player> 57 52 <SharedLosTech>unlock_shared_los</SharedLosTech> 58 53 </Player> 59 54 <StatisticsTracker/> 60 55 <TechnologyManager/> -
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>10</Add> </Player.MaxPopulation>19 </Modifications>20 <AuraName>Wonder Aura</AuraName>21 <AuraDescription>+10 maximum population cap.</AuraDescription>22 </Aura1>23 </Auras>24 13 <BuildRestrictions> 25 14 <Category>Wonder</Category> 26 15 </BuildRestrictions> 27 16 <Capturable> 28 <CapturePoints> 2000</CapturePoints>17 <CapturePoints>1500</CapturePoints> 29 18 <RegenRate>5.0</RegenRate> 30 19 </Capturable> 31 20 <Cost> 32 21 <BuildTime>1000</BuildTime> 33 22 <Resources> 34 <food> 1000</food>23 <food>0</food> 35 24 <wood>1000</wood> 36 25 <stone>1000</stone> 37 26 <metal>1000</metal> 38 27 </Resources> 39 28 </Cost>