Files
dockipelago/worlds/papermario/modules/random_stat_distribution.py
Jonathan Tinney 7971961166
Some checks failed
Analyze modified files / flake8 (push) Failing after 2m28s
Build / build-win (push) Has been cancelled
Build / build-ubuntu2204 (push) Has been cancelled
ctest / Test C++ ubuntu-latest (push) Has been cancelled
ctest / Test C++ windows-latest (push) Has been cancelled
Analyze modified files / mypy (push) Has been cancelled
Build and Publish Docker Images / Push Docker image to Docker Hub (push) Successful in 5m4s
Native Code Static Analysis / scan-build (push) Failing after 5m2s
type check / pyright (push) Successful in 1m7s
unittests / Test Python 3.11.2 ubuntu-latest (push) Failing after 16m23s
unittests / Test Python 3.12 ubuntu-latest (push) Failing after 28m19s
unittests / Test Python 3.13 ubuntu-latest (push) Failing after 14m49s
unittests / Test hosting with 3.13 on ubuntu-latest (push) Successful in 5m0s
unittests / Test Python 3.13 macos-latest (push) Has been cancelled
unittests / Test Python 3.11 windows-latest (push) Has been cancelled
unittests / Test Python 3.13 windows-latest (push) Has been cancelled
add schedule I, sonic 1/frontiers/heroes, spirit island
2026-04-02 23:46:36 -07:00

38 lines
1.1 KiB
Python

# from https://github.com/icebound777/PMR-SeedGenerator/blob/main/rando_modules/random_stat_distribution.py
def generate_random_stats(level: int, random) -> tuple[int, int, int]:
level = min(level, 27) # clamp to max level for sanity
starting_hp = 5
starting_fp = 5
starting_bp = 3
while level > 0:
level -= 1
stat = random.randint(0, 2)
while True:
# rollover if a stat is already maxed
if stat == 0:
if starting_hp >= 50:
stat += 1
else:
break
if stat == 1:
if starting_fp >= 50:
stat += 1
else:
break
if stat == 2:
if starting_bp >= 30:
stat = 0
else:
break
# apply stat
if stat == 0:
starting_hp += 5
elif stat == 1:
starting_fp += 5
else:
starting_bp += 3
return starting_hp, starting_fp, starting_bp