Compare commits
191 Commits
main
...
artamis-mo
| Author | SHA1 | Date | |
|---|---|---|---|
| d0a8df25f6 | |||
|
|
6f552949fa | ||
|
|
ca1eb82ce1 | ||
|
|
414a155323 | ||
|
|
b9d8d9174f | ||
|
|
8e58f9662e | ||
|
|
6f4597398f | ||
|
|
5e71874446 | ||
|
|
1870dd24ba | ||
|
|
f70b6c4c9c | ||
|
|
79d4d5b10b | ||
|
|
7fea34adc3 | ||
|
|
a3f9e6cbc9 | ||
|
|
bccc83f864 | ||
|
|
6409721841 | ||
|
|
d3a7b014bd | ||
|
|
3ec8631203 | ||
|
|
2081912a39 | ||
|
|
67bbde2556 | ||
|
|
0503c2ead3 | ||
|
|
7a642cc1a9 | ||
|
|
eb8d44e975 | ||
|
|
1f35f5fa93 | ||
|
|
6bc819f4bc | ||
|
|
bb0c5f5b9a | ||
|
|
0e397c7079 | ||
|
|
2572a25089 | ||
|
|
dcdf168618 | ||
|
|
8a8136a267 | ||
|
|
5f158497f9 | ||
|
|
bc74e67e07 | ||
|
|
dbc592dad0 | ||
|
|
afe1345e34 | ||
|
|
410df2a948 | ||
|
|
7c6eada7b2 | ||
|
|
8e1217d1a5 | ||
|
|
5615277705 | ||
|
|
2de0f9d766 | ||
|
|
4da88cf794 | ||
|
|
e2cc1b5de7 | ||
|
|
103a6f79d1 | ||
|
|
17861c1050 | ||
|
|
a63c33a711 | ||
|
|
c84ef117c8 | ||
|
|
834096f282 | ||
|
|
0a31d96ee4 | ||
|
|
3edb733dcb | ||
|
|
9c01cc31e0 | ||
|
|
ea8262855e | ||
|
|
98ea11887e | ||
|
|
18aefcd3f2 | ||
|
|
3a13332533 | ||
|
|
c279ef7bc6 | ||
|
|
55ef0cc8c9 | ||
|
|
babc4f441c | ||
|
|
92d932da55 | ||
|
|
b1b65a3adf | ||
|
|
d6f5e87ccf | ||
|
|
079239ea70 | ||
|
|
93bac29e8c | ||
|
|
c9fea29d92 | ||
|
|
e17895902e | ||
|
|
1596550111 | ||
|
|
c888e17845 | ||
|
|
3dee611b51 | ||
|
|
d6c7a04316 | ||
|
|
900c8a519a | ||
|
|
43acc9f003 | ||
|
|
96eb8fcd9a | ||
|
|
d4bd682ac9 | ||
|
|
61d4783f61 | ||
|
|
00fff466ff | ||
|
|
d8483bef6e | ||
|
|
56a198fcfd | ||
|
|
4e362dc722 | ||
|
|
cfcfc9ecfd | ||
|
|
a3a415adfd | ||
|
|
14c95aa85b | ||
|
|
8d941dad6f | ||
|
|
8628f6637a | ||
|
|
17b7914c35 | ||
|
|
b8dfd5ce4c | ||
|
|
b3749b7fe3 | ||
|
|
3aaf625282 | ||
|
|
9df2360b8b | ||
|
|
d61ac9a135 | ||
|
|
c8fc56d7c4 | ||
|
|
51aad167cc | ||
|
|
e2def66522 | ||
|
|
73e9d9d577 | ||
|
|
a5d7ff65c1 | ||
|
|
05bf60abf7 | ||
|
|
7f627e2c07 | ||
|
|
19e0fe1286 | ||
|
|
b390974019 | ||
|
|
9da65fab09 | ||
|
|
02d2eab5a4 | ||
|
|
985c8b681b | ||
|
|
cf5a4012c0 | ||
|
|
c59e75ef7b | ||
|
|
2dbe344348 | ||
|
|
90ba4fbda7 | ||
|
|
8ff2fb91d4 | ||
|
|
ee1190cf12 | ||
|
|
b7315a9991 | ||
|
|
e76dd67ff6 | ||
|
|
a16de9da0a | ||
|
|
af0527f9a6 | ||
|
|
04bb867805 | ||
|
|
5cfbf84519 | ||
|
|
a00cd0212a | ||
|
|
61885767d5 | ||
|
|
b0619d5751 | ||
|
|
769ab01d19 | ||
|
|
b918d96294 | ||
|
|
dc76761fc8 | ||
|
|
c48bca965e | ||
|
|
0e294f53ec | ||
|
|
cf7f16d36b | ||
|
|
78bc54d227 | ||
|
|
30fd16bdb8 | ||
|
|
95fb26f20c | ||
|
|
8c07ca8c81 | ||
|
|
fc31e2f442 | ||
|
|
bfca1df83c | ||
|
|
41e55b169f | ||
|
|
e8e9c76eda | ||
|
|
ff9c7480db | ||
|
|
5444ea7061 | ||
|
|
069355778d | ||
|
|
9a6f6f7a75 | ||
|
|
7105187ad3 | ||
|
|
98b971a659 | ||
|
|
e6430b2f86 | ||
|
|
4a6f4fce4f | ||
|
|
837e651d7b | ||
|
|
4d1d728db1 | ||
|
|
3dc4802be7 | ||
|
|
08e9df66de | ||
|
|
14d7bdba15 | ||
|
|
5eaf551584 | ||
|
|
e941e8bdbf | ||
|
|
659ae21fa7 | ||
|
|
032dd8712e | ||
|
|
5caacaac87 | ||
|
|
95e80227e1 | ||
|
|
dced197dc4 | ||
|
|
3549e55c59 | ||
|
|
24d1b96b9e | ||
|
|
76b4ff2a6e | ||
|
|
d9e300e0fd | ||
|
|
98e2486292 | ||
|
|
044fdaa717 | ||
|
|
922232264d | ||
|
|
92dafd0a73 | ||
|
|
a010080371 | ||
|
|
849691b009 | ||
|
|
912c4db021 | ||
|
|
d91ade58ee | ||
|
|
90d02672b5 | ||
|
|
8ba0bbc73a | ||
|
|
59e4a6c1e3 | ||
|
|
a2b1f885a5 | ||
|
|
ceec3ed28b | ||
|
|
7ad1211960 | ||
|
|
3b7a6554ac | ||
|
|
a49921392b | ||
|
|
f71038d17c | ||
|
|
ea4f03118b | ||
|
|
54d99f5b54 | ||
|
|
f38a5fbadd | ||
|
|
4123961e81 | ||
|
|
30f800f648 | ||
|
|
2c5cb791a6 | ||
|
|
397693c8a8 | ||
|
|
3541e13f21 | ||
|
|
0f2851e1b3 | ||
|
|
b0a9831082 | ||
|
|
cf921a8f54 | ||
|
|
b622953cd0 | ||
|
|
64cca7fff9 | ||
|
|
1762fefba9 | ||
|
|
7e06efb1d0 | ||
|
|
c3ddce5b1a | ||
|
|
3c622eefe4 | ||
|
|
17aebc940a | ||
|
|
110da2b524 | ||
|
|
10fa86d52c | ||
|
|
bede861e3d | ||
|
|
694ba4c9bb | ||
|
|
a7d5d45d14 |
@@ -1,6 +1,7 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Archipelago Unittests" type="tests" factoryName="Unittests">
|
||||
<module name="Archipelago" />
|
||||
<module name="Grinch-AP" />
|
||||
<option name="ENV_FILES" value="" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<option name="SDK_HOME" value="" />
|
||||
|
||||
685
worlds/grinch/Client.py
Normal file
685
worlds/grinch/Client.py
Normal file
@@ -0,0 +1,685 @@
|
||||
import time
|
||||
from typing import TYPE_CHECKING, Sequence
|
||||
import asyncio
|
||||
import NetUtils
|
||||
import copy
|
||||
import uuid
|
||||
import Utils
|
||||
from .Locations import grinch_locations, GrinchLocation
|
||||
from .Items import (
|
||||
ALL_ITEMS_TABLE,
|
||||
MISSION_ITEMS_TABLE,
|
||||
GADGETS_TABLE,
|
||||
KEYS_TABLE,
|
||||
GrinchItemData,
|
||||
) # , SLEIGH_PARTS_TABLE
|
||||
import worlds._bizhawk as bizhawk
|
||||
from worlds._bizhawk.client import BizHawkClient
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from worlds._bizhawk.context import BizHawkClientContext
|
||||
from CommonClient import logger
|
||||
|
||||
|
||||
# Stores received index of last item received in PS1 memory card save data
|
||||
# By storing this index, it will remember the last item received and prevent item duplication loops
|
||||
RECV_ITEM_ADDR = 0x010068
|
||||
RECV_ITEM_BITSIZE = 4
|
||||
|
||||
# Maximum number of times we check if we are in demo mode or not
|
||||
MAX_DEMO_MODE_CHECK = 30
|
||||
|
||||
# List of Menu Map IDs
|
||||
MENU_MAP_IDS: list[int] = [0x00, 0x02, 0x35, 0x36, 0x37]
|
||||
|
||||
MAX_EGGS: int = 200
|
||||
EGG_COUNT_ADDR: int = 0x010058
|
||||
EGG_ADDR_BYTESIZE: int = 2
|
||||
|
||||
|
||||
class GrinchClient(BizHawkClient):
|
||||
game = "The Grinch"
|
||||
system = "PSX"
|
||||
patch_suffix = ".apgrinch"
|
||||
items_handling = 0b111
|
||||
demo_mode_buffer: int = 0
|
||||
last_map_location: int = -1
|
||||
ingame_log: bool = False
|
||||
previous_egg_count: int = 0
|
||||
send_ring_link: bool = False
|
||||
unique_client_id: int = 0
|
||||
ring_link_enabled = False
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.last_received_index = 0
|
||||
self.loading_bios_msg = False
|
||||
self.loc_unlimited_eggs = False
|
||||
self.unique_client_id = 0
|
||||
|
||||
async def validate_rom(self, ctx: "BizHawkClientContext") -> bool:
|
||||
from CommonClient import logger
|
||||
|
||||
# TODO Check the ROM data to see if it matches against bytes expected
|
||||
grinch_identifier_ram_address: int = 0x00928C
|
||||
bios_identifier_ram_address: int = 0x097F30
|
||||
|
||||
try:
|
||||
bytes_actual: bytes = (
|
||||
await bizhawk.read(
|
||||
ctx.bizhawk_ctx, [(grinch_identifier_ram_address, 11, "MainRAM")]
|
||||
)
|
||||
)[0]
|
||||
|
||||
psx_rom_name = bytes_actual.decode("ascii")
|
||||
if psx_rom_name != "SLUS_011.97":
|
||||
bios_bytes_check: bytes = (
|
||||
await bizhawk.read(
|
||||
ctx.bizhawk_ctx, [(bios_identifier_ram_address, 24, "MainRAM")]
|
||||
)
|
||||
)[0]
|
||||
|
||||
if "System ROM Version" in bios_bytes_check.decode("ascii"):
|
||||
if not self.loading_bios_msg:
|
||||
self.loading_bios_msg = True
|
||||
logger.error(
|
||||
"BIOS is currently loading. Will wait up to 5 seconds before retrying."
|
||||
)
|
||||
|
||||
return False
|
||||
|
||||
logger.error(
|
||||
"Invalid rom detected. You are not playing Grinch USA Version."
|
||||
)
|
||||
raise Exception(
|
||||
"Invalid rom detected. You are not playing Grinch USA Version."
|
||||
)
|
||||
|
||||
ctx.command_processor.commands["ringlink"] = _cmd_ringlink
|
||||
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
ctx.game = self.game
|
||||
ctx.items_handling = self.items_handling
|
||||
ctx.want_slot_data = True
|
||||
ctx.watcher_timeout = 0.125
|
||||
self.loading_bios_msg = False
|
||||
|
||||
return True
|
||||
|
||||
def on_package(self, ctx: "BizHawkClientContext", cmd: str, args: dict) -> None:
|
||||
from CommonClient import logger
|
||||
|
||||
super().on_package(ctx, cmd, args)
|
||||
|
||||
match cmd:
|
||||
case "Connected": # On Connect
|
||||
self.loc_unlimited_eggs = bool(ctx.slot_data["give_unlimited_eggs"])
|
||||
self.unique_client_id = self._get_uuid()
|
||||
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."
|
||||
)
|
||||
|
||||
self.ring_link_enabled = bool(ctx.slot_data["ring_link"])
|
||||
|
||||
tags = copy.deepcopy(ctx.tags)
|
||||
|
||||
if self.ring_link_enabled:
|
||||
ctx.tags.add("RingLink")
|
||||
|
||||
else:
|
||||
ctx.tags -= {"RingLink"}
|
||||
|
||||
if tags != ctx.tags:
|
||||
Utils.async_start(
|
||||
ctx.send_msgs([{"cmd": "ConnectUpdate", "tags": ctx.tags}]),
|
||||
"Update RingLink Tags",
|
||||
)
|
||||
|
||||
case "Bounced":
|
||||
if "tags" not in args:
|
||||
return
|
||||
|
||||
if (
|
||||
"RingLink" in ctx.tags
|
||||
and "RingLink" in args["tags"]
|
||||
and args["data"]["source"] != self.unique_client_id
|
||||
):
|
||||
Utils.async_start(
|
||||
self.ring_link_input(args["data"]["amount"], ctx), "SyncEggs"
|
||||
)
|
||||
|
||||
async def set_auth(self, ctx: "BizHawkClientContext") -> None:
|
||||
await ctx.get_username()
|
||||
|
||||
async def game_watcher(self, ctx: "BizHawkClientContext") -> None:
|
||||
from CommonClient import logger
|
||||
|
||||
# If the player is not connected to an AP Server, or their connection was disconnected.
|
||||
if not ctx.slot:
|
||||
return
|
||||
|
||||
try:
|
||||
if not await self.ingame_checker(ctx):
|
||||
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.receiving_items_handler(ctx)
|
||||
await self.goal_checker(ctx)
|
||||
await self.option_handler(ctx)
|
||||
await self.constant_address_update(ctx)
|
||||
|
||||
except bizhawk.RequestFailedError as ex:
|
||||
# The connector didn't respond. Exit handler and return to main loop to reconnect
|
||||
logger.error(
|
||||
"Failure to connect / authenticate the grinch. Error details: "
|
||||
+ str(ex)
|
||||
)
|
||||
pass
|
||||
|
||||
except Exception as genericEx:
|
||||
# For all other errors, catch this and let the client gracefully disconnect
|
||||
logger.error(
|
||||
"Unknown error occurred while playing the grinch. Error details: "
|
||||
+ str(genericEx)
|
||||
)
|
||||
await ctx.disconnect(False)
|
||||
pass
|
||||
|
||||
async def location_checker(self, ctx: "BizHawkClientContext"):
|
||||
from CommonClient import logger
|
||||
|
||||
# Update the AP Server to know what locations are not checked yet.
|
||||
local_locations_checked: list[int] = []
|
||||
addr_list_to_read: list[tuple[int, int, str]] = []
|
||||
local_ap_locations: set[int] = copy.deepcopy(ctx.missing_locations)
|
||||
|
||||
# Loop through the first time of everything left to create the list of RAM addresses to read / monitor.
|
||||
for missing_location in local_ap_locations:
|
||||
grinch_loc_name = ctx.location_names.lookup_in_game(missing_location)
|
||||
grinch_loc_ram_data = grinch_locations[grinch_loc_name]
|
||||
missing_addr_list: list[tuple[int, int, str]] = [
|
||||
(read_addr.ram_address, read_addr.byte_size, "MainRAM")
|
||||
for read_addr in grinch_loc_ram_data.update_ram_addr
|
||||
]
|
||||
addr_list_to_read = [*addr_list_to_read, *missing_addr_list]
|
||||
|
||||
returned_bytes: list[bytes] = await bizhawk.read(
|
||||
ctx.bizhawk_ctx, addr_list_to_read
|
||||
)
|
||||
|
||||
# Now loop through everything again and this time get the byte value from the above read, convert to int,
|
||||
# and check to see if that ram address has our expected value.
|
||||
for missing_location in local_ap_locations:
|
||||
# Missing location is the AP ID & we need to convert it back to a location name within our game.
|
||||
# Using the location name, we can then get the Grinch ram data from there.
|
||||
grinch_loc_name = ctx.location_names.lookup_in_game(missing_location)
|
||||
grinch_loc_ram_data = grinch_locations[grinch_loc_name]
|
||||
|
||||
# Grinch ram data may have more than one address to update, so we are going to loop through all addresses in a location
|
||||
# We use a list here to keep track of all our checks. If they are all true, then and only then do we mark that location as checked.
|
||||
ram_checked_list: list[bool] = []
|
||||
|
||||
for addr_to_update in grinch_loc_ram_data.update_ram_addr:
|
||||
is_binary = True if not addr_to_update.binary_bit_pos is None else False
|
||||
orig_index: int = addr_list_to_read.index(
|
||||
(addr_to_update.ram_address, addr_to_update.byte_size, "MainRAM")
|
||||
)
|
||||
value_read_from_bizhawk: int = int.from_bytes(
|
||||
returned_bytes[orig_index], "little"
|
||||
)
|
||||
|
||||
if is_binary:
|
||||
ram_checked_list.append(
|
||||
(value_read_from_bizhawk & (1 << addr_to_update.binary_bit_pos))
|
||||
> 0
|
||||
)
|
||||
|
||||
else:
|
||||
expected_int_value = addr_to_update.value
|
||||
ram_checked_list.append(
|
||||
expected_int_value == value_read_from_bizhawk
|
||||
)
|
||||
|
||||
if all(ram_checked_list):
|
||||
local_locations_checked.append(
|
||||
GrinchLocation.get_apid(grinch_loc_ram_data.id)
|
||||
)
|
||||
|
||||
# Update the AP server with the locally checked list of locations (In other words, locations I found in Grinch)
|
||||
locations_sent_to_ap: set[int] = await ctx.check_locations(
|
||||
local_locations_checked
|
||||
)
|
||||
|
||||
if len(locations_sent_to_ap) > 0:
|
||||
await self.remove_physical_items(ctx)
|
||||
|
||||
ctx.locations_checked = set(local_locations_checked)
|
||||
|
||||
async def receiving_items_handler(self, ctx: "BizHawkClientContext"):
|
||||
# Len will give us the size of the items received list & we will track that against how many items we received already
|
||||
# If the list says that we have 3 items and we already received items, we will ignore and continue.
|
||||
# Otherwise, we will get the new items and give them to the player.
|
||||
|
||||
self.last_received_index = int.from_bytes(
|
||||
(
|
||||
await bizhawk.read(
|
||||
ctx.bizhawk_ctx, [(RECV_ITEM_ADDR, RECV_ITEM_BITSIZE, "MainRAM")]
|
||||
)
|
||||
)[0],
|
||||
"little",
|
||||
)
|
||||
|
||||
if len(ctx.items_received) == self.last_received_index:
|
||||
return
|
||||
|
||||
# Ensures we only get the new items that we want to give the player
|
||||
new_items_only = ctx.items_received[self.last_received_index :]
|
||||
ram_addr_dict: dict[int, list[int]] = {}
|
||||
|
||||
for item_received in new_items_only:
|
||||
local_item = ctx.item_names.lookup_in_game(item_received.item)
|
||||
grinch_item_ram_data = ALL_ITEMS_TABLE[local_item]
|
||||
|
||||
for addr_to_update in grinch_item_ram_data.update_ram_addr:
|
||||
is_binary = True if not addr_to_update.binary_bit_pos is None else False
|
||||
|
||||
if addr_to_update.ram_address in ram_addr_dict.keys():
|
||||
current_ram_address_value = ram_addr_dict[
|
||||
addr_to_update.ram_address
|
||||
][0]
|
||||
else:
|
||||
current_ram_address_value = int.from_bytes(
|
||||
(
|
||||
await bizhawk.read(
|
||||
ctx.bizhawk_ctx,
|
||||
[
|
||||
(
|
||||
addr_to_update.ram_address,
|
||||
addr_to_update.byte_size,
|
||||
"MainRAM",
|
||||
)
|
||||
],
|
||||
)
|
||||
)[0],
|
||||
"little",
|
||||
)
|
||||
|
||||
if is_binary:
|
||||
current_ram_address_value = current_ram_address_value | (
|
||||
1 << addr_to_update.binary_bit_pos
|
||||
)
|
||||
|
||||
elif addr_to_update.update_existing_value:
|
||||
# Grabs minimum value of a list of numbers and makes sure it does not go above max count possible
|
||||
current_ram_address_value += addr_to_update.value
|
||||
current_ram_address_value = min(
|
||||
current_ram_address_value, addr_to_update.max_count
|
||||
)
|
||||
|
||||
else:
|
||||
current_ram_address_value = addr_to_update.value
|
||||
|
||||
# Write the updated value back into RAM
|
||||
ram_addr_dict[addr_to_update.ram_address] = [
|
||||
current_ram_address_value,
|
||||
addr_to_update.byte_size,
|
||||
]
|
||||
|
||||
self.last_received_index += 1
|
||||
|
||||
# Update the latest received item index to ram as well.
|
||||
ram_addr_dict[RECV_ITEM_ADDR] = [self.last_received_index, RECV_ITEM_BITSIZE]
|
||||
|
||||
await bizhawk.write(
|
||||
ctx.bizhawk_ctx, self.convert_dict_to_ram_list(ram_addr_dict)
|
||||
)
|
||||
|
||||
async def goal_checker(self, ctx: "BizHawkClientContext"):
|
||||
if not ctx.finished_game:
|
||||
goal_loc = grinch_locations["MC - Sleigh Ride - Neutralizing Santa"]
|
||||
goal_ram_address = goal_loc.update_ram_addr[0]
|
||||
current_ram_address_value = int.from_bytes(
|
||||
(
|
||||
await bizhawk.read(
|
||||
ctx.bizhawk_ctx,
|
||||
[
|
||||
(
|
||||
goal_ram_address.ram_address,
|
||||
goal_ram_address.byte_size,
|
||||
"MainRAM",
|
||||
)
|
||||
],
|
||||
)
|
||||
)[0],
|
||||
"little",
|
||||
)
|
||||
|
||||
if (current_ram_address_value & (1 << goal_ram_address.binary_bit_pos)) > 0:
|
||||
# if current_ram_address_value == goal_ram_address.value:
|
||||
ctx.finished_game = True
|
||||
await ctx.send_msgs(
|
||||
[
|
||||
{
|
||||
"cmd": "StatusUpdate",
|
||||
"status": NetUtils.ClientStatus.CLIENT_GOAL,
|
||||
}
|
||||
]
|
||||
)
|
||||
|
||||
# This function's entire purpose is to take away items we physically received ingame, but have not received from AP
|
||||
async def remove_physical_items(self, ctx: "BizHawkClientContext"):
|
||||
ram_addr_dict: dict[int, list[int]] = {}
|
||||
|
||||
list_recv_itemids: list[int] = [netItem.item for netItem in ctx.items_received]
|
||||
items_to_check: dict[str, GrinchItemData] = {
|
||||
**GADGETS_TABLE
|
||||
} # , **SLEIGH_PARTS_TABLE
|
||||
heart_count = len(
|
||||
list(item_id for item_id in list_recv_itemids if item_id == 42570)
|
||||
)
|
||||
heart_item_data = ALL_ITEMS_TABLE["Heart of Stone"]
|
||||
ram_addr_dict[heart_item_data.update_ram_addr[0].ram_address] = [
|
||||
min(heart_count, 4),
|
||||
1,
|
||||
]
|
||||
|
||||
# Setting mission count for all accesses back to 0 to prevent warping/unlocking after completing 3 missions
|
||||
ram_addr_dict[0x0100F0] = [0, 4]
|
||||
|
||||
for item_name, item_data in items_to_check.items():
|
||||
# If item is an event or already been received, ignore.
|
||||
if (
|
||||
item_data.id is None
|
||||
or GrinchLocation.get_apid(item_data.id) in list_recv_itemids
|
||||
):
|
||||
continue
|
||||
|
||||
# This assumes we don't have the item so we must set all the data to 0
|
||||
for addr_to_update in item_data.update_ram_addr:
|
||||
is_binary = True if not addr_to_update.binary_bit_pos is None else False
|
||||
|
||||
if is_binary:
|
||||
if addr_to_update.ram_address in ram_addr_dict.keys():
|
||||
current_bin_value = ram_addr_dict[addr_to_update.ram_address][0]
|
||||
|
||||
else:
|
||||
current_bin_value = int.from_bytes(
|
||||
(
|
||||
await bizhawk.read(
|
||||
ctx.bizhawk_ctx,
|
||||
[
|
||||
(
|
||||
addr_to_update.ram_address,
|
||||
addr_to_update.byte_size,
|
||||
"MainRAM",
|
||||
)
|
||||
],
|
||||
)
|
||||
)[0],
|
||||
"little",
|
||||
)
|
||||
current_bin_value &= ~(1 << addr_to_update.binary_bit_pos)
|
||||
ram_addr_dict[addr_to_update.ram_address] = [current_bin_value, 1]
|
||||
|
||||
else:
|
||||
ram_addr_dict[addr_to_update.ram_address] = [
|
||||
0,
|
||||
addr_to_update.byte_size,
|
||||
]
|
||||
|
||||
await bizhawk.write(
|
||||
ctx.bizhawk_ctx, self.convert_dict_to_ram_list(ram_addr_dict)
|
||||
)
|
||||
|
||||
def convert_dict_to_ram_list(
|
||||
self, addr_dict: dict[int, list[int]]
|
||||
) -> list[tuple[int, Sequence[int], str]]:
|
||||
addr_list_to_update: list[tuple[int, Sequence[int], str]] = []
|
||||
|
||||
for key, val in addr_dict.items():
|
||||
addr_list_to_update.append(
|
||||
(key, val[0].to_bytes(val[1], "little"), "MainRAM")
|
||||
)
|
||||
|
||||
return addr_list_to_update
|
||||
|
||||
# Removes the regional access until you actually received it from AP.
|
||||
async def constant_address_update(self, ctx: "BizHawkClientContext"):
|
||||
ram_addr_dict: dict[int, list[int]] = {}
|
||||
|
||||
list_recv_itemids: list[int] = [netItem.item for netItem in ctx.items_received]
|
||||
items_to_check: dict[str, GrinchItemData] = {
|
||||
**KEYS_TABLE,
|
||||
**MISSION_ITEMS_TABLE,
|
||||
}
|
||||
|
||||
for item_name, item_data in items_to_check.items():
|
||||
# If item is an event or already been received, ignore.
|
||||
if (
|
||||
item_data.id is None
|
||||
): # or GrinchLocation.get_apid(item_data.id) in list_recv_itemids:
|
||||
continue
|
||||
|
||||
# This will either constantly update the item to ensure you still have it or take it away if you don't deserve it
|
||||
for addr_to_update in item_data.update_ram_addr:
|
||||
is_binary = True if not addr_to_update.binary_bit_pos is None else False
|
||||
|
||||
if is_binary:
|
||||
if addr_to_update.ram_address in ram_addr_dict.keys():
|
||||
current_bin_value = ram_addr_dict[addr_to_update.ram_address][0]
|
||||
|
||||
else:
|
||||
current_bin_value = int.from_bytes(
|
||||
(
|
||||
await bizhawk.read(
|
||||
ctx.bizhawk_ctx,
|
||||
[
|
||||
(
|
||||
addr_to_update.ram_address,
|
||||
addr_to_update.byte_size,
|
||||
"MainRAM",
|
||||
)
|
||||
],
|
||||
)
|
||||
)[0],
|
||||
"little",
|
||||
)
|
||||
|
||||
if GrinchLocation.get_apid(item_data.id) in list_recv_itemids:
|
||||
current_bin_value |= 1 << addr_to_update.binary_bit_pos
|
||||
|
||||
else:
|
||||
current_bin_value &= ~(1 << addr_to_update.binary_bit_pos)
|
||||
|
||||
ram_addr_dict[addr_to_update.ram_address] = [current_bin_value, 1]
|
||||
|
||||
else:
|
||||
if GrinchLocation.get_apid(item_data.id) in list_recv_itemids:
|
||||
ram_addr_dict[addr_to_update.ram_address] = [
|
||||
addr_to_update.value,
|
||||
addr_to_update.byte_size,
|
||||
]
|
||||
|
||||
else:
|
||||
ram_addr_dict[addr_to_update.ram_address] = [
|
||||
0,
|
||||
addr_to_update.byte_size,
|
||||
]
|
||||
|
||||
await bizhawk.write(
|
||||
ctx.bizhawk_ctx, self.convert_dict_to_ram_list(ram_addr_dict)
|
||||
)
|
||||
|
||||
async def ingame_checker(self, ctx: "BizHawkClientContext"):
|
||||
from CommonClient import logger
|
||||
|
||||
ingame_map_id = int.from_bytes(
|
||||
(await bizhawk.read(ctx.bizhawk_ctx, [(0x010000, 1, "MainRAM")]))[0],
|
||||
"little",
|
||||
)
|
||||
initial_cutscene_checker = int.from_bytes(
|
||||
(await bizhawk.read(ctx.bizhawk_ctx, [(0x010094, 1, "MainRAM")]))[0],
|
||||
"little",
|
||||
)
|
||||
|
||||
# If not in game or at a menu, or loading the publisher logos
|
||||
if ingame_map_id <= 0x04 or ingame_map_id >= 0x35:
|
||||
self.ingame_log = False
|
||||
return False
|
||||
|
||||
# If grinch has changed maps
|
||||
if not ingame_map_id == self.last_map_location:
|
||||
# If the last "map" we were on was a menu or a publisher logo
|
||||
if self.last_map_location in MENU_MAP_IDS:
|
||||
# Reset our demo mode checker just in case the game is in demo mode.
|
||||
self.demo_mode_buffer = 0
|
||||
self.ingame_log = False
|
||||
|
||||
if initial_cutscene_checker != 1:
|
||||
return False
|
||||
|
||||
# Update the previous map we were on to be the current map.
|
||||
self.last_map_location = ingame_map_id
|
||||
|
||||
# Use this as a delayed check to make sure we are in game
|
||||
if not self.demo_mode_buffer == MAX_DEMO_MODE_CHECK:
|
||||
await asyncio.sleep(0.1)
|
||||
self.demo_mode_buffer += 1
|
||||
return False
|
||||
|
||||
demo_mode = int.from_bytes(
|
||||
(await bizhawk.read(ctx.bizhawk_ctx, [(0x01008A, 1, "MainRAM")]))[0],
|
||||
"little",
|
||||
)
|
||||
|
||||
if demo_mode == 1:
|
||||
return False
|
||||
|
||||
if not self.ingame_log:
|
||||
logger.info("You can now start sending locations from the Grinch!")
|
||||
self.ingame_log = True
|
||||
|
||||
return True
|
||||
|
||||
async def option_handler(self, ctx: "BizHawkClientContext"):
|
||||
if self.loc_unlimited_eggs:
|
||||
await bizhawk.write(
|
||||
ctx.bizhawk_ctx,
|
||||
[(EGG_COUNT_ADDR, MAX_EGGS.to_bytes(2, "little"), "MainRAM")],
|
||||
)
|
||||
|
||||
async def ring_link_output(self, ctx: "BizHawkClientContext"):
|
||||
from CommonClient import logger
|
||||
|
||||
while self.send_ring_link and ctx.slot:
|
||||
|
||||
try:
|
||||
current_egg_count = int.from_bytes(
|
||||
(
|
||||
await bizhawk.read(
|
||||
ctx.bizhawk_ctx,
|
||||
[(EGG_COUNT_ADDR, EGG_ADDR_BYTESIZE, "MainRAM")],
|
||||
)
|
||||
)[0],
|
||||
"little",
|
||||
)
|
||||
|
||||
if (current_egg_count - self.previous_egg_count) != 0:
|
||||
msg = {
|
||||
"cmd": "Bounce",
|
||||
"data": {
|
||||
"time": time.time(),
|
||||
"source": self.unique_client_id,
|
||||
"amount": current_egg_count - self.previous_egg_count,
|
||||
},
|
||||
"tags": ["RingLink"],
|
||||
}
|
||||
await ctx.send_msgs([msg])
|
||||
self.previous_egg_count = current_egg_count
|
||||
# logger.info(f"RingLink: You sent {str(current_egg_count - self.previous_egg_count)} rotten eggs.")
|
||||
|
||||
await asyncio.sleep(0.1)
|
||||
|
||||
except Exception as ex:
|
||||
logger.error(
|
||||
"While monitoring grinch's egg count ingame, an error occurred. Details:"
|
||||
+ str(ex)
|
||||
)
|
||||
self.send_ring_link = False
|
||||
|
||||
if not ctx.slot:
|
||||
logger.info(
|
||||
"You must be connected to the multi-world in order for RingLink to work properly."
|
||||
)
|
||||
|
||||
async def ring_link_input(self, egg_amount: int, ctx: "BizHawkClientContext"):
|
||||
from CommonClient import logger
|
||||
|
||||
game_egg_count = int.from_bytes(
|
||||
(
|
||||
await bizhawk.read(
|
||||
ctx.bizhawk_ctx, [(EGG_COUNT_ADDR, EGG_ADDR_BYTESIZE, "MainRAM")]
|
||||
)
|
||||
)[0],
|
||||
"little",
|
||||
)
|
||||
non_neg_eggs = (
|
||||
game_egg_count + egg_amount if game_egg_count + egg_amount > 0 else 0
|
||||
)
|
||||
current_egg_count = min(non_neg_eggs, MAX_EGGS)
|
||||
|
||||
await bizhawk.write(
|
||||
ctx.bizhawk_ctx,
|
||||
[
|
||||
(
|
||||
EGG_COUNT_ADDR,
|
||||
int(current_egg_count).to_bytes(EGG_ADDR_BYTESIZE, "little"),
|
||||
"MainRAM",
|
||||
)
|
||||
],
|
||||
)
|
||||
|
||||
self.previous_egg_count = current_egg_count
|
||||
# logger.info(f"RingLink: You received {str(egg_amount)} rotten eggs.")
|
||||
|
||||
def _get_uuid(self) -> int:
|
||||
string_id = str(uuid.uuid4())
|
||||
uid: int = 0
|
||||
for char in string_id:
|
||||
uid += ord(char)
|
||||
return uid
|
||||
|
||||
|
||||
def _cmd_ringlink(self):
|
||||
"""Toggle ringling from client. Overrides default setting."""
|
||||
if not self.ctx.slot:
|
||||
return
|
||||
|
||||
Utils.async_start(
|
||||
_update_ring_link(self.ctx, not "RingLink" in self.ctx.tags),
|
||||
name="Update RingLink",
|
||||
)
|
||||
|
||||
|
||||
async def _update_ring_link(ctx: "BizHawkClientContext", ring_link: bool):
|
||||
"""Helper function to set Ring Link connection tag on/off and update the connection if already connected."""
|
||||
old_tags = copy.deepcopy(ctx.tags)
|
||||
|
||||
if ring_link:
|
||||
ctx.tags.add("RingLink")
|
||||
|
||||
else:
|
||||
ctx.tags -= {"RingLink"}
|
||||
|
||||
if old_tags != ctx.tags and ctx.server and not ctx.server.socket.closed:
|
||||
await ctx.send_msgs([{"cmd": "ConnectUpdate", "tags": ctx.tags}])
|
||||
609
worlds/grinch/Items.py
Normal file
609
worlds/grinch/Items.py
Normal file
@@ -0,0 +1,609 @@
|
||||
from typing import NamedTuple, Optional
|
||||
|
||||
from .RamHandler import GrinchRamData, UpdateMethod
|
||||
from BaseClasses import Item
|
||||
from BaseClasses import (
|
||||
ItemClassification as IC,
|
||||
) # IC can be any name, saves having to type the whole word in code
|
||||
|
||||
|
||||
class GrinchItemData(NamedTuple):
|
||||
item_group: list[
|
||||
str
|
||||
] # arbituary that can be whatever it can be, basically the field/property for item groups
|
||||
id: Optional[int]
|
||||
classification: IC
|
||||
update_ram_addr: list[GrinchRamData]
|
||||
|
||||
|
||||
class GrinchItem(Item):
|
||||
game: str = "The Grinch"
|
||||
|
||||
# Tells server what item id it is
|
||||
@staticmethod
|
||||
def get_apid(id: int):
|
||||
# If you give me an input id, I will return the Grinch equivalent server/ap id
|
||||
base_id: int = 42069
|
||||
return base_id + id if id is not None else None
|
||||
|
||||
def __init__(self, name: str, player: int, data: GrinchItemData):
|
||||
super(GrinchItem, self).__init__(
|
||||
name, data.classification, GrinchItem.get_apid(data.id), player
|
||||
)
|
||||
|
||||
self.type = data.item_group
|
||||
self.item_id = data.id
|
||||
|
||||
|
||||
# allows hinting of items via category
|
||||
def get_item_names_per_category() -> dict[str, set[str]]:
|
||||
categories: dict[str, set[str]] = {}
|
||||
|
||||
for name, data in ALL_ITEMS_TABLE.items():
|
||||
for group in data.item_group: # iterate over each category
|
||||
categories.setdefault(group, set()).add(name)
|
||||
|
||||
return categories
|
||||
|
||||
|
||||
class grinch_items:
|
||||
class gadgets:
|
||||
BINOCULARS: str = "Binoculars"
|
||||
ROCKET_EGG_LAUNCHER: str = "Rotten Egg Launcher"
|
||||
ROCKET_SPRING: str = "Rocket Spring"
|
||||
SLIME_SHOOTER: str = "Slime Shooter"
|
||||
OCTOPUS_CLIMBING_DEVICE: str = "Octopus Climbing Device"
|
||||
MARINE_MOBILE: str = "Marine Mobile"
|
||||
GRINCH_COPTER: str = "Grinch Copter"
|
||||
|
||||
class keys:
|
||||
WHOVILLE: str = "Whoville Vacuum Tube"
|
||||
WHO_FOREST: str = "Who Forest Vacuum Tube"
|
||||
WHO_DUMP: str = "Who Dump Vacuum Tube"
|
||||
WHO_LAKE: str = "Who Lake Vacuum Tube"
|
||||
PROGRESSIVE_VACUUM_TUBE: str = "Progressive Vacuum Tube"
|
||||
SLEIGH_ROOM_KEY: str = "Sleigh Room Key"
|
||||
|
||||
class moves:
|
||||
PANCAKE: str = "Pancake"
|
||||
BAD_BREATH: str = "Bad Breath"
|
||||
SIEZE: str = "Seize"
|
||||
MAX: str = "Max"
|
||||
SNEAK: str = "Sneak"
|
||||
|
||||
class level_items:
|
||||
WV_WHO_CLOAK: str = "Who Cloak"
|
||||
WV_PAINT_BUCKET: str = "Painting Bucket"
|
||||
WV_HAMMER: str = "Hammer"
|
||||
WV_SCULPTIN_TOOLS: str = "Sculpting Tools"
|
||||
WF_GLUE_BUCKET: str = "Glue Bucket"
|
||||
WF_CABLE_CAR_ACCESS_CARD: str = "Cable Car Access Card"
|
||||
WD_SCISSORS: str = "Scissors"
|
||||
WL_ROPE: str = "Rope"
|
||||
WL_HOOK: str = "Hook"
|
||||
WL_DRILLL: str = "Drill"
|
||||
WL_SCOUT_CLOTHES: str = "Scout Clothes"
|
||||
|
||||
class useful_items:
|
||||
HEART_OF_STONE: str = "Heart of Stone"
|
||||
|
||||
class trap_items:
|
||||
DEPLETION_TRAP: str = "Depletion Trap"
|
||||
DUMP_IT_TO_CRUMPIT: str = "Dump it to Crumpit"
|
||||
WHO_SENT_ME_BACK: str = "Who sent me back?"
|
||||
|
||||
|
||||
class grinch_categories:
|
||||
FILLER: str = "Filler"
|
||||
GADGETS: str = "Gadgets"
|
||||
HEALING_ITEMS: str = "Healing Items"
|
||||
MISSION_SPECIFIC_ITEMS: str = "Mission Specific Items"
|
||||
MOVES: str = "Moves"
|
||||
REQUIRED_ITEM: str = "Required Items"
|
||||
ROTTEN_EGG_BUNDLES: str = "Rotten Egg Bundles"
|
||||
SLEIGH_ROOM: str = "Sleigh Room"
|
||||
TRAPS: str = "Traps"
|
||||
USEFUL_ITEMS: str = "Useful Items"
|
||||
VACUUM_TUBES: str = "Vacuum Tubes"
|
||||
|
||||
|
||||
# Gadgets
|
||||
# All gadgets require at least 4 different blueprints to be unlocked in the computer in Mount Crumpit.
|
||||
GADGETS_TABLE: dict[str, GrinchItemData] = {
|
||||
grinch_items.gadgets.BINOCULARS: GrinchItemData(
|
||||
[grinch_categories.GADGETS],
|
||||
100,
|
||||
IC.useful,
|
||||
[
|
||||
GrinchRamData(0x0102B6, value=0x40),
|
||||
GrinchRamData(0x0102B7, value=0x41),
|
||||
GrinchRamData(0x0102B8, value=0x44),
|
||||
GrinchRamData(0x0102B9, value=0x45),
|
||||
# GrinchRamData(0x0100BC, binary_bit_pos=0)
|
||||
],
|
||||
),
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER: GrinchItemData(
|
||||
[grinch_categories.GADGETS],
|
||||
101,
|
||||
IC.progression,
|
||||
[
|
||||
GrinchRamData(0x0102BA, value=0x40),
|
||||
GrinchRamData(0x0102BB, value=0x41),
|
||||
GrinchRamData(0x0102BC, value=0x44),
|
||||
GrinchRamData(0x0102BD, value=0x45),
|
||||
# GrinchRamData(0x0100BC, binary_bit_pos=1)
|
||||
],
|
||||
),
|
||||
grinch_items.gadgets.ROCKET_SPRING: GrinchItemData(
|
||||
[grinch_categories.GADGETS],
|
||||
102,
|
||||
IC.progression,
|
||||
[
|
||||
GrinchRamData(0x0102BE, value=0x40),
|
||||
GrinchRamData(0x0102BF, value=0x41),
|
||||
GrinchRamData(0x0102C0, value=0x42),
|
||||
GrinchRamData(0x0102C1, value=0x44),
|
||||
GrinchRamData(0x0102C2, value=0x45),
|
||||
GrinchRamData(0x0102C3, value=0x46),
|
||||
GrinchRamData(0x0102C4, value=0x48),
|
||||
GrinchRamData(0x0102C5, value=0x49),
|
||||
GrinchRamData(0x0102C6, value=0x4A),
|
||||
# GrinchRamData(0x0100BC, binary_bit_pos=2)
|
||||
],
|
||||
),
|
||||
grinch_items.gadgets.SLIME_SHOOTER: GrinchItemData(
|
||||
[
|
||||
grinch_categories.GADGETS,
|
||||
"Slime Gun", # For canon --MarioSpore
|
||||
],
|
||||
103,
|
||||
IC.progression,
|
||||
[
|
||||
GrinchRamData(0x0102C7, value=0x40),
|
||||
GrinchRamData(0x0102C8, value=0x41),
|
||||
GrinchRamData(0x0102C9, value=0x42),
|
||||
GrinchRamData(0x0102CA, value=0x44),
|
||||
GrinchRamData(0x0102CB, value=0x45),
|
||||
GrinchRamData(0x0102CC, value=0x46),
|
||||
GrinchRamData(0x0102CD, value=0x48),
|
||||
GrinchRamData(0x0102CE, value=0x49),
|
||||
GrinchRamData(0x0102CF, value=0x4A),
|
||||
# GrinchRamData(0x0100BC, binary_bit_pos=3)
|
||||
],
|
||||
),
|
||||
grinch_items.gadgets.OCTOPUS_CLIMBING_DEVICE: GrinchItemData(
|
||||
[grinch_categories.GADGETS],
|
||||
104,
|
||||
IC.progression,
|
||||
[
|
||||
GrinchRamData(0x0102D0, value=0x40),
|
||||
GrinchRamData(0x0102D1, value=0x41),
|
||||
GrinchRamData(0x0102D2, value=0x42),
|
||||
GrinchRamData(0x0102D3, value=0x44),
|
||||
GrinchRamData(0x0102D4, value=0x45),
|
||||
GrinchRamData(0x0102D5, value=0x46),
|
||||
GrinchRamData(0x0102D6, value=0x48),
|
||||
GrinchRamData(0x0102D7, value=0x49),
|
||||
GrinchRamData(0x0102D8, value=0x4A),
|
||||
# GrinchRamData(0x0100BC, binary_bit_pos=4)
|
||||
],
|
||||
),
|
||||
grinch_items.gadgets.MARINE_MOBILE: GrinchItemData(
|
||||
[grinch_categories.GADGETS],
|
||||
105,
|
||||
IC.progression,
|
||||
[
|
||||
GrinchRamData(0x0102D9, value=0x40),
|
||||
GrinchRamData(0x0102DA, value=0x41),
|
||||
GrinchRamData(0x0102DB, value=0x42),
|
||||
GrinchRamData(0x0102DC, value=0x43),
|
||||
GrinchRamData(0x0102DD, value=0x44),
|
||||
GrinchRamData(0x0102DE, value=0x45),
|
||||
GrinchRamData(0x0102DF, value=0x46),
|
||||
GrinchRamData(0x0102E0, value=0x47),
|
||||
GrinchRamData(0x0102E1, value=0x48),
|
||||
GrinchRamData(0x0102E2, value=0x49),
|
||||
GrinchRamData(0x0102E3, value=0x4A),
|
||||
GrinchRamData(0x0102E4, value=0x4B),
|
||||
GrinchRamData(0x0102E5, value=0x4C),
|
||||
GrinchRamData(0x0102E6, value=0x4D),
|
||||
GrinchRamData(0x0102E7, value=0x4E),
|
||||
GrinchRamData(0x0102E8, value=0x4F),
|
||||
# GrinchRamData(0x0100BC, binary_bit_pos=5)
|
||||
],
|
||||
),
|
||||
grinch_items.gadgets.GRINCH_COPTER: GrinchItemData(
|
||||
[grinch_categories.GADGETS],
|
||||
106,
|
||||
IC.progression,
|
||||
[
|
||||
GrinchRamData(0x0102E9, value=0x40),
|
||||
GrinchRamData(0x0102EA, value=0x41),
|
||||
GrinchRamData(0x0102EB, value=0x42),
|
||||
GrinchRamData(0x0102EC, value=0x43),
|
||||
GrinchRamData(0x0102ED, value=0x44),
|
||||
GrinchRamData(0x0102EE, value=0x45),
|
||||
GrinchRamData(0x0102EF, value=0x46),
|
||||
GrinchRamData(0x0102F0, value=0x47),
|
||||
GrinchRamData(0x0102F1, value=0x48),
|
||||
GrinchRamData(0x0102F2, value=0x49),
|
||||
GrinchRamData(0x0102F3, value=0x4A),
|
||||
GrinchRamData(0x0102F4, value=0x4B),
|
||||
GrinchRamData(0x0102F5, value=0x4C),
|
||||
GrinchRamData(0x0102F6, value=0x4D),
|
||||
GrinchRamData(0x0102F7, value=0x4E),
|
||||
GrinchRamData(0x0102F8, value=0x4F),
|
||||
# GrinchRamData(0x0100BC, binary_bit_pos=6)
|
||||
],
|
||||
),
|
||||
}
|
||||
|
||||
# Mission Specific Items
|
||||
MISSION_ITEMS_TABLE: dict[str, GrinchItemData] = {
|
||||
grinch_items.level_items.WV_WHO_CLOAK: GrinchItemData(
|
||||
[
|
||||
grinch_categories.MISSION_SPECIFIC_ITEMS,
|
||||
grinch_categories.USEFUL_ITEMS,
|
||||
],
|
||||
200,
|
||||
IC.progression,
|
||||
[GrinchRamData(0x0101F9, binary_bit_pos=0)],
|
||||
),
|
||||
grinch_items.level_items.WV_PAINT_BUCKET: GrinchItemData(
|
||||
[
|
||||
grinch_categories.MISSION_SPECIFIC_ITEMS,
|
||||
grinch_categories.USEFUL_ITEMS,
|
||||
],
|
||||
201,
|
||||
IC.progression_deprioritized,
|
||||
[GrinchRamData(0x0101F9, binary_bit_pos=1)],
|
||||
),
|
||||
grinch_items.level_items.WD_SCISSORS: GrinchItemData(
|
||||
[
|
||||
grinch_categories.MISSION_SPECIFIC_ITEMS,
|
||||
grinch_categories.USEFUL_ITEMS,
|
||||
],
|
||||
202,
|
||||
IC.progression_deprioritized,
|
||||
[
|
||||
GrinchRamData(0x0101F9, binary_bit_pos=6),
|
||||
GrinchRamData(0x0100C2, binary_bit_pos=1),
|
||||
],
|
||||
),
|
||||
grinch_items.level_items.WF_GLUE_BUCKET: GrinchItemData(
|
||||
[
|
||||
grinch_categories.MISSION_SPECIFIC_ITEMS,
|
||||
grinch_categories.USEFUL_ITEMS,
|
||||
],
|
||||
203,
|
||||
IC.progression_deprioritized,
|
||||
[GrinchRamData(0x0101F9, binary_bit_pos=4)],
|
||||
),
|
||||
grinch_items.level_items.WF_CABLE_CAR_ACCESS_CARD: GrinchItemData(
|
||||
[
|
||||
grinch_categories.MISSION_SPECIFIC_ITEMS,
|
||||
grinch_categories.USEFUL_ITEMS,
|
||||
],
|
||||
204,
|
||||
IC.progression,
|
||||
[GrinchRamData(0x0101F9, binary_bit_pos=5)],
|
||||
),
|
||||
grinch_items.level_items.WL_DRILLL: GrinchItemData(
|
||||
[
|
||||
grinch_categories.MISSION_SPECIFIC_ITEMS,
|
||||
grinch_categories.USEFUL_ITEMS,
|
||||
],
|
||||
205,
|
||||
IC.progression_deprioritized,
|
||||
[GrinchRamData(0x0101FA, binary_bit_pos=2)],
|
||||
),
|
||||
grinch_items.level_items.WL_ROPE: GrinchItemData(
|
||||
[
|
||||
grinch_categories.MISSION_SPECIFIC_ITEMS,
|
||||
grinch_categories.USEFUL_ITEMS,
|
||||
],
|
||||
206,
|
||||
IC.progression_deprioritized,
|
||||
[GrinchRamData(0x0101FA, binary_bit_pos=1)],
|
||||
),
|
||||
grinch_items.level_items.WL_HOOK: GrinchItemData(
|
||||
[
|
||||
grinch_categories.MISSION_SPECIFIC_ITEMS,
|
||||
grinch_categories.USEFUL_ITEMS,
|
||||
],
|
||||
207,
|
||||
IC.progression_deprioritized,
|
||||
[GrinchRamData(0x0101FA, binary_bit_pos=0)],
|
||||
),
|
||||
grinch_items.level_items.WV_SCULPTIN_TOOLS: GrinchItemData(
|
||||
[
|
||||
grinch_categories.MISSION_SPECIFIC_ITEMS,
|
||||
grinch_categories.USEFUL_ITEMS,
|
||||
],
|
||||
208,
|
||||
IC.progression_deprioritized,
|
||||
[GrinchRamData(0x0101F9, binary_bit_pos=2)],
|
||||
),
|
||||
grinch_items.level_items.WV_HAMMER: GrinchItemData(
|
||||
[
|
||||
grinch_categories.MISSION_SPECIFIC_ITEMS,
|
||||
grinch_categories.USEFUL_ITEMS,
|
||||
],
|
||||
209,
|
||||
IC.progression_deprioritized,
|
||||
[GrinchRamData(0x0101F9, binary_bit_pos=3)],
|
||||
),
|
||||
grinch_items.level_items.WL_SCOUT_CLOTHES: GrinchItemData(
|
||||
[
|
||||
grinch_categories.MISSION_SPECIFIC_ITEMS,
|
||||
grinch_categories.USEFUL_ITEMS,
|
||||
],
|
||||
210,
|
||||
IC.progression,
|
||||
[GrinchRamData(0x0101F9, binary_bit_pos=7)],
|
||||
),
|
||||
}
|
||||
|
||||
# Sleigh Parts
|
||||
# SLEIGH_PARTS_TABLE: dict[str, GrinchItemData] = {
|
||||
# "Exhaust Pipes": GrinchItemData(["Sleigh Parts"], 300, IC.progression_skip_balancing,
|
||||
# [GrinchRamData(0x0101FB, binary_bit_pos=2)]),
|
||||
# "GPS": GrinchItemData(["Sleigh Parts"], 301, IC.useful,
|
||||
# [GrinchRamData(0x0101FB, binary_bit_pos=5)]),
|
||||
# "Tires": GrinchItemData(["Sleigh Parts"], 302, IC.progression_skip_balancing,
|
||||
# [GrinchRamData(0x0101FB, binary_bit_pos=4)]),
|
||||
# "Skis": GrinchItemData(["Sleigh Parts"], 303, IC.progression_skip_balancing,
|
||||
# [GrinchRamData(0x0101FB, binary_bit_pos=3)]),
|
||||
# "Twin-End Tuba": GrinchItemData(["Sleigh Parts"], 304, IC.progression_skip_balancing,
|
||||
# [GrinchRamData(0x0101FB, binary_bit_pos=6)])
|
||||
# }
|
||||
|
||||
# Access Keys
|
||||
KEYS_TABLE: dict[str, GrinchItemData] = {
|
||||
grinch_items.keys.WHOVILLE: GrinchItemData(
|
||||
[grinch_categories.VACUUM_TUBES],
|
||||
400,
|
||||
IC.progression,
|
||||
[GrinchRamData(0x010200, binary_bit_pos=1)],
|
||||
),
|
||||
grinch_items.keys.WHO_FOREST: GrinchItemData(
|
||||
[grinch_categories.VACUUM_TUBES],
|
||||
401,
|
||||
IC.progression,
|
||||
[GrinchRamData(0x0100AA, binary_bit_pos=2)],
|
||||
),
|
||||
grinch_items.keys.WHO_DUMP: GrinchItemData(
|
||||
[grinch_categories.VACUUM_TUBES],
|
||||
402,
|
||||
IC.progression,
|
||||
[GrinchRamData(0x0100AA, binary_bit_pos=3)],
|
||||
),
|
||||
grinch_items.keys.WHO_LAKE: GrinchItemData(
|
||||
[grinch_categories.VACUUM_TUBES],
|
||||
403,
|
||||
IC.progression,
|
||||
[GrinchRamData(0x0100AA, binary_bit_pos=4)],
|
||||
),
|
||||
# "Progressive Vacuum Tube": GrinchItemData(["Vacuum Tubes"], 404, IC.progression,
|
||||
# [GrinchRamData()]),
|
||||
# "Spin N' Win Door Unlock": GrinchItemData(["Supadow Door Unlocks"], 405, IC.progression,
|
||||
# [GrinchRamData()]),
|
||||
# "Dankamania Door Unlock": GrinchItemData(["Supadow Door Unlocks"], 406, IC.progression,
|
||||
# [GrinchRamData()]),
|
||||
# "The Copter Race Contest Door Unlock": GrinchItemData("Supadow Door Unlocks", 407, IC.progression,
|
||||
# [GrinchRamData()]),
|
||||
# "Progressive Supadow Door Unlock": GrinchItemData("Supadow Door Unlocks", 408, IC.progression,
|
||||
# [GrinchRamData()]),
|
||||
# "Bike Race Access": GrinchItemData(["Supadow Door Unlocks", 409, IC.progression,
|
||||
# [GrinchRamData()])
|
||||
grinch_items.keys.SLEIGH_ROOM_KEY: GrinchItemData(
|
||||
[
|
||||
grinch_categories.SLEIGH_ROOM,
|
||||
grinch_categories.REQUIRED_ITEM,
|
||||
],
|
||||
410,
|
||||
IC.progression,
|
||||
[
|
||||
GrinchRamData(0x010200, binary_bit_pos=6),
|
||||
GrinchRamData(0x0100AA, binary_bit_pos=5),
|
||||
],
|
||||
),
|
||||
}
|
||||
|
||||
# Misc Items
|
||||
MISC_ITEMS_TABLE: dict[str, GrinchItemData] = {
|
||||
# This item may not function properly if you receive it during a loading screen or in Mount Crumpit
|
||||
# "Fully Healed Grinch": GrinchItemData(["Health Items", "Filler"], 500, IC.filler,
|
||||
# [GrinchRamData(0x0E8FDC, value=120)]),
|
||||
"5 Rotten Eggs": GrinchItemData(
|
||||
[
|
||||
grinch_categories.ROTTEN_EGG_BUNDLES,
|
||||
grinch_categories.FILLER,
|
||||
],
|
||||
502,
|
||||
IC.filler,
|
||||
[
|
||||
GrinchRamData(
|
||||
0x010058,
|
||||
value=5,
|
||||
update_method=UpdateMethod.ADD,
|
||||
max_count=200,
|
||||
byte_size=2,
|
||||
)
|
||||
],
|
||||
),
|
||||
"10 Rotten Eggs": GrinchItemData(
|
||||
[
|
||||
grinch_categories.ROTTEN_EGG_BUNDLES,
|
||||
grinch_categories.FILLER,
|
||||
],
|
||||
503,
|
||||
IC.filler,
|
||||
[
|
||||
GrinchRamData(
|
||||
0x010058,
|
||||
value=10,
|
||||
update_method=UpdateMethod.ADD,
|
||||
max_count=200,
|
||||
byte_size=2,
|
||||
)
|
||||
],
|
||||
),
|
||||
"20 Rotten Eggs": GrinchItemData(
|
||||
[
|
||||
grinch_categories.ROTTEN_EGG_BUNDLES,
|
||||
grinch_categories.FILLER,
|
||||
],
|
||||
504,
|
||||
IC.filler,
|
||||
[
|
||||
GrinchRamData(
|
||||
0x010058,
|
||||
value=20,
|
||||
update_method=UpdateMethod.ADD,
|
||||
max_count=200,
|
||||
byte_size=2,
|
||||
)
|
||||
],
|
||||
),
|
||||
}
|
||||
|
||||
USEFUL_ITEMS_TABLE: dict[str, GrinchItemData] = {
|
||||
grinch_items.useful_items.HEART_OF_STONE: GrinchItemData(
|
||||
[
|
||||
grinch_categories.USEFUL_ITEMS,
|
||||
grinch_categories.HEALING_ITEMS,
|
||||
],
|
||||
501,
|
||||
IC.useful,
|
||||
[
|
||||
GrinchRamData(
|
||||
0x0100ED,
|
||||
value=1,
|
||||
update_method=UpdateMethod.ADD,
|
||||
max_count=4,
|
||||
)
|
||||
],
|
||||
)
|
||||
}
|
||||
|
||||
# Traps
|
||||
TRAPS_TABLE: dict[str, GrinchItemData] = {
|
||||
# alias to Ice Trap for traplink
|
||||
# "Freeze Trap": GrinchItemData(["Traps"], 600, IC.trap, [GrinchRamData()]),
|
||||
# "Bee Trap": GrinchItemData(["Traps"], 601, IC.trap, [GrinchRamData()]),
|
||||
# "Electrocution Trap": GrinchItemData(["Traps"], 602, IC.trap, [GrinchRamData()]),
|
||||
# alias to Slowness Trap for traplink
|
||||
# "Tip Toe Trap": GrinchItemData(["Traps"], 603, IC.trap, [GrinchRamData()]),
|
||||
# This item may not function properly if you receive it during a loading screen or in Mount Crumpit
|
||||
# alias to Exhaustion Trap
|
||||
# "Damage Trap": GrinchItemData(["Traps"], 604, IC.trap, [GrinchRamData(0x0E8FDC, value=-20, update_method=UpdateMethod.ADD)]),
|
||||
grinch_items.trap_items.DEPLETION_TRAP: GrinchItemData(
|
||||
[grinch_categories.TRAPS],
|
||||
605,
|
||||
IC.trap,
|
||||
[GrinchRamData(0x010058, value=0, byte_size=2)],
|
||||
),
|
||||
grinch_items.trap_items.DUMP_IT_TO_CRUMPIT: GrinchItemData(
|
||||
[grinch_categories.TRAPS],
|
||||
606,
|
||||
IC.trap, # Alias to Home Trap for traplink
|
||||
[
|
||||
GrinchRamData(0x010000, value=0x05),
|
||||
GrinchRamData(0x08FB94, value=1),
|
||||
GrinchRamData(0x0100B4, value=0),
|
||||
],
|
||||
),
|
||||
# alias to Spring Trap for traplink
|
||||
# "Rocket Spring Trap": GrinchItemData(["Traps"], 607, IC.trap, [GrinchRamData()]),
|
||||
# alias to Home Trap for traplink
|
||||
grinch_items.trap_items.WHO_SENT_ME_BACK: GrinchItemData(
|
||||
[grinch_categories.TRAPS],
|
||||
608,
|
||||
IC.trap,
|
||||
[
|
||||
GrinchRamData(0x08FB94, value=1),
|
||||
],
|
||||
),
|
||||
# "Cutscene Trap": GrinchItemData(["Traps"], 609, IC.trap, [GrinchRamData()]),
|
||||
# "No Vac Trap": GrinchItemData(["Traps"], 610, IC.trap, [GrinchRamData(0x0102DA, value=0]),
|
||||
# "Invisible Trap": GrinchItemData(["Traps"], 611, IC.trap, [GrinchRamData(0x0102DA, value=0, byte_size=4)])
|
||||
# "Child Trap": GrinchItemData(["Traps"], 612, IC.trap,[GrinchRamData()])
|
||||
# "Disable Jump Trap": GrinchItemData(["Traps"], 613, IC.trap,[GrinchRamData(0x010026, binary_bit_pos=6)])
|
||||
}
|
||||
|
||||
# Movesets
|
||||
MOVES_TABLE: dict[str, GrinchItemData] = {
|
||||
grinch_items.moves.BAD_BREATH: GrinchItemData(
|
||||
[grinch_categories.MOVES],
|
||||
700,
|
||||
IC.progression,
|
||||
[
|
||||
GrinchRamData(0x0100BB, binary_bit_pos=1),
|
||||
],
|
||||
),
|
||||
grinch_items.moves.PANCAKE: GrinchItemData(
|
||||
[grinch_categories.MOVES],
|
||||
701,
|
||||
IC.progression,
|
||||
[
|
||||
GrinchRamData(0x0100BB, binary_bit_pos=2),
|
||||
],
|
||||
),
|
||||
grinch_items.moves.SIEZE: GrinchItemData(
|
||||
[grinch_categories.MOVES],
|
||||
702,
|
||||
IC.progression,
|
||||
[
|
||||
GrinchRamData(0x0100BB, binary_bit_pos=3),
|
||||
],
|
||||
),
|
||||
grinch_items.moves.MAX: GrinchItemData(
|
||||
[grinch_categories.MOVES],
|
||||
703,
|
||||
IC.progression,
|
||||
[
|
||||
GrinchRamData(0x0100BB, binary_bit_pos=4),
|
||||
],
|
||||
),
|
||||
grinch_items.moves.SNEAK: GrinchItemData(
|
||||
[grinch_categories.MOVES],
|
||||
704,
|
||||
IC.progression,
|
||||
[
|
||||
GrinchRamData(0x0100BB, binary_bit_pos=5),
|
||||
],
|
||||
),
|
||||
}
|
||||
|
||||
# Double star combines all dictionaries from each individual list together
|
||||
ALL_ITEMS_TABLE: dict[str, GrinchItemData] = {
|
||||
**GADGETS_TABLE,
|
||||
**MISSION_ITEMS_TABLE,
|
||||
**KEYS_TABLE,
|
||||
**MISC_ITEMS_TABLE,
|
||||
**TRAPS_TABLE,
|
||||
**USEFUL_ITEMS_TABLE,
|
||||
# **SLEIGH_PARTS_TABLE,
|
||||
**MOVES_TABLE,
|
||||
}
|
||||
|
||||
# Psuedocoding traplink table
|
||||
# BEE_TRAP_EQUIV = ["Army Trap", "Buyon Trap", "Ghost", "Gooey Bag", "OmoTrap", "Police Trap"]
|
||||
# ICE_TRAP_EQUIV = ["Chaos Control Trap", "Freeze Trap", "Frozen Trap", "Honey Trap", "Paralyze Trap", "Stun Trap", "Bubble Trap"]
|
||||
# DAMAGE_TRAP_EQUIV = ["Banana Trap", "Bomb", "Bonk Trap", "Fire Trap", "Laughter Trap", "Nut Trap", "Push Trap",
|
||||
# "Squash Trap", "Thwimp Trap", "TNT Barrel Trap", "Meteor Trap", "Double Damage", "Spike Ball Trap"]
|
||||
|
||||
# SPRING_TRAP_EQUIV = ["Eject Ability", "Hiccup Trap", "Jump Trap", "Jumping Jacks Trap", "Whoops! Trap"]
|
||||
# HOME_TRAP_EQUIV = ["Blue Balls Curse", "Instant Death Trap", "Get Out Trap"]
|
||||
# SLOWNESS_TRAP_EQUIV = ["Iron Boots Trap", "Slow Trap", "Sticky Floor Trap"]
|
||||
# CUTSCENE_TRAP_EQUIV = ["Phone Trap"]
|
||||
# ELEC_TRAP_EQUIV = []
|
||||
# DEPL_TRAP_EQUIV = ["Dry Trap"]
|
||||
|
||||
|
||||
def grinch_items_to_id() -> dict[str, int]:
|
||||
item_mappings: dict[str, int] = {}
|
||||
for ItemName, ItemData in ALL_ITEMS_TABLE.items():
|
||||
item_mappings.update({ItemName: GrinchItem.get_apid(ItemData.id)})
|
||||
return item_mappings
|
||||
1250
worlds/grinch/Locations.py
Normal file
1250
worlds/grinch/Locations.py
Normal file
File diff suppressed because it is too large
Load Diff
156
worlds/grinch/Options.py
Normal file
156
worlds/grinch/Options.py
Normal file
@@ -0,0 +1,156 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
from Options import (
|
||||
FreeText,
|
||||
NumericOption,
|
||||
Toggle,
|
||||
DefaultOnToggle,
|
||||
Choice,
|
||||
TextChoice,
|
||||
Range,
|
||||
NamedRange,
|
||||
OptionList,
|
||||
PerGameCommonOptions,
|
||||
OptionSet,
|
||||
)
|
||||
|
||||
|
||||
class StartingArea(Choice):
|
||||
"""
|
||||
Here, you can select which area you'll start the game with. [NOT IMPLEMENTED]
|
||||
Whichever one you pick is the region you'll have access to at the start of the Multiworld.
|
||||
"""
|
||||
|
||||
option_whoville = 0
|
||||
option_who_forest = 1
|
||||
option_who_dump = 2
|
||||
option_who_lake = 3
|
||||
default = 0
|
||||
display_name = "Starting Area"
|
||||
|
||||
|
||||
class ProgressiveVacuum(Toggle): # DefaultOnToggle
|
||||
"""
|
||||
Determines whether you get access to main areas progressively [NOT IMPLEMENTED]
|
||||
|
||||
Enabled: Whoville > Who Forest > Who Dump > Who Lake
|
||||
"""
|
||||
|
||||
display_name = "Progressive Vacuum Tubes"
|
||||
|
||||
|
||||
class Missionsanity(Choice):
|
||||
"""
|
||||
How mission checks are randomized in the pool [NOT IMPLEMENTED]
|
||||
|
||||
None: Does not add mission checks
|
||||
Completion: Only completing the mission gives you a check
|
||||
Individual: Individual tasks for one mission, such as individual snowmen squashed, are checks.
|
||||
Both: Both individual tasks and mission completion are randomized.
|
||||
"""
|
||||
|
||||
display_name = "Mission Locations"
|
||||
option_none = 0
|
||||
option_completion = 1
|
||||
option_individual = 2
|
||||
option_both = 3
|
||||
default = 1
|
||||
|
||||
|
||||
class ExcludeEnvironments(OptionSet):
|
||||
"""
|
||||
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.
|
||||
[NOT IMPLEMENTED]
|
||||
|
||||
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",
|
||||
"North Shore", "Mayor's Villa", "Sleigh Ride"
|
||||
"""
|
||||
|
||||
display_name = "Exclude Environments"
|
||||
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",
|
||||
"North Shore",
|
||||
"Mayor's Villa",
|
||||
"Sleigh Ride",
|
||||
}
|
||||
|
||||
|
||||
class ProgressiveGadget(Toggle): # DefaultOnToggle
|
||||
"""
|
||||
Determines whether you get access to a gadget as individual blueprint count. [NOT IMPLEMENTED]
|
||||
"""
|
||||
|
||||
display_name = "Progressive Gadgets"
|
||||
|
||||
|
||||
class Supadow(Toggle):
|
||||
"""Enables completing minigames through the Supadows in Mount Crumpit as checks. NOT IMPLEMENTED]"""
|
||||
|
||||
display_name = "Supadow Minigames"
|
||||
|
||||
|
||||
class Gifts(Range):
|
||||
"""
|
||||
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]
|
||||
"""
|
||||
|
||||
display_name = "Gifts Squashed per Check"
|
||||
range_start = 0
|
||||
range_end = 300
|
||||
default = 0
|
||||
|
||||
|
||||
class Moverando(Toggle):
|
||||
"""Randomizes Grinch's moveset along with randomizing max into the pool. [NOT IMPLEMENTED]"""
|
||||
|
||||
display_name = "Moves Randomized"
|
||||
|
||||
|
||||
class UnlimitedEggs(Toggle):
|
||||
"""Determine whether or not you run out of rotten eggs when you utilize your gadgets."""
|
||||
|
||||
display_name = "Unlimited Rotten Eggs"
|
||||
|
||||
|
||||
class RingLinkOption(Toggle):
|
||||
"""Whenever this is toggled, your ammo is linked with other ringlink-compatible games that also have this enabled."""
|
||||
|
||||
display_name = "Ring Link"
|
||||
|
||||
|
||||
class TrapLinkOption(Toggle):
|
||||
"""If a trap is sent from Grinch, traps that are compatible with other games are triggered as well. [NOT IMPLEMENTED]"""
|
||||
|
||||
display_name = "Trap Link"
|
||||
|
||||
|
||||
@dataclass
|
||||
class GrinchOptions(PerGameCommonOptions): # DeathLinkMixin
|
||||
starting_area: StartingArea
|
||||
progressive_vacuum: ProgressiveVacuum
|
||||
missionsanity: Missionsanity
|
||||
exclude_environments: ExcludeEnvironments
|
||||
progressive_gadget: ProgressiveGadget
|
||||
supadow_minigames: Supadow
|
||||
giftsanity: Gifts
|
||||
move_rando: Moverando
|
||||
unlimited_eggs: UnlimitedEggs
|
||||
ring_link: RingLinkOption
|
||||
trap_link: TrapLinkOption
|
||||
66
worlds/grinch/RamHandler.py
Normal file
66
worlds/grinch/RamHandler.py
Normal file
@@ -0,0 +1,66 @@
|
||||
from enum import STRICT, IntEnum
|
||||
from typing import NamedTuple, Optional
|
||||
|
||||
|
||||
class UpdateMethod(IntEnum, boundary=STRICT):
|
||||
SET = 1
|
||||
ADD = 2
|
||||
SUBTRACT = 3
|
||||
FREEZE = 4
|
||||
|
||||
|
||||
class GrinchRamData(NamedTuple):
|
||||
"""A Representation of an update to RAM data for The Grinch.
|
||||
|
||||
ram_address (int): The RAM address that we are updating, usually passed in with hex, representation (0x11111111)
|
||||
value (int; Optional): The value we are using to set, add, or subtract from the RAM Address Value. Defaults to 1 if binary_bit_pos is passed in
|
||||
binary_bit_pos: (int; Optional): If passed in, we are looking for a specific bit within the byte of the ram_address. This is represented as a small-endian bit position, meaning the right-most bit is 0, and the left-most bit is 7
|
||||
byte_size: (int: Default: 1): The size of the RAM Address address we are looking for.
|
||||
update_method (UpdateMethod; Default: SET): Determines what we are doing to the RAM Address. We can either SET the address, simply assigning a value. We can ADD or SUBTRACT, modifying hte existing value by a set amount. And we can FREEZE the address, preventing it from updating in the future
|
||||
min_count: The minimum amount that a value can go down to using SUBTRACT
|
||||
max_count: The maximum amount that a value can go down to using ADD
|
||||
"""
|
||||
|
||||
ram_address: int
|
||||
value: Optional[int] = None # none is empty/null
|
||||
# Either set or add either hex or unsigned values through Client.py
|
||||
# Hex uses 0x00, unsigned are base whole numbers
|
||||
binary_bit_pos: Optional[int] = None
|
||||
byte_size: int = 1
|
||||
update_method: UpdateMethod = UpdateMethod.SET
|
||||
min_count: int = 0
|
||||
max_count: int = 255
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
ram_address: int,
|
||||
value: Optional[int],
|
||||
byte_size: int,
|
||||
update_method: UpdateMethod,
|
||||
min_count: int,
|
||||
max_count: int,
|
||||
):
|
||||
self.ram_address = ram_address
|
||||
|
||||
if value:
|
||||
self.value = value
|
||||
else:
|
||||
self.value = 1
|
||||
|
||||
if byte_size:
|
||||
self.byte_size = byte_size
|
||||
|
||||
if update_method:
|
||||
self.update_method = update_method
|
||||
|
||||
if min_count and min_count > -1:
|
||||
self.min_count = min_count
|
||||
|
||||
if max_count and max_count > -1:
|
||||
self.max_count = max_count
|
||||
elif max_count and max_count > ((2 ** (self.byte_size * 8)) - 1):
|
||||
raise ValueError(
|
||||
"max_count cannot be larger than the RAM addresses max possible value"
|
||||
)
|
||||
else:
|
||||
self.max_count = (2 ** (self.byte_size * 8)) - 1
|
||||
112
worlds/grinch/Regions.py
Normal file
112
worlds/grinch/Regions.py
Normal file
@@ -0,0 +1,112 @@
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from BaseClasses import Region
|
||||
from .Rules import access_rules_dict, interpret_rule
|
||||
|
||||
from ..generic.Rules import add_rule
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
||||
from . import GrinchWorld
|
||||
|
||||
mainareas_list = [
|
||||
"Whoville",
|
||||
"Who Forest",
|
||||
"Who Dump",
|
||||
"Who Lake",
|
||||
]
|
||||
|
||||
subareas_list = [
|
||||
"Post Office",
|
||||
"City Hall",
|
||||
"Clock Tower",
|
||||
"Ski Resort",
|
||||
"Civic Center",
|
||||
"Minefield",
|
||||
"Power Plant",
|
||||
"Generator Building",
|
||||
"Submarine World",
|
||||
"Scout's Hut",
|
||||
"North Shore",
|
||||
"Mayor's Villa",
|
||||
"Sleigh Room",
|
||||
]
|
||||
|
||||
supadow_list = [
|
||||
"Spin N' Win Supadow",
|
||||
"Dankamania Supadow",
|
||||
"The Copter Race Contest Supadow",
|
||||
"Bike Race",
|
||||
]
|
||||
|
||||
|
||||
def create_regions(world: "GrinchWorld"):
|
||||
for mainarea in mainareas_list:
|
||||
# Each area in mainarea, create a region for the given player
|
||||
world.multiworld.regions.append(
|
||||
Region(mainarea, world.player, world.multiworld)
|
||||
)
|
||||
for subarea in subareas_list:
|
||||
# Each area in subarea, create a region for the given player
|
||||
world.multiworld.regions.append(Region(subarea, world.player, world.multiworld))
|
||||
for supadow in supadow_list:
|
||||
# Each area in supadow, create a region for the given player
|
||||
world.multiworld.regions.append(Region(supadow, world.player, world.multiworld))
|
||||
|
||||
|
||||
# TODO Optimize this function
|
||||
def grinchconnect(
|
||||
world: "GrinchWorld", current_region_name: str, connected_region_name: str
|
||||
):
|
||||
current_region = world.get_region(current_region_name)
|
||||
connected_region = world.get_region(connected_region_name)
|
||||
required_items: list[list[str]] = access_rules_dict[connected_region.name]
|
||||
rule_list = interpret_rule(required_items, world.player)
|
||||
# Goes from current to connected
|
||||
current_region.connect(connected_region)
|
||||
# Goes from connected to current
|
||||
connected_region.connect(current_region)
|
||||
for access_rule in rule_list:
|
||||
for region_entrance in current_region.entrances:
|
||||
if (
|
||||
region_entrance.connected_region.name == current_region_name
|
||||
and region_entrance.parent_region.name == connected_region_name
|
||||
):
|
||||
if rule_list.index(access_rule) == 0:
|
||||
add_rule(region_entrance, access_rule)
|
||||
else:
|
||||
add_rule(region_entrance, access_rule, combine="or")
|
||||
for region_entrance in connected_region.entrances:
|
||||
if (
|
||||
region_entrance.connected_region.name == connected_region_name
|
||||
and region_entrance.parent_region.name == current_region_name
|
||||
):
|
||||
if rule_list.index(access_rule) == 0:
|
||||
add_rule(region_entrance, access_rule)
|
||||
else:
|
||||
add_rule(region_entrance, access_rule, combine="or")
|
||||
|
||||
|
||||
# What regions are connected to each other
|
||||
def connect_regions(world: "GrinchWorld"):
|
||||
grinchconnect(world, "Mount Crumpit", "Whoville")
|
||||
grinchconnect(world, "Mount Crumpit", "Who Forest")
|
||||
grinchconnect(world, "Mount Crumpit", "Who Dump")
|
||||
grinchconnect(world, "Mount Crumpit", "Who Lake")
|
||||
grinchconnect(world, "Mount Crumpit", "Sleigh Room")
|
||||
grinchconnect(world, "Mount Crumpit", "Spin N' Win")
|
||||
grinchconnect(world, "Mount Crumpit", "Dankamania")
|
||||
grinchconnect(world, "Mount Crumpit", "The Copter Race Contest")
|
||||
grinchconnect(world, "Whoville", "Post Office")
|
||||
grinchconnect(world, "Whoville", "City Hall")
|
||||
grinchconnect(world, "Whoville", "Clock Tower")
|
||||
grinchconnect(world, "Who Forest", "Ski Resort")
|
||||
grinchconnect(world, "Who Forest", "Civic Center")
|
||||
grinchconnect(world, "Who Dump", "Minefield")
|
||||
grinchconnect(world, "Who Dump", "Power Plant")
|
||||
grinchconnect(world, "Power Plant", "Generator Building")
|
||||
grinchconnect(world, "Who Lake", "Submarine World")
|
||||
grinchconnect(world, "Who Lake", "Scout's Hut")
|
||||
grinchconnect(world, "Who Lake", "North Shore")
|
||||
grinchconnect(world, "North Shore", "Mayor's Villa")
|
||||
grinchconnect(world, "Sleigh Room", "Bike Race")
|
||||
901
worlds/grinch/Rules.py
Normal file
901
worlds/grinch/Rules.py
Normal file
@@ -0,0 +1,901 @@
|
||||
from typing import Callable
|
||||
|
||||
import Utils
|
||||
from BaseClasses import CollectionState
|
||||
from worlds.AutoWorld import World
|
||||
from worlds.generic.Rules import add_rule
|
||||
from .Items import grinch_items
|
||||
|
||||
|
||||
# Adds all rules from access_rules_dict to locations
|
||||
def set_location_rules(world: World):
|
||||
all_locations = world.get_locations()
|
||||
for location in all_locations:
|
||||
loc_rules = rules_dict[location.name]
|
||||
rule_list = interpret_rule(loc_rules, world.player)
|
||||
for access_rule in rule_list:
|
||||
if rule_list.index(access_rule) == 0:
|
||||
add_rule(location, access_rule)
|
||||
else:
|
||||
add_rule(location, access_rule, "or")
|
||||
|
||||
|
||||
def interpret_rule(rule_set: list[list[str]], player: int):
|
||||
# If a region/location does not have any items required, make the section(s) return no logic.
|
||||
if len(rule_set) < 1:
|
||||
return True
|
||||
|
||||
# Otherwise, if a region/location DOES have items required, make the section(s) return list of logic.
|
||||
|
||||
access_list: list[Callable[[CollectionState], bool]] = []
|
||||
for item_set in rule_set:
|
||||
access_list.append(
|
||||
lambda state, items=tuple(item_set): state.has_all(items, player)
|
||||
)
|
||||
return access_list
|
||||
|
||||
# Each item in the list is a separate list of rules. Each separate list is just an "OR" condition.
|
||||
|
||||
|
||||
access_rules_dict: dict[str, list[list[str]]] = {
|
||||
"Whoville": [
|
||||
[
|
||||
grinch_items.keys.WHOVILLE,
|
||||
]
|
||||
],
|
||||
"Post Office": [
|
||||
[
|
||||
grinch_items.level_items.WV_WHO_CLOAK,
|
||||
]
|
||||
],
|
||||
"City Hall": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
]
|
||||
],
|
||||
"Clock Tower": [[]],
|
||||
"Who Forest": [
|
||||
[
|
||||
grinch_items.keys.WHO_FOREST,
|
||||
],
|
||||
],
|
||||
"Ski Resort": [
|
||||
[
|
||||
grinch_items.level_items.WF_CABLE_CAR_ACCESS_CARD,
|
||||
]
|
||||
],
|
||||
"Civic Center": [
|
||||
[
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.OCTOPUS_CLIMBING_DEVICE,
|
||||
],
|
||||
],
|
||||
"Who Dump": [
|
||||
[
|
||||
grinch_items.keys.WHO_DUMP,
|
||||
],
|
||||
],
|
||||
"Minefield": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"Power Plant": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.OCTOPUS_CLIMBING_DEVICE,
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
],
|
||||
"Generator Building": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.OCTOPUS_CLIMBING_DEVICE,
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
],
|
||||
"Who Lake": [
|
||||
[
|
||||
grinch_items.keys.WHO_LAKE,
|
||||
],
|
||||
],
|
||||
"Scout's Hut": [
|
||||
[
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
],
|
||||
"North Shore": [
|
||||
[
|
||||
grinch_items.level_items.WL_SCOUT_CLOTHESL,
|
||||
]
|
||||
],
|
||||
"Mayor's Villa": [
|
||||
[
|
||||
grinch_items.level_items.WL_SCOUT_CLOTHESL,
|
||||
]
|
||||
],
|
||||
"Submarine World": [
|
||||
[
|
||||
grinch_items.gadgets.MARINE_MOBILE,
|
||||
]
|
||||
],
|
||||
"Sleigh Room": [
|
||||
[
|
||||
grinch_items.keys.SLEIGH_ROOM_KEY,
|
||||
]
|
||||
],
|
||||
"Spin N' Win": [[]],
|
||||
"Dankamania": [],
|
||||
"The Copter Race Contest": [[]],
|
||||
"Bike Race": [[]],
|
||||
}
|
||||
|
||||
|
||||
rules_dict: dict[str, list[list[str]]] = {
|
||||
# Rules applied to regions first via the access_list, so "First Visit" checks should ALWAYS be empty
|
||||
# First Visit Checks (ALWAYS empty)
|
||||
"WV - First Visit": [[]],
|
||||
"WV - Post Office - First Visit": [[]],
|
||||
"WV - City Hall - First Visit": [[]],
|
||||
"WV - Clock Tower - First Visit": [[]],
|
||||
"WF - First Visit": [[]],
|
||||
"WF - Ski Resort - First Visit": [[]],
|
||||
"WF - Civic Center - First Visit": [[]],
|
||||
"WD - First Visit": [[]],
|
||||
"WD - Minefield - First Visit": [[]],
|
||||
"WD - Power Plant - First Visit": [[]],
|
||||
"WD - Generator Building - First Visit": [[]],
|
||||
"WL - South Shore - First Visit": [[]],
|
||||
"WL - Submarine World - First Visit": [[]],
|
||||
"WL - Scout's Hut - First Visit": [[]],
|
||||
"WL - North Shore - First Visit": [[]],
|
||||
"WL - Mayor's Villa - First Visit": [[]],
|
||||
# Whoville Missions
|
||||
"WV - Post Office - Shuffling The Mail": [[]],
|
||||
"WV - Smashing Snowmen": [[]],
|
||||
"WV - Painting The Mayor's Posters": [
|
||||
[
|
||||
grinch_items.level_items.WV_PAINT_BUCKET,
|
||||
]
|
||||
],
|
||||
"WV - Launching Eggs Into Houses": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
]
|
||||
],
|
||||
"WV - City Hall - Modifying The Mayor's Statue": [
|
||||
[
|
||||
grinch_items.level_items.WV_SCULPTING_TOOLS,
|
||||
]
|
||||
],
|
||||
"WV - Clock Tower - Advancing The Countdown-To-Xmas Clock": [
|
||||
[
|
||||
grinch_items.level_items.WV_HAMMER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
]
|
||||
],
|
||||
"WV - Squashing All Gifts": [
|
||||
[
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.level_items.WV_WHO_CLOAK,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
]
|
||||
],
|
||||
# Who Forest Missions
|
||||
"WF - Making Xmas Trees Droop": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
]
|
||||
# "move_rando"
|
||||
# [grinch_items.gadgets.ROCKET_EGG_LAUNCHER, BB]
|
||||
],
|
||||
"WF - Sabotaging Snow Cannon With Glue": [
|
||||
[
|
||||
grinch_items.level_items.WF_GLUE_BUCKET,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.level_items.WF_GLUE_BUCKET,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WF - Putting Beehives In Cabins": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WF - Ski Resort - Sliming The Mayor's Skis": [
|
||||
[
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
]
|
||||
],
|
||||
"WF - Civic Center - Replacing The Candles On The Cake With Fireworks": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.OCTOPUS_CLIMBING_DEVICE,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
# "move_rando"
|
||||
# [grinch_items.gadgets.ROCKET_EGG_LAUNCHER, grinch_items.gadgets.GRINCH_COPTER],
|
||||
# [grinch_items.gadgets.ROCKET_EGG_LAUNCHER, grinch_items.gadgets.OCTOPUS_CLIMBING_DEVICE, grinch_items.gadgets.ROCKET_SPRING, SN],
|
||||
# [grinch_items.gadgets.ROCKET_EGG_LAUNCHER, grinch_items.gadgets.OCTOPUS_CLIMBING_DEVICE, grinch_items.gadgets.ROCKET_SPRING, grinch_items.gadgets.SLIME_SHOOTER]
|
||||
],
|
||||
"WF - Squashing All Gifts": [
|
||||
[
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
grinch_items.level_items.WF_CABLE_CAR_ACCESS_CARD,
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.OCTOPUS_CLIMBING_DEVICE,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
grinch_items.level_items.WF_CABLE_CAR_ACCESS_CARD,
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
],
|
||||
],
|
||||
# Who Dump Missions
|
||||
"WD - Stealing Food From Birds": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
]
|
||||
# "move_rando"
|
||||
# [grinch_items.gadgets.ROCKET_SPRING, grinch_items.gadgets.ROCKET_EGG_LAUNCHER, PC]
|
||||
],
|
||||
"WD - Feeding The Computer With Robot Parts": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
]
|
||||
# "move_rando"
|
||||
# [grinch_items.gadgets.ROCKET_SPRING, grinch_items.gadgets.ROCKET_EGG_LAUNCHER, PC]
|
||||
],
|
||||
"WD - Infesting The Mayor's House With Rats": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
# "move_rando"
|
||||
# [grinch_items.gadgets.ROCKET_EGG_LAUNCHER, grinch_items.gadgets.ROCKET_SPRING, PC],
|
||||
# [grinch_items.gadgets.ROCKET_EGG_LAUNCHER, grinch_items.gadgets.GRINCH_COPTER, PC]
|
||||
],
|
||||
"WD - Conducting The Stinky Gas To Who-Bris' Shack": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
]
|
||||
# "move_rando"
|
||||
# [grinch_items.gadgets.ROCKET_SPRING, grinch_items.gadgets.ROCKET_EGG_LAUNCHER, PC]
|
||||
],
|
||||
"WD - Minefield - Shaving Who Dump Guardian": [
|
||||
[
|
||||
grinch_items.level_items.WL_SCOUT_CLOTHES,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
[
|
||||
grinch_items.level_items.WL_SCOUT_CLOTHES,
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
# "move_rando"
|
||||
# [grinch_items.level_items.WL_SCOUT_CLOTHES, grinch_items.gadgets.GRINCH_COPTER, SN],
|
||||
# [grinch_items.level_items.WL_SCOUT_CLOTHES, grinch_items.gadgets.SLIME_SHOOTER, grinch_items.gadgets.ROCKET_SPRING, SN]
|
||||
],
|
||||
"WD - Generator Building - Short-Circuiting Power-Plant": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.OCTOPUS_CLIMBING_DEVICE,
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
],
|
||||
"WD - Squashing All Gifts": [
|
||||
[
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.OCTOPUS_CLIMBING_DEVICE,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
],
|
||||
],
|
||||
# Who Lake Missions
|
||||
"WL - South Shore - Putting Thistles In Shorts": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.OCTOPUS_CLIMBING_DEVICE,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WL - South Shore - Sabotaging The Tents": [
|
||||
[
|
||||
grinch_items.gadgets.OCTOPUS_CLIMBING_DEVICE,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[grinch_items.gadgets.GRINCH_COPTER],
|
||||
],
|
||||
"WL - North Shore - Drilling Holes In Canoes": [
|
||||
[
|
||||
grinch_items.level_items.WL_DRILL,
|
||||
]
|
||||
],
|
||||
"WL - Submarine World - Modifying The Marine Mobile": [[]],
|
||||
"WL - Mayor's Villa - Hooking The Mayor's Bed To The Motorboat": [
|
||||
[
|
||||
grinch_items.level_items.WL_ROPE,
|
||||
grinch_items.level_items.WL_HOOK,
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.level_items.WL_SCOUT_CLOTHES,
|
||||
]
|
||||
],
|
||||
"WL - Squashing All Gifts": [
|
||||
[
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
grinch_items.gadgets.MARINE_MOBILE,
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.level_items.WL_SCOUT_CLOTHES,
|
||||
grinch_items.level_items.WL_HOOK,
|
||||
grinch_items.level_items.WL_ROPE,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.OCTOPUS_CLIMBING_DEVICE,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
grinch_items.gadgets.MARINE_MOBILE,
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.level_items.WL_SCOUT_CLOTHES,
|
||||
grinch_items.level_items.WL_HOOK,
|
||||
grinch_items.level_items.WL_ROPE,
|
||||
],
|
||||
],
|
||||
# Whoville Blueprints
|
||||
"WV - Binoculars BP on Post Office Roof": [[]],
|
||||
"WV - City Hall - Binoculars BP left side of Library": [[]],
|
||||
"WV - City Hall - Binoculars BP front side of Library": [[]],
|
||||
"WV - City Hall - Binoculars BP right side of Library": [[]],
|
||||
"WV - TEL BP left of City Hall": [[]],
|
||||
"WV - REL BP left of Clock Tower": [[]],
|
||||
"WV - Post Office - REL BP inside Silver Room": [[]],
|
||||
"WV - Post Office - REL BP at Entrance Door after Migrinch_items.gadgets.SLIME_SHOOTERion Completion": [
|
||||
[]
|
||||
],
|
||||
"WV - City Hall - GC BP in Safe Room": [[]],
|
||||
"WV - City Hall - GC BP in Statue Room": [[]],
|
||||
"WV - Clock Tower - GC BP in Bedroom": [
|
||||
[grinch_items.gadgets.ROCKET_SPRING]
|
||||
# "move_rando"
|
||||
# [MX, grinch_items.gadgets.ROCKET_SPRING]
|
||||
],
|
||||
"WV - Clock Tower - GC BP in Bell Room": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
]
|
||||
],
|
||||
# Who Forest Blueprints
|
||||
"WF - RS BP behind Vacuum Tube": [[]],
|
||||
"WF - RS BP in front of 2nd House near Vacuum Tube": [[]],
|
||||
"WF - RS BP near Tree House on Ground": [[]],
|
||||
"WF - RS BP behind Cable Car House": [[]],
|
||||
"WF - RS BP near Who Snowball in Cave": [[]],
|
||||
"WF - RS BP on Branch Platform closest to Glue Cannon": [[]],
|
||||
"WF - RS BP on Branch Platform Near Beast": [[]],
|
||||
"WF - RS BP on Branch Platform Elevated next to House": [[]],
|
||||
"WF - RS BP on Tree House": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WF - SS BP in Branch Platform Elevated House": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WF - SS BP in Branch Platform House next to Beast": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WF - SS BP in House in front of Civic Center Cave": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WF - SS BP in House next to Tree House": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WF - SS BP in House acrogrinch_items.gadgets.SLIME_SHOOTER from Tree House": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WF - SS BP in 2nd House near Vacuum Tube Right Side": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WF - SS BP in 2nd House near Vacuum Tube Left Side": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WF - SS BP in 2nd House near Vacuum Tube inbetween Blueprints": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WF - SS BP in House near Vacuum Tube": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WF - Ski Resort - GC BP inside Dog's Fence": [[]],
|
||||
"WF - Ski Resort - GC BP in Max Cave": [
|
||||
[]
|
||||
# "move_rando"
|
||||
# [MX]
|
||||
],
|
||||
"WF - Civic Center - GC BP on Left Side in Bat Cave Wall": [
|
||||
[
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.OCTOPUS_CLIMBING_DEVICE,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
],
|
||||
"WF - Civic Center - GC BP in Frozen Ice": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.OCTOPUS_CLIMBING_DEVICE,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.OCTOPUS_CLIMBING_DEVICE,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
],
|
||||
# Who Dump Blueprints
|
||||
"WD - OCD BP inside Middle Pipe": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WD - OCD BP inside Right Pipe": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WD - OCD BP in Vent to Mayor's House": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WD - OCD BP inside Left Pipe": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WD - OCD BP near Right Side of Power Plant Wall": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WD - OCD BP near Who-Bris' Shack": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
]
|
||||
],
|
||||
"WD - Minefield - OCD BP on Left Side of House": [
|
||||
[]
|
||||
# "move_rando"
|
||||
# [grinch_items.gadgets.ROCKET_EGG_LAUNCHER, grinch_items.gadgets.GRINCH_COPTER],
|
||||
# [grinch_items.gadgets.ROCKET_EGG_LAUNCHER, grinch_items.gadgets.SLIME_SHOOTER, grinch_items.gadgets.ROCKET_SPRING]
|
||||
# [MX]
|
||||
],
|
||||
"WD - Minefield - OCD BP on Right Side of Shack": [
|
||||
[
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
],
|
||||
"WD - Minefield - OCD BP inside Guardian's House": [
|
||||
[]
|
||||
# "move_rando"
|
||||
# [grinch_items.gadgets.ROCKET_EGG_LAUNCHER, grinch_items.gadgets.GRINCH_COPTER],
|
||||
# [grinch_items.gadgets.ROCKET_EGG_LAUNCHER, grinch_items.gadgets.SLIME_SHOOTER, grinch_items.gadgets.ROCKET_SPRING]
|
||||
# [MX]
|
||||
],
|
||||
"WD - Power Plant - GC BP in Max Cave": [
|
||||
[]
|
||||
# "move_rando"
|
||||
# [MX]
|
||||
],
|
||||
"WD - Power Plant - GC BP After First Gate": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
# "move_rando"
|
||||
# [MX, grinch_items.gadgets.ROCKET_EGG_LAUNCHER, grinch_items.gadgets.ROCKET_SPRING]
|
||||
],
|
||||
"WD - Generator Building - GC BP on the Highest Platform": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.OCTOPUS_CLIMBING_DEVICE,
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
],
|
||||
"WD - Generator Building - GC BP at the Entrance after Migrinch_items.gadgets.SLIME_SHOOTERion Completion": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.OCTOPUS_CLIMBING_DEVICE,
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
],
|
||||
# Who Lake Blueprints
|
||||
"WL - South Shore - MM BP on Bridge to Scout's Hut": [[]],
|
||||
"WL - South Shore - MM BP across from Tent near Porcupine": [[]],
|
||||
"WL - South Shore - MM BP near Outhouse": [[]],
|
||||
"WL - South Shore - MM BP near Hill Bridge": [[]],
|
||||
"WL - South Shore - MM BP on Scout's Hut Roof": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WL - South Shore - MM BP on Grass Platform": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WL - South Shore - MM BP across Zipline Platform": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
grinch_items.gadgets.OCTOPUS_CLIMBING_DEVICE,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WL - South Shore - MM BP behind Summer Beast": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.OCTOPUS_CLIMBING_DEVICE,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
],
|
||||
"WL - North Shore - MM BP below Bridge": [[]],
|
||||
"WL - North Shore - MM BP behind Skunk Hut": [[]],
|
||||
"WL - North Shore - MM BP inside Skunk Hut": [
|
||||
[]
|
||||
# "move_rando"
|
||||
# [MX]
|
||||
],
|
||||
"WL - North Shore - MM BP inside House's Fence": [
|
||||
[]
|
||||
# "move_rando"
|
||||
# [MX]
|
||||
],
|
||||
"WL - North Shore - MM BP inside Boulder Box near Bridge": [[]],
|
||||
"WL - North Shore - MM BP inside Boulder Box behind Skunk Hut": [[]],
|
||||
"WL - North Shore - MM BP inside Drill House": [[]],
|
||||
"WL - North Shore - MM BP on Crow Platform near Drill House": [[]],
|
||||
"WL - Submarine World - GC BP Just Below Water Surface": [
|
||||
[grinch_items.gadgets.MARINE_MOBILE]
|
||||
],
|
||||
"WL - Submarine World - GC BP Underwater": [
|
||||
[
|
||||
grinch_items.gadgets.MARINE_MOBILE,
|
||||
]
|
||||
],
|
||||
"WL - Mayor's Villa - GC BP on Tree Branch": [
|
||||
[
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
],
|
||||
"WL - Mayor's Villa - GC BP in Pirate's Cave": [
|
||||
[
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
],
|
||||
# Finale
|
||||
"WV - Exhaust Pipes": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.keys.SLEIGH_ROOM_KEY,
|
||||
]
|
||||
],
|
||||
"WF - Skis": [
|
||||
[
|
||||
grinch_items.keys.SLEIGH_ROOM_KEY,
|
||||
]
|
||||
],
|
||||
"WD - Tires": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.keys.SLEIGH_ROOM_KEY,
|
||||
]
|
||||
],
|
||||
"WL - Submarine World - Twin-End Tuba": [
|
||||
[
|
||||
grinch_items.gadgets.MARINE_MOBILE,
|
||||
grinch_items.keys.SLEIGH_ROOM_KEY,
|
||||
]
|
||||
],
|
||||
"WL - South Shore - GPS": [
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.keys.SLEIGH_ROOM_KEY,
|
||||
]
|
||||
],
|
||||
"MC - Sleigh Ride - Stealing All Gifts": [
|
||||
# ["Exhaust Pipes", "Tires", "Skis", "Twin-End Tuba"]
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.keys.WHOVILLE,
|
||||
grinch_items.keys.WHO_FOREST,
|
||||
grinch_items.keys.WHO_DUMP,
|
||||
grinch_items.keys.WHO_LAKE,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
grinch_items.gadgets.MARINE_MOBILE,
|
||||
]
|
||||
],
|
||||
"MC - Sleigh Ride - Neutralizing Santa": [
|
||||
# ["Exhaust Pipes", "Tires", "Skis", "Twin-End Tuba"]
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.keys.WHOVILLE,
|
||||
grinch_items.keys.WHO_FOREST,
|
||||
grinch_items.keys.WHO_DUMP,
|
||||
grinch_items.keys.WHO_LAKE,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
grinch_items.gadgets.MARINE_MOBILE,
|
||||
]
|
||||
],
|
||||
# Hearts of Stone
|
||||
"WV - Post Office - Heart of Stone": [[]],
|
||||
"WF - Ski Resort - Heart of Stone": [[]],
|
||||
"WD - Minefield - Heart of Stone": [
|
||||
[
|
||||
grinch_items.gadgets.GRINCH_COPTER,
|
||||
],
|
||||
[
|
||||
grinch_items.gadgets.ROCKET_EGG_LAUNCHER,
|
||||
grinch_items.gadgets.SLIME_SHOOTER,
|
||||
grinch_items.gadgets.ROCKET_SPRING,
|
||||
],
|
||||
],
|
||||
"WL - North Shore - Heart of Stone": [
|
||||
[]
|
||||
# "move_rando"
|
||||
# [MX]
|
||||
],
|
||||
# Supadows
|
||||
"Spin N' Win - Easy": [[]],
|
||||
"Spin N' Win - Hard": [[]],
|
||||
"Spin N' Win - Real Tough": [[]],
|
||||
"Dankamania - Easy - 15 Points": [[]],
|
||||
"Dankamania - Hard - 15 Points": [[]],
|
||||
"Dankamania - Real Tough - 15 Points": [[]],
|
||||
"The Copter Race Contest - Easy": [[]],
|
||||
"The Copter Race Contest - Hard": [[]],
|
||||
"The Copter Race Contest - Real Tough": [[]],
|
||||
"Bike Race - 1st Place": [[]],
|
||||
"Bike Race - Top 2": [[]],
|
||||
"Bike Race - Top 3": [[]],
|
||||
# Intro
|
||||
"MC - 1st Crate Squashed": [[]],
|
||||
"MC - 2nd Crate Squashed": [[]],
|
||||
"MC - 3rd Crate Squashed": [[]],
|
||||
"MC - 4th Crate Squashed": [[]],
|
||||
"MC - 5th Crate Squashed": [[]],
|
||||
# "Green Present": [
|
||||
# []
|
||||
# ],
|
||||
# "Red Present": [
|
||||
# []
|
||||
# ],
|
||||
# "Pink Present": [
|
||||
# [grinch_items.gadgets.ROCKET_EGG_LAUNCHER],
|
||||
# [move_rando]
|
||||
# [PC]
|
||||
# ],
|
||||
# "Yellow Present": [
|
||||
# []
|
||||
# "move_rando"
|
||||
# [PC]
|
||||
# ]
|
||||
}
|
||||
85
worlds/grinch/__init__.py
Normal file
85
worlds/grinch/__init__.py
Normal file
@@ -0,0 +1,85 @@
|
||||
from BaseClasses import Region, Item, ItemClassification
|
||||
from .Locations import grinch_locations_to_id, grinch_locations, GrinchLocation, get_location_names_per_category
|
||||
from .Items import grinch_items_to_id, GrinchItem, ALL_ITEMS_TABLE, MISC_ITEMS_TABLE, get_item_names_per_category
|
||||
from .Regions import connect_regions
|
||||
from .Rules import set_location_rules
|
||||
|
||||
from .Client import *
|
||||
from typing import ClassVar
|
||||
|
||||
from worlds.AutoWorld import World
|
||||
from Options import OptionError
|
||||
|
||||
from .Options import GrinchOptions
|
||||
from .Rules import access_rules_dict
|
||||
|
||||
|
||||
class GrinchWorld(World):
|
||||
game: ClassVar[str] = "The Grinch"
|
||||
options_dataclass = Options.GrinchOptions
|
||||
options: Options.GrinchOptions
|
||||
topology_present = True #not an open world game, very linear
|
||||
item_name_to_id: ClassVar[dict[str,int]] = grinch_items_to_id()
|
||||
location_name_to_id: ClassVar[dict[str,int]] = grinch_locations_to_id()
|
||||
required_client_version = (0, 6, 3)
|
||||
item_name_groups = get_item_names_per_category()
|
||||
location_name_groups = get_location_names_per_category()
|
||||
|
||||
def __init__(self, *args, **kwargs): #Pulls __init__ function and takes control from there in BaseClasses.py
|
||||
self.origin_region_name: str = "Mount Crumpit"
|
||||
super(GrinchWorld, self).__init__(*args, **kwargs)
|
||||
|
||||
def generate_early(self) -> None: #Special conditions changed before generation occurs
|
||||
if self.options.ring_link == 1 and self.options.unlimited_eggs == 1:
|
||||
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}")
|
||||
|
||||
|
||||
def create_regions(self): #Generates all regions for the multiworld
|
||||
for region_name in access_rules_dict.keys():
|
||||
self.multiworld.regions.append(Region(region_name, self.player, self.multiworld))
|
||||
self.multiworld.regions.append(Region("Mount Crumpit", self.player, self.multiworld))
|
||||
for location, data in grinch_locations.items():
|
||||
region = self.get_region(data.region)
|
||||
entry = GrinchLocation(self.player, location, region, data)
|
||||
if location == "MC - Sleigh Ride - Neutralizing Santa":
|
||||
entry.place_locked_item(Item("Goal", ItemClassification.progression, None, self.player))
|
||||
region.locations.append(entry)
|
||||
connect_regions(self)
|
||||
|
||||
def create_item(self, item: str) -> GrinchItem: #Creates specific items on demand
|
||||
if item in ALL_ITEMS_TABLE.keys():
|
||||
return GrinchItem(item, self.player, ALL_ITEMS_TABLE[item])
|
||||
raise Exception(f"Invalid item name: {item}")
|
||||
|
||||
def create_items(self): #Generates all items for the multiworld
|
||||
self_itempool: list[GrinchItem] = []
|
||||
for item, data in ALL_ITEMS_TABLE.items():
|
||||
self_itempool.append(self.create_item(item))
|
||||
if item == "Heart of Stone":
|
||||
for _ in range(3):
|
||||
self_itempool.append(self.create_item(item))
|
||||
|
||||
#Get number of current unfilled locations
|
||||
unfilled_locations: int = len(self.multiworld.get_unfilled_locations(self.player)) - len(ALL_ITEMS_TABLE.keys()) - 3
|
||||
|
||||
for _ in range(unfilled_locations):
|
||||
self_itempool.append(self.create_item((self.get_other_filler_item(list(MISC_ITEMS_TABLE.keys())))))
|
||||
self.multiworld.itempool += self_itempool
|
||||
|
||||
def set_rules(self):
|
||||
self.multiworld.completion_condition[self.player] = lambda state: state.has("Goal", self.player)
|
||||
set_location_rules(self)
|
||||
|
||||
def get_other_filler_item(self, other_filler: list[str]) -> str:
|
||||
return self.random.choices(other_filler)[0]
|
||||
|
||||
def fill_slot_data(self):
|
||||
return {
|
||||
"give_unlimited_eggs": self.options.unlimited_eggs.value,
|
||||
"ring_link": self.options.ring_link.value,
|
||||
}
|
||||
|
||||
def generate_output(self, output_directory: str) -> None:
|
||||
# print("")
|
||||
pass
|
||||
6
worlds/grinch/archipelago.json
Normal file
6
worlds/grinch/archipelago.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"minimum_ap_version": "0.6.3",
|
||||
"world_version": "1.2.3",
|
||||
"authors": ["MarioSpore"],
|
||||
"game": "The Grinch"
|
||||
}
|
||||
7
worlds/grinch/docs/Credits.md
Normal file
7
worlds/grinch/docs/Credits.md
Normal file
@@ -0,0 +1,7 @@
|
||||
- Credit to Raven-187 & Hacc on gamehacking.org for providing the addresses for various cheat codes. Without them, this
|
||||
would of made RAM searching much more tedious.
|
||||
- Shoutouts to SomeJakeGuy for basically teaching me how to code in general along with starting decompilation of the game
|
||||
into motion
|
||||
- Shoutouts to BootsinSoots for helping with the implementation of the logic rules code itself.
|
||||
- Thanks to the Grinch PS1 speedrunning discord community server for encouraging the production of this randomizer.
|
||||
- Credit to Artamiss for the vast majority of BZZ decompilation and general backend coding.
|
||||
26
worlds/grinch/docs/en_The Grinch.md
Normal file
26
worlds/grinch/docs/en_The Grinch.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# The Grinch
|
||||
|
||||
## Where is the options page?
|
||||
|
||||
The [player options page for this game](../player-options) contains all the
|
||||
options you need to configure and export a config file.
|
||||
|
||||
## What items and locations get shuffled?
|
||||
|
||||
Items such as gadgets, sleigh parts, heart of stones, vacuum accesses, and useful items (or mission specific items) are
|
||||
shuffled. Locations that players can do to send items out include visiting an area for the first time, collecting a blueprint,
|
||||
and completing a mission.
|
||||
|
||||
## What is the goal of The Grinch when randomized?
|
||||
|
||||
The player must obtain the Skis, Twin-End Tuba, Exhaust Pipes, and the Tires to be able to build the sleigh and to finally
|
||||
stop Christmas from coming once and for all by neutralizing Santa Claus!
|
||||
|
||||
## Which items can be in another player's world?
|
||||
|
||||
- All gadgets such as the binoculars, Rotten Egg Launcher, Rocket Spring, Slime Shooter, Octopus Climbing Device, Marine
|
||||
Mobile, and the Grinch Copter.
|
||||
- 4 Heart of Stones that increases the player's max health by one.
|
||||
- Useful items, or mission specific items, that allow the player to access certain subareas or complete missions that
|
||||
require that specific item.
|
||||
- Vacuum accesses that give the player access to Who Forest, Who Dump, and Who Lake respectively.
|
||||
53
worlds/grinch/docs/setup_en.md
Normal file
53
worlds/grinch/docs/setup_en.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# The Grinch (PS1) - Setup Guide
|
||||
|
||||
## Required Software
|
||||
- [Archipelago](https://github.com/ArchipelagoMW/Archipelago/releases). Please use version 0.6.3 or later for integrated
|
||||
BizHawk support.
|
||||
- Legally obtained NTSC Bin ROM file, probably named something like `Grinch, The (USA) (En,Fr,Es).bin`.
|
||||
The game's CUE file should also work aswell along side the BIN file if you have troubles opening the BIN file.
|
||||
- [BizHawk](https://tasvideos.org/BizHawk/ReleaseHistory) Version 2.9.1 is required to play. Any version is NOT compatible and may have unintended behavior in
|
||||
the game as well as not being able to connect to the client through the LUA Console.
|
||||
- The latest `grinch.apworld` file. You can find this on the [Releases page](https://github.com/MarioSpore/Grinch-AP/releases/latest). Put this in your `Archipelago/custom_worlds` folder.
|
||||
- PSX BIOS Firmware bin file, which is required to run the game through Bizhawk. The file you need should be
|
||||
named something like `SCPH-5501.BIN`.
|
||||
|
||||
## Configuring BizHawk
|
||||
Once you have installed BizHawk, open `EmuHawk.exe` and change the following settings:
|
||||
|
||||
- If you're using BizHawk 2.7 or 2.8, go to `Config > Customize`. On the Advanced tab, switch the Lua Core from
|
||||
`NLua+KopiLua` to `Lua+LuaInterface`, then restart EmuHawk. (If you're using BizHawk 2.9, you can skip this step.)
|
||||
- Under `Config > Customize`, check the "Run in background" option to prevent disconnecting from the client while you're
|
||||
tabbed out of EmuHawk.
|
||||
- Under `Config > Preferred Cores > PSX`, select NymaShock.
|
||||
- Open any PlayStation game in EmuHawk and go to `Config > Controllers…` to configure your inputs. If you can't click
|
||||
`Controllers…`, it's because you need to load a game first.
|
||||
You may need to invert Sensitivity for the up/down axis to -100%.
|
||||
This can be found under Analog Controls through `Config > Controllers…`.
|
||||
Depending on your controller, you may also want to tweak the Deadzone. Something like 6% is recommended for a DualShock 4.
|
||||
- Consider clearing keybinds in `Config > Hotkeys…` if you don't intend to use them. Select the keybind and press Esc to
|
||||
clear it.
|
||||
- You are required to legally obtain a PSX Bios BIN firmware file for the game to be opened. To import this, you go to
|
||||
`Config > Firmware... > Tools` and scrolling until you see the PlayStation tab. You might right click on the bios region
|
||||
and click `Set Customization` or `Import` on the top of the window. Then a window should open, telling you what file to
|
||||
import, which is the BIN file required. The bios should be recognized if Bizhawk displays a checkmark beside it, saying
|
||||
the bios version you have is stable and should run without issues. If a bios is already been imported and the game
|
||||
runs fine by itself, you may skip this step.
|
||||
|
||||
## Generating a Game
|
||||
|
||||
1. Create your options file (YAML). After installing the `grinch.apworld` file, you can generate a template within the Archipelago Launcher by clicking `Generate Template Settings`.
|
||||
2. Follow the general Archipelago instructions for [generating a game](https://archipelago.gg/tutorial/Archipelago/setup/en#generating-a-game).
|
||||
3. Open `ArchipelagoLauncher.exe`
|
||||
4. Select "BizHawk Client" in the right-side column. On your first time opening BizHawk Client, you will also be asked to
|
||||
locate `EmuHawk.exe` in your BizHawk install.
|
||||
|
||||
### Connect to the Multiserver
|
||||
|
||||
Once both the client and the emulator are started, they must be connected. **This should happen automatically.**
|
||||
However, if the lua script window doesn't appear, then within the emulator click
|
||||
on the "Tools" menu and select "Lua Console". Click the folder button or press Ctrl+O to open a Lua
|
||||
script. Navigate to your Archipelago install folder and open `data/lua/connector_bizhawk_generic.lua`.
|
||||
|
||||
To connect the client to the multiserver simply put `<address>:<port>` on the text field on top and
|
||||
press enter (if the server uses a password, type in the bottom text field
|
||||
`/connect <address>:<port> [password]`)
|
||||
Reference in New Issue
Block a user