mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Filler is now being placed yippe
This commit is contained in:
@@ -153,12 +153,15 @@ KEYS_TABLE: dict[str, GrinchItemData] = {
|
|||||||
#Misc Items
|
#Misc Items
|
||||||
MISC_ITEMS_TABLE: dict[str, GrinchItemData] = {
|
MISC_ITEMS_TABLE: dict[str, GrinchItemData] = {
|
||||||
"Fully Healed Grinch": GrinchItemData("Health Items", 500, IC.filler, [GrinchRamData(0x800E8FDC, value=120)]),
|
"Fully Healed Grinch": GrinchItemData("Health Items", 500, IC.filler, [GrinchRamData(0x800E8FDC, value=120)]),
|
||||||
"Heart of Stone": GrinchItemData("Health Items", 501, IC.useful, [GrinchRamData(0x800100ED, value=1)]),
|
|
||||||
"5 Rotten Eggs": GrinchItemData("Rotten Egg Bundles", 502, IC.filler, [GrinchRamData(0x80010058, value=5)]),
|
"5 Rotten Eggs": GrinchItemData("Rotten Egg Bundles", 502, IC.filler, [GrinchRamData(0x80010058, value=5)]),
|
||||||
"10 Rotten Eggs": GrinchItemData("Rotten Egg Bundles", 503, IC.filler, [GrinchRamData(0x80010058, value=10)]),
|
"10 Rotten Eggs": GrinchItemData("Rotten Egg Bundles", 503, IC.filler, [GrinchRamData(0x80010058, value=10)]),
|
||||||
"20 Rotten Eggs": GrinchItemData("Rotten Egg Bundles", 504, IC.filler, [GrinchRamData(0x80010058, value=20)])
|
"20 Rotten Eggs": GrinchItemData("Rotten Egg Bundles", 504, IC.filler, [GrinchRamData(0x80010058, value=20)])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
USEFUL_IC_TABLE: dict[str, GrinchItemData] = {
|
||||||
|
"Heart of Stone": GrinchItemData("Health Items", 501, IC.useful, [GrinchRamData(0x800100ED, value=1)])
|
||||||
|
}
|
||||||
|
|
||||||
#Traps
|
#Traps
|
||||||
TRAPS_TABLE: dict[str, GrinchItemData] = {
|
TRAPS_TABLE: dict[str, GrinchItemData] = {
|
||||||
# "Freeze Trap": GrinchItemData("Traps", 600, IC.trap, [GrinchRamData()]), #alias to Ice Trap for traplink
|
# "Freeze Trap": GrinchItemData("Traps", 600, IC.trap, [GrinchRamData()]), #alias to Ice Trap for traplink
|
||||||
@@ -176,13 +179,13 @@ TRAPS_TABLE: dict[str, GrinchItemData] = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#Movesets
|
#Movesets
|
||||||
MOVES_TABLE: dict[str, GrinchItemData] = {
|
# MOVES_TABLE: dict[str, GrinchItemData] = {
|
||||||
"Bad Breath": GrinchItemData("Movesets", 700, IC.progression, [GrinchRamData(0x800100BB, binary_bit_pos=1)]),
|
# "Bad Breath": GrinchItemData("Movesets", 700, IC.progression, [GrinchRamData(0x800100BB, binary_bit_pos=1)]),
|
||||||
"Pancake": GrinchItemData("Movesets", 701, IC.progression, [GrinchRamData(0x800100BB, binary_bit_pos=2)]),
|
# "Pancake": GrinchItemData("Movesets", 701, IC.progression, [GrinchRamData(0x800100BB, binary_bit_pos=2)]),
|
||||||
"Push & Pull": GrinchItemData("Movesets", 702, IC.progression, [GrinchRamData(0x800100BB, binary_bit_pos=3)]),
|
# "Push & Pull": GrinchItemData("Movesets", 702, IC.progression, [GrinchRamData(0x800100BB, binary_bit_pos=3)]),
|
||||||
"Max": GrinchItemData("Movesets", 703, IC.progression, [GrinchRamData(0x800100BB, binary_bit_pos=4)]),
|
# "Max": GrinchItemData("Movesets", 703, IC.progression, [GrinchRamData(0x800100BB, binary_bit_pos=4)]),
|
||||||
"Tip Toe": GrinchItemData("Movesets", 704, IC.progression, [GrinchRamData(0x800100BB, binary_bit_pos=5)]),
|
# "Tip Toe": GrinchItemData("Movesets", 704, IC.progression, [GrinchRamData(0x800100BB, binary_bit_pos=5)])
|
||||||
}
|
# }
|
||||||
#Double star combines all dictionaries from each individual list together
|
#Double star combines all dictionaries from each individual list together
|
||||||
ALL_ITEMS_TABLE: dict[str, GrinchItemData] = {
|
ALL_ITEMS_TABLE: dict[str, GrinchItemData] = {
|
||||||
**GADGETS_TABLE,
|
**GADGETS_TABLE,
|
||||||
@@ -191,7 +194,8 @@ ALL_ITEMS_TABLE: dict[str, GrinchItemData] = {
|
|||||||
**KEYS_TABLE,
|
**KEYS_TABLE,
|
||||||
**MISC_ITEMS_TABLE,
|
**MISC_ITEMS_TABLE,
|
||||||
**TRAPS_TABLE,
|
**TRAPS_TABLE,
|
||||||
**MOVES_TABLE
|
**USEFUL_IC_TABLE
|
||||||
|
# **MOVES_TABLE
|
||||||
}
|
}
|
||||||
|
|
||||||
def grinch_items_to_id() -> dict[str, int]:
|
def grinch_items_to_id() -> dict[str, int]:
|
||||||
|
@@ -6,11 +6,14 @@ from .Options import GrinchOptions
|
|||||||
from BaseClasses import Region
|
from BaseClasses import Region
|
||||||
from .Rules import access_rules_dict, interpret_rule
|
from .Rules import access_rules_dict, interpret_rule
|
||||||
|
|
||||||
|
import logging
|
||||||
|
logger = logging.getLogger()
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
|
||||||
from . import GrinchWorld
|
from . import GrinchWorld
|
||||||
|
|
||||||
mainareas_list = [
|
mainareas_list = [
|
||||||
"Mount Crumpit",
|
|
||||||
"Whoville",
|
"Whoville",
|
||||||
"Who Forest",
|
"Who Forest",
|
||||||
"Who Dump",
|
"Who Dump",
|
||||||
@@ -51,10 +54,11 @@ def create_regions(world: "GrinchWorld"):
|
|||||||
world.multiworld.regions.append(Region(supadow, world.player, world.multiworld))
|
world.multiworld.regions.append(Region(supadow, world.player, world.multiworld))
|
||||||
|
|
||||||
def grinchconnect(world: "GrinchWorld", current_region_name: str, connected_region_name: str):
|
def grinchconnect(world: "GrinchWorld", current_region_name: str, connected_region_name: str):
|
||||||
rule = []
|
logger.info("Current Region Name: "+ current_region_name)
|
||||||
|
logger.info("Connected Region Name: "+ connected_region_name)
|
||||||
current_region = world.get_region(current_region_name)
|
current_region = world.get_region(current_region_name)
|
||||||
connected_region = world.get_region(connected_region_name)
|
connected_region = world.get_region(connected_region_name)
|
||||||
required_items: set[list[str]] = access_rules_dict[connected_region.name]
|
required_items: list[list[str]] = access_rules_dict[connected_region.name]
|
||||||
rule = interpret_rule(required_items, world.player)
|
rule = interpret_rule(required_items, world.player)
|
||||||
#Goes from current to connected
|
#Goes from current to connected
|
||||||
current_region.connect(connected_region, rule = rule)
|
current_region.connect(connected_region, rule = rule)
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
from worlds.AutoWorld import World
|
from worlds.AutoWorld import World
|
||||||
# from .Options import GrinchOptions
|
# from .Options import GrinchOptions
|
||||||
from worlds.generic.Rules import add_rule
|
from worlds.generic.Rules import add_rule
|
||||||
|
import logging
|
||||||
|
logger = logging.getLogger()
|
||||||
|
|
||||||
def set_rules(world: World):
|
def set_rules(world: World):
|
||||||
all_locations = world.get_locations()
|
all_locations = world.get_locations()
|
||||||
@@ -455,5 +456,6 @@ def interpret_rule(rule_set: list[list[str]], player: int):
|
|||||||
else:
|
else:
|
||||||
old_rule = lambda state: False
|
old_rule = lambda state: False
|
||||||
for item_set in rule_set:
|
for item_set in rule_set:
|
||||||
|
logger.info("Rules to access: " + ";".join(item_set))
|
||||||
old_rule = lambda state: state.has_all(item_set, player) or old_rule
|
old_rule = lambda state: state.has_all(item_set, player) or old_rule
|
||||||
return old_rule
|
return old_rule
|
@@ -1,6 +1,6 @@
|
|||||||
from BaseClasses import Region, Item, ItemClassification
|
from BaseClasses import Region, Item, ItemClassification
|
||||||
from .Locations import grinch_locations_to_id, grinch_locations, GrinchLocation
|
from .Locations import grinch_locations_to_id, grinch_locations, GrinchLocation
|
||||||
from .Items import grinch_items_to_id, GrinchItem, ALL_ITEMS_TABLE
|
from .Items import grinch_items_to_id, GrinchItem, ALL_ITEMS_TABLE, MISC_ITEMS_TABLE
|
||||||
from .Regions import connect_regions
|
from .Regions import connect_regions
|
||||||
from .Rules import set_rules
|
from .Rules import set_rules
|
||||||
|
|
||||||
@@ -53,8 +53,17 @@ class GrinchWorld(World):
|
|||||||
if item == "Heart of Stone":
|
if item == "Heart of Stone":
|
||||||
for _ in range(3):
|
for _ in range(3):
|
||||||
self_itempool.append(self.create_item(item))
|
self_itempool.append(self.create_item(item))
|
||||||
|
|
||||||
|
#Get number of current unfilled locations
|
||||||
|
unfilled_locations: int = len(self.multiworld.get_unfilled_locations(self.player))
|
||||||
|
|
||||||
|
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
|
self.multiworld.itempool += self_itempool
|
||||||
|
|
||||||
def set_rules(self):
|
def set_rules(self):
|
||||||
self.multiworld.completion_condition[self.player] = lambda state: state.has("Goal", self.player)
|
self.multiworld.completion_condition[self.player] = lambda state: state.has("Goal", self.player)
|
||||||
set_rules(self)
|
set_rules(self)
|
||||||
|
|
||||||
|
def get_other_filler_item(self, other_filler: list[str]) -> str:
|
||||||
|
return self.random.choices(other_filler)[0]
|
Reference in New Issue
Block a user