Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Entrance.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Optional, Any

from Region import REGION_ALIASES

if TYPE_CHECKING:
from Region import Region
from RulesCommon import AccessRule
Expand Down Expand Up @@ -97,3 +99,8 @@ def assume_reachable(self) -> Entrance:

def __str__(self) -> str:
return self.name


def resolve_entrance_alias(alias: str) -> str:
source, target = alias.split(' -> ')
return f'{REGION_ALIASES.get(source, source)} -> {REGION_ALIASES.get(target, target)}'
4 changes: 2 additions & 2 deletions EntranceShuffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ def build_one_way_targets(world: World, types_to_include: Iterable[str], exclude
('KF House of Twins -> Kokiri Forest', { 'index': 0x033C })),
('Interior', ('Kokiri Forest -> KF Know It All House', { 'index': 0x00C9 }),
('KF Know It All House -> Kokiri Forest', { 'index': 0x026A })),
('Interior', ('Kokiri Forest -> KF Kokiri Shop', { 'index': 0x00C1 }),
('KF Kokiri Shop -> Kokiri Forest', { 'index': 0x0266 })),
('Interior', ('Kokiri Forest -> KF Shop', { 'index': 0x00C1 }),
('KF Shop -> Kokiri Forest', { 'index': 0x0266 })),
('Interior', ('Lake Hylia -> LH Lab', { 'index': 0x0043 }),
('LH Lab -> Lake Hylia', { 'index': 0x03CC })),
('Interior', ('LH Fishing Island -> LH Fishing Hole', { 'index': 0x045F }),
Expand Down
152 changes: 76 additions & 76 deletions HintList.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ItemPool.py
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ def get_pool_core(world: World) -> tuple[list[str], dict[str, Item]]:
world.state.collect(ItemFactory('Small Key (Fire Temple)', world))

if world.settings.shuffle_ganon_bosskey == 'on_lacs':
placed_items['ToT Light Arrows Cutscene'] = ItemFactory('Boss Key (Ganons Castle)', world)
placed_items['Temple of Time Light Arrow Cutscene'] = ItemFactory('Boss Key (Ganons Castle)', world)

if world.settings.shuffle_ganon_bosskey in ('stones', 'medallions', 'dungeons', 'tokens', 'hearts', 'triforce'):
placed_items['Gift from Sages'] = ItemFactory('Boss Key (Ganons Castle)', world)
Expand Down
257 changes: 173 additions & 84 deletions LocationList.py

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ def calculate_traded_flags(world):
shuffle_messages.shop_item_messages = []

# kokiri shop
shop_locations = [location for location in world.get_region('KF Kokiri Shop').locations if location.type == 'Shop'] # Need to filter because of the freestanding item in KF Shop
shop_locations = [location for location in world.get_region('KF Shop').locations if location.type == 'Shop'] # Need to filter because of the freestanding item in KF Shop
shop_objs = place_shop_items(rom, world, shop_items, messages, shop_locations, True)
shop_objs |= {0x00FC, 0x00B2, 0x0101, 0x0102, 0x00FD, 0x00C5} # Shop objects
rom.write_byte(0x2587029, len(shop_objs))
Expand Down Expand Up @@ -1696,9 +1696,9 @@ def update_scrub_text(message: bytearray, text_replacement: list[str], default_p
return message

single_item_scrubs = {
0x3E: world.get_location("HF Deku Scrub Grotto"),
0x3E: world.get_location("HF Inside Fence Grotto Deku Scrub"),
0x77: world.get_location("LW Deku Scrub Near Bridge"),
0x79: world.get_location("LW Deku Scrub Grotto Front"),
0x79: world.get_location("LW Scrubs Grotto Deku Scrub Front"),
}

scrub_message_dict = {}
Expand Down Expand Up @@ -1810,7 +1810,7 @@ def update_scrub_text(message: bytearray, text_replacement: list[str], default_p
if 'unique_merchants' not in world.settings.misc_hints:
update_message_by_id(messages, 0x500C, "Mysterious item! How about\x01\x05\x41100 Rupees\x05\x40?\x01\x1B\x05\x42Buy\x01Don't buy\x05\x40\x02")
else:
location = world.get_location("Kak Granny Buy Blue Potion")
location = world.get_location("Kak Odd Medicine Building Buy Blue Potion")
item_text = get_hint(get_item_generic_name(location.item), True).text
wrapped_item_text = line_wrap(item_text, False, False, False)
if wrapped_item_text != item_text:
Expand Down
13 changes: 9 additions & 4 deletions Plandomizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
from typing import TYPE_CHECKING, Any, Optional

import StartingItems
from Entrance import Entrance
from Entrance import Entrance, resolve_entrance_alias
from EntranceShuffle import EntranceShuffleError, change_connections, confirm_replacement, validate_world, check_entrances_compatibility
from Fill import FillError
from Hints import HintArea, gossipLocations, GossipText
from Item import ItemFactory, ItemInfo, ItemIterator, is_item, Item
from ItemPool import item_groups, get_junk_item, song_list, trade_items, child_trade_items
from JSONDump import dump_obj, CollapseList, CollapseDict, AlignedDict, SortedDict
from Location import Location, LocationIterator, LocationFactory
from LocationList import location_groups, location_table
from LocationList import location_groups, location_table, LOCATION_ALIASES
from Region import REGION_ALIASES
from Search import Search
from SettingsList import build_close_match, validate_settings, settings_versioning
from Spoiler import Spoiler, HASH_ICONS, PASSWORD_NOTES
Expand Down Expand Up @@ -189,6 +190,10 @@ def __init__(self, src_dict: dict[str, Optional[str]] | str) -> None:
if 'from' in src_dict:
src_dict['origin'] = src_dict['from']
del src_dict['from']
if 'region' in src_dict:
src_dict['region'] = REGION_ALIASES.get(src_dict['region'], src_dict['region'])
if 'origin' in src_dict:
src_dict['origin'] = REGION_ALIASES.get(src_dict['origin'], src_dict['origin'])
super().__init__({'region': None, 'origin': None}, src_dict)

def to_json(self) -> str | CollapseDict:
Expand Down Expand Up @@ -294,8 +299,8 @@ def update(self, src_dict: dict[str, Any], update_all: bool = False) -> None:
'trials': {name: TrialRecord(record) for (name, record) in src_dict.get('trials', {}).items()},
'songs': {name: SongRecord(record) for (name, record) in src_dict.get('songs', {}).items()},
'item_pool': {name: ItemPoolRecord(record) for (name, record) in src_dict.get('item_pool', {}).items()},
'entrances': {name: EntranceRecord(record) for (name, record) in src_dict.get('entrances', {}).items()},
'locations': {name: [LocationRecord(rec) for rec in record] if is_pattern(name) else LocationRecord(record) for (name, record) in src_dict.get('locations', {}).items() if not is_output_only(name)},
'entrances': {resolve_entrance_alias(name): EntranceRecord(record) for (name, record) in src_dict.get('entrances', {}).items()},
'locations': {LOCATION_ALIASES.get(name, name): [LocationRecord(rec) for rec in record] if is_pattern(name) else LocationRecord(record) for (name, record) in src_dict.get('locations', {}).items() if not is_output_only(name)},
'woth_locations': None,
'goal_locations': None,
'barren_regions': None,
Expand Down
6 changes: 6 additions & 0 deletions Region.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,9 @@ def __str__(self) -> str:

def __repr__(self) -> str:
return f"{self.world.__repr__()} {self.name}"


# Mapping of old region names to current ones for better plando backwards compatibility
REGION_ALIASES: dict[str, str] = {
"KF Kokiri Shop": "KF Shop",
}
2 changes: 1 addition & 1 deletion World.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def __init__(self, world_id: int, settings: Settings, resolve_randomized_setting
max_tokens = max(max_tokens, self.settings.ganon_bosskey_tokens)
tokens = [50, 40, 30, 20, 10]
for t in tokens:
if f'Kak {t} Gold Skulltula Reward' not in self.settings.disabled_locations:
if f'Kak House of Skulltula {t} Gold Skulltula Reward' not in self.settings.disabled_locations:
max_tokens = max(max_tokens, t)
break
self.max_progressions['Gold Skulltula Token'] = max_tokens
Expand Down
Loading