Skip to content

Commit

Permalink
DOOM 1993: Added goal to beat only boss
Browse files Browse the repository at this point in the history
  • Loading branch information
Daivuk committed Nov 25, 2023
1 parent 477e7ca commit c910340
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
13 changes: 13 additions & 0 deletions worlds/doom_1993/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
from Options import AssembleOptions, Choice, Toggle, DeathLink, DefaultOnToggle, StartInventoryPool


class Goal(Choice):
"""
Choose the main goal.
complete_all_levels: All levels of the selected episodes
complete_boss_levels: Boss levels (E#M8) of selected episodes
"""
display_name = "Goal"
option_complete_all_levels = 0
option_complete_boss_levels = 1
default = 0


class Difficulty(Choice):
"""
Choose the difficulty option. Those match DOOM's difficulty options.
Expand Down Expand Up @@ -130,6 +142,7 @@ class Episode4(Toggle):

options: typing.Dict[str, AssembleOptions] = {
"start_inventory_from_pool": StartInventoryPool,
"goal": Goal,
"difficulty": Difficulty,
"random_monsters": RandomMonsters,
"random_pickups": RandomPickups,
Expand Down
13 changes: 12 additions & 1 deletion worlds/doom_1993/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ class DOOM1993World(World):
"Hell Beneath (E4M1)"
]

boss_level_for_espidoes: List[str] = [
"Phobos Anomaly (E1M8)",
"Tower of Babel (E2M8)",
"Dis (E3M8)",
"Unto the Cruel (E4M8)"
]

# Item ratio that scales depending on episode count. These are the ratio for 3 episode.
items_ratio: Dict[str, float] = {
"Armor": 41,
Expand Down Expand Up @@ -140,7 +147,11 @@ def create_regions(self):
self.location_count = len(self.multiworld.get_locations(self.player))

def completion_rule(self, state: CollectionState):
for map_name in Maps.map_names:
goal_levels = Maps.map_names
if getattr(self.multiworld, "goal")[self.player].value:
goal_levels = self.boss_level_for_espidoes

for map_name in goal_levels:
if map_name + " - Exit" not in self.location_name_to_id:
continue

Expand Down

0 comments on commit c910340

Please sign in to comment.