Skip to content

Commit

Permalink
The Witness: New hint type ("area hints") (ArchipelagoMW#2494)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
3 people authored and EmilyV99 committed Apr 15, 2024
1 parent efde630 commit 5e8eb1c
Show file tree
Hide file tree
Showing 19 changed files with 1,135 additions and 594 deletions.
12 changes: 6 additions & 6 deletions worlds/witness/WitnessItems.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Jokes:

Doors:
1100 - Glass Factory Entry (Panel) - 0x01A54
1101 - Tutorial Outpost Entry (Panel) - 0x0A171
1102 - Tutorial Outpost Exit (Panel) - 0x04CA4
1101 - Outside Tutorial Outpost Entry (Panel) - 0x0A171
1102 - Outside Tutorial Outpost Exit (Panel) - 0x04CA4
1105 - Symmetry Island Lower (Panel) - 0x000B0
1107 - Symmetry Island Upper (Panel) - 0x1C349
1108 - Desert Surface 3 Control (Panel) - 0x09FA0
Expand Down Expand Up @@ -168,9 +168,9 @@ Doors:
1750 - Theater Entry (Door) - 0x17F88
1753 - Theater Exit Left (Door) - 0x0A16D
1756 - Theater Exit Right (Door) - 0x3CCDF
1759 - Jungle Bamboo Laser Shortcut (Door) - 0x3873B
1759 - Jungle Laser Shortcut (Door) - 0x3873B
1760 - Jungle Popup Wall (Door) - 0x1475B
1762 - River Monastery Garden Shortcut (Door) - 0x0CF2A
1762 - Jungle Monastery Garden Shortcut (Door) - 0x0CF2A
1765 - Bunker Entry (Door) - 0x0C2A4
1768 - Bunker Tinted Glass Door - 0x17C79
1771 - Bunker UV Room Entry (Door) - 0x0C2A3
Expand All @@ -195,7 +195,7 @@ Doors:
1828 - Mountain Floor 2 Exit (Door) - 0x09EDD
1831 - Mountain Floor 2 Staircase Far (Door) - 0x09E07
1834 - Mountain Bottom Floor Giant Puzzle Exit (Door) - 0x09F89
1840 - Mountain Bottom Floor Final Room Entry (Door) - 0x0C141
1840 - Mountain Bottom Floor Pillars Room Entry (Door) - 0x0C141
1843 - Mountain Bottom Floor Rock (Door) - 0x17F33
1846 - Caves Entry (Door) - 0x2D77D
1849 - Caves Pillar Door - 0x019A5
Expand Down Expand Up @@ -247,7 +247,7 @@ Doors:
2035 - Mountain & Caves Control Panels - 0x09ED8,0x09E86,0x09E39,0x09EEB,0x335AB,0x335AC,0x3369D

2100 - Symmetry Island Panels - 0x1C349,0x000B0
2101 - Tutorial Outpost Panels - 0x0A171,0x04CA4
2101 - Outside Tutorial Outpost Panels - 0x0A171,0x04CA4
2105 - Desert Panels - 0x09FAA,0x1C2DF,0x1831E,0x1C260,0x1831C,0x1C2F3,0x1831D,0x1C2B1,0x1831B,0x0C339,0x0A249,0x0A015,0x09FA0,0x09F86
2110 - Quarry Outside Panels - 0x17C09,0x09E57,0x17CC4
2115 - Quarry Stoneworks Panels - 0x01E5A,0x01E59,0x03678,0x03676,0x03679,0x03675
Expand Down
346 changes: 205 additions & 141 deletions worlds/witness/WitnessLogic.txt

Large diffs are not rendered by default.

346 changes: 205 additions & 141 deletions worlds/witness/WitnessLogicExpert.txt

Large diffs are not rendered by default.

346 changes: 205 additions & 141 deletions worlds/witness/WitnessLogicVanilla.txt

Large diffs are not rendered by default.

35 changes: 23 additions & 12 deletions worlds/witness/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
Archipelago init file for The Witness
"""
import dataclasses
from typing import Dict, Optional

from typing import Dict, Optional
from BaseClasses import Region, Location, MultiWorld, Item, Entrance, Tutorial, CollectionState
from Options import PerGameCommonOptions, Toggle
from .presets import witness_option_presets
from .hints import get_always_hint_locations, get_always_hint_items, get_priority_hint_locations, \
get_priority_hint_items, make_hints, generate_joke_hints
from worlds.AutoWorld import World, WebWorld
from .player_logic import WitnessPlayerLogic
from .static_logic import StaticWitnessLogic
from .hints import get_always_hint_locations, get_always_hint_items, get_priority_hint_locations, \
get_priority_hint_items, make_always_and_priority_hints, generate_joke_hints, make_area_hints, get_hintable_areas, \
make_extra_location_hints, create_all_hints
from .locations import WitnessPlayerLocations, StaticWitnessLocations
from .items import WitnessItem, StaticWitnessItems, WitnessPlayerItems, ItemData
from .regions import WitnessRegions
Expand Down Expand Up @@ -57,6 +58,7 @@ class WitnessWorld(World):
}
location_name_to_id = StaticWitnessLocations.ALL_LOCATIONS_TO_ID
item_name_groups = StaticWitnessItems.item_groups
location_name_groups = StaticWitnessLocations.AREA_LOCATION_GROUPS

required_client_version = (0, 4, 4)

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

extra_checks = [
("First Hallway Room", "First Hallway Bend"),
("First Hallway", "First Hallway Straight"),
("Tutorial First Hallway Room", "Tutorial First Hallway Bend"),
("Tutorial First Hallway", "Tutorial First Hallway Straight"),
("Desert Outside", "Desert Surface 1"),
("Desert Outside", "Desert Surface 2"),
]
Expand Down Expand Up @@ -277,26 +279,35 @@ def fill_slot_data(self) -> dict:
hint_amount = self.options.hint_amount.value

credits_hint = (
"This Randomizer is brought to you by",
"NewSoupVi, Jarno, blastron,",
"jbzdarkid, sigma144, IHNN, oddGarrett, Exempt-Medic.", -1
"This Randomizer is brought to you by\n"
"NewSoupVi, Jarno, blastron,\n",
"jbzdarkid, sigma144, IHNN, oddGarrett, Exempt-Medic.", -1, -1
)

audio_logs = get_audio_logs().copy()

if hint_amount:
generated_hints = make_hints(self, hint_amount, self.own_itempool)
area_hints = round(self.options.area_hint_percentage / 100 * hint_amount)

generated_hints = create_all_hints(self, hint_amount, area_hints)

self.random.shuffle(audio_logs)

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

for _ in range(0, hint_amount):
hint = generated_hints.pop(0)
for hint in generated_hints:
location = hint.location
area_amount = hint.area_amount

# None if junk hint, address if location hint, area string if area hint
arg_1 = location.address if location else (hint.area if hint.area else None)

# self.player if junk hint, player if location hint, progression amount if area hint
arg_2 = area_amount if area_amount is not None else (location.player if location else self.player)

for _ in range(0, duplicates):
audio_log = audio_logs.pop()
self.log_ids_to_hints[int(audio_log, 16)] = hint
self.log_ids_to_hints[int(audio_log, 16)] = (hint.wording, arg_1, arg_2)

if audio_logs:
audio_log = audio_logs.pop()
Expand Down
Loading

0 comments on commit 5e8eb1c

Please sign in to comment.