Core: rename world to multiworld (#931)

* rename references to `Multiworld` in core to `multiworld` instead of `world`

* fix smz3

* fix oot

* fix low hanging fruit

* revert mysteriously broken spacing in world api.md

* fix more randomly broken spacing

* hate

* that better be all of it

* begrudgingly move over smw

* ._.

* missed some worlds

* this is getting tedious now

* Missed some self.world definitions

Co-authored-by: espeon65536 <espeon65536@gmail.com>
Co-authored-by: Zach Parks <zach@alliware.com>
This commit is contained in:
alwaysintreble
2022-10-31 21:41:21 -05:00
committed by GitHub
parent 87f4a97f1e
commit 2af510328e
85 changed files with 1623 additions and 1621 deletions

View File

@@ -47,22 +47,22 @@ class SubnauticaWorld(World):
creatures_to_scan: List[str]
def generate_early(self) -> None:
if "Seaglide Fragment" not in self.world.early_items[self.player]:
self.world.early_items[self.player].value["Seaglide Fragment"] = 2
if "Seaglide Fragment" not in self.multiworld.early_items[self.player]:
self.multiworld.early_items[self.player].value["Seaglide Fragment"] = 2
scan_option: Options.AggressiveScanLogic = self.world.creature_scan_logic[self.player]
scan_option: Options.AggressiveScanLogic = self.multiworld.creature_scan_logic[self.player]
creature_pool = scan_option.get_pool()
self.world.creature_scans[self.player].value = min(
self.multiworld.creature_scans[self.player].value = min(
len(creature_pool),
self.world.creature_scans[self.player].value
self.multiworld.creature_scans[self.player].value
)
self.creatures_to_scan = self.world.random.sample(creature_pool,
self.world.creature_scans[self.player].value)
self.creatures_to_scan = self.multiworld.random.sample(creature_pool,
self.multiworld.creature_scans[self.player].value)
def create_regions(self):
self.world.regions += [
self.multiworld.regions += [
self.create_region("Menu", None, ["Lifepod 5"]),
self.create_region("Planet 4546B",
Locations.events +
@@ -75,13 +75,13 @@ class SubnauticaWorld(World):
def generate_basic(self):
# Link regions
self.world.get_entrance("Lifepod 5", self.player).connect(self.world.get_region("Planet 4546B", self.player))
self.multiworld.get_entrance("Lifepod 5", self.player).connect(self.multiworld.get_region("Planet 4546B", self.player))
# Generate item pool
pool = []
neptune_launch_platform = None
extras = self.world.creature_scans[self.player].value
valuable = self.world.item_pool[self.player] == Options.ItemPool.option_valuable
extras = self.multiworld.creature_scans[self.player].value
valuable = self.multiworld.item_pool[self.player] == Options.ItemPool.option_valuable
for item in item_table.values():
for i in range(item["count"]):
subnautica_item = self.create_item(item["name"])
@@ -92,26 +92,26 @@ class SubnauticaWorld(World):
else:
pool.append(subnautica_item)
for item_name in self.world.random.choices(sorted(Items.advancement_item_names - {"Neptune Launch Platform"}),
k=extras):
for item_name in self.multiworld.random.choices(sorted(Items.advancement_item_names - {"Neptune Launch Platform"}),
k=extras):
item = self.create_item(item_name)
item.classification = ItemClassification.filler # as it's an extra, just fast-fill it somewhere
pool.append(item)
self.world.itempool += pool
self.multiworld.itempool += pool
# Victory item
self.world.get_location("Aurora - Captain Data Terminal", self.player).place_locked_item(
self.multiworld.get_location("Aurora - Captain Data Terminal", self.player).place_locked_item(
neptune_launch_platform)
for event in Locations.events:
self.world.get_location(event, self.player).place_locked_item(
self.multiworld.get_location(event, self.player).place_locked_item(
SubnauticaItem(event, ItemClassification.progression, None, player=self.player))
# make the goal event the victory "item"
self.world.get_location(self.world.goal[self.player].get_event_name(), self.player).item.name = "Victory"
self.multiworld.get_location(self.multiworld.goal[self.player].get_event_name(), self.player).item.name = "Victory"
def fill_slot_data(self) -> Dict[str, Any]:
goal: Options.Goal = self.world.goal[self.player]
item_pool: Options.ItemPool = self.world.item_pool[self.player]
goal: Options.Goal = self.multiworld.goal[self.player]
item_pool: Options.ItemPool = self.multiworld.item_pool[self.player]
vanilla_tech: List[str] = []
if item_pool == Options.ItemPool.option_valuable:
for item in Items.item_table.values():
@@ -122,7 +122,7 @@ class SubnauticaWorld(World):
"goal": goal.current_key,
"vanilla_tech": vanilla_tech,
"creatures_to_scan": self.creatures_to_scan,
"death_link": self.world.death_link[self.player].value,
"death_link": self.multiworld.death_link[self.player].value,
}
return slot_data
@@ -136,7 +136,7 @@ class SubnauticaWorld(World):
def create_region(self, name: str, locations=None, exits=None):
ret = Region(name, RegionType.Generic, name, self.player)
ret.world = self.world
ret.multiworld = self.multiworld
if locations:
for location in locations:
loc_id = self.location_name_to_id.get(location, None)