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 Messenger: Hotfix item links filler gen #3078

Merged
merged 4 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
23 changes: 16 additions & 7 deletions worlds/messenger/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging
from datetime import date
from typing import Any, ClassVar, Dict, List, Optional, TextIO
from typing import Any, ClassVar, Dict, List, Optional, Set, TextIO

from BaseClasses import CollectionState, Entrance, Item, ItemClassification, MultiWorld, Tutorial
from Options import Accessibility
Expand Down Expand Up @@ -154,13 +153,12 @@ def generate_early(self) -> None:
# TODO add a check for transition shuffle when that gets added back in
if not self.options.shuffle_portals and "Searing Crags Portal" not in self.starting_portals:
self.starting_portals.append("Searing Crags Portal")
if len(self.starting_portals) > 4:
portals_to_strip = [portal for portal in ["Riviere Turquoise Portal", "Sunken Shrine Portal"]
if portal in self.starting_portals]
self.starting_portals.remove(self.random.choice(portals_to_strip))
portals_to_strip = [portal for portal in ["Riviere Turquoise Portal", "Sunken Shrine Portal"]
if portal in self.starting_portals]
self.starting_portals.remove(self.random.choice(portals_to_strip))

self.filler = FILLER.copy()
if (not hasattr(self.options, "traps") and date.today() < date(2024, 4, 2)) or self.options.traps:
if self.options.traps:
self.filler.update(TRAPS)

self.plando_portals = []
Expand Down Expand Up @@ -350,6 +348,17 @@ def get_item_classification(self, name: str) -> ItemClassification:

return ItemClassification.filler

@classmethod
def create_group(cls, multiworld: "MultiWorld", new_player_id: int, players: Set[int]) -> World:
group = super().create_group(multiworld, new_player_id, players)
assert isinstance(group, MessengerWorld)

group.filler = FILLER.copy()
group.options.traps.value = all(multiworld.worlds[player].options.traps for player in players)
if group.options.traps:
group.filler.update(TRAPS)
return group

def collect(self, state: "CollectionState", item: "Item") -> bool:
change = super().collect(state, item)
if change and "Time Shard" in item.name:
Expand Down
18 changes: 9 additions & 9 deletions worlds/messenger/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,15 +567,6 @@
"Elemental Skylands - Earth Generator Shop",
],
"Earth Generator Shop": [
"Elemental Skylands - Fire Shmup",
],
"Fire Shmup": [
"Elemental Skylands - Fire Intro Shop",
],
"Fire Intro Shop": [
"Elemental Skylands - Fire Generator Shop",
],
"Fire Generator Shop": [
"Elemental Skylands - Water Shmup",
],
"Water Shmup": [
Expand All @@ -585,6 +576,15 @@
"Elemental Skylands - Water Generator Shop",
],
"Water Generator Shop": [
"Elemental Skylands - Fire Shmup",
],
"Fire Shmup": [
"Elemental Skylands - Fire Intro Shop",
],
"Fire Intro Shop": [
"Elemental Skylands - Fire Generator Shop",
],
"Fire Generator Shop": [
"Elemental Skylands - Right",
],
"Right": [
Expand Down
5 changes: 1 addition & 4 deletions worlds/messenger/options.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from dataclasses import dataclass
from datetime import date
from typing import Dict

from schema import And, Optional, Or, Schema
Expand Down Expand Up @@ -203,8 +202,6 @@ class MessengerOptions(DeathLinkMixin, PerGameCommonOptions):
notes_needed: NotesNeeded
total_seals: AmountSeals
percent_seals_required: RequiredSeals
traps: Traps
shop_price: ShopPrices
shop_price_plan: PlannedShopPrices

if date.today() > date(2024, 4, 1):
traps: Traps
Loading