Skip to content

Commit

Permalink
Draft of Skull Mask/MoT Misc hints
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaybone25 committed Dec 29, 2024
1 parent efa5c4a commit 5de3d55
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 36 deletions.
29 changes: 12 additions & 17 deletions HintList.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def tokens_required_by_settings(world: World) -> int:
# Hints required under certain settings
conditional_always: dict[str, Callable[[World], bool]] = {
'Market 10 Big Poes': lambda world: world.settings.big_poe_count > 3 and 'big_poes' not in world.settings.misc_hints,
'Deku Theater Mask of Truth': lambda world: not world.settings.complete_mask_quest and 'Mask of Truth' not in world.settings.shuffle_child_trade,
'Deku Theater Mask of Truth': lambda world: (not world.settings.complete_mask_quest and 'Mask of Truth' not in world.settings.shuffle_child_trade) and not ('mask_of_truth' not in world.settings.misc_hints or 'mask_shop_dual' not in world.settings.misc_hints),
'Song from Ocarina of Time': lambda world: stones_required_by_settings(world) < 2,
'HF Ocarina of Time Item': lambda world: stones_required_by_settings(world) < 2,
'Sheik in Kakariko': lambda world: medallions_required_by_settings(world) < 5,
Expand Down Expand Up @@ -1909,14 +1909,6 @@ def rainbow_bridge_hint_kind(world: World) -> str:
'location_fallback': "Yeaaarrgh! I'm cursed!!",
'text_style': 0x23,
},
'100_skulltulas': {
'id': 0x9009,
'hint_location': '100 Skulltulas Reward Hint',
'item_location': 'Kak 100 Gold Skulltula Reward',
'location_text': "Yeaaarrgh! I'm cursed!! Please save me by destroying \x05\x41100 Spiders of the Curse\x05\x40 and I will give you \x05\x42{item}\x05\x40.",
'location_fallback': "Yeaaarrgh! I'm cursed!!",
'text_style': 0x23,
},
'frogs2': {
'id': 0x022E,
'hint_location': 'ZR Frogs Ocarina Minigame Hint',
Expand All @@ -1929,16 +1921,16 @@ def rainbow_bridge_hint_kind(world: World) -> str:
'id': 0x0344,
'hint_location': 'Deku Theater Skull Mask',
'item_location': 'Deku Theater Skull Mask',
'location_text': 'Bringing the \x05\x41Skull Mask\x05\x40 to Deku Theater will reward you with \x05\x42{item}\x05\x40',
'location_fallback': 'Forest Stage\x01\x01We are waiting to see your\x01beautiful face!\x01Win fabulous prizes!',
'location_text': 'Wearing the \x05\x41Skull Mask\x05\x40 will reward you with \x05\x42{item}\x05\x40',
'location_fallback': '\x05\x42\x06\x3dForest Stage\x04\x01\x05\x40\x06\x14We are waiting to see your\x01\x06\x32beautiful face!\x01\x06\x28Win fabulous prizes!',
'text_style': 0x13,
},
'mask_of_truth': {
'id': 0x0344,
'hint_location': 'Deku Theater Mask of Truth',
'item_location': 'Deku Theater Mask of Truth',
'location_text': 'Bringing the \x05\x41Mask of Truth\x05\x40 to Deku Theater will reward you with \x05\x42{item}\x05\x40',
'location_fallback': 'Forest Stage\x01\x01We are waiting to see your\x01beautiful face!\x01Win fabulous prizes!',
'location_text': 'Wearing the \x05\x41Mask of Truth\x05\x40 will reward you with \x05\x42{item}\x05\x40',
'location_fallback': '\x05\x42\x06\x3dForest Stage\x04\x01\x05\x40\x06\x14We are waiting to see your\x01\x06\x32beautiful face!\x01\x06\x28Win fabulous prizes!',
'text_style': 0x13,
},
'big_poes': {
Expand All @@ -1947,20 +1939,23 @@ def rainbow_bridge_hint_kind(world: World) -> str:
'item_location': 'Market 10 Big Poes',
'location_text': "\x08Hey, young man. What's happening \x01today? Do you want\x01\x05\x41{item}\x05\x40?\x04\x1AIf you earn \x05\x41{poe_points} points\x05\x40, you'll\x01be a happy man! Heh heh.\x04\x08Your card now has \x05\x45\x1E\x01 \x05\x40points.\x01Come back again!\x01Heh heh heh!\x02",
'location_fallback': "\x08Hey, young man. What's happening \x01today? If you have a \x05\x41Poe\x05\x40, I will \x01buy it.\x04\x1AIf you earn \x05\x41{poe_points} points\x05\x40, you'll\x01be a happy man! Heh heh.\x04\x08Your card now has \x05\x45\x1E\x01 \x05\x40points.\x01Come back again!\x01Heh heh heh!\x02",
'text_style': 0x03
},
}

#Adds capability for dual misc hints. Required keys "id" for text ID to replace. 'hint_location_0' and 'hint_location_1', name of the hint. These must have _0 for the first hint and _1 for the second hint.
#'item_location_0' and 'item_location_1' the location of the check per spoiler log. This also must have _0 for the first location and _1 for the second location. 'location_text', is the text for the
#dual hint where item_1 is the item from item_location_0 and item_2 is the item from item_location_1. 'location_fallback', text to handle if the misc hint is not turned on. 'text_style', argument for text box style.
misc_dual_hint_table: dict[str, dict[str, Any]] = {
'mask_shop_dual': {
'id': 0x0344,
'hint_location_0': 'Deku Theater Skull Mask',
'item_location_0': 'Deku Theater Skull Mask',
'hint_location_1': 'Deku Theater Mask of Truth',
'item_location_1': 'Deku Theater Mask of Truth',
'location_text_0': 'Bringing the \x05\x41Skull Mask\x05\x40 to Deku Theater will reward you with \x05\x42{item_1}\x05\x40',
'location_text_1': 'Bringing the \x05\x41Mark of Truth\x05\x40 to Deku Theater will reward you with \x05\x42{item_2}\x05\x40',
'location_text_2': '\x01Bringing the \x05\x41Skull Mask\x05\x40 to Deku Theater will reward you with \x05\x42{item_1}\x05\x40\x04Bringing the \x05\x41Mask of Truth\x05\x40 to Deku Theater will reward you with \x05\x42{item_2}\x05\x40',
'location_fallback': 'Forest Stage\x04\x04We are waiting to see your\x04beautiful face!\x04Win fabulous prizes!',
'location_text': '\x01Wearing the \x05\x41Skull Mask\x05\x40 will reward you with \x05\x42{item_1}\x05\x40\x04Wearing the \x05\x41Mask of Truth\x05\x40 will reward you with \x05\x42{item_2}\x05\x40',
'location_fallback': '\x05\x42\x06\x3dForest Stage\x04\x01\x05\x40\x06\x14We are waiting to see your\x01\x06\x32beautiful face!\x01\x06\x28Win fabulous prizes!',
'text_style': 0x13
},
}

Expand Down
24 changes: 9 additions & 15 deletions Hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from urllib.error import URLError, HTTPError

from HintList import Hint, get_hint, get_multi, get_hint_group, get_upgrade_hint_list, hint_exclusions, \
misc_item_hint_table, misc_location_hint_table
misc_item_hint_table, misc_location_hint_table, misc_dual_hint_table
from Item import Item, make_event_item
from ItemList import REWARD_COLORS
from Messages import Message, COLOR_MAP, update_message_by_id
Expand Down Expand Up @@ -1829,7 +1829,7 @@ def build_misc_location_hints(world: World, messages: list[Message]) -> None:
world.settings.clearer_hints).text, poe_points=poe_points)
else:
text = data['location_fallback'].format(poe_points=poe_points)
update_message_by_id(messages, data['id'], text)
update_message_by_id(messages, data['id'], text, data['text_style'])
return
else:
if hint_type in world.settings.misc_hints:
Expand All @@ -1838,35 +1838,29 @@ def build_misc_location_hints(world: World, messages: list[Message]) -> None:
text = data['location_text'].format(item=get_hint(get_item_generic_name(item),
world.settings.clearer_hints).text)

update_message_by_id(messages, data['id'], str(GossipText(text, ['Green'], prefix='')), data['text_style'], allow_duplicates=True)
if hint_type not in ['skull_mask', 'mask_of_truth'] and hint_type not in world.settings.misc_hints:
update_message_by_id(messages, data['id'], str(GossipText(text, ['Green'], prefix='')), data['text_style'], allow_duplicates=True)
update_message_by_id(messages, data['id'], str(GossipText(text, ['Green'], prefix='')), data['text_style'], allow_duplicates=True)
#Allows for other misc hints to use 'location_fallback, but avoids the mask hints from being overwritten.
if hint_type not in ['skull_mask', 'mask_of_truth'] and hint_type not in world.settings.misc_hints:
update_message_by_id(messages, data['id'], str(GossipText(text, ['Green'], prefix='')), data['text_style'], allow_duplicates=True)

def build_misc_dual_hints(world: World, messages: list[Message]) -> None:
for hint_type, data in misc_dual_hint_table.items():
#Change misc_hints list to use the Skull Mask and Mask of Truth Dual hint
if 'skull_mask' in world.settings.misc_hints and 'mask_of_truth' in world.settings.misc_hints:
world.settings.misc_hints.remove('skull_mask')
world.settings.misc_hints.remove('mask_of_truth')
world.settings.misc_hints.append('mask_shop_dual')
text = data['location_fallback']
if hint_type in world.settings.misc_hints:
#if hint_type in world.misc_dual_hint_items:
keys = list(world.misc_dual_hint_items.keys())
items = []
for key in keys:
item = world.misc_dual_hint_items[key]
items.append(item)
item_1 = items[0]
item_2 = items[1]
if data['item_location_0'] in world.settings.disabled_locations and data['item_location_1'] in world.settings.disabled_locations:
text = data['location_fallback']
elif data['item_location_0'] in world.settings.disabled_locations:
text = data['location_text_1'].format(item_2=get_hint(get_item_generic_name(item_2), world.settings.clearer_hints).text)
elif data['item_location_1'] in world.settings.disabled_locations:
text = data['location_text_0'].format(item_1=get_hint(get_item_generic_name(item_1), world.settings.clearer_hints).text)
else:
text = data['location_text_2'].format(item_1=get_hint(get_item_generic_name(item_1), world.settings.clearer_hints).text, item_2=get_hint(get_item_generic_name(item_2), world.settings.clearer_hints).text)
update_message_by_id(messages, data['id'], str(GossipText(text, ['Green'], prefix='')), 0x13, allow_duplicates=True)
text = data['location_text'].format(item_1=get_hint(get_item_generic_name(item_1), world.settings.clearer_hints).text, item_2=get_hint(get_item_generic_name(item_2), world.settings.clearer_hints).text)
update_message_by_id(messages, data['id'], str(GossipText(text, ['Green'], prefix='')), data['text_style'], allow_duplicates=True)



Expand Down
2 changes: 1 addition & 1 deletion Location.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from enum import Enum
from typing import TYPE_CHECKING, Optional, Any, overload

from HintList import misc_item_hint_table, misc_location_hint_table
from HintList import misc_item_hint_table, misc_location_hint_table, misc_dual_hint_table
from LocationList import location_table, location_is_viewable, LocationAddress, LocationDefault, LocationFilterTags

if TYPE_CHECKING:
Expand Down
5 changes: 4 additions & 1 deletion Patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from Entrance import Entrance
from HintList import get_hint
from Hints import GossipText, HintArea, write_gossip_stone_hints, build_altar_hints, \
build_ganon_text, build_misc_item_hints, build_misc_location_hints, get_simple_hint_no_prefix, get_item_generic_name
build_ganon_text, build_misc_item_hints, build_misc_location_hints, build_misc_dual_hints, get_simple_hint_no_prefix, get_item_generic_name
from Item import Item
from ItemList import REWARD_COLORS
from ItemPool import reward_list, song_list, trade_items, child_trade_items
Expand Down Expand Up @@ -1433,6 +1433,9 @@ def calculate_traded_flags(world):
# build misc. location hints
build_misc_location_hints(world, messages)

#build misc. dual hints
build_misc_dual_hints(world, messages)

if 'mask_shop' in world.settings.misc_hints:
rom.write_int32(rom.sym('CFG_MASK_SHOP_HINT'), 1)

Expand Down
9 changes: 9 additions & 0 deletions SettingsList.py
Original file line number Diff line number Diff line change
Expand Up @@ -3601,6 +3601,15 @@ class SettingInfos:
The Poe collector will tell the reward for selling
him Big Poes.
The sign in Deku Theater will tell the reward for showing
the Skull Mask.
The sign in Deku Theater will tell the reward for showing
the Mask of Truth.
If both Skull Mask and Mask of Truth are selected, the sign
in Deku Theater will tell the reward for both items.
''',
shared = True,
default = ['altar', 'ganondorf', 'warp_songs_and_owls'],
Expand Down
6 changes: 4 additions & 2 deletions World.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from Dungeon import Dungeon
from Entrance import Entrance
from Goals import Goal, GoalCategory
from HintList import get_required_hints, misc_item_hint_table, misc_location_hint_table
from HintList import get_required_hints, misc_item_hint_table, misc_location_hint_table, misc_dual_hint_table
from Hints import HintArea, hint_dist_keys, hint_dist_files
from Item import Item, ItemFactory, ItemInfo, make_event_item
from ItemList import REWARD_COLORS
Expand Down Expand Up @@ -50,6 +50,7 @@ def __init__(self, world_id: int, settings: Settings, resolve_randomized_setting
}
self.misc_hint_item_locations: dict[str, Location] = {}
self.misc_hint_location_items: dict[str, Item] = {}
self.misc_dual_hint_items: dict[str, Item] = {}
self.triforce_count: int = 0
self.total_starting_triforce_count: int = 0
self.empty_areas: dict[HintArea, dict[str, Any]] = {}
Expand Down Expand Up @@ -263,7 +264,8 @@ def __missing__(self, dungeon_name: str) -> EmptyDungeonInfo:
self.dungeon_rewards_hinted: bool = settings.shuffle_mapcompass != 'remove' if settings.enhance_map_compass else 'altar' in settings.misc_hints
self.misc_hint_items: dict[str, str] = {hint_type: self.hint_dist_user.get('misc_hint_items', {}).get(hint_type, data['default_item']) for hint_type, data in misc_item_hint_table.items()}
self.misc_hint_locations: dict[str, str] = {hint_type: self.hint_dist_user.get('misc_hint_locations', {}).get(hint_type, data['item_location']) for hint_type, data in misc_location_hint_table.items()}
self.misc_dual_hint: dict[str, str] = {hint_type: self.hint_dist_user.get('misc_dual_hint', {}).get(hint_type, data) for hint_type, data in misc_dual_hint_table.items()}
for i in range(2):
self.misc_dual_hint: dict[str, str] = {hint_type: self.hint_dist_user.get('misc_dual_hint', {}).get(hint_type, data['item_location' + '_' + str(i)]) for hint_type, data in misc_dual_hint_table.items()}
self.state: State = State(self)

# Allows us to cut down on checking whether some items are required
Expand Down

0 comments on commit 5de3d55

Please sign in to comment.