From 3e258bd20fe6d369c3b4d235da6338275b3b46cb Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 23 Jun 2022 23:22:22 +0200 Subject: Update RNG. --- rules.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index cbb402e..4bd32c4 100644 --- a/rules.js +++ b/rules.js @@ -46,7 +46,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 log(...args) { @@ -2959,6 +2961,9 @@ exports.setup = function (seed, scenario, options) { where: null, } + if (options.rng) + game.rng = options.rng + if (scenario === "The Bruce") setup_the_bruce() else if (scenario === "Braveheart") -- cgit v1.2.3