diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-06-23 23:28:24 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 12:31:29 +0100 |
commit | 61b6fa09541a8cd00ea33bfd5a8059e99d56fbb3 (patch) | |
tree | ff4be76b9d477f7bc3b863f37c1390806626fd76 | |
parent | 58662532de14ae1ec96790a00972754dc33cad95 (diff) | |
download | pax-pamir-61b6fa09541a8cd00ea33bfd5a8059e99d56fbb3.tar.gz |
Update RNG.
-rw-r--r-- | rules.js | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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) |