Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Witness: Advanced Hints Options #3706

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 17 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
15 changes: 10 additions & 5 deletions worlds/witness/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from logging import error, warning
from typing import Any, Dict, List, Optional, cast

from BaseClasses import CollectionState, Entrance, Location, Region, Tutorial
from BaseClasses import CollectionState, Entrance, Location, LocationProgressType, Region, Tutorial

from Options import OptionError, PerGameCommonOptions, Toggle
from worlds.AutoWorld import WebWorld, World
Expand Down Expand Up @@ -237,10 +237,8 @@ def create_regions(self) -> None:
# Then, add checks in order until the required amount of sphere 1 checks is met.

extra_checks = [
("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"),
(location, static_witness_logic.ENTITIES_BY_NAME[location]["region"]["name"])
for location in static_witness_locations.EXTRA_LOCATIONS
]

for i in range(num_early_locs, needed_size):
Expand Down Expand Up @@ -326,6 +324,13 @@ def fill_slot_data(self) -> Dict[str, Any]:

already_hinted_locations = set()

# Excluded locations should never be hinted

already_hinted_locations |= {
location.name for location in self.multiworld.get_locations(self.player)
if location.progress_type == LocationProgressType.EXCLUDED
}

# Laser hints

if self.options.laser_hints:
Expand Down
15 changes: 15 additions & 0 deletions worlds/witness/data/static_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,23 @@

ITEM_DATA: Dict[str, ItemData] = {}
ITEM_GROUPS: Dict[str, Set[str]] = {}
POSSIBLE_ITEMS: Set[str] = set()

# Useful items that are treated specially at generation time and should not be automatically added to the player's
# item list during get_progression_items.
_special_usefuls: List[str] = ["Puzzle Skip"]

_impossible_items: Set[str] = {
"Dots",
"Full Dots",
"Symmetry",
"Colored Dots",
"Stars",
"Stars + Same Colored Symbol",
"Invisible Dots"
}



def populate_items() -> None:
for item_name, definition in static_witness_logic.ALL_ITEMS.items():
Expand Down Expand Up @@ -43,6 +55,9 @@ def populate_items() -> None:
ITEM_DATA[item_name] = ItemData(ap_item_code, definition,
classification, local_only)

if item_name not in _impossible_items:
POSSIBLE_ITEMS.add(item_name)


def get_item_to_door_mappings() -> Dict[int, List[int]]:
output: Dict[int, List[int]] = {}
Expand Down
22 changes: 21 additions & 1 deletion worlds/witness/data/static_locations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Dict, Set, cast
from typing import Dict, List, Set, cast

from . import static_logic as static_witness_logic
from . import utils

ID_START = 158000

Expand Down Expand Up @@ -453,6 +454,15 @@

AREA_LOCATION_GROUPS: Dict[str, Set[str]] = {}

POSSIBLE_LOCATIONS: Set[str] = set()

EXTRA_LOCATIONS: List[str] = [
"Tutorial First Hallway Bend",
"Tutorial First Hallway Straight",
"Desert Surface 1",
"Desert Surface 2",
]


def get_id(entity_hex: str) -> int:
"""
Expand Down Expand Up @@ -488,3 +498,13 @@ def get_event_name(entity_hex: str) -> str:
for loc in ALL_LOCATIONS_TO_IDS:
area = static_witness_logic.ENTITIES_BY_NAME[loc]["area"]["name"]
AREA_LOCATION_GROUPS.setdefault(area, set()).add(loc)

POSSIBLE_LOCATIONS |= GENERAL_LOCATIONS
POSSIBLE_LOCATIONS.update(EXTRA_LOCATIONS)

door_shuffle_line_gen = (line for line in utils.get_complex_doors())
for line in door_shuffle_line_gen:
NewSoupVi marked this conversation as resolved.
Show resolved Hide resolved
if line.startswith("Added Locations"):
break

POSSIBLE_LOCATIONS.update([line.strip() for line in door_shuffle_line_gen])
Loading
Loading