Race flag on GUI

Async Doors League presets
Take into account starting inventory with default item pool
This commit is contained in:
aerinon
2023-01-06 13:56:18 -07:00
parent c2da20207b
commit 8839926a97
13 changed files with 134 additions and 19 deletions

View File

@@ -962,9 +962,26 @@ def get_pool_core(world, player, progressive, shuffle, difficulty, treasure_hunt
pool.extend(['Small Key (Universal)']) pool.extend(['Small Key (Universal)'])
else: else:
pool.extend(['Small Key (Universal)']) pool.extend(['Small Key (Universal)'])
modify_pool_for_start_inventory(pool, world, player)
return (pool, placed_items, precollected_items, clock_mode, lamps_needed_for_dark_rooms) return (pool, placed_items, precollected_items, clock_mode, lamps_needed_for_dark_rooms)
def modify_pool_for_start_inventory(pool, world, player):
for item in world.precollected_items:
if item.player == player:
pool.remove(item.name)
if item.dungeon:
d = world.get_dungeon(item.dungeon, item.player)
match = next((i for i in d.all_items if i.name == item.name), None)
if match:
if match.map or match.compass:
d.dungeon_items.remove(match)
elif match.smallkey:
d.small_keys.remove(match)
elif match.bigkey:
d.big_key.remove(match)
def make_custom_item_pool(world, player, progressive, shuffle, difficulty, timer, goal, mode, swords, bombbag, customitemarray): def make_custom_item_pool(world, player, progressive, shuffle, difficulty, timer, goal, mode, swords, bombbag, customitemarray):
if isinstance(customitemarray,dict) and 1 in customitemarray: if isinstance(customitemarray,dict) and 1 in customitemarray:
customitemarray = customitemarray[1] customitemarray = customitemarray[1]

14
Main.py
View File

@@ -34,7 +34,7 @@ from source.overworld.EntranceShuffle2 import link_entrances_new
from source.tools.BPS import create_bps_from_data from source.tools.BPS import create_bps_from_data
from source.classes.CustomSettings import CustomSettings from source.classes.CustomSettings import CustomSettings
__version__ = '1.2.0.2-u' __version__ = '1.2.0.3-u'
from source.classes.BabelFish import BabelFish from source.classes.BabelFish import BabelFish
@@ -150,7 +150,7 @@ def main(args, seed=None, fish=None):
world.player_names[player].append(name) world.player_names[player].append(name)
logger.info('') logger.info('')
world.settings = CustomSettings() world.settings = CustomSettings()
world.settings.create_from_world(world) world.settings.create_from_world(world, args.race)
outfilebase = f'DR_{args.outputname if args.outputname else world.seed}' outfilebase = f'DR_{args.outputname if args.outputname else world.seed}'
@@ -196,16 +196,6 @@ def main(args, seed=None, fish=None):
item = ItemFactory(inv_item.strip(), p) item = ItemFactory(inv_item.strip(), p)
if item: if item:
world.push_precollected(item) world.push_precollected(item)
if item.dungeon:
d = world.get_dungeon(item.dungeon, item.player)
match = next((i for i in d.all_items if i.name == item.name), None)
if match:
if match.map or match.compass:
d.dungeon_items.remove(match)
elif match.smallkey:
d.small_keys.remove(match)
elif match.bigkey:
d.big_key.remove(match)
if args.print_custom_yaml: if args.print_custom_yaml:
world.settings.record_info(world) world.settings.record_info(world)

View File

@@ -109,6 +109,14 @@ These are now independent of retro mode and have three options: None, Random, an
# Bug Fixes and Notes # Bug Fixes and Notes
* 1.2.0.3-u
* Starting inventory taken into account with default item pool. (Custom pools must do this themselves)
* Fast ROM update
* Fix for restricted boss item counting maps & compasses as vital
* Bug fix for vanilla ER + inverted + experimental
* 1.2.0.2-u
* Fixed a bug with certain trap doors missing
* Added a hint reference for district hints
* 1.2.0.1-u * 1.2.0.1-u
* Added new ganonhunt and completionist goals * Added new ganonhunt and completionist goals
* Fixed the issue when defeating Agahnim and standing in the doorway can cause door state to linger. * Fixed the issue when defeating Agahnim and standing in the doorway can cause door state to linger.
@@ -116,9 +124,6 @@ These are now independent of retro mode and have three options: None, Random, an
* Fix for vanilla Doors + Standard + ER * Fix for vanilla Doors + Standard + ER
* Added a limit per dungeon on small key doors to ensure reasonable generation * Added a limit per dungeon on small key doors to ensure reasonable generation
* Fixed many small bugs * Fixed many small bugs
* 1.2.0.2-u
* Fixed a bug with certain trap doors missing
* Added a hint reference for district hints
# Known Issues # Known Issues

4
Rom.py
View File

@@ -37,7 +37,7 @@ from source.dungeon.RoomList import Room0127
JAP10HASH = '03a63945398191337e896e5771f77173' JAP10HASH = '03a63945398191337e896e5771f77173'
RANDOMIZERBASEHASH = 'f204143853a58e55a5fbc4c5bc87045e' RANDOMIZERBASEHASH = '1e1094919d6a9dd151f8bc15c40b35f7'
class JsonRom(object): class JsonRom(object):
@@ -2226,7 +2226,7 @@ def write_strings(rom, world, player, team):
for loc_name in district.locations: for loc_name in district.locations:
location_item = world.get_location(loc_name, player).item location_item = world.get_location(loc_name, player).item
if location_item.advancement: if location_item.advancement:
if 'Heart Container' in location_item.name: if 'Heart Container' in location_item.name or location_item.compass or location_item.map:
continue continue
itm_type = 'useful' if useful_item_for_hint(location_item, world) else 'vital' itm_type = 'useful' if useful_item_for_hint(location_item, world) else 'vital'
hint_type = 'path' hint_type = 'path'

Binary file not shown.

View File

@@ -0,0 +1,23 @@
meta:
players: 1
race: true
settings:
shopsanity: true
pseudoboots: true
goal: crystals
crystals_gt: random
bombbag: true
shuffle: crossed
shufflelinks: true
keysanity: true
door_shuffle: crossed
intensity: 3
door_type_mode: big
pottery: keys
dropshuffle: true
experimental: true
dungeon_counters: 'on'
hints: true
msu_resume: true
collection_rate: true
quickswap: true

View File

@@ -0,0 +1,22 @@
meta:
players: 1
race: true
settings:
shopsanity: true
pseudoboots: true
goal: crystals
crystals_gt: random
shuffle: crossed
shufflelinks: true
keysanity: true
door_shuffle: crossed
intensity: 3
door_type_mode: big
pottery: keys
dropshuffle: true
experimental: true
dungeon_counters: 'on'
hints: true
msu_resume: true
collection_rate: true
quickswap: true

View File

@@ -0,0 +1,22 @@
meta:
players: 1
race: true
settings:
shopsanity: true
pseudoboots: true
goal: crystals
crystals_gt: random
shuffle: crossed
shufflelinks: true
keysanity: true
door_shuffle: crossed
intensity: 3
door_type_mode: big
pottery: lottery
dropshuffle: true
experimental: true
dungeon_counters: 'on'
hints: true
msu_resume: true
collection_rate: true
quickswap: true

View File

@@ -0,0 +1,30 @@
meta:
players: 1
race: true
settings:
1:
shopsanity: true
pseudoboots: true
mode: standard
swords: assured
goal: crystals
crystals_gt: random
shuffle: crossed
shufflelinks: true
keysanity: true
door_shuffle: crossed
intensity: 3
door_type_mode: big
pottery: keys
dropshuffle: true
experimental: true
dungeon_counters: 'on'
hints: true
msu_resume: true
collection_rate: true
quickswap: true
start_inventory:
1:
- Progressive Armor
- Pegasus Boots
- Boss Heart Container

View File

@@ -213,6 +213,7 @@
"randomizer.generation.print_custom_yaml": "Print Customizer File", "randomizer.generation.print_custom_yaml": "Print Customizer File",
"randomizer.generation.usestartinventory": "Use Starting Inventory", "randomizer.generation.usestartinventory": "Use Starting Inventory",
"randomizer.generation.usecustompool": "Use Custom Item Pool", "randomizer.generation.usecustompool": "Use Custom Item Pool",
"randomizer.generation.race": "Generate \"Race\" ROM",
"randomizer.generation.saveonexit": "Save Settings on Exit", "randomizer.generation.saveonexit": "Save Settings on Exit",
"randomizer.generation.saveonexit.ask": "Ask Me", "randomizer.generation.saveonexit.ask": "Ask Me",

View File

@@ -6,6 +6,7 @@
"calcplaythrough": { "type": "checkbox" }, "calcplaythrough": { "type": "checkbox" },
"print_custom_yaml": { "type": "checkbox" }, "print_custom_yaml": { "type": "checkbox" },
"usestartinventory": { "type": "checkbox" }, "usestartinventory": { "type": "checkbox" },
"usecustompool": { "type": "checkbox" } "usecustompool": { "type": "checkbox" },
"race": { "type": "checkbox" }
} }
} }

View File

@@ -61,6 +61,7 @@ class CustomSettings(object):
args.bps = get_setting(meta['bps'], args.bps) args.bps = get_setting(meta['bps'], args.bps)
args.suppress_rom = get_setting(meta['suppress_rom'], args.suppress_rom) args.suppress_rom = get_setting(meta['suppress_rom'], args.suppress_rom)
args.names = get_setting(meta['names'], args.names) args.names = get_setting(meta['names'], args.names)
args.race = get_setting(meta['race'], args.race)
self.player_range = range(1, args.multi + 1) self.player_range = range(1, args.multi + 1)
if 'settings' in self.file_source: if 'settings' in self.file_source:
for p in self.player_range: for p in self.player_range:
@@ -156,6 +157,7 @@ class CustomSettings(object):
args.ow_palettes[p] = get_setting(settings['ow_palettes'], args.ow_palettes[p]) args.ow_palettes[p] = get_setting(settings['ow_palettes'], args.ow_palettes[p])
args.uw_palettes[p] = get_setting(settings['uw_palettes'], args.uw_palettes[p]) args.uw_palettes[p] = get_setting(settings['uw_palettes'], args.uw_palettes[p])
args.shuffle_sfx[p] = get_setting(settings['shuffle_sfx'], args.shuffle_sfx[p]) args.shuffle_sfx[p] = get_setting(settings['shuffle_sfx'], args.shuffle_sfx[p])
args.msu_resume[p] = get_setting(settings['msu_resume'], args.msu_resume[p])
def get_item_pool(self): def get_item_pool(self):
if 'item_pool' in self.file_source: if 'item_pool' in self.file_source:
@@ -202,13 +204,14 @@ class CustomSettings(object):
return self.file_source['drops'] return self.file_source['drops']
return None return None
def create_from_world(self, world): def create_from_world(self, world, race):
self.player_range = range(1, world.players + 1) self.player_range = range(1, world.players + 1)
settings_dict, meta_dict = {}, {} settings_dict, meta_dict = {}, {}
self.world_rep['meta'] = meta_dict self.world_rep['meta'] = meta_dict
meta_dict['players'] = world.players meta_dict['players'] = world.players
meta_dict['algorithm'] = world.algorithm meta_dict['algorithm'] = world.algorithm
meta_dict['seed'] = world.seed meta_dict['seed'] = world.seed
meta_dict['race'] = race
self.world_rep['settings'] = settings_dict self.world_rep['settings'] = settings_dict
for p in self.player_range: for p in self.player_range:
settings_dict[p] = {} settings_dict[p] = {}

View File

@@ -130,6 +130,7 @@ SETTINGSTOPROCESS = {
"print_custom_yaml": "print_custom_yaml", "print_custom_yaml": "print_custom_yaml",
"usestartinventory": "usestartinventory", "usestartinventory": "usestartinventory",
"usecustompool": "custom", "usecustompool": "custom",
"race": "race",
"saveonexit": "saveonexit" "saveonexit": "saveonexit"
} }
}, },