Index: binaries/data/mods/public/gui/session/selection_panels.js
===================================================================
--- binaries/data/mods/public/gui/session/selection_panels.js (révision 18106)
+++ binaries/data/mods/public/gui/session/selection_panels.js (copie de travail)
@@ -796,11 +796,15 @@ g_SelectionPanels.Research = {
Engine.GetGUIObjectByName("unitResearchPair["+i+"]").hidden = true;
},
"addData": function(data)
{
data.entType = data.item.pair ? [data.item.top, data.item.bottom] : [data.item];
- data.template = data.entType.map(GetTechnologyData);
+// data.template = data.entType.map(GetTechnologyData);
+ data.template = data.entType.map(t => Engine.GuiInterfaceCall("GetTechnologyData", {
+ "name": t,
+ "ent": data.unitEntState.id
+ }));
// abort if no template found for any of the techs
if (data.template.some(v => !v))
return false;
// index one row below
var shiftedIndex = data.i + data.rowLength;
Index: binaries/data/mods/public/gui/session/session.js
===================================================================
--- binaries/data/mods/public/gui/session/session.js (révision 18106)
+++ binaries/data/mods/public/gui/session/session.js (copie de travail)
@@ -197,11 +197,11 @@ function GetTemplateDataWithoutLocalizat
function GetTechnologyData(technologyName)
{
if (!(technologyName in g_TechnologyData))
{
- let template = Engine.GuiInterfaceCall("GetTechnologyData", technologyName);
+ let template = Engine.GuiInterfaceCall("GetTechnologyData", {name: technologyName, ent: null});
translateObjectKeys(template, ["specific", "generic", "description", "tooltip", "requirementsTooltip"]);
g_TechnologyData[technologyName] = template;
}
return g_TechnologyData[technologyName];
Index: binaries/data/mods/public/simulation/components/GuiInterface.js
===================================================================
--- binaries/data/mods/public/simulation/components/GuiInterface.js (révision 18106)
+++ binaries/data/mods/public/simulation/components/GuiInterface.js (copie de travail)
@@ -606,23 +606,28 @@ GuiInterface.prototype.GetTemplateData =
aurasTemplate[name].auraDescription = auraTemplate.auraDescription || null;
}
return GetTemplateDataHelper(template, player, aurasTemplate);
};
-GuiInterface.prototype.GetTechnologyData = function(player, name)
+GuiInterface.prototype.GetTechnologyData = function(player, data)
{
let cmpDataTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_DataTemplateManager);
- let template = cmpDataTemplateManager.GetTechnologyTemplate(name);
+ let template = cmpDataTemplateManager.GetTechnologyTemplate(data.name);
if (!template)
{
- warn("Tried to get data for invalid technology: " + name);
+ warn("Tried to get data for invalid technology: " + data.name);
return null;
}
let cmpPlayer = QueryPlayerIDInterface(player, IID_Player);
- return GetTechnologyDataHelper(template, cmpPlayer.GetCiv());
+ let techData = GetTechnologyDataHelper(template, cmpPlayer.GetCiv());
+ if (!data.ent)
+ return techData;
+ for (let r in techData.cost)
+ techData.cost[r] = ApplyValueModificationsToEntity("Technology/Cost/"+r, +techData.cost[r], data.ent);
+ return techData;
};
GuiInterface.prototype.IsTechnologyResearched = function(player, data)
{
if (!data.tech)
Index: binaries/data/mods/public/simulation/components/ProductionQueue.js
===================================================================
--- binaries/data/mods/public/simulation/components/ProductionQueue.js (révision 18106)
+++ binaries/data/mods/public/simulation/components/ProductionQueue.js (copie de travail)
@@ -319,15 +319,15 @@ ProductionQueue.prototype.AddBatch = fun
var cmpDataTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_DataTemplateManager);
var template = cmpDataTemplateManager.GetTechnologyTemplate(templateName);
if (!template)
return;
var cmpPlayer = QueryOwnerInterface(this.entity);
- var time = template.researchTime * cmpPlayer.GetCheatTimeMultiplier();
+ var time = ApplyValueModificationsToEntity("Technology/Cost/time", +template.researchTime, this.entity) * cmpPlayer.GetCheatTimeMultiplier();
var cost = {};
- for each (var r in ["food", "wood", "stone", "metal"])
- cost[r] = Math.floor(template.cost[r]);
+ for (let r in template.cost)
+ cost[r] = Math.floor(ApplyValueModificationsToEntity("Technology/Cost/"+r, +template.cost[r], this.entity));
// TrySubtractResources should report error to player (they ran out of resources)
if (!cmpPlayer.TrySubtractResources(cost))
return;
Index: binaries/data/mods/public/simulation/data/auras/maur_hero_ashoka.json
===================================================================
--- binaries/data/mods/public/simulation/data/auras/maur_hero_ashoka.json (nonexistent)
+++ binaries/data/mods/public/simulation/data/auras/maur_hero_ashoka.json (copie de travail)
@@ -0,0 +1,15 @@
+{
+ "type": "global",
+ "affectedPlayers": ["MutualAlly"],
+ "affects": ["Temple"],
+ "modifications": [
+ { "value": "Technology/Cost/wood", "multiply": 0.5 },
+ { "value": "Technology/Cost/food", "multiply": 0.5 },
+ { "value": "Technology/Cost/metal", "multiply": 0.5 },
+ { "value": "Technology/Cost/stone", "multiply": 0.5 },
+ { "value": "Technology/Cost/time", "multiply": 0.5 }
+ ],
+ "auraDescription": "All allied Temple technologies -50% cost and research time.",
+ "auraName": "Evangelism Aura",
+ "overlayIcon": "art/textures/ui/session/auras/build_bonus.png"
+}
Index: binaries/data/mods/public/simulation/data/auras/maur_hero_chanakya.json
===================================================================
--- binaries/data/mods/public/simulation/data/auras/maur_hero_chanakya.json (nonexistent)
+++ binaries/data/mods/public/simulation/data/auras/maur_hero_chanakya.json (copie de travail)
@@ -0,0 +1,10 @@
+{
+ "type": "garrison",
+ "affects": ["Structure"],
+ "modifications": [
+ { "value": "Technology/Cost/time", "multiply": 0.5 }
+ ],
+ "auraDescription": "Empower a building with -50% research time.",
+ "auraName": "Teacher Aura",
+ "overlayIcon": "art/textures/ui/session/auras/build_bonus.png"
+}
Index: binaries/data/mods/public/simulation/templates/template_structure_military_blacksmith.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_structure_military_blacksmith.xml (révision 18106)
+++ binaries/data/mods/public/simulation/templates/template_structure_military_blacksmith.xml (copie de travail)
@@ -15,11 +15,11 @@
1
0.1
Unit
- Infantry
+ Infantry Healer
0
2
2000
Index: binaries/data/mods/public/simulation/templates/units/maur_hero_ashoka.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/units/maur_hero_ashoka.xml (révision 18106)
+++ binaries/data/mods/public/simulation/templates/units/maur_hero_ashoka.xml (copie de travail)
@@ -1,7 +1,8 @@
+ maur_hero_ashoka
5.0
Index: binaries/data/mods/public/simulation/templates/units/maur_hero_chanakya.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/units/maur_hero_chanakya.xml (révision 18106)
+++ binaries/data/mods/public/simulation/templates/units/maur_hero_chanakya.xml (copie de travail)
@@ -3,37 +3,37 @@
4.0
8.0
4.0
-
- 20
- 12
- 2000
-
- Human
-
+ maur_hero_chanakya
2
60
100
250
+
+ 20
+ 12
+ 2000
+
+ Human
+
600
maur
- Human Organic
+ Human Organic Support
Hero Healer
Acharya Chanakya
Acharya Chāṇakya
units/maur_hero_chanakya.png
Hero Special: "Healer" - Heal units at an accelerated rate.
-Hero Special: "Teacher" - Empower a building to research and train +50% faster.
Hero Special: "Philosopher" - Research 4 special technologies only available to Chanakya.
phase_city
hero