Ticket #3428: 3428.1.patch

File 3428.1.patch, 1.6 KB (added by Palaxin, 8 years ago)

Patch doing the "first step" proposed by mimo. In addition, each trader will add a greater bonus for the merchant ship. First trader 40%, second 50%, then 60%, ...

  • ps/trunk/binaries/data/mods/public/simulation/components/Trader.js

     
    22// resources a trader gets
    33
    44// Additional gain for ships for each garrisoned trader, in percents
    5 const GARRISONED_TRADER_ADDITION = 20;
     5const GARRISONED_TRADER_ADDITION = 40;
    66
    77// Array of resource names
    88const RESOURCES = ["food", "wood", "stone", "metal"];
     
    5151            {
    5252                var cmpGarrisonedUnitTrader = Engine.QueryInterface(entity, IID_Trader);
    5353                if (cmpGarrisonedUnitTrader)
     54                {
     55                    garrisonMultiplier += GARRISONED_TRADER_ADDITION * (1 + garrisonedTradersCount / 10);
    5456                    garrisonedTradersCount++;
     57                }
    5558            }
    56             garrisonMultiplier *= 1 + GARRISONED_TRADER_ADDITION * garrisonedTradersCount / 100;
    5759
    5860            if (gain.traderGain)
    5961                gain.traderGain = Math.round(garrisonMultiplier * gain.traderGain);
  • ps/trunk/binaries/data/mods/public/simulation/templates/template_unit_mechanical_ship_merchant.xml

     
    77  </Armour>
    88  <Cost>
    99    <Resources>
    10       <wood>0</wood>
     10      <wood>100</wood>
    1111      <metal>100</metal>
    1212    </Resources>
    1313  </Cost>