Move game names and descriptions into AutoWorld, fix option value names on player-settings pages

This commit is contained in:
Chris Wilson
2021-08-31 17:28:46 -04:00
parent 66627d8a66
commit 4fcce66505
7 changed files with 41 additions and 57 deletions

View File

@@ -16,6 +16,12 @@ from ..AutoWorld import World
client_version = 6
class MinecraftWorld(World):
"""
Minecraft is a game about creativity. In a world made entirely of cubes, you explore, discover, mine,
craft, and try not to explode. Delve deep into the earth and discover abandoned mines, ancient
structures, and materials to create a portal to another world. Defeat the Ender Dragon, and claim
victory!
"""
game: str = "Minecraft"
options = minecraft_options
topology_present = True
@@ -47,7 +53,7 @@ class MinecraftWorld(World):
itempool = []
junk_pool = junk_weights.copy()
# Add all required progression items
for (name, num) in required_items.items():
for (name, num) in required_items.items():
itempool += [name] * num
# Add structure compasses if desired
if self.world.structure_compasses[self.player]:
@@ -85,9 +91,9 @@ class MinecraftWorld(World):
def MCRegion(region_name: str, exits=[]):
ret = Region(region_name, None, region_name, self.player, self.world)
ret.locations = [MinecraftAdvancement(self.player, loc_name, loc_data.id, ret)
for loc_name, loc_data in advancement_table.items()
for loc_name, loc_data in advancement_table.items()
if loc_data.region == region_name]
for exit in exits:
for exit in exits:
ret.exits.append(Entrance(self.player, exit, ret))
return ret
@@ -100,7 +106,7 @@ class MinecraftWorld(World):
with open(os.path.join(output_directory, filename), 'wb') as f:
f.write(b64encode(bytes(json.dumps(data), 'utf-8')))
def fill_slot_data(self):
def fill_slot_data(self):
slot_data = self._get_mc_data()
for option_name in minecraft_options:
option = getattr(self.world, option_name)[self.player]
@@ -115,7 +121,7 @@ class MinecraftWorld(World):
item.never_exclude = True
return item
def mc_update_output(raw_data, server, port):
def mc_update_output(raw_data, server, port):
data = json.loads(b64decode(raw_data))
data['server'] = server
data['port'] = port