diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-06-23 23:22:22 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-17 12:53:18 +0100 |
commit | 3e258bd20fe6d369c3b4d235da6338275b3b46cb (patch) | |
tree | aa3f74f1d485c81cc5694e4d7c6599f20c406b10 /rules.js | |
parent | 7cdf8ecdcd78f85c3331a97c6373595cd5e4a5cb (diff) | |
download | hammer-of-the-scots-3e258bd20fe6d369c3b4d235da6338275b3b46cb.tar.gz |
Update RNG.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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") |