Fix --securerandom to not be mad at not having a seed
This commit is contained in:
5
Main.py
5
Main.py
@@ -5,6 +5,7 @@ import json
|
||||
import logging
|
||||
import os
|
||||
import RaceRandom as random
|
||||
import string
|
||||
import time
|
||||
import zlib
|
||||
|
||||
@@ -87,7 +88,7 @@ def main(args, seed=None, fish=None):
|
||||
random.seed(world.seed)
|
||||
|
||||
if args.securerandom:
|
||||
world.seed = None
|
||||
world.seed = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(9))
|
||||
|
||||
world.remote_items = args.remote_items.copy()
|
||||
world.mapshuffle = args.mapshuffle.copy()
|
||||
@@ -368,7 +369,7 @@ def main(args, seed=None, fish=None):
|
||||
logger.info(world.fish.translate("cli","cli","made.playthrough") % (YES if (args.calc_playthrough) else NO))
|
||||
logger.info(world.fish.translate("cli","cli","made.spoiler") % (YES if (not args.jsonout and args.create_spoiler) else NO))
|
||||
logger.info(world.fish.translate("cli","cli","used.enemizer") % (YES if enemized else NO))
|
||||
logger.info(world.fish.translate("cli","cli","seed") + ": %d", world.seed)
|
||||
logger.info(world.fish.translate("cli","cli","seed") + ": %s", world.seed)
|
||||
logger.info(world.fish.translate("cli","cli","total.time"), time.perf_counter() - start)
|
||||
|
||||
# print_wiki_doors_by_room(dungeon_regions,world,1)
|
||||
|
||||
3
Rom.py
3
Rom.py
@@ -1661,8 +1661,9 @@ def patch_rom(world, rom, player, team, enemized, is_mystery=False):
|
||||
# set rom name
|
||||
# 21 bytes
|
||||
from Main import __version__
|
||||
seedstring = f'{world.seed:09}' if isinstance(world.seed, int) else world.seed
|
||||
# todo: change to DR when Enemizer is okay with DR
|
||||
rom.name = bytearray(f'ER{__version__.split("-")[0].replace(".","")[0:3]}_{team+1}_{player}_{world.seed:09}\0', 'utf8')[:21]
|
||||
rom.name = bytearray(f'ER{__version__.split("-")[0].replace(".","")[0:3]}_{team+1}_{player}_{seedstring}\0', 'utf8')[:21]
|
||||
rom.name.extend([0] * (21 - len(rom.name)))
|
||||
rom.write_bytes(0x7FC0, rom.name)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"cli": {
|
||||
"app.title": "ALttP Tür Randomisier Version %s - Nummer: %d, Code: %s",
|
||||
"app.title": "ALttP Tür Randomisier Version %s - Nummer: %s, Code: %s",
|
||||
"shuffling.world": "Welt wird durchmischt.",
|
||||
"generating.itempool": "Generier Gegenstandsbasis.",
|
||||
"calc.access.rules": "Berechne Zugriffsregeln.",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"cli": {
|
||||
"yes": "Yes",
|
||||
"no": "No",
|
||||
"app.title": "ALttP Door Randomizer Version %s - Seed: %d, Code: %s",
|
||||
"app.title": "ALttP Door Randomizer Version %s - Seed: %s, Code: %s",
|
||||
"version": "Version",
|
||||
"seed": "Seed",
|
||||
"player": "Player",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"cli": {
|
||||
"app.title": "ALttP Puerta Aleatorizador Versión %s - Número: %d, Código: %s",
|
||||
"app.title": "ALttP Puerta Aleatorizador Versión %s - Número: %s, Código: %s",
|
||||
"player": "Jugador",
|
||||
"shuffling.world": "Barajando el Mundo",
|
||||
"shuffling.dungeons": "Barajando Mazmorras",
|
||||
|
||||
Reference in New Issue
Block a user