diff --git a/binaries/data/mods/public/gui/credits/texts/programming.json b/binaries/data/mods/public/gui/credits/texts/programming.json
index d0490d7..8851beb 100644
a
|
b
|
|
195 | 195 | {"nick": "zoot"}, |
196 | 196 | {"nick": "zsol", "name": "Zsolt Dollenstein"}, |
197 | 197 | {"nick": "Zyi", "name": "Charles De Meulenaer"} |
| 198 | {"nick": "LittleDev"} |
198 | 199 | ] |
199 | 200 | } |
200 | 201 | ] |
diff --git a/binaries/data/mods/public/simulation/ai/common-api/entity.js b/binaries/data/mods/public/simulation/ai/common-api/entity.js
index d0fcac2..f764114 100644
a
|
b
|
m.Template = m.Class({
|
544 | 544 | |
545 | 545 | visionRange: function() { |
546 | 546 | return +this.get("Vision/Range"); |
| 547 | }, |
| 548 | |
| 549 | gainMultiplier: function() { |
| 550 | if(!this.get("Trader")) { |
| 551 | return undefined; |
| 552 | } |
| 553 | return +this.get("Trader/GainMultiplier"); |
547 | 554 | } |
548 | 555 | }); |
549 | 556 | |
… |
… |
m.Entity = m.Class({
|
912 | 919 | return this; |
913 | 920 | }, |
914 | 921 | |
915 | | research: function(template) { |
| 922 | research: function(template) { |
916 | 923 | Engine.PostCommand(PlayerID,{ "type": "research", "entity": this.id(), "template": template }); |
917 | 924 | return this; |
918 | 925 | }, |
diff --git a/binaries/data/mods/public/simulation/ai/common-api/shared.js b/binaries/data/mods/public/simulation/ai/common-api/shared.js
index 211b211..67d58fb 100644
a
|
b
|
m.g_ResourceForbiddenComponents = {
|
80 | 80 | }; |
81 | 81 | |
82 | 82 | m.SharedScript.prototype.GetTemplate = function(name) |
83 | | { |
| 83 | { |
84 | 84 | if (this._templates[name]) |
85 | 85 | return this._templates[name]; |
86 | 86 | |
diff --git a/binaries/data/mods/public/simulation/ai/petra/config.js b/binaries/data/mods/public/simulation/ai/petra/config.js
index e9ae59f..8770145 100644
a
|
b
|
m.Config = function(difficulty)
|
34 | 34 | "provisionFields" : 2 |
35 | 35 | }; |
36 | 36 | |
37 | | this.distUnitGain = 115*115; // TODO take it directly from helpers/TraderGain.js |
38 | | |
39 | 37 | // Note: attack settings are set directly in attack_plan.js |
40 | 38 | // defense |
41 | 39 | this.Defense = |
diff --git a/binaries/data/mods/public/simulation/ai/petra/headquarters.js b/binaries/data/mods/public/simulation/ai/petra/headquarters.js
index 27e4d54..2c8b398 100644
a
|
b
|
m.HQ.prototype.findMarketLocation = function(gameState, template)
|
1094 | 1094 | |
1095 | 1095 | if (bestVal === undefined) // no constraints. For the time being, place it arbitrarily by the ConstructionPlan |
1096 | 1096 | return [-1, -1, -1, 0]; |
1097 | | |
1098 | | var expectedGain = Math.round(bestVal / this.Config.distUnitGain); |
| 1097 | let shipMerchantTemplate = gameState.applyCiv("units/{civ}_ship_merchant"); |
| 1098 | let supportTraderTemplate = gameState.applyCiv("units/{civ}_support_trader"); |
| 1099 | let template = gameState.getTemplate(isNavalMarket ? shipMerchantTemplate : supportTraderTemplate); |
| 1100 | let gainMultiplier = template.gainMultiplier(); |
| 1101 | let expectedGain = Math.round(bestVal * gainMultiplier / 10000); |
1099 | 1102 | if (this.Config.debug > 1) |
1100 | 1103 | API3.warn("this would give a trading gain of " + expectedGain); |
1101 | 1104 | // do not keep it if gain is too small, except if this is our first BarterMarket |
diff --git a/binaries/data/mods/public/simulation/ai/petra/tradeManager.js b/binaries/data/mods/public/simulation/ai/petra/tradeManager.js
index fc510d8..87565c8 100644
a
|
b
|
m.TradeManager.prototype.checkRoutes = function(gameState, accessIndex)
|
408 | 408 | var sea = (sea1 && sea1 == sea2) ? sea1 : undefined; |
409 | 409 | if (!land && !sea) |
410 | 410 | continue; |
411 | | var gain = Math.round(API3.SquareVectorDistance(m1.position(), m2.position()) / this.Config.distUnitGain); |
| 411 | let shipMerchantTemplate = gameState.applyCiv("units/{civ}_ship_merchant"); |
| 412 | let supportTraderTemplate = gameState.applyCiv("units/{civ}_support_trader"); |
| 413 | let template = gameState.getTemplate(sea ? shipMerchantTemplate : supportTraderTemplate); |
| 414 | let gainMultiplier = template.gainMultiplier(); |
| 415 | let gain = Math.round(API3.SquareVectorDistance(m1.position(), m2.position()) * gainMultiplier / 10000); |
412 | 416 | if (gain < this.minimalGain) |
413 | 417 | continue; |
414 | 418 | if (m1.foundationProgress() === undefined && m2.foundationProgress() === undefined) |