summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-06-23 23:28:24 +0200
committerTor Andersson <tor@ccxvii.net>2023-02-18 12:31:29 +0100
commit61b6fa09541a8cd00ea33bfd5a8059e99d56fbb3 (patch)
treeff4be76b9d477f7bc3b863f37c1390806626fd76
parent58662532de14ae1ec96790a00972754dc33cad95 (diff)
downloadpax-pamir-61b6fa09541a8cd00ea33bfd5a8059e99d56fbb3.tar.gz
Update RNG.
-rw-r--r--rules.js8
1 files changed, 7 insertions, 1 deletions
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)