Index: binaries/data/mods/public/gui/session/selection_panels.js
===================================================================
--- binaries/data/mods/public/gui/session/selection_panels.js (révision 18130)
+++ binaries/data/mods/public/gui/session/selection_panels.js (copie de travail)
@@ -800,10 +800,14 @@ g_SelectionPanels.Research = {
data.entType = data.item.pair ? [data.item.top, data.item.bottom] : [data.item];
data.template = data.entType.map(GetTechnologyData);
// abort if no template found for any of the techs
if (data.template.some(v => !v))
return false;
+ data.template = data.template.map(t => Engine.GuiInterfaceCall("GetModifiedTechnologyCosts", {
+ "template": t,
+ "ent": data.unitEntState.id
+ }));
// index one row below
var shiftedIndex = data.i + data.rowLength;
data.positions = data.item.pair ? [data.i, shiftedIndex] : [shiftedIndex];
data.positionsToHide = data.item.pair ? [] : [data.i];
Index: binaries/data/mods/public/simulation/components/GuiInterface.js
===================================================================
--- binaries/data/mods/public/simulation/components/GuiInterface.js (révision 18130)
+++ binaries/data/mods/public/simulation/components/GuiInterface.js (copie de travail)
@@ -621,10 +621,17 @@ GuiInterface.prototype.GetTechnologyData
let cmpPlayer = QueryPlayerIDInterface(player, IID_Player);
return GetTechnologyDataHelper(template, cmpPlayer.GetCiv());
};
+GuiInterface.prototype.GetModifiedTechnologyCosts = function(player, data)
+{
+ for (let c in data.template.cost)
+ data.template.cost[c] = ApplyValueModificationsToEntity("Technology/Cost/"+c, +data.template.cost[c], data.ent);
+ return data.template;
+};
+
GuiInterface.prototype.IsTechnologyResearched = function(player, data)
{
if (!data.tech)
return true;
@@ -1870,10 +1877,11 @@ let exposedFunctions = {
"GetEntityState": 1,
"GetExtendedEntityState": 1,
"GetAverageRangeForBuildings": 1,
"GetTemplateData": 1,
"GetTechnologyData": 1,
+ "GetModifiedTechnologyCosts": 1,
"IsTechnologyResearched": 1,
"CheckTechnologyRequirements": 1,
"GetStartedResearch": 1,
"GetBattleState": 1,
"GetIncomingAttacks": 1,
Index: binaries/data/mods/public/simulation/components/ProductionQueue.js
===================================================================
--- binaries/data/mods/public/simulation/components/ProductionQueue.js (révision 18130)
+++ 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 res in template.cost)
+ cost[res] = Math.floor(ApplyValueModificationsToEntity("Technology/Cost/"+res, +template.cost[res], 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 18130)
+++ 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 18130)
+++ 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 18130)
+++ 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