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

Remaining koala changes #80

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6184298
commented out crash site entrances disabling
Avasam Jul 21, 2024
27291b9
comment out the correct lines for Crash Site
Jul 21, 2024
2cfd8ce
teleporters bugfix
Jul 21, 2024
f405ace
bugfix st. claire's camp
Jul 21, 2024
a821f6b
bugfix altar of ages
Jul 21, 2024
e6fb1e9
twin outposts logic added
Jul 21, 2024
84b72ae
added option to skip water levels
Jul 21, 2024
41c550a
account for spirit fights in graph
Jul 21, 2024
43fc0df
accounted for beta volcano in graph
Jul 21, 2024
19bb6b7
slightly adjusted some comments
Jul 21, 2024
d63da1f
updated the spoiler log
Jul 21, 2024
8f5b767
mountain sled run meme
Jul 21, 2024
3013304
updated README.md
Jul 21, 2024
b60d7e1
some bugfixes
Jul 21, 2024
5c178b0
added manually_disabled_levels functionality (Crash Site)
Jul 21, 2024
35d203d
broke up set_transitions_map in smaller functions
Jul 21, 2024
0441b95
shortened a couple of lines
Jul 21, 2024
72c88b6
Merge branch 'main' into remaining_koala_changes
wossnameGitHub Jul 21, 2024
6f02429
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 21, 2024
8834cd4
first round of ruff changes
Jul 25, 2024
0f65e67
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 25, 2024
eac73a7
second wave of ruff fixes
Jul 25, 2024
a7e42d2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 25, 2024
9209cf9
split up highjack_transition_rando() into 2 functions
Jul 25, 2024
84b53a6
moved WATER_LEVELS to constants.py
Jul 25, 2024
91748c2
moved WaterExit to constants.py
Jul 25, 2024
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
8 changes: 8 additions & 0 deletions Dolphin scripts/Entrance Randomizer/CONFIGS.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@
default = True
"""

SKIP_WATER_LEVELS: bool = True
"""
If True, you will completely skip all 3 underwater levels.
If False, these 3 levels are included in the randomization process normally.

default = True
"""

IMMEDIATE_SPIRIT_FIGHTS: bool = True
"""
If True, entering a Temple for which you haven't completed the spirit fight yet will immediately
Expand Down
28 changes: 20 additions & 8 deletions Dolphin scripts/Entrance Randomizer/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,21 @@
from lib.constants import __version__
from lib.entrance_rando import (
CLOSED_DOOR_EXITS,
DISABLED_TRANSITIONS,
NO_CONNECTION_FOUND_ERROR,
SHOWN_DISABLED_TRANSITIONS,
bypassed_exits,
highjack_transition_rando,
manually_disabled_transitions,
set_transitions_map,
starting_area,
transition_infos_dict_rando,
transitions_map,
)
from lib.graph_creation import create_graphml
from lib.shaman_shop import patch_shaman_shop, randomize_shaman_shop
from lib.utils import (
draw_text,
dump_spoiler_logs,

Check failure on line 38 in Dolphin scripts/Entrance Randomizer/__main__.py

View workflow job for this annotation

GitHub Actions / Run pyright

Type of "dump_spoiler_logs" is partially unknown   Type of "dump_spoiler_logs" is "(starting_area_name: str, transitions_map: Mapping[tuple[int, int], tuple[int, int]], seed_string: int | float | str | bytes | bytearray | Literal[False] | None, transition_infos_dict_rando: dict[int, Unknown], bypassed_exits: list[tuple[int, int]], disabled_transitions: list[tuple[int, int]]) -> None" (reportUnknownVariableType)
follow_pointer_path,
highjack_transition,
prevent_item_softlock,
Expand All @@ -51,10 +54,17 @@
starting_area_name = hex(starting_area).upper() + " (unknown level)"

# Dump spoiler logs and graph
dump_spoiler_logs(starting_area_name, transitions_map, seed_string)
dump_spoiler_logs(
starting_area_name,
transitions_map,
seed_string,
transition_infos_dict_rando,
bypassed_exits,

Check failure on line 62 in Dolphin scripts/Entrance Randomizer/__main__.py

View workflow job for this annotation

GitHub Actions / Run pyright

Argument of type "tuple[tuple[LevelCRC, LevelCRC], tuple[LevelCRC, LevelCRC], tuple[LevelCRC, LevelCRC], tuple[LevelCRC, LevelCRC], tuple[LevelCRC, LevelCRC]]" cannot be assigned to parameter "bypassed_exits" of type "list[tuple[int, int]]" in function "dump_spoiler_logs"   "tuple[tuple[LevelCRC, LevelCRC], tuple[LevelCRC, LevelCRC], tuple[LevelCRC, LevelCRC], tuple[LevelCRC, LevelCRC], tuple[LevelCRC, LevelCRC]]" is incompatible with "list[tuple[int, int]]" (reportArgumentType)
DISABLED_TRANSITIONS,

Check failure on line 63 in Dolphin scripts/Entrance Randomizer/__main__.py

View workflow job for this annotation

GitHub Actions / Run pyright

Argument of type "list[tuple[LevelCRC, LevelCRC]]" cannot be assigned to parameter "disabled_transitions" of type "list[tuple[int, int]]" in function "dump_spoiler_logs"   "list[tuple[LevelCRC, LevelCRC]]" is incompatible with "list[tuple[int, int]]"     Type parameter "_T@list" is invariant, but "tuple[LevelCRC, LevelCRC]" is not the same as "tuple[int, int]"     Consider switching from "list" to "Sequence" which is covariant (reportArgumentType)
)
create_graphml(
transitions_map,
SHOWN_DISABLED_TRANSITIONS,
manually_disabled_transitions,
CLOSED_DOOR_EXITS,
seed_string,
starting_area,
Expand Down Expand Up @@ -100,6 +110,13 @@
return
if highjack_transition(LevelCRC.GATES_OF_EL_DORADO, LevelCRC.JAGUAR, LevelCRC.PUSCA):
return
# This does NOT influence how you start the level unfortunately,
# but at least it makes sure the Teleporters work right from the get-go.
if previous_area_id == LevelCRC.MAIN_MENU and state.current_area_new == starting_area:
memory.write_u32(
follow_pointer_path(ADDRESSES.prev_area),
TRANSITION_INFOS_DICT[starting_area].default_entrance,
)

# Standardize the Altar of Ages exit to remove the Altar -> BBCamp transition
highjack_transition(
Expand All @@ -115,11 +132,6 @@
LevelCRC.VIRACOCHA_MONOLITHS,
)

# Standardize St. Claire's Excavation Camp
highjack_transition(None, LevelCRC.ST_CLAIRE_NIGHT, LevelCRC.ST_CLAIRE_DAY)

# TODO: Skip swim levels (3)

highjack_transition_rando()

prevent_item_softlock()
Expand Down
14 changes: 13 additions & 1 deletion Dolphin scripts/Entrance Randomizer/lib/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,19 @@ class LevelCRC(IntEnum):
WHITE_VALLEY = 0x62548B77


class WaterExit(IntEnum):
JUNGLE_TO_WATER = 0X9D1A6D4A
BURNING_TO_WATER = 0X7C65128A
WATER_TO_JUNGLE = 0X00D15464
WATER_TO_BURNING = 0XE1AE2BA4


WATER_LEVELS = (
LevelCRC.TWIN_OUTPOSTS_UNDERWATER,
LevelCRC.FLOODED_CAVE,
LevelCRC.MYSTERIOUS_TEMPLE,
)

TEMPLES_WITH_FIGHT = {
LevelCRC.MONKEY_TEMPLE: LevelCRC.MONKEY_SPIRIT,
LevelCRC.SCORPION_TEMPLE: LevelCRC.SCORPION_SPIRIT,
Expand All @@ -257,7 +270,6 @@ class LevelCRC(IntEnum):
"""Entrances that can softlock by infinitely running into a door.
Value is the minimum height boost needed to regain control."""


ONE_WAY_TRANSITIONS = (
# the White Valley geyser
Transition(LevelCRC.WHITE_VALLEY, LevelCRC.MOUNTAIN_SLED_RUN),
Expand Down
Loading