Skip to content

Commit bd60885

Browse files
committed
Update misc hint ocarina of time and song of time with new misc dual hint system
1 parent e77659f commit bd60885

7 files changed

Lines changed: 66 additions & 35 deletions

File tree

HintList.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ def tokens_required_by_settings(world: World) -> int:
216216
conditional_always: dict[str, Callable[[World], bool]] = {
217217
'Market 10 Big Poes': lambda world: world.settings.big_poe_count > 3 and 'big_poes' not in world.settings.misc_hints,
218218
'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 'mask_of_truth' not in world.settings.misc_hints,
219-
'Song from Ocarina of Time': lambda world: stones_required_by_settings(world) < 2,
220-
'HF Ocarina of Time Item': lambda world: stones_required_by_settings(world) < 2,
219+
'Song from Ocarina of Time': lambda world: stones_required_by_settings(world) < 2 and 'song_of_time' not in world.settings.misc_hints,
220+
'HF Ocarina of Time Item': lambda world: stones_required_by_settings(world) < 2 and 'ocarina_of_time' not in world.settings.misc_hints,
221221
'Sheik in Kakariko': lambda world: medallions_required_by_settings(world) < 5,
222222
'DMT Biggoron': lambda world: ('Claim Check' not in world.settings.adult_trade_start or len(world.settings.adult_trade_start) != 1) and not world.settings.adult_trade_shuffle,
223223
'Kak 30 Gold Skulltula Reward': lambda world: tokens_required_by_settings(world) < 30 and '30_skulltulas' not in world.settings.misc_hints,
@@ -1949,6 +1949,20 @@ def rainbow_bridge_hint_kind(world: World) -> str:
19491949
'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",
19501950
'text_style': 0x03,
19511951
},
1952+
'ocarina_of_time': {
1953+
'id': 0x707A,
1954+
'hint_location': 'HF Ocarina of Time Item Hint',
1955+
'item_location': 'HF Ocarina of Time Item',
1956+
'location_text': 'The object retrieved under the drawbridge is \x05\x42{item}\x05\x40.',
1957+
'text_style': 0x20,
1958+
},
1959+
'song_of_time': {
1960+
'id': 0x707A,
1961+
'hint_location': 'Song from Ocarina of Time Hint',
1962+
'item_location': 'Song from Ocarina of Time',
1963+
'location_text': 'The song learned after the reunification of \x05\x41The Spiritual Stones\x05\x40 is \x05\x42{item}\x05\x40.',
1964+
'text_style': 0x20,
1965+
}
19521966
}
19531967

19541968
# Adds capability for dual misc hints. Only used when neither or both hints are enabled, uses corresponding misc_location_hint_table entries if only one is enabled.
@@ -1961,6 +1975,11 @@ def rainbow_bridge_hint_kind(world: World) -> str:
19611975
'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!',
19621976
'text_style': 0x13,
19631977
},
1978+
('ocarina_of_time', 'song_of_time'): {
1979+
'id': 0x707A,
1980+
'location_text': 'It is also written that reuniting \x05\x41The Spiritual Stones\x05\x40 leads to \x05\x42{item_1}\x05\x40 and \x05\x42{item_2}\x05\x40',
1981+
'text_style': 0x20,
1982+
},
19641983
}
19651984

19661985
# Separate table for goal names to avoid duplicates in the hint table.

Hints.py

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,7 +1666,8 @@ def build_altar_hints(world: World, messages: list[Message], include_rewards: bo
16661666
child_text += get_hint('Spiritual Stone Text Start', world.settings.clearer_hints).text + '\x04'
16671667
for (reward, color) in boss_rewards_spiritual_stones:
16681668
child_text += build_boss_string(reward, color, world)
1669-
if 'altar_child_oot' in world.settings.misc_hints:
1669+
sot_oot_misc_hint = build_oot_sot_hints(world)
1670+
if sot_oot_misc_hint is not None:
16701671
child_text += build_oot_sot_hints(world)
16711672
child_text += '\x04'
16721673
child_text += get_hint('Child Altar Text End', world.settings.clearer_hints).text
@@ -1716,14 +1717,10 @@ def build_boss_string(reward: str, color: str, world: World) -> str:
17161717
return str(text) + '\x04'
17171718

17181719
def build_oot_sot_hints(world: World) -> str:
1719-
sot_location = world.get_location('Song from Ocarina of Time')
1720-
oot_location = world.get_location('HF Ocarina of Time Item')
1721-
1722-
sot_item = "#" + get_hint(get_item_generic_name(sot_location.item), world.settings.clearer_hints).text + '# '
1723-
oot_item = "#" + get_hint(get_item_generic_name(oot_location.item), world.settings.clearer_hints).text + '# '
1724-
1725-
string = f"It is also written that reuniting #The Spiritual Stones# leads to " + sot_item + " and " + oot_item + ''
1726-
1720+
dual_data = misc_dual_hint_table.get(('ocarina_of_time', 'song_of_time'))
1721+
string = build_text_misc_dual_hints(world, dual_data, hint_type1='ocarina_of_time', hint_type2='song_of_time')
1722+
if string is None:
1723+
return None
17271724
return str(GossipText(string, ['Yellow', 'Blue', 'Blue'], prefix=''))
17281725

17291726
def build_bridge_reqs_string(world: World) -> str:
@@ -1861,28 +1858,36 @@ def build_misc_location_hints(world: World, messages: list[Message]) -> None:
18611858

18621859
def build_misc_dual_hints(world: World, messages: list[Message]) -> None:
18631860
for (hint_type1, hint_type2), data in misc_dual_hint_table.items():
1864-
item_1 = world.misc_hint_location_items[hint_type1]
1865-
item_2 = world.misc_hint_location_items[hint_type2]
1866-
if hint_type1 in world.settings.misc_hints and hint_type1 in world.misc_hint_location_items:
1867-
if hint_type2 in world.settings.misc_hints and hint_type2 in world.misc_hint_location_items:
1868-
text = data['location_text'].format(
1869-
item_1=get_hint(get_item_generic_name(item_1), world.settings.clearer_hints).text,
1870-
item_2=get_hint(get_item_generic_name(item_2), world.settings.clearer_hints).text,
1871-
)
1872-
else:
1873-
text = misc_location_hint_table[hint_type1]['location_text'].format(
1874-
item=get_hint(get_item_generic_name(item_1), world.settings.clearer_hints).text,
1875-
)
1861+
if hint_type1 == 'ocarina_of_time':
1862+
continue
1863+
1864+
text = build_text_misc_dual_hints(world, data, hint_type1, hint_type2)
1865+
if text is not None:
1866+
update_message_by_id(messages, data['id'], str(GossipText(text, ['Green'], prefix='')), data['text_style'])
1867+
1868+
1869+
def build_text_misc_dual_hints(world: World, data, hint_type1: str, hint_type2: str):
1870+
item_1 = world.misc_hint_location_items[hint_type1]
1871+
item_2 = world.misc_hint_location_items[hint_type2]
1872+
if hint_type1 in world.settings.misc_hints and hint_type1 in world.misc_hint_location_items:
1873+
if hint_type2 in world.settings.misc_hints and hint_type2 in world.misc_hint_location_items:
1874+
return data['location_text'].format(
1875+
item_1=get_hint(get_item_generic_name(item_1), world.settings.clearer_hints).text,
1876+
item_2=get_hint(get_item_generic_name(item_2), world.settings.clearer_hints).text,
1877+
)
18761878
else:
1877-
if hint_type2 in world.settings.misc_hints and hint_type2 in world.misc_hint_location_items:
1878-
text = misc_location_hint_table[hint_type2]['location_text'].format(
1879-
item=get_hint(get_item_generic_name(item_2), world.settings.clearer_hints).text,
1880-
)
1881-
else:
1882-
if hint_type1 not in world.settings.misc_hints and hint_type2 not in world.settings.misc_hints:
1883-
return
1884-
text = data['location_fallback']
1885-
update_message_by_id(messages, data['id'], str(GossipText(text, ['Green'], prefix='')), data['text_style'])
1879+
return misc_location_hint_table[hint_type1]['location_text'].format(
1880+
item=get_hint(get_item_generic_name(item_1), world.settings.clearer_hints).text,
1881+
)
1882+
else:
1883+
if hint_type2 in world.settings.misc_hints and hint_type2 in world.misc_hint_location_items:
1884+
return misc_location_hint_table[hint_type2]['location_text'].format(
1885+
item=get_hint(get_item_generic_name(item_2), world.settings.clearer_hints).text,
1886+
)
1887+
else:
1888+
if hint_type1 not in world.settings.misc_hints and hint_type2 not in world.settings.misc_hints:
1889+
return None
1890+
return data['location_fallback']
18861891

18871892

18881893
def get_raw_text(string: str) -> str:

LocationList.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2610,6 +2610,8 @@ def shop_address(shop_id: int, shelf_id: int) -> int:
26102610
("Market 10 Big Poes Hint", ("Hint", None, None, None, None, None)),
26112611
("Deku Theater Skull Mask Hint", ("Hint", None, None, None, None, None)),
26122612
("Deku Theater Mask of Truth Hint", ("Hint", None, None, None, None, None)),
2613+
("HF Ocarina of Time Item Hint", ("Hint", None, None, None, None, None)),
2614+
("Song from Ocarina of Time Hint", ("Hint", None, None, None, None, None)),
26132615
("Ganondorf Hint", ("Hint", None, None, None, None, None)),
26142616
])
26152617

SettingsList.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3583,7 +3583,8 @@ class SettingInfos:
35833583
gui_text = 'Misc. Hints',
35843584
choices = {
35853585
'altar': 'Temple of Time Altar',
3586-
'altar_child_oot': 'Temple of Time Altar Child OoT and SoT rewards',
3586+
'ocarina_of_time': 'Ocarina of Time reward',
3587+
'song_of_time': 'Song of Time',
35873588
'dampe_diary': "Dampé's Diary (Hookshot)",
35883589
'ganondorf': 'Ganondorf (Light Arrows)',
35893590
'warp_songs_and_owls': 'Warp Songs and Owls',
@@ -3610,7 +3611,7 @@ class SettingInfos:
36103611
Give Information is enabled).
36113612
36123613
Reading the Temple of Time altar as a child will
3613-
tell you what rewards the Ocarina of Time and
3614+
tell you what rewards the Ocarina of Time or/and
36143615
the Song of Time lead to.
36153616
36163617
Reading the Temple of Time altar as adult

World.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from Dungeon import Dungeon
1212
from Entrance import Entrance
1313
from Goals import Goal, GoalCategory
14-
from HintList import get_required_hints, misc_item_hint_table, misc_location_hint_table, misc_dual_hint_table
14+
from HintList import get_required_hints, misc_item_hint_table, misc_location_hint_table
1515
from Hints import HintArea, hint_dist_keys, hint_dist_files
1616
from Item import Item, ItemFactory, ItemInfo, make_event_item
1717
from ItemList import REWARD_COLORS

data/Glitched World/Overworld.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,8 @@
432432
"locations": {
433433
"ToT Light Arrows Cutscene": "is_adult and can_trigger_lacs",
434434
"ToT Child Altar Hint": "is_child",
435+
"HF Ocarina of Time Item Hint": "is_child",
436+
"Song from Ocarina of Time Hint": "is_child",
435437
"ToT Adult Altar Hint": "is_adult"
436438
},
437439
"exits": {

data/World/Overworld.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,6 +1308,8 @@
13081308
"locations": {
13091309
"ToT Light Arrows Cutscene": "is_adult and can_trigger_lacs",
13101310
"ToT Child Altar Hint": "is_child",
1311+
"HF Ocarina of Time Item Hint": "is_child",
1312+
"Song from Ocarina of Time Hint": "is_child",
13111313
"ToT Adult Altar Hint": "is_adult"
13121314
},
13131315
"exits": {

0 commit comments

Comments
 (0)