TUNIC: Minor refactor of the vanilla_portals function (#3009)

* Remove unused, change an if to an elif

* Remove unused import
This commit is contained in:
Scipio Wright 2024-03-28 17:23:37 -04:00 committed by GitHub
parent eb66886a90
commit c97215e0e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 5 deletions

View File

@ -1,4 +1,4 @@
from typing import Dict, List, Set, Tuple, TYPE_CHECKING from typing import Dict, List, Set, TYPE_CHECKING
from BaseClasses import Region, ItemClassification, Item, Location from BaseClasses import Region, ItemClassification, Item, Location
from .locations import location_table from .locations import location_table
from .er_data import Portal, tunic_er_regions, portal_mapping, \ from .er_data import Portal, tunic_er_regions, portal_mapping, \
@ -89,7 +89,6 @@ def place_event_items(world: "TunicWorld", regions: Dict[str, Region]) -> None:
def vanilla_portals() -> Dict[Portal, Portal]: def vanilla_portals() -> Dict[Portal, Portal]:
portal_pairs: Dict[Portal, Portal] = {} portal_pairs: Dict[Portal, Portal] = {}
portal_map = portal_mapping.copy() portal_map = portal_mapping.copy()
shop_num = 1
while portal_map: while portal_map:
portal1 = portal_map[0] portal1 = portal_map[0]
@ -98,11 +97,10 @@ def vanilla_portals() -> Dict[Portal, Portal]:
portal2_sdt = portal1.destination_scene() portal2_sdt = portal1.destination_scene()
if portal2_sdt.startswith("Shop,"): if portal2_sdt.startswith("Shop,"):
portal2 = Portal(name=f"Shop", region="Shop", portal2 = Portal(name="Shop", region="Shop",
destination="Previous Region", tag="_") destination="Previous Region", tag="_")
shop_num += 1
if portal2_sdt == "Purgatory, Purgatory_bottom": elif portal2_sdt == "Purgatory, Purgatory_bottom":
portal2_sdt = "Purgatory, Purgatory_top" portal2_sdt = "Purgatory, Purgatory_top"
for portal in portal_map: for portal in portal_map: