Ticket #3522: 3522.3.3.diff
File 3522.3.3.diff, 5.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/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 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) 24 22 } 25 23 26 24 function ApplyValueModificationsToTemplate(tech_type, current_value, playerID, template) 27 25 { 28 26 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> 32 43 </Footprint> 33 <GarrisonHolder disable=""/> 44 <GarrisonHolder> 45 <Max>20</Max> 46 <EjectHealth>0.1</EjectHealth> 47 <EjectClassesOnDestroy datatype="tokens">Unit</EjectClassesOnDestroy> 48 <List datatype="tokens">Support Infantry Cavalry</List> 49 <BuffHeal>1</BuffHeal> 50 <LoadingRange>1</LoadingRange> 51 </GarrisonHolder> 34 52 <Health> 35 53 <Max>5000</Max> 36 54 <SpawnEntityOnDeath>rubble/rubble_stone_6x6</SpawnEntityOnDeath> 37 55 </Health> 38 56 <Identity> 39 57 <GenericName>Wonder</GenericName> 40 58 <Tooltip>Bring glory to your civilization and add large tracts of land to your empire.</Tooltip> 41 59 <Classes datatype="tokens"> 42 60 City 43 61 Wonder 44 62 </Classes> 45 63 <Icon>structures/wonder.png</Icon> 46 64 <RequiredTechnology>phase_city</RequiredTechnology> 47 65 </Identity> 48 66 <Loot> 49 67 <xp>200</xp> … … 53 71 <metal>100</metal> 54 72 </Loot> 55 73 <Obstruction> 56 74 <Static width="30.0" depth="30.0"/> 57 75 </Obstruction> 58 <ProductionQueue>59 <BatchTimeModifier>0.7</BatchTimeModifier>60 <Technologies datatype="tokens">61 pop_wonder62 </Technologies>63 </ProductionQueue>64 76 <RallyPoint disable=""/> 65 77 <Sound> 66 78 <SoundGroups> 67 79 <select>interface/select/building/sel_wonder.xml</select> 68 80 <constructed>interface/complete/building/complete_wonder.xml</constructed>