mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 04:01:32 -06:00
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:
@@ -44,42 +44,42 @@ class V6World(World):
|
||||
option_definitions = v6_options
|
||||
|
||||
def create_regions(self):
|
||||
create_regions(self.world,self.player)
|
||||
create_regions(self.multiworld, self.player)
|
||||
|
||||
def set_rules(self):
|
||||
self.area_connections = {}
|
||||
self.area_cost_map = {}
|
||||
set_rules(self.world, self.player, self.area_connections, self.area_cost_map)
|
||||
set_rules(self.multiworld, self.player, self.area_connections, self.area_cost_map)
|
||||
|
||||
def create_item(self, name: str) -> Item:
|
||||
return V6Item(name, ItemClassification.progression, item_table[name], self.player)
|
||||
|
||||
def generate_basic(self):
|
||||
trinkets = [self.create_item("Trinket " + str(i+1).zfill(2)) for i in range(0,20)]
|
||||
self.world.itempool += trinkets
|
||||
self.multiworld.itempool += trinkets
|
||||
|
||||
musiclist_o = [1,2,3,4,9,12]
|
||||
musiclist_s = musiclist_o.copy()
|
||||
if self.world.MusicRandomizer[self.player].value:
|
||||
self.world.random.shuffle(musiclist_s)
|
||||
if self.multiworld.MusicRandomizer[self.player].value:
|
||||
self.multiworld.random.shuffle(musiclist_s)
|
||||
self.music_map = dict(zip(musiclist_o, musiclist_s))
|
||||
|
||||
def fill_slot_data(self):
|
||||
return {
|
||||
"MusicRando": self.music_map,
|
||||
"AreaRando": self.area_connections,
|
||||
"DoorCost": self.world.DoorCost[self.player].value,
|
||||
"DoorCost": self.multiworld.DoorCost[self.player].value,
|
||||
"AreaCostRando": self.area_cost_map,
|
||||
"DeathLink": self.world.death_link[self.player].value,
|
||||
"DeathLink_Amnesty": self.world.DeathLinkAmnesty[self.player].value
|
||||
"DeathLink": self.multiworld.death_link[self.player].value,
|
||||
"DeathLink_Amnesty": self.multiworld.DeathLinkAmnesty[self.player].value
|
||||
}
|
||||
|
||||
def generate_output(self, output_directory: str):
|
||||
if self.world.players != 1:
|
||||
if self.multiworld.players != 1:
|
||||
return
|
||||
data = {
|
||||
"slot_data": self.fill_slot_data(),
|
||||
"location_to_item": {self.location_name_to_id[i.name] : item_table[i.item.name] for i in self.world.get_locations()},
|
||||
"location_to_item": {self.location_name_to_id[i.name] : item_table[i.item.name] for i in self.multiworld.get_locations()},
|
||||
"data_package": {
|
||||
"data": {
|
||||
"games": {
|
||||
@@ -91,6 +91,6 @@ class V6World(World):
|
||||
}
|
||||
}
|
||||
}
|
||||
filename = f"{self.world.get_out_file_name_base(self.player)}.apv6"
|
||||
filename = f"{self.multiworld.get_out_file_name_base(self.player)}.apv6"
|
||||
with open(os.path.join(output_directory, filename), 'w') as f:
|
||||
json.dump(data, f)
|
||||
|
Reference in New Issue
Block a user