Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
nbrochu committed Jan 25, 2025
1 parent 44b0d32 commit 44ea3a6
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 103 deletions.
45 changes: 15 additions & 30 deletions worlds/keymasters_keep/games/mega_man_2_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def optional_game_constraint_templates(self) -> List[GameObjectiveTemplate]:
return constraints

def game_objective_templates(self) -> List[GameObjectiveTemplate]:
objectives: List[GameObjectiveTemplate] = [
templates: List[GameObjectiveTemplate] = [
GameObjectiveTemplate(
label="Defeat Metal Man CONDITION",
data={
Expand Down Expand Up @@ -132,7 +132,7 @@ def game_objective_templates(self) -> List[GameObjectiveTemplate]:
]

if self.include_wily_stages:
objectives += [
templates.extend([
GameObjectiveTemplate(
label="Defeat Mecha Dragon CONDITION",
data={
Expand Down Expand Up @@ -183,13 +183,13 @@ def game_objective_templates(self) -> List[GameObjectiveTemplate]:
is_difficult=False,
weight=5,
),
]
])

return objectives
return templates

@property
def include_wily_stages(self) -> bool:
return self.archipelago_options.mega_man_2_wily_stages.value
return bool(self.archipelago_options.mega_man_2_wily_stages.value)

@staticmethod
def mm2_weapons() -> List[str]:
Expand All @@ -202,14 +202,10 @@ def mm2_weapons() -> List[str]:
def metal_man_weapons(self) -> List[str]:
weapons: List[str] = self.mm2_weapons()

weapons.extend([
"using only Quick Boomerang",
])
weapons.append("using only Quick Boomerang")

if self.include_difficult_objectives:
weapons.extend([
"using only Atomic Fire",
])
weapons.append("using only Atomic Fire")

if self.include_wily_stages:
weapons.append("using only Metal Blade")
Expand Down Expand Up @@ -240,9 +236,7 @@ def bubble_man_weapons(self) -> List[str]:
def quick_man_weapons(self) -> List[str]:
weapons: List[str] = self.mm2_weapons()

weapons.extend([
"using only Atomic Fire",
])
weapons.append("using only Atomic Fire")

if self.include_difficult_objectives:
weapons.extend([
Expand All @@ -262,9 +256,7 @@ def crash_man_weapons(self) -> List[str]:
])

if self.include_difficult_objectives:
weapons.extend([
"using only Atomic Fire",
])
weapons.append("using only Atomic Fire")

return weapons

Expand All @@ -289,9 +281,7 @@ def heat_man_weapons(self) -> List[str]:
])

if self.include_difficult_objectives:
weapons.extend([
"using only Air Shooter",
])
weapons.append("using only Air Shooter")

return weapons

Expand All @@ -315,9 +305,7 @@ def mecha_dragon_weapons(self) -> List[str]:
])

if self.include_difficult_objectives:
weapons.extend([
"using only Atomic Fire",
])
weapons.append("using only Atomic Fire")

return weapons

Expand All @@ -331,9 +319,7 @@ def picopico_kun_weapons(self) -> List[str]:
])

if self.include_difficult_objectives:
weapons.extend([
"using only Atomic Fire",
])
weapons.append("using only Atomic Fire")

return weapons

Expand All @@ -356,16 +342,15 @@ def guts_tank_weapons(self) -> List[str]:
def wily_machine_2_weapons(self) -> List[str]:
weapons: List[str] = self.mm2_weapons()

weapons.extend([
"using only Metal Blade",
])
weapons.append("using only Metal Blade")

return weapons


# Archipelago Options
class MegaMan2WilyStages(DefaultOnToggle):
"""
If enabled, objectives that require you to enter the Wily Stages may be included.
If enabled, Mega Man 2 objectives that require you to enter the Wily Stages may be included.
"""

display_name = "Mega Man 2 Wily Stages"
64 changes: 22 additions & 42 deletions worlds/keymasters_keep/games/mega_man_3_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

@dataclass
class MegaMan3KeymastersKeepOptions:
mega_man_3_latest_stages: MegaMan3WilyStages
mega_man_3_latest_stages: MegaMan3LatestStages


class MegaMan3Game(Game):
Expand Down Expand Up @@ -55,7 +55,7 @@ def optional_game_constraint_templates(self) -> List[GameObjectiveTemplate]:
return constraints

def game_objective_templates(self) -> List[GameObjectiveTemplate]:
objectives: List[GameObjectiveTemplate] = [
templates: List[GameObjectiveTemplate] = [
GameObjectiveTemplate(
label="Defeat Needle Man CONDITION",
data={
Expand Down Expand Up @@ -140,7 +140,7 @@ def game_objective_templates(self) -> List[GameObjectiveTemplate]:
]

if self.include_doc_robot_stages:
objectives.extend([
templates.extend([
GameObjectiveTemplate(
label="Defeat Doc Robot (Metal Man) CONDITION",
data={
Expand Down Expand Up @@ -216,7 +216,7 @@ def game_objective_templates(self) -> List[GameObjectiveTemplate]:
])

if self.include_wily_stages:
objectives.extend([
templates.extend([
GameObjectiveTemplate(
label="Defeat Break Man",
data=dict(),
Expand Down Expand Up @@ -271,17 +271,15 @@ def game_objective_templates(self) -> List[GameObjectiveTemplate]:
),
])

return objectives
return templates

@property
def include_doc_robot_stages(self) -> bool:
if self.archipelago_options.mega_man_3_latest_stages.value >= 1:
return True
return self.archipelago_options.mega_man_3_latest_stages.value >= 1

@property
def include_wily_stages(self) -> bool:
if self.archipelago_options.mega_man_3_latest_stages.value >= 2:
return True
return self.archipelago_options.mega_man_3_latest_stages.value >= 2

@staticmethod
def mm3_weapons() -> List[str]:
Expand Down Expand Up @@ -312,9 +310,7 @@ def needle_man_weapons(self) -> List[str]:
def magnet_man_weapons(self) -> List[str]:
weapons: List[str] = self.mm3_weapons()

weapons.extend([
"using only Spark Shock",
])
weapons.append("using only Spark Shock")

if self.include_difficult_objectives:
weapons.extend([
Expand Down Expand Up @@ -359,9 +355,7 @@ def top_man_weapons(self) -> List[str]:
weapons: List[str] = self.mm3_weapons()

if self.include_difficult_objectives:
weapons.extend([
"using only Spark Shock",
])
weapons.append("using only Spark Shock")

return weapons

Expand Down Expand Up @@ -395,9 +389,7 @@ def spark_man_weapons(self) -> List[str]:
]

if self.include_difficult_objectives:
weapons.extend([
"using only Hard Knuckle",
])
weapons.append("using only Hard Knuckle")

if self.include_wily_stages:
weapons.append("using only Spark Shock")
Expand Down Expand Up @@ -435,13 +427,11 @@ def proto_man_weapons(self) -> List[str]:
]

if self.include_difficult_objectives:
weapons.extend([
"using only Magnet Missile",
])
weapons.append("using only Magnet Missile")

return weapons

@staticmethod # Will not be static if any of these methods are labeled 'difficult'
@staticmethod
def doc_metal_weapons() -> List[str]:
weapons: List[str] = [
"",
Expand All @@ -458,9 +448,7 @@ def doc_metal_weapons() -> List[str]:
def doc_quick_weapons(self) -> List[str]:
weapons: List[str] = self.mm3_weapons()

weapons.extend([
"using only Gemini Laser",
])
weapons.append("using only Gemini Laser")

if self.include_difficult_objectives:
weapons.extend([
Expand Down Expand Up @@ -492,23 +480,17 @@ def doc_air_weapons(self) -> List[str]:
def doc_crash_weapons(self) -> List[str]:
weapons: List[str] = self.mm3_weapons()

weapons.extend([
"using only Hard Knuckle",
])
weapons.append("using only Hard Knuckle")

if self.include_difficult_objectives:
weapons.extend([
"using only Spark Shock",
])
weapons.append("using only Spark Shock")

return weapons

def doc_flash_weapons(self) -> List[str]:
weapons: List[str] = self.mm3_weapons()

weapons.extend([
"using only Gemini Laser",
])
weapons.append("using only Gemini Laser")

return weapons

Expand All @@ -523,9 +505,7 @@ def doc_bubble_weapons(self) -> List[str]:
]

if self.include_difficult_objectives:
weapons.extend([
"using only Hard Knuckle",
])
weapons.append("using only Hard Knuckle")

return weapons

Expand Down Expand Up @@ -562,7 +542,7 @@ def kamegoro_maker_weapons(self) -> List[str]:

return weapons

@staticmethod # Will not be static if any of these methods are labeled 'difficult'
@staticmethod
def yellow_devil_mk_ii_weapons() -> List[str]:
weapons: List[str] = [
"",
Expand Down Expand Up @@ -601,7 +581,7 @@ def wily_machine_3_weapons(self) -> List[str]:

return weapons

@staticmethod # Will not be static if any of these methods are labeled 'difficult'
@staticmethod
def gamma_weapons() -> List[str]:
weapons: List[str] = [
"",
Expand All @@ -614,10 +594,10 @@ def gamma_weapons() -> List[str]:

return weapons


class MegaMan3WilyStages(Choice):
# Archipelago Options
class MegaMan3LatestStages(Choice):
"""
Determines the latest wave of stages that may have trial objectives.
Determines the latest wave of Mega Man 3 stages that may have trial objectives.
"""

display_name = "Mega Man 3 Latest Stages"
Expand Down
Loading

0 comments on commit 44ea3a6

Please sign in to comment.