DOOM 1993: Added various new options (#2067)

This commit is contained in:
David St-Louis
2023-11-25 09:43:14 -05:00
committed by GitHub
parent 59ed2602bd
commit c138918400
7 changed files with 316 additions and 186 deletions

View File

@@ -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,
@@ -90,6 +97,8 @@ class DOOM1993World(World):
self.included_episodes[0] = 1
def create_regions(self):
pro = getattr(self.multiworld, "pro")[self.player].value
# Main regions
menu_region = Region("Menu", self.player, self.multiworld)
hub_region = Region("Hub", self.player, self.multiworld)
@@ -116,8 +125,11 @@ class DOOM1993World(World):
self.multiworld.regions.append(region)
for connection in region_dict["connections"]:
connections.append((region, connection))
for connection_dict in region_dict["connections"]:
# Check if it's a pro-only connection
if connection_dict["pro"] and not pro:
continue
connections.append((region, connection_dict["target"]))
# Connect main regions to Hub
hub_region.add_exits(main_regions)
@@ -135,7 +147,11 @@ class DOOM1993World(World):
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
@@ -151,12 +167,15 @@ class DOOM1993World(World):
return True
def set_rules(self):
Rules.set_rules(self, self.included_episodes)
pro = getattr(self.multiworld, "pro")[self.player].value
allow_death_logic = getattr(self.multiworld, "allow_death_logic")[self.player].value
Rules.set_rules(self, self.included_episodes, pro)
self.multiworld.completion_condition[self.player] = lambda state: self.completion_rule(state)
# Forbid progression items to locations that can be missed and can't be picked up. (e.g. One-time timed
# platform) Unless the user allows for it.
if not getattr(self.multiworld, "allow_death_logic")[self.player].value:
if not allow_death_logic:
for death_logic_location in Locations.death_logic_locations:
self.multiworld.exclude_locations[self.player].value.add(death_logic_location)
@@ -165,7 +184,6 @@ class DOOM1993World(World):
return DOOM1993Item(name, Items.item_table[item_id]["classification"], item_id, self.player)
def create_items(self):
is_only_first_episode: bool = self.get_episode_count() == 1 and self.included_episodes[0]
itempool: List[DOOM1993Item] = []
start_with_computer_area_maps: bool = getattr(self.multiworld, "start_with_computer_area_maps")[self.player].value
@@ -180,9 +198,6 @@ class DOOM1993World(World):
if item["episode"] != -1 and not self.included_episodes[item["episode"] - 1]:
continue
if item["name"] in {"BFG9000", "Plasma Gun"} and is_only_first_episode:
continue # Don't include those guns if only first episode
count = item["count"] if item["name"] not in self.starting_level_for_episode else item["count"] - 1
itempool += [self.create_item(item["name"]) for _ in range(count)]
@@ -212,8 +227,10 @@ class DOOM1993World(World):
# Give Computer area maps if option selected
if getattr(self.multiworld, "start_with_computer_area_maps")[self.player].value:
for item_id, item_dict in Items.item_table.items():
if item_dict["doom_type"] == DOOM_TYPE_COMPUTER_AREA_MAP:
self.multiworld.push_precollected(self.create_item(item_dict["name"]))
item_episode = item_dict["episode"]
if item_episode > 0:
if item_dict["doom_type"] == DOOM_TYPE_COMPUTER_AREA_MAP and self.included_episodes[item_episode - 1]:
self.multiworld.push_precollected(self.create_item(item_dict["name"]))
# Fill the rest starting with powerups, then fillers
self.create_ratioed_items("Armor", itempool)