mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 04:01:32 -06:00
V6: Use new options api (#2668)
* v6: Use new options API * v6: Add display names for some options
This commit is contained in:

committed by
GitHub

parent
fe3bc8d6be
commit
d000b52ae0
@@ -2,7 +2,7 @@ import typing
|
||||
import os, json
|
||||
from .Items import item_table, V6Item
|
||||
from .Locations import location_table, V6Location
|
||||
from .Options import v6_options
|
||||
from .Options import V6Options
|
||||
from .Rules import set_rules
|
||||
from .Regions import create_regions
|
||||
from BaseClasses import Item, ItemClassification, Tutorial
|
||||
@@ -41,7 +41,7 @@ class V6World(World):
|
||||
|
||||
music_map: typing.Dict[int,int]
|
||||
|
||||
option_definitions = v6_options
|
||||
options_dataclass = V6Options
|
||||
|
||||
def create_regions(self):
|
||||
create_regions(self.multiworld, self.player)
|
||||
@@ -49,7 +49,7 @@ class V6World(World):
|
||||
def set_rules(self):
|
||||
self.area_connections = {}
|
||||
self.area_cost_map = {}
|
||||
set_rules(self.multiworld, self.player, self.area_connections, self.area_cost_map)
|
||||
set_rules(self.multiworld, self.options, 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)
|
||||
@@ -61,7 +61,7 @@ class V6World(World):
|
||||
def generate_basic(self):
|
||||
musiclist_o = [1,2,3,4,9,12]
|
||||
musiclist_s = musiclist_o.copy()
|
||||
if self.multiworld.MusicRandomizer[self.player].value:
|
||||
if self.options.music_rando:
|
||||
self.multiworld.random.shuffle(musiclist_s)
|
||||
self.music_map = dict(zip(musiclist_o, musiclist_s))
|
||||
|
||||
@@ -69,10 +69,10 @@ class V6World(World):
|
||||
return {
|
||||
"MusicRando": self.music_map,
|
||||
"AreaRando": self.area_connections,
|
||||
"DoorCost": self.multiworld.DoorCost[self.player].value,
|
||||
"DoorCost": self.options.door_cost.value,
|
||||
"AreaCostRando": self.area_cost_map,
|
||||
"DeathLink": self.multiworld.death_link[self.player].value,
|
||||
"DeathLink_Amnesty": self.multiworld.DeathLinkAmnesty[self.player].value
|
||||
"DeathLink": self.options.death_link.value,
|
||||
"DeathLink_Amnesty": self.options.death_link_amnesty.value
|
||||
}
|
||||
|
||||
def generate_output(self, output_directory: str):
|
||||
|
Reference in New Issue
Block a user