5 Commits

4 changed files with 33 additions and 16 deletions

View File

@@ -41,6 +41,7 @@ class GrinchClient(BizHawkClient):
previous_egg_count: int = 0 previous_egg_count: int = 0
send_ring_link: bool = False send_ring_link: bool = False
unique_client_id: int = 0 unique_client_id: int = 0
ring_link_enabled = False
def __init__(self): def __init__(self):
super().__init__() super().__init__()
@@ -93,12 +94,10 @@ class GrinchClient(BizHawkClient):
logger.info("You are now connected to the client. "+ logger.info("You are now connected to the client. "+
"There may be a slight delay to check you are not in demo mode before locations start to send.") "There may be a slight delay to check you are not in demo mode before locations start to send.")
ring_link_enabled = bool(ctx.slot_data["ring_link"]) self.ring_link_enabled = bool(ctx.slot_data["ring_link"])
tags = copy.deepcopy(ctx.tags) tags = copy.deepcopy(ctx.tags)
if ring_link_enabled: if self.ring_link_enabled:
self.send_ring_link = True
Utils.async_start(self.ring_link_output(ctx), name="EggLink")
ctx.tags.add("RingLink") ctx.tags.add("RingLink")
else: else:
ctx.tags -= { "RingLink" } ctx.tags -= { "RingLink" }
@@ -126,6 +125,11 @@ class GrinchClient(BizHawkClient):
if not await self.ingame_checker(ctx): if not await self.ingame_checker(ctx):
return return
if not any(task.get_name() == "Grinch EggLink" for task in asyncio.all_tasks()):
print("EggLink")
self.send_ring_link = True
Utils.async_start(self.ring_link_output(ctx), name="Grinch EggLink")
await self.location_checker(ctx) await self.location_checker(ctx)
await self.receiving_items_handler(ctx) await self.receiving_items_handler(ctx)
await self.goal_checker(ctx) await self.goal_checker(ctx)

View File

@@ -42,13 +42,14 @@ class Missionsanity(Choice):
class ExcludeEnvironments(OptionSet): class ExcludeEnvironments(OptionSet):
""" """
Allows entire environments to be an excluded location to ensure you are not logically required to enter the environment along Allows entire environments to be an excluded location to ensure you are not logically required to enter the environment along
with any and all checks that are in that environment too. WARNING: Excluding too many environments may cause generation to fail. with any and all checks that are in that environment too.
WARNING: Excluding too many environments may cause generation to fail.
[NOT IMPLEMENTED] [NOT IMPLEMENTED]
Valid keys: "Whoville", "Who Forest", "Who Dump", "Who Lake", "Post Office", "Clock Tower", "City Hall", Valid keys: "Whoville", "Who Forest", "Who Dump", "Who Lake", "Post Office", "Clock Tower", "City Hall",
"Ski Resort", "Civic Center", "Minefield", "Power Plant", "Generator Building", "Scout's Hut", "Ski Resort", "Civic Center", "Minefield", "Power Plant", "Generator Building", "Scout's Hut",
"North Shore", "Mayor's Villa", "Sleigh Ride" "North Shore", "Mayor's Villa", "Sleigh Ride"
""" """
display_name = "Exclude Environments" display_name = "Exclude Environments"
valid_keys = {"Whoville", "Who Forest", "Who Dump", "Who Lake", "Post Office", "Clock Tower", "City Hall", valid_keys = {"Whoville", "Who Forest", "Who Dump", "Who Lake", "Post Office", "Clock Tower", "City Hall",
@@ -68,7 +69,8 @@ class Supadow(Toggle):
class Gifts(Range): class Gifts(Range):
""" """
Considers how many gifts must be squashed per check. Considers how many gifts must be squashed per check.
Enabling this will also enable squashing all gifts in a region mission along side this. [NOT IMPLEMENTED]""" Enabling this will also enable squashing all gifts in a region mission along side this. [NOT IMPLEMENTED]
"""
display_name = "Gifts Squashed per Check" display_name = "Gifts Squashed per Check"
range_start = 0 range_start = 0
range_end = 300 range_end = 300
@@ -77,13 +79,17 @@ class Gifts(Range):
class GadgetRando(OptionSet): class GadgetRando(OptionSet):
""" """
Randomizes Grinch's gadgets along with randomizing Binoculars into the pool. [NOT IMPLEMENTED] Randomizes Grinch's gadgets along with randomizing Binoculars into the pool. [NOT IMPLEMENTED]
Valid keys: "Binoculars", "Rotten Egg Launcher", "Rocket Spring", "Slime Shooter", "Octopus Climbing Device",
"Marine Mobile", "Grinch Copter"
""" """
display_name = "Gadgets Randomized" display_name = "Gadgets Randomized"
valid_keys = {"Binoculars", "Rotten Egg Launcher", "Rocket Spring", "Slime Shooter", "Octopus Climbing Device", default = [
"Marine Mobile", "Grinch Copter"} "Binoculars",
"Rotten Egg Launcher",
"Rocket Spring",
"Slime Shooter",
"Octopus Climbing Device",
"Marine Mobile",
"Grinch Copter"
]
class Moverando(OptionSet): class Moverando(OptionSet):
"""Randomizes Grinch's moveset along with randomizing max into the pool. [NOT IMPLEMENTED] """Randomizes Grinch's moveset along with randomizing max into the pool. [NOT IMPLEMENTED]
@@ -91,7 +97,13 @@ class Moverando(OptionSet):
Valid keys: "Pancake", "Seize", "Max", "Bad Breath", "Sneak" Valid keys: "Pancake", "Seize", "Max", "Bad Breath", "Sneak"
""" """
display_name = "Moves Randomized" display_name = "Moves Randomized"
valid_keys = {"Pancake", "Seize", "Max", "Bad Breath", "Sneak"} default = [
"Pancake",
"Seize",
"Max",
"Bad Breath",
"Sneak"
]
class UnlimitedEggs(Toggle): class UnlimitedEggs(Toggle):
"""Determine whether or not you run out of rotten eggs when you utilize your gadgets.""" """Determine whether or not you run out of rotten eggs when you utilize your gadgets."""
@@ -114,6 +126,7 @@ class GrinchOptions(PerGameCommonOptions):#DeathLinkMixin
progressive_gadget: ProgressiveGadget progressive_gadget: ProgressiveGadget
supadow_minigames: Supadow supadow_minigames: Supadow
giftsanity: Gifts giftsanity: Gifts
gadget_rando: GadgetRando
move_rando: Moverando move_rando: Moverando
unlimited_eggs: UnlimitedEggs unlimited_eggs: UnlimitedEggs
ring_link: RingLinkOption ring_link: RingLinkOption

View File

@@ -479,7 +479,7 @@ rules_dict: dict[str,list[list[str]]] = {
[] []
], ],
"WV - Exhaust Pipes": [ "WV - Exhaust Pipes": [
[REL] [WV, REL]
], ],
"WF - Skis": [ "WF - Skis": [
[WF] [WF]

View File

@@ -8,7 +8,7 @@ from .Client import *
from typing import ClassVar from typing import ClassVar
from worlds.AutoWorld import World from worlds.AutoWorld import World
import Options from Options import OptionError
from .Options import GrinchOptions from .Options import GrinchOptions
from .Rules import access_rules_dict from .Rules import access_rules_dict
@@ -31,7 +31,7 @@ class GrinchWorld(World):
def generate_early(self) -> None: #Special conditions changed before generation occurs def generate_early(self) -> None: #Special conditions changed before generation occurs
if self.options.ring_link == 1 and self.options.unlimited_eggs == 1: if self.options.ring_link == 1 and self.options.unlimited_eggs == 1:
raise Options.OptionError("Cannot enable both unlimited rotten eggs and ring links. You can only enable one of these at a time."+ raise OptionError("Cannot enable both unlimited rotten eggs and ring links. You can only enable one of these at a time." +
f"The following player's YAML needs to be fixed: {self.player_name}") f"The following player's YAML needs to be fixed: {self.player_name}")