KDL3, MM2: set goal condition before generate basic (#5382)

* move goal kdl3

* mm2

* missed the singular important line
This commit is contained in:
Silvris
2025-09-30 11:30:26 -05:00
committed by GitHub
parent d9955d624b
commit a30b43821f
3 changed files with 11 additions and 10 deletions

View File

@@ -303,9 +303,6 @@ class KDL3World(World):
def generate_basic(self) -> None: def generate_basic(self) -> None:
self.stage_shuffle_enabled = self.options.stage_shuffle > 0 self.stage_shuffle_enabled = self.options.stage_shuffle > 0
goal = self.options.goal.value
goal_location = self.multiworld.get_location(location_name.goals[goal], self.player)
goal_location.place_locked_item(KDL3Item("Love-Love Rod", ItemClassification.progression, None, self.player))
for level in range(1, 6): for level in range(1, 6):
self.multiworld.get_location(f"Level {level} Boss - Defeated", self.player) \ self.multiworld.get_location(f"Level {level} Boss - Defeated", self.player) \
.place_locked_item( .place_locked_item(
@@ -313,7 +310,6 @@ class KDL3World(World):
self.multiworld.get_location(f"Level {level} Boss - Purified", self.player) \ self.multiworld.get_location(f"Level {level} Boss - Purified", self.player) \
.place_locked_item( .place_locked_item(
KDL3Item(f"Level {level} Boss Purified", ItemClassification.progression, None, self.player)) KDL3Item(f"Level {level} Boss Purified", ItemClassification.progression, None, self.player))
self.multiworld.completion_condition[self.player] = lambda state: state.has("Love-Love Rod", self.player)
# this can technically be done at any point before generate_output # this can technically be done at any point before generate_output
if self.options.allow_bb: if self.options.allow_bb:
if self.options.allow_bb == self.options.allow_bb.option_enforced: if self.options.allow_bb == self.options.allow_bb.option_enforced:

View File

@@ -1,6 +1,8 @@
from BaseClasses import ItemClassification
from worlds.generic.Rules import set_rule, add_rule from worlds.generic.Rules import set_rule, add_rule
from .names import location_name, enemy_abilities, animal_friend_spawns from .items import KDL3Item
from .locations import location_table from .locations import location_table
from .names import location_name, enemy_abilities, animal_friend_spawns
from .options import GoalSpeed from .options import GoalSpeed
import typing import typing
@@ -111,6 +113,11 @@ def can_fix_angel_wings(state: "CollectionState", player: int, copy_abilities: t
def set_rules(world: "KDL3World") -> None: def set_rules(world: "KDL3World") -> None:
goal = world.options.goal.value
goal_location = world.multiworld.get_location(location_name.goals[goal], world.player)
goal_location.place_locked_item(KDL3Item("Love-Love Rod", ItemClassification.progression, None, world.player))
world.multiworld.completion_condition[world.player] = lambda state: state.has("Love-Love Rod", world.player)
# Level 1 # Level 1
set_rule(world.multiworld.get_location(location_name.grass_land_muchi, world.player), set_rule(world.multiworld.get_location(location_name.grass_land_muchi, world.player),
lambda state: can_reach_chuchu(state, world.player)) lambda state: can_reach_chuchu(state, world.player))

View File

@@ -133,6 +133,9 @@ class MM2World(World):
Consumables.option_all): Consumables.option_all):
stage.add_locations(energy_pickups[region], MM2Location) stage.add_locations(energy_pickups[region], MM2Location)
self.multiworld.regions.append(stage) self.multiworld.regions.append(stage)
goal_location = self.get_location(dr_wily)
goal_location.place_locked_item(MM2Item("Victory", ItemClassification.progression, None, self.player))
self.multiworld.completion_condition[self.player] = lambda state: state.has("Victory", self.player)
def create_item(self, name: str) -> MM2Item: def create_item(self, name: str) -> MM2Item:
item = item_table[name] item = item_table[name]
@@ -189,11 +192,6 @@ class MM2World(World):
f"Incompatible starting Robot Master, changing to " f"Incompatible starting Robot Master, changing to "
f"{self.options.starting_robot_master.current_key.replace('_', ' ').title()}") f"{self.options.starting_robot_master.current_key.replace('_', ' ').title()}")
def generate_basic(self) -> None:
goal_location = self.get_location(dr_wily)
goal_location.place_locked_item(MM2Item("Victory", ItemClassification.progression, None, self.player))
self.multiworld.completion_condition[self.player] = lambda state: state.has("Victory", self.player)
def fill_hook(self, def fill_hook(self,
progitempool: List["Item"], progitempool: List["Item"],
usefulitempool: List["Item"], usefulitempool: List["Item"],