From 61b6fa09541a8cd00ea33bfd5a8059e99d56fbb3 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 23 Jun 2022 23:28:24 +0200 Subject: Update RNG. --- rules.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index e146625..3359a16 100644 --- a/rules.js +++ b/rules.js @@ -137,7 +137,9 @@ exports.roles = function (scenario) { } function random(n) { - return ((game.seed = game.seed * 69621 % 0x7fffffff) / 0x7fffffff) * n | 0 + if (game.rng === 1) + return ((game.seed = game.seed * 69621 % 0x7fffffff) / 0x7fffffff) * n | 0 + return (game.seed = game.seed * 200105 % 34359738337) % n } function shuffle(deck) { @@ -3137,6 +3139,10 @@ exports.setup = function (seed, scenario, options) { } } + // Old RNG for ancient replays + if (options.rng) + game.rng = options.rng + prepare_deck() for (let col = 0; col < 6; ++col) -- cgit v1.2.3