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:
@@ -54,7 +54,7 @@ class WitnessWorld(World):
|
||||
|
||||
def _get_slot_data(self):
|
||||
return {
|
||||
'seed': self.world.random.randint(0, 1000000),
|
||||
'seed': self.multiworld.random.randint(0, 1000000),
|
||||
'victory_location': int(self.player_logic.VICTORY_LOCATION, 16),
|
||||
'panelhex_to_id': self.locat.CHECK_PANELHEX_TO_ID,
|
||||
'item_id_to_door_hexes': self.items.ITEM_ID_TO_DOOR_HEX,
|
||||
@@ -66,19 +66,19 @@ class WitnessWorld(World):
|
||||
}
|
||||
|
||||
def generate_early(self):
|
||||
if not (is_option_enabled(self.world, self.player, "shuffle_symbols")
|
||||
or get_option_value(self.world, self.player, "shuffle_doors")
|
||||
or is_option_enabled(self.world, self.player, "shuffle_lasers")):
|
||||
if self.world.players == 1:
|
||||
if not (is_option_enabled(self.multiworld, self.player, "shuffle_symbols")
|
||||
or get_option_value(self.multiworld, self.player, "shuffle_doors")
|
||||
or is_option_enabled(self.multiworld, self.player, "shuffle_lasers")):
|
||||
if self.multiworld.players == 1:
|
||||
warning("This Witness world doesn't have any progression items. Please turn on Symbol Shuffle, Door"
|
||||
" Shuffle or Laser Shuffle if that doesn't seem right.")
|
||||
else:
|
||||
raise Exception("This Witness world doesn't have any progression items. Please turn on Symbol Shuffle,"
|
||||
" Door Shuffle or Laser Shuffle.")
|
||||
|
||||
self.player_logic = WitnessPlayerLogic(self.world, self.player)
|
||||
self.locat = WitnessPlayerLocations(self.world, self.player, self.player_logic)
|
||||
self.items = WitnessPlayerItems(self.locat, self.world, self.player, self.player_logic)
|
||||
self.player_logic = WitnessPlayerLogic(self.multiworld, self.player)
|
||||
self.locat = WitnessPlayerLocations(self.multiworld, self.player, self.player_logic)
|
||||
self.items = WitnessPlayerItems(self.locat, self.multiworld, self.player, self.player_logic)
|
||||
self.regio = WitnessRegions(self.locat)
|
||||
|
||||
self.log_ids_to_hints = dict()
|
||||
@@ -99,12 +99,12 @@ class WitnessWorld(World):
|
||||
less_junk = 0
|
||||
|
||||
# Put good item on first check if symbol shuffle is on
|
||||
symbols = is_option_enabled(self.world, self.player, "shuffle_symbols")
|
||||
symbols = is_option_enabled(self.multiworld, self.player, "shuffle_symbols")
|
||||
|
||||
if symbols and get_option_value(self.world, self.player, "puzzle_randomization") != 1:
|
||||
random_good_item = self.world.random.choice(self.items.GOOD_ITEMS)
|
||||
if symbols and get_option_value(self.multiworld, self.player, "puzzle_randomization") != 1:
|
||||
random_good_item = self.multiworld.random.choice(self.items.GOOD_ITEMS)
|
||||
|
||||
first_check = self.world.get_location(
|
||||
first_check = self.multiworld.get_location(
|
||||
"Tutorial Gate Open", self.player
|
||||
)
|
||||
first_check.place_locked_item(items_by_name[random_good_item])
|
||||
@@ -113,7 +113,7 @@ class WitnessWorld(World):
|
||||
less_junk = 1
|
||||
|
||||
for item in self.player_logic.STARTING_INVENTORY:
|
||||
self.world.push_precollected(items_by_name[item])
|
||||
self.multiworld.push_precollected(items_by_name[item])
|
||||
pool.remove(items_by_name[item])
|
||||
|
||||
for item in self.items.EXTRA_AMOUNTS:
|
||||
@@ -133,28 +133,28 @@ class WitnessWorld(World):
|
||||
item_obj = self.create_item(
|
||||
self.player_logic.EVENT_ITEM_PAIRS[event_location]
|
||||
)
|
||||
location_obj = self.world.get_location(event_location, self.player)
|
||||
location_obj = self.multiworld.get_location(event_location, self.player)
|
||||
location_obj.place_locked_item(item_obj)
|
||||
|
||||
self.world.itempool += pool
|
||||
self.multiworld.itempool += pool
|
||||
|
||||
def create_regions(self):
|
||||
self.regio.create_regions(self.world, self.player, self.player_logic)
|
||||
self.regio.create_regions(self.multiworld, self.player, self.player_logic)
|
||||
|
||||
def set_rules(self):
|
||||
set_rules(self.world, self.player, self.player_logic, self.locat)
|
||||
set_rules(self.multiworld, self.player, self.player_logic, self.locat)
|
||||
|
||||
def fill_slot_data(self) -> dict:
|
||||
hint_amount = get_option_value(self.world, self.player, "hint_amount")
|
||||
hint_amount = get_option_value(self.multiworld, self.player, "hint_amount")
|
||||
|
||||
credits_hint = ("This Randomizer", "is brought to you by", "NewSoupVi, Jarno, jbzdarkid, sigma144", -1)
|
||||
|
||||
audio_logs = get_audio_logs().copy()
|
||||
|
||||
if hint_amount != 0:
|
||||
generated_hints = make_hints(self.world, self.player, hint_amount)
|
||||
generated_hints = make_hints(self.multiworld, self.player, hint_amount)
|
||||
|
||||
self.world.random.shuffle(audio_logs)
|
||||
self.multiworld.random.shuffle(audio_logs)
|
||||
|
||||
duplicates = len(audio_logs) // hint_amount
|
||||
|
||||
@@ -169,7 +169,7 @@ class WitnessWorld(World):
|
||||
audio_log = audio_logs.pop()
|
||||
self.log_ids_to_hints[int(audio_log, 16)] = credits_hint
|
||||
|
||||
joke_hints = generate_joke_hints(self.world, len(audio_logs))
|
||||
joke_hints = generate_joke_hints(self.multiworld, len(audio_logs))
|
||||
|
||||
while audio_logs:
|
||||
audio_log = audio_logs.pop()
|
||||
@@ -181,7 +181,7 @@ class WitnessWorld(World):
|
||||
|
||||
for option_name in the_witness_options:
|
||||
slot_data[option_name] = get_option_value(
|
||||
self.world, self.player, option_name
|
||||
self.multiworld, self.player, option_name
|
||||
)
|
||||
|
||||
return slot_data
|
||||
@@ -234,7 +234,7 @@ def create_region(world: MultiWorld, player: int, name: str,
|
||||
"""
|
||||
|
||||
ret = Region(name, RegionType.Generic, name, player)
|
||||
ret.world = world
|
||||
ret.multiworld = world
|
||||
if region_locations:
|
||||
for location in region_locations:
|
||||
loc_id = locat.CHECK_LOCATION_TABLE[location]
|
||||
|
||||
Reference in New Issue
Block a user