parent
b88f63b699
commit
d420717eba
@ -34,7 +34,7 @@ Market.prototype.RemoveTrader = function(ent)
|
||||
Market.prototype.GetInternationalBonus = function()
|
||||
{
|
||||
return ApplyValueModificationsToEntity("Market/InternationalBonus", +this.template.InternationalBonus, this.entity);
|
||||
}
|
||||
};
|
||||
|
||||
Market.prototype.HasType = function(type)
|
||||
{
|
||||
|
@ -135,7 +135,7 @@ Trader.prototype.GetSecondMarket = function()
|
||||
Trader.prototype.GetTraderGainMultiplier = function()
|
||||
{
|
||||
return ApplyValueModificationsToEntity("Trader/GainMultiplier", +this.template.GainMultiplier, this.entity);
|
||||
}
|
||||
};
|
||||
|
||||
Trader.prototype.HasBothMarkets = function()
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ function CalculateTraderGain(firstMarket, secondMarket, traderTemplate, trader)
|
||||
let distanceSq = firstMarketPosition.distanceToSquared(secondMarketPosition);
|
||||
// We calculate gain as square of distance to encourage trading between remote markets
|
||||
// and gainMultiplier corresponds to the gain for a 100m distance
|
||||
gain.traderGain = distanceSq * gainMultiplier / 10000;
|
||||
gain.traderGain = gainMultiplier * distanceSq / 10000;
|
||||
|
||||
gain.market1Owner = cmpMarket1Player.GetPlayerID();
|
||||
gain.market2Owner = cmpMarket2Player.GetPlayerID();
|
||||
|
Loading…
Reference in New Issue
Block a user