Super Metroid: Replace random module with world random in variaRandomizer (#4429)

This commit is contained in:
Mysteryem
2025-04-01 17:14:47 +01:00
committed by GitHub
parent 5a6b02dbd3
commit ca08e4b950
16 changed files with 154 additions and 142 deletions

View File

@@ -1,5 +1,5 @@
import io
import os, json, re, random
import os, json, re
import pathlib
import sys
from typing import Any
@@ -88,7 +88,7 @@ def normalizeRounding(n):
# gauss random in [0, r] range
# the higher the slope, the less probable extreme values are.
def randGaussBounds(r, slope=5):
def randGaussBounds(random, r, slope=5):
r = float(r)
n = normalizeRounding(random.gauss(r/2, r/slope))
if n < 0:
@@ -111,7 +111,7 @@ def getRangeDict(weightDict):
return rangeDict
def chooseFromRange(rangeDict):
def chooseFromRange(rangeDict, random):
r = random.random()
val = None
for v in sorted(rangeDict, key=rangeDict.get):