19 | | @@ -82,6 +82,15 @@ class ViewerPage extends ReferencePage |
| 19 | @@ -77,6 +77,11 @@ class ViewerPage extends ReferencePage |
| 20 | let researchers = templateLists.techs.get(currentTemplateName); |
| 21 | if (researchers && researchers.length) |
| 22 | this.currentTemplate.researchedByListOfNames = researchers.map(researcher => getEntityNames(this.TemplateParser.getEntity(researcher, this.activeCiv))); |
| 23 | + |
| 24 | + const {techCostMultiplier} = this.TemplateParser.getEntity(researchers[0], this.activeCiv); |
| 25 | + for (const res in this.currentTemplate.cost) |
| 26 | + if (this.currentTemplate.cost[res]) |
| 27 | + this.currentTemplate.cost[res] *= techCostMultiplier[res]; |
| 28 | } |
| 29 | |
21 | | this.currentTemplate.buildListOfNames = this.currentTemplate.builder.map(prod => getEntityNames(this.TemplateParser.getEntity(prod, this.activeCiv))); |
22 | | |
23 | | + if (this.currentTemplate.researchedByListOfNames) |
24 | | + { |
25 | | + const structure = this.TemplateParser.getEntity(`structures/${this.activeCiv}/${this.currentTemplate.researchedByListOfNames[0].toLowerCase()}`, this.activeCiv); |
26 | | + |
27 | | + for (const i in this.currentTemplate.cost) |
28 | | + if (this.currentTemplate.cost[i]) |
29 | | + this.currentTemplate.cost[i] *= structure.techCostMultiplier[i]; |
30 | | + } |
31 | | + |
32 | | if (this.currentTemplate.production) |
33 | | { |
34 | | if (this.currentTemplate.production.units && this.currentTemplate.production.units.length) |