From 430467b2f67b2ff0917b329da7d3f6214bf224bb Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 23 Jun 2022 23:31:53 +0200 Subject: Update RNG. --- rules.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 182ad3e..b340c95 100644 --- a/rules.js +++ b/rules.js @@ -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(); -- cgit v1.2.3