Trade with Dragons gives less then expected amount of uranium because of delta calculations

Issue #147 resolved
Владислав Чехарев created an issue

Synopsis

Base amount of uranium is reduced by 0.125 (so it is 0.875 instead of 1) because of how rand() works.

Details

Average amount depending on delta is calculated before applying tradeRatio as following:

var sratio = s.seasons[currentSeason];
var min = s.value * sratio - s.value * sratio * s.delta/2;
var amt = min + this.game.rand(s.value * sratio * s.delta);

For Dragons, sratio = 1 for all season, s.value = 1 and s.delta = 0.25. From here, min = 0.875 and amt = 0.875 + rand(0.25). Rand function doesn't return floating point values, so rand(0.25) = 0 and amt = 0.875 = min (basically just reduced by delta/2).

Comments (2)

  1. Log in to comment