Ticket #3930: 3930.2.diff
File 3930.2.diff, 9.3 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/gui/session/selection_panels.js
g_SelectionPanels.Research = { 796 796 Engine.GetGUIObjectByName("unitResearchPair["+i+"]").hidden = true; 797 797 }, 798 798 "addData": function(data) 799 799 { 800 800 data.entType = data.item.pair ? [data.item.top, data.item.bottom] : [data.item]; 801 data.template = data.entType.map(GetTechnologyData); 801 // data.template = data.entType.map(GetTechnologyData); 802 data.template = data.entType.map(t => Engine.GuiInterfaceCall("GetTechnologyData", { 803 "name": t, 804 "ent": data.unitEntState.id 805 })); 802 806 // abort if no template found for any of the techs 803 807 if (data.template.some(v => !v)) 804 808 return false; 805 809 // index one row below 806 810 var shiftedIndex = data.i + data.rowLength; -
binaries/data/mods/public/gui/session/session.js
function GetTemplateDataWithoutLocalizat 197 197 198 198 function GetTechnologyData(technologyName) 199 199 { 200 200 if (!(technologyName in g_TechnologyData)) 201 201 { 202 let template = Engine.GuiInterfaceCall("GetTechnologyData", technologyName);202 let template = Engine.GuiInterfaceCall("GetTechnologyData", {name: technologyName, ent: null}); 203 203 translateObjectKeys(template, ["specific", "generic", "description", "tooltip", "requirementsTooltip"]); 204 204 g_TechnologyData[technologyName] = template; 205 205 } 206 206 207 207 return g_TechnologyData[technologyName]; -
binaries/data/mods/public/simulation/components/GuiInterface.js
GuiInterface.prototype.GetTemplateData = 606 606 aurasTemplate[name].auraDescription = auraTemplate.auraDescription || null; 607 607 } 608 608 return GetTemplateDataHelper(template, player, aurasTemplate); 609 609 }; 610 610 611 GuiInterface.prototype.GetTechnologyData = function(player, name)611 GuiInterface.prototype.GetTechnologyData = function(player, data) 612 612 { 613 613 let cmpDataTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_DataTemplateManager); 614 let template = cmpDataTemplateManager.GetTechnologyTemplate( name);614 let template = cmpDataTemplateManager.GetTechnologyTemplate(data.name); 615 615 616 616 if (!template) 617 617 { 618 warn("Tried to get data for invalid technology: " + name);618 warn("Tried to get data for invalid technology: " + data.name); 619 619 return null; 620 620 } 621 621 622 622 let cmpPlayer = QueryPlayerIDInterface(player, IID_Player); 623 return GetTechnologyDataHelper(template, cmpPlayer.GetCiv()); 623 let techData = GetTechnologyDataHelper(template, cmpPlayer.GetCiv()); 624 if (!data.ent) 625 return techData; 626 for (let r in techData.cost) 627 techData.cost[r] = ApplyValueModificationsToEntity("Technology/Cost/"+r, +techData.cost[r], data.ent); 628 return techData; 624 629 }; 625 630 626 631 GuiInterface.prototype.IsTechnologyResearched = function(player, data) 627 632 { 628 633 if (!data.tech) -
binaries/data/mods/public/simulation/components/ProductionQueue.js
ProductionQueue.prototype.AddBatch = fun 319 319 var cmpDataTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_DataTemplateManager); 320 320 var template = cmpDataTemplateManager.GetTechnologyTemplate(templateName); 321 321 if (!template) 322 322 return; 323 323 var cmpPlayer = QueryOwnerInterface(this.entity); 324 var time = template.researchTime* cmpPlayer.GetCheatTimeMultiplier();324 var time = ApplyValueModificationsToEntity("Technology/Cost/time", +template.researchTime, this.entity) * cmpPlayer.GetCheatTimeMultiplier(); 325 325 326 326 var cost = {}; 327 for each (var r in ["food", "wood", "stone", "metal"])328 cost[r] = Math.floor( template.cost[r]);327 for (let r in template.cost) 328 cost[r] = Math.floor(ApplyValueModificationsToEntity("Technology/Cost/"+r, +template.cost[r], this.entity)); 329 329 330 330 // TrySubtractResources should report error to player (they ran out of resources) 331 331 if (!cmpPlayer.TrySubtractResources(cost)) 332 332 return; 333 333 -
binaries/data/mods/public/simulation/data/auras/maur_hero_ashoka.json
1 { 2 "type": "global", 3 "affectedPlayers": ["MutualAlly"], 4 "affects": ["Temple"], 5 "modifications": [ 6 { "value": "Technology/Cost/wood", "multiply": 0.5 }, 7 { "value": "Technology/Cost/food", "multiply": 0.5 }, 8 { "value": "Technology/Cost/metal", "multiply": 0.5 }, 9 { "value": "Technology/Cost/stone", "multiply": 0.5 }, 10 { "value": "Technology/Cost/time", "multiply": 0.5 } 11 ], 12 "auraDescription": "All allied Temple technologies -50% cost and research time.", 13 "auraName": "Evangelism Aura", 14 "overlayIcon": "art/textures/ui/session/auras/build_bonus.png" 15 } -
binaries/data/mods/public/simulation/data/auras/maur_hero_chanakya.json
1 { 2 "type": "garrison", 3 "affects": ["Structure"], 4 "modifications": [ 5 { "value": "Technology/Cost/time", "multiply": 0.5 } 6 ], 7 "auraDescription": "Empower a building with -50% research time.", 8 "auraName": "Teacher Aura", 9 "overlayIcon": "art/textures/ui/session/auras/build_bonus.png" 10 } -
binaries/data/mods/public/simulation/templates/template_structure_military_blacksmith.xml
15 15 </Footprint> 16 16 <GarrisonHolder> 17 17 <Max>1</Max> 18 18 <EjectHealth>0.1</EjectHealth> 19 19 <EjectClassesOnDestroy datatype="tokens">Unit</EjectClassesOnDestroy> 20 <List datatype="tokens">Infantry </List>20 <List datatype="tokens">Infantry Healer</List> 21 21 <BuffHeal>0</BuffHeal> 22 22 <LoadingRange>2</LoadingRange> 23 23 </GarrisonHolder> 24 24 <Health> 25 25 <Max>2000</Max> -
binaries/data/mods/public/simulation/templates/units/maur_hero_ashoka.xml
1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <Entity parent="template_unit_hero_cavalry_archer"> 3 <Auras datatype="tokens">maur_hero_ashoka</Auras> 3 4 <Footprint replace=""> 4 5 <Square width="6.0" depth="12.0"/> 5 6 <Height>5.0</Height> 6 7 </Footprint> 7 8 <Identity> -
binaries/data/mods/public/simulation/templates/units/maur_hero_chanakya.xml
3 3 <Armour> 4 4 <Hack>4.0</Hack> 5 5 <Pierce>8.0</Pierce> 6 6 <Crush>4.0</Crush> 7 7 </Armour> 8 <Heal> 9 <Range>20</Range> 10 <HP>12</HP> 11 <Rate>2000</Rate> 12 <UnhealableClasses datatype="tokens"/> 13 <HealableClasses datatype="tokens">Human</HealableClasses> 14 </Heal> 8 <Auras datatype="tokens">maur_hero_chanakya</Auras> 15 9 <Cost> 16 10 <Population>2</Population> 17 11 <BuildTime>60</BuildTime> 18 12 <Resources> 19 13 <food>100</food> 20 14 <metal>250</metal> 21 15 </Resources> 22 16 </Cost> 17 <Heal> 18 <Range>20</Range> 19 <HP>12</HP> 20 <Rate>2000</Rate> 21 <UnhealableClasses datatype="tokens"/> 22 <HealableClasses datatype="tokens">Human</HealableClasses> 23 </Heal> 23 24 <Health> 24 25 <Max>600</Max> 25 26 </Health> 26 27 <Identity> 27 28 <Civ>maur</Civ> 28 <Classes datatype="tokens">Human Organic </Classes>29 <Classes datatype="tokens">Human Organic Support</Classes> 29 30 <VisibleClasses datatype="tokens">Hero Healer</VisibleClasses> 30 31 <GenericName>Acharya Chanakya</GenericName> 31 32 <SpecificName>Acharya Chāṇakya</SpecificName> 32 33 <Icon>units/maur_hero_chanakya.png</Icon> 33 34 <Tooltip>Hero Special: "Healer" - Heal units at an accelerated rate. 34 Hero Special: "Teacher" - Empower a building to research and train +50% faster.35 35 Hero Special: "Philosopher" - Research 4 special technologies only available to Chanakya.</Tooltip> 36 36 <RequiredTechnology>phase_city</RequiredTechnology> 37 37 </Identity> 38 38 <Minimap> 39 39 <Type>hero</Type>