mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Ocarina of Time 7.0 (#1277)
## What is this fixing or adding? - Adds the majority of OoTR 7.0 features: - Pot shuffle, Freestanding item shuffle, Crate shuffle, Beehive shuffle - Key rings mode - Dungeon shortcuts to speed up dungeons - "Regional" shuffle for dungeon items - New options for shop pricing in shopsanity - Expanded Ganon's Boss Key shuffle options - Pre-planted beans - Improved Chest Appearance Matches Contents mode - Blue Fire Arrows - Bonk self-damage - Finer control over MQ dungeons and spawn position randomization - Several bugfixes as a result of the update: - Items recognized by the server and valid starting items are now in a 1-to-1 correspondence. In particular, starting with keys is now supported. - Entrance randomization success rate improved. Hopefully it is now at 100%. Co-authored-by: Zach Parks <zach@alliware.com>
This commit is contained in:
@@ -1,14 +1,37 @@
|
||||
from enum import Enum
|
||||
from .LocationList import location_table
|
||||
from BaseClasses import Location
|
||||
|
||||
location_id_offset = 67000
|
||||
location_name_to_id = {name: (location_id_offset + index) for (index, name) in enumerate(location_table)
|
||||
if location_table[name][0] not in ['Boss', 'Event', 'Drop', 'HintStone', 'Hint']}
|
||||
locnames_pre_70 = {
|
||||
"Gift from Sages",
|
||||
"ZR Frogs Zeldas Lullaby",
|
||||
"ZR Frogs Eponas Song",
|
||||
"ZR Frogs Sarias Song",
|
||||
"ZR Frogs Suns Song",
|
||||
"ZR Frogs Song of Time",
|
||||
}
|
||||
loctypes_70 = {'Beehive', 'Pot', 'FlyingPot', 'Crate', 'SmallCrate', 'RupeeTower', 'Freestanding', 'ActorOverride'}
|
||||
new_name_order = sorted(location_table.keys(),
|
||||
key=lambda name: 2 if location_table[name][0] in loctypes_70
|
||||
else 1 if name in locnames_pre_70
|
||||
else 0)
|
||||
|
||||
location_name_to_id = {name: (location_id_offset + index) for (index, name) in enumerate(new_name_order)
|
||||
if location_table[name][0] not in {'Boss', 'Event', 'Drop', 'HintStone', 'Hint'}}
|
||||
|
||||
class DisableType(Enum):
|
||||
ENABLED = 0
|
||||
PENDING = 1
|
||||
DISABLED = 2
|
||||
|
||||
class OOTLocation(Location):
|
||||
game: str = 'Ocarina of Time'
|
||||
|
||||
def __init__(self, player, name='', code=None, address1=None, address2=None, default=None, type='Chest', scene=None, parent=None, filter_tags=None, internal=False):
|
||||
def __init__(self, player, name='', code=None, address1=None, address2=None,
|
||||
default=None, type='Chest', scene=None, parent=None, filter_tags=None,
|
||||
internal=False, vanilla_item=None
|
||||
):
|
||||
super(OOTLocation, self).__init__(player, name, code, parent)
|
||||
self.address1 = address1
|
||||
self.address2 = address2
|
||||
@@ -16,15 +39,21 @@ class OOTLocation(Location):
|
||||
self.type = type
|
||||
self.scene = scene
|
||||
self.internal = internal
|
||||
self.vanilla_item = vanilla_item
|
||||
if filter_tags is None:
|
||||
self.filter_tags = None
|
||||
else:
|
||||
self.filter_tags = list(filter_tags)
|
||||
self.never = False # no idea what this does
|
||||
self.disabled = DisableType.ENABLED
|
||||
|
||||
if type == 'Event':
|
||||
self.event = True
|
||||
|
||||
@property
|
||||
def dungeon(self):
|
||||
return self.parent_region.dungeon
|
||||
|
||||
|
||||
def LocationFactory(locations, player: int):
|
||||
ret = []
|
||||
@@ -42,7 +71,10 @@ def LocationFactory(locations, player: int):
|
||||
if addresses is None:
|
||||
addresses = (None, None)
|
||||
address1, address2 = addresses
|
||||
ret.append(OOTLocation(player, match_location, location_name_to_id.get(match_location, None), address1, address2, default, type, scene, filter_tags=filter_tags))
|
||||
ret.append(OOTLocation(player, match_location,
|
||||
location_name_to_id.get(match_location, None),
|
||||
address1, address2, default, type, scene,
|
||||
filter_tags=filter_tags, vanilla_item=vanilla_item))
|
||||
else:
|
||||
raise KeyError('Unknown Location: %s', location)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user