HK: Removes Vanilla Items from ItemPool and Uses Grimmchild1 when relevant (#2898)
This commit is contained in:
parent
67ed0fdca5
commit
72e6383cc7
|
@ -35,6 +35,7 @@ item_name_groups = ({
|
||||||
"GeoChests": lookup_type_to_names["Geo"],
|
"GeoChests": lookup_type_to_names["Geo"],
|
||||||
"GeoRocks": lookup_type_to_names["Rock"],
|
"GeoRocks": lookup_type_to_names["Rock"],
|
||||||
"GrimmkinFlames": lookup_type_to_names["Flame"],
|
"GrimmkinFlames": lookup_type_to_names["Flame"],
|
||||||
|
"Grimmchild": {"Grimmchild1", "Grimmchild2"},
|
||||||
"Grubs": lookup_type_to_names["Grub"],
|
"Grubs": lookup_type_to_names["Grub"],
|
||||||
"JournalEntries": lookup_type_to_names["Journal"],
|
"JournalEntries": lookup_type_to_names["Journal"],
|
||||||
"JunkPitChests": lookup_type_to_names["JunkPitChest"],
|
"JunkPitChests": lookup_type_to_names["JunkPitChest"],
|
||||||
|
|
|
@ -406,6 +406,15 @@ class ExtraPlatforms(DefaultOnToggle):
|
||||||
"""Places additional platforms to make traveling throughout Hallownest more convenient."""
|
"""Places additional platforms to make traveling throughout Hallownest more convenient."""
|
||||||
|
|
||||||
|
|
||||||
|
class AddUnshuffledLocations(Toggle):
|
||||||
|
"""Adds non-randomized locations to the location pool, which allows syncing
|
||||||
|
of location state with co-op or automatic collection via collect.
|
||||||
|
|
||||||
|
Note: This will increase the number of location checks required to purchase
|
||||||
|
hints to the total maximum.
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
class DeathLinkShade(Choice):
|
class DeathLinkShade(Choice):
|
||||||
"""Sets whether to create a shade when you are killed by a DeathLink and how to handle your existing shade, if any.
|
"""Sets whether to create a shade when you are killed by a DeathLink and how to handle your existing shade, if any.
|
||||||
|
|
||||||
|
@ -488,7 +497,7 @@ hollow_knight_options: typing.Dict[str, type(Option)] = {
|
||||||
**{
|
**{
|
||||||
option.__name__: option
|
option.__name__: option
|
||||||
for option in (
|
for option in (
|
||||||
StartLocation, Goal, WhitePalace, ExtraPlatforms, StartingGeo,
|
StartLocation, Goal, WhitePalace, ExtraPlatforms, AddUnshuffledLocations, StartingGeo,
|
||||||
DeathLink, DeathLinkShade, DeathLinkBreaksFragileCharms,
|
DeathLink, DeathLinkShade, DeathLinkBreaksFragileCharms,
|
||||||
MinimumGeoPrice, MaximumGeoPrice,
|
MinimumGeoPrice, MaximumGeoPrice,
|
||||||
MinimumGrubPrice, MaximumGrubPrice,
|
MinimumGrubPrice, MaximumGrubPrice,
|
||||||
|
|
|
@ -234,7 +234,7 @@ class HKWorld(World):
|
||||||
randomized_starting_items.update(items)
|
randomized_starting_items.update(items)
|
||||||
|
|
||||||
# noinspection PyShadowingNames
|
# noinspection PyShadowingNames
|
||||||
def _add(item_name: str, location_name: str):
|
def _add(item_name: str, location_name: str, randomized: bool):
|
||||||
"""
|
"""
|
||||||
Adds a pairing of an item and location, doing appropriate checks to see if it should be vanilla or not.
|
Adds a pairing of an item and location, doing appropriate checks to see if it should be vanilla or not.
|
||||||
"""
|
"""
|
||||||
|
@ -252,7 +252,7 @@ class HKWorld(World):
|
||||||
if item_name in junk_replace:
|
if item_name in junk_replace:
|
||||||
item_name = self.get_filler_item_name()
|
item_name = self.get_filler_item_name()
|
||||||
|
|
||||||
item = self.create_item(item_name)
|
item = self.create_item(item_name) if not vanilla or location_name == "Start" or self.multiworld.AddUnshuffledLocations[self.player] else self.create_event(item_name)
|
||||||
|
|
||||||
if location_name == "Start":
|
if location_name == "Start":
|
||||||
if item_name in randomized_starting_items:
|
if item_name in randomized_starting_items:
|
||||||
|
@ -277,30 +277,35 @@ class HKWorld(World):
|
||||||
|
|
||||||
for option_key, option in hollow_knight_randomize_options.items():
|
for option_key, option in hollow_knight_randomize_options.items():
|
||||||
randomized = getattr(self.multiworld, option_key)[self.player]
|
randomized = getattr(self.multiworld, option_key)[self.player]
|
||||||
|
if all([not randomized, option_key in logicless_options, not self.multiworld.AddUnshuffledLocations[self.player]]):
|
||||||
|
continue
|
||||||
for item_name, location_name in zip(option.items, option.locations):
|
for item_name, location_name in zip(option.items, option.locations):
|
||||||
if item_name in junk_replace:
|
if item_name in junk_replace:
|
||||||
item_name = self.get_filler_item_name()
|
item_name = self.get_filler_item_name()
|
||||||
|
|
||||||
if (item_name == "Crystal_Heart" and self.multiworld.SplitCrystalHeart[self.player]) or \
|
if (item_name == "Crystal_Heart" and self.multiworld.SplitCrystalHeart[self.player]) or \
|
||||||
(item_name == "Mothwing_Cloak" and self.multiworld.SplitMothwingCloak[self.player]):
|
(item_name == "Mothwing_Cloak" and self.multiworld.SplitMothwingCloak[self.player]):
|
||||||
_add("Left_" + item_name, location_name)
|
_add("Left_" + item_name, location_name, randomized)
|
||||||
_add("Right_" + item_name, "Split_" + location_name)
|
_add("Right_" + item_name, "Split_" + location_name, randomized)
|
||||||
continue
|
continue
|
||||||
if item_name == "Mantis_Claw" and self.multiworld.SplitMantisClaw[self.player]:
|
if item_name == "Mantis_Claw" and self.multiworld.SplitMantisClaw[self.player]:
|
||||||
_add("Left_" + item_name, "Left_" + location_name)
|
_add("Left_" + item_name, "Left_" + location_name, randomized)
|
||||||
_add("Right_" + item_name, "Right_" + location_name)
|
_add("Right_" + item_name, "Right_" + location_name, randomized)
|
||||||
continue
|
continue
|
||||||
if item_name == "Shade_Cloak" and self.multiworld.SplitMothwingCloak[self.player]:
|
if item_name == "Shade_Cloak" and self.multiworld.SplitMothwingCloak[self.player]:
|
||||||
if self.multiworld.random.randint(0, 1):
|
if self.multiworld.random.randint(0, 1):
|
||||||
item_name = "Left_Mothwing_Cloak"
|
item_name = "Left_Mothwing_Cloak"
|
||||||
else:
|
else:
|
||||||
item_name = "Right_Mothwing_Cloak"
|
item_name = "Right_Mothwing_Cloak"
|
||||||
|
if item_name == "Grimmchild2" and self.multiworld.RandomizeGrimmkinFlames[self.player] and self.multiworld.RandomizeCharms[self.player]:
|
||||||
|
_add("Grimmchild1", location_name, randomized)
|
||||||
|
continue
|
||||||
|
|
||||||
_add(item_name, location_name)
|
_add(item_name, location_name, randomized)
|
||||||
|
|
||||||
if self.multiworld.RandomizeElevatorPass[self.player]:
|
if self.multiworld.RandomizeElevatorPass[self.player]:
|
||||||
randomized = True
|
randomized = True
|
||||||
_add("Elevator_Pass", "Elevator_Pass")
|
_add("Elevator_Pass", "Elevator_Pass", randomized)
|
||||||
|
|
||||||
for shop, locations in self.created_multi_locations.items():
|
for shop, locations in self.created_multi_locations.items():
|
||||||
for _ in range(len(locations), getattr(self.multiworld, shop_to_option[shop])[self.player].value):
|
for _ in range(len(locations), getattr(self.multiworld, shop_to_option[shop])[self.player].value):
|
||||||
|
@ -475,6 +480,10 @@ class HKWorld(World):
|
||||||
item_data = item_table[name]
|
item_data = item_table[name]
|
||||||
return HKItem(name, item_data.advancement, item_data.id, item_data.type, self.player)
|
return HKItem(name, item_data.advancement, item_data.id, item_data.type, self.player)
|
||||||
|
|
||||||
|
def create_event(self, name: str) -> HKItem:
|
||||||
|
item_data = item_table[name]
|
||||||
|
return HKItem(name, item_data.advancement, None, item_data.type, self.player)
|
||||||
|
|
||||||
def create_location(self, name: str, vanilla=False) -> HKLocation:
|
def create_location(self, name: str, vanilla=False) -> HKLocation:
|
||||||
costs = None
|
costs = None
|
||||||
basename = name
|
basename = name
|
||||||
|
@ -493,6 +502,12 @@ class HKWorld(World):
|
||||||
name = f"{name}_{i}"
|
name = f"{name}_{i}"
|
||||||
|
|
||||||
region = self.multiworld.get_region("Menu", self.player)
|
region = self.multiworld.get_region("Menu", self.player)
|
||||||
|
|
||||||
|
if vanilla and not self.multiworld.AddUnshuffledLocations[self.player]:
|
||||||
|
loc = HKLocation(self.player, name,
|
||||||
|
None, region, costs=costs, vanilla=vanilla,
|
||||||
|
basename=basename)
|
||||||
|
else:
|
||||||
loc = HKLocation(self.player, name,
|
loc = HKLocation(self.player, name,
|
||||||
self.location_name_to_id[name], region, costs=costs, vanilla=vanilla,
|
self.location_name_to_id[name], region, costs=costs, vanilla=vanilla,
|
||||||
basename=basename)
|
basename=basename)
|
||||||
|
|
Loading…
Reference in New Issue