Skip to content

Commit 99bd0a7

Browse files
NewSoupViExempt-MedicScipioWright
authored andcommitted
The Witness: New hint type ("area hints") (ArchipelagoMW#2494)
This new type of "area hint" will instead give you general information about one of the named geographical areas in your world. Example: ``` There are 4 progression items in the "Quarry" region. Of them, 2 are for other players. Also, one of them is a laser for this world. ``` This also renames some of the locations in the game to better fit into an "area", such as the "River Obelisk" being renamed to the "Mountainside Obelisk". --------- Co-authored-by: Exempt-Medic <[email protected]> Co-authored-by: Scipio Wright <[email protected]>
1 parent 1c4c3b3 commit 99bd0a7

19 files changed

+1135
-594
lines changed

worlds/witness/WitnessItems.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ Jokes:
3939

4040
Doors:
4141
1100 - Glass Factory Entry (Panel) - 0x01A54
42-
1101 - Tutorial Outpost Entry (Panel) - 0x0A171
43-
1102 - Tutorial Outpost Exit (Panel) - 0x04CA4
42+
1101 - Outside Tutorial Outpost Entry (Panel) - 0x0A171
43+
1102 - Outside Tutorial Outpost Exit (Panel) - 0x04CA4
4444
1105 - Symmetry Island Lower (Panel) - 0x000B0
4545
1107 - Symmetry Island Upper (Panel) - 0x1C349
4646
1108 - Desert Surface 3 Control (Panel) - 0x09FA0
@@ -168,9 +168,9 @@ Doors:
168168
1750 - Theater Entry (Door) - 0x17F88
169169
1753 - Theater Exit Left (Door) - 0x0A16D
170170
1756 - Theater Exit Right (Door) - 0x3CCDF
171-
1759 - Jungle Bamboo Laser Shortcut (Door) - 0x3873B
171+
1759 - Jungle Laser Shortcut (Door) - 0x3873B
172172
1760 - Jungle Popup Wall (Door) - 0x1475B
173-
1762 - River Monastery Garden Shortcut (Door) - 0x0CF2A
173+
1762 - Jungle Monastery Garden Shortcut (Door) - 0x0CF2A
174174
1765 - Bunker Entry (Door) - 0x0C2A4
175175
1768 - Bunker Tinted Glass Door - 0x17C79
176176
1771 - Bunker UV Room Entry (Door) - 0x0C2A3
@@ -195,7 +195,7 @@ Doors:
195195
1828 - Mountain Floor 2 Exit (Door) - 0x09EDD
196196
1831 - Mountain Floor 2 Staircase Far (Door) - 0x09E07
197197
1834 - Mountain Bottom Floor Giant Puzzle Exit (Door) - 0x09F89
198-
1840 - Mountain Bottom Floor Final Room Entry (Door) - 0x0C141
198+
1840 - Mountain Bottom Floor Pillars Room Entry (Door) - 0x0C141
199199
1843 - Mountain Bottom Floor Rock (Door) - 0x17F33
200200
1846 - Caves Entry (Door) - 0x2D77D
201201
1849 - Caves Pillar Door - 0x019A5
@@ -247,7 +247,7 @@ Doors:
247247
2035 - Mountain & Caves Control Panels - 0x09ED8,0x09E86,0x09E39,0x09EEB,0x335AB,0x335AC,0x3369D
248248

249249
2100 - Symmetry Island Panels - 0x1C349,0x000B0
250-
2101 - Tutorial Outpost Panels - 0x0A171,0x04CA4
250+
2101 - Outside Tutorial Outpost Panels - 0x0A171,0x04CA4
251251
2105 - Desert Panels - 0x09FAA,0x1C2DF,0x1831E,0x1C260,0x1831C,0x1C2F3,0x1831D,0x1C2B1,0x1831B,0x0C339,0x0A249,0x0A015,0x09FA0,0x09F86
252252
2110 - Quarry Outside Panels - 0x17C09,0x09E57,0x17CC4
253253
2115 - Quarry Stoneworks Panels - 0x01E5A,0x01E59,0x03678,0x03676,0x03679,0x03675

worlds/witness/WitnessLogic.txt

+205-141
Large diffs are not rendered by default.

worlds/witness/WitnessLogicExpert.txt

+205-141
Large diffs are not rendered by default.

worlds/witness/WitnessLogicVanilla.txt

+205-141
Large diffs are not rendered by default.

worlds/witness/__init__.py

+23-12
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22
Archipelago init file for The Witness
33
"""
44
import dataclasses
5-
from typing import Dict, Optional
65

6+
from typing import Dict, Optional
77
from BaseClasses import Region, Location, MultiWorld, Item, Entrance, Tutorial, CollectionState
88
from Options import PerGameCommonOptions, Toggle
99
from .presets import witness_option_presets
10-
from .hints import get_always_hint_locations, get_always_hint_items, get_priority_hint_locations, \
11-
get_priority_hint_items, make_hints, generate_joke_hints
1210
from worlds.AutoWorld import World, WebWorld
1311
from .player_logic import WitnessPlayerLogic
1412
from .static_logic import StaticWitnessLogic
13+
from .hints import get_always_hint_locations, get_always_hint_items, get_priority_hint_locations, \
14+
get_priority_hint_items, make_always_and_priority_hints, generate_joke_hints, make_area_hints, get_hintable_areas, \
15+
make_extra_location_hints, create_all_hints
1516
from .locations import WitnessPlayerLocations, StaticWitnessLocations
1617
from .items import WitnessItem, StaticWitnessItems, WitnessPlayerItems, ItemData
1718
from .regions import WitnessRegions
@@ -57,6 +58,7 @@ class WitnessWorld(World):
5758
}
5859
location_name_to_id = StaticWitnessLocations.ALL_LOCATIONS_TO_ID
5960
item_name_groups = StaticWitnessItems.item_groups
61+
location_name_groups = StaticWitnessLocations.AREA_LOCATION_GROUPS
6062

6163
required_client_version = (0, 4, 4)
6264

@@ -191,8 +193,8 @@ def create_regions(self):
191193
# Then, add checks in order until the required amount of sphere 1 checks is met.
192194

193195
extra_checks = [
194-
("First Hallway Room", "First Hallway Bend"),
195-
("First Hallway", "First Hallway Straight"),
196+
("Tutorial First Hallway Room", "Tutorial First Hallway Bend"),
197+
("Tutorial First Hallway", "Tutorial First Hallway Straight"),
196198
("Desert Outside", "Desert Surface 1"),
197199
("Desert Outside", "Desert Surface 2"),
198200
]
@@ -277,26 +279,35 @@ def fill_slot_data(self) -> dict:
277279
hint_amount = self.options.hint_amount.value
278280

279281
credits_hint = (
280-
"This Randomizer is brought to you by",
281-
"NewSoupVi, Jarno, blastron,",
282-
"jbzdarkid, sigma144, IHNN, oddGarrett, Exempt-Medic.", -1
282+
"This Randomizer is brought to you by\n"
283+
"NewSoupVi, Jarno, blastron,\n",
284+
"jbzdarkid, sigma144, IHNN, oddGarrett, Exempt-Medic.", -1, -1
283285
)
284286

285287
audio_logs = get_audio_logs().copy()
286288

287289
if hint_amount:
288-
generated_hints = make_hints(self, hint_amount, self.own_itempool)
290+
area_hints = round(self.options.area_hint_percentage / 100 * hint_amount)
291+
292+
generated_hints = create_all_hints(self, hint_amount, area_hints)
289293

290294
self.random.shuffle(audio_logs)
291295

292296
duplicates = min(3, len(audio_logs) // hint_amount)
293297

294-
for _ in range(0, hint_amount):
295-
hint = generated_hints.pop(0)
298+
for hint in generated_hints:
299+
location = hint.location
300+
area_amount = hint.area_amount
301+
302+
# None if junk hint, address if location hint, area string if area hint
303+
arg_1 = location.address if location else (hint.area if hint.area else None)
304+
305+
# self.player if junk hint, player if location hint, progression amount if area hint
306+
arg_2 = area_amount if area_amount is not None else (location.player if location else self.player)
296307

297308
for _ in range(0, duplicates):
298309
audio_log = audio_logs.pop()
299-
self.log_ids_to_hints[int(audio_log, 16)] = hint
310+
self.log_ids_to_hints[int(audio_log, 16)] = (hint.wording, arg_1, arg_2)
300311

301312
if audio_logs:
302313
audio_log = audio_logs.pop()

0 commit comments

Comments
 (0)