Merge branch 'DoorDevUnstable' of https://github.com/ardnaxelarak/ALttPDoorRandomizer into ardnaxelarak-DoorDevUnstable

This commit is contained in:
aerinon
2021-07-23 10:04:02 -07:00
16 changed files with 23 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
import logging import logging
import random import RaceRandom as random
from BaseClasses import Boss from BaseClasses import Boss
from Fill import FillError from Fill import FillError

View File

@@ -1,4 +1,4 @@
import random import RaceRandom as random
from collections import defaultdict, deque from collections import defaultdict, deque
import logging import logging
import operator as op import operator as op

View File

@@ -1,4 +1,4 @@
import random import RaceRandom as random
import collections import collections
import itertools import itertools
from collections import defaultdict, deque from collections import defaultdict, deque

View File

@@ -3,7 +3,7 @@ import argparse
import copy import copy
import os import os
import logging import logging
import random import RaceRandom as random
import textwrap import textwrap
import shlex import shlex
import sys import sys

View File

@@ -1,4 +1,4 @@
import random import RaceRandom as random
from BaseClasses import Dungeon from BaseClasses import Dungeon
from Bosses import BossFactory from Bosses import BossFactory

View File

@@ -1,4 +1,4 @@
import random import RaceRandom as random
# ToDo: With shuffle_ganon option, prevent gtower from linking to an exit only location through a 2 entrance cave. # ToDo: With shuffle_ganon option, prevent gtower from linking to an exit only location through a 2 entrance cave.
from collections import defaultdict from collections import defaultdict

View File

@@ -1,4 +1,4 @@
import random import RaceRandom as random
import logging import logging
from BaseClasses import CollectionState from BaseClasses import CollectionState

View File

@@ -1,7 +1,7 @@
from collections import namedtuple from collections import namedtuple
import logging import logging
import math import math
import random import RaceRandom as random
from BaseClasses import Region, RegionType, Shop, ShopType, Location, CollectionState from BaseClasses import Region, RegionType, Shop, ShopType, Location, CollectionState
from Bosses import place_bosses from Bosses import place_bosses

11
Main.py
View File

@@ -4,7 +4,8 @@ from itertools import zip_longest
import json import json
import logging import logging
import os import os
import random import RaceRandom as random
import string
import time import time
import zlib import zlib
@@ -41,8 +42,8 @@ def main(args, seed=None, fish=None):
start = time.perf_counter() start = time.perf_counter()
# if args.securerandom: if args.securerandom:
# random.use_secure() random.use_secure()
# initialize the world # initialize the world
if args.code: if args.code:
@@ -61,7 +62,7 @@ def main(args, seed=None, fish=None):
random.seed(world.seed) random.seed(world.seed)
if args.securerandom: 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.remote_items = args.remote_items.copy()
world.mapshuffle = args.mapshuffle.copy() world.mapshuffle = args.mapshuffle.copy()
@@ -331,7 +332,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.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","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","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) logger.info(world.fish.translate("cli","cli","total.time"), time.perf_counter() - start)
# print_wiki_doors_by_room(dungeon_regions,world,1) # print_wiki_doors_by_room(dungeon_regions,world,1)

View File

@@ -1,6 +1,6 @@
import argparse import argparse
import logging import logging
import random import RaceRandom as random
import urllib.request import urllib.request
import urllib.parse import urllib.parse
import yaml import yaml

View File

@@ -3,7 +3,7 @@ import argparse
import hashlib import hashlib
import logging import logging
import os import os
import random import RaceRandom as random
import time import time
import sys import sys

View File

@@ -275,7 +275,7 @@ vanilla_pots = {
def shuffle_pots(world, player): def shuffle_pots(world, player):
import random import RaceRandom as random
new_pot_contents = {} new_pot_contents = {}

5
Rom.py
View File

@@ -5,7 +5,7 @@ import json
import hashlib import hashlib
import logging import logging
import os import os
import random import RaceRandom as random
import struct import struct
import sys import sys
import subprocess import subprocess
@@ -1529,8 +1529,9 @@ def patch_rom(world, rom, player, team, enemized, is_mystery=False):
# set rom name # set rom name
# 21 bytes # 21 bytes
from Main import __version__ 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 # 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.name.extend([0] * (21 - len(rom.name)))
rom.write_bytes(0x7FC0, rom.name) rom.write_bytes(0x7FC0, rom.name)

View File

@@ -1,6 +1,6 @@
{ {
"cli": { "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.", "shuffling.world": "Welt wird durchmischt.",
"generating.itempool": "Generier Gegenstandsbasis.", "generating.itempool": "Generier Gegenstandsbasis.",
"calc.access.rules": "Berechne Zugriffsregeln.", "calc.access.rules": "Berechne Zugriffsregeln.",

View File

@@ -2,7 +2,7 @@
"cli": { "cli": {
"yes": "Yes", "yes": "Yes",
"no": "No", "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", "version": "Version",
"seed": "Seed", "seed": "Seed",
"player": "Player", "player": "Player",

View File

@@ -1,6 +1,6 @@
{ {
"cli": { "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", "player": "Jugador",
"shuffling.world": "Barajando el Mundo", "shuffling.world": "Barajando el Mundo",
"shuffling.dungeons": "Barajando Mazmorras", "shuffling.dungeons": "Barajando Mazmorras",