diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-06-23 23:31:53 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 12:42:59 +0100 |
commit | 430467b2f67b2ff0917b329da7d3f6214bf224bb (patch) | |
tree | 7ded6c84326e5a983d61a5882e55eadc8466084f | |
parent | 69431f8710e8a556ec733d069ddef399a97b19c1 (diff) | |
download | 300-earth-and-water-430467b2f67b2ff0917b329da7d3f6214bf224bb.tar.gz |
Update RNG.
-rw-r--r-- | rules.js | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -202,7 +202,9 @@ let states = {}; let game = null; function random(n) { - return Math.floor(((game.seed = game.seed * 48271 % 0x7fffffff) / 0x7fffffff) * n); + if (game.rng === 1) + return Math.floor(((game.seed = game.seed * 48271 % 0x7fffffff) / 0x7fffffff) * n) + return (game.seed = game.seed * 200105 % 34359738337) % n } function $(msg) { @@ -3387,6 +3389,10 @@ exports.setup = function (seed, scenario, options) { where: null, }; + // Old RNG for ancient replays + if (options.rng) + game.rng = options.rng + if (options.cheap_fleets) { log("Each fleet costs only 1 talent."); log_blank(); |