New baserom with various fixes for both font and multiclient issue with pottery

Bump TFH limit to 850. It throws an error if you try to generate with too many pieces.
This commit is contained in:
aerinon
2022-04-28 16:27:37 -06:00
parent 7a35bbfc41
commit f93ecf9412
6 changed files with 25 additions and 12 deletions

View File

@@ -44,6 +44,7 @@ Difficulty = namedtuple('Difficulty',
'progressive_bow_limit', 'heart_piece_limit', 'boss_heart_container_limit']) 'progressive_bow_limit', 'heart_piece_limit', 'boss_heart_container_limit'])
total_items_to_place = 153 total_items_to_place = 153
max_goal = 850
difficulties = { difficulties = {
'normal': Difficulty( 'normal': Difficulty(
@@ -203,6 +204,7 @@ def generate_itempool(world, player):
world.push_item(loc, ItemFactory('Triforce', player), False) world.push_item(loc, ItemFactory('Triforce', player), False)
loc.event = True loc.event = True
loc.locked = True loc.locked = True
loc.forced_item = loc.item
world.get_location('Ganon', player).event = True world.get_location('Ganon', player).event = True
world.get_location('Ganon', player).locked = True world.get_location('Ganon', player).locked = True
@@ -774,7 +776,8 @@ def get_pool_core(progressive, shuffle, difficulty, treasure_hunt_total, timer,
if goal in ['triforcehunt', 'trinity']: if goal in ['triforcehunt', 'trinity']:
if treasure_hunt_total == 0: if treasure_hunt_total == 0:
treasure_hunt_total = 30 if goal == 'triforcehunt' else 10 treasure_hunt_total = 30 if goal == 'triforcehunt' else 10
triforcepool = ['Triforce Piece'] * int(treasure_hunt_total) # triforce pieces max out
triforcepool = ['Triforce Piece'] * min(treasure_hunt_total, max_goal)
pool.extend(alwaysitems) pool.extend(alwaysitems)
@@ -967,8 +970,8 @@ def make_custom_item_pool(progressive, shuffle, difficulty, timer, goal, mode, s
pool.append(thisbottle) pool.append(thisbottle)
if customitemarray["triforcepieces"] > 0 or customitemarray["triforcepiecesgoal"] > 0: if customitemarray["triforcepieces"] > 0 or customitemarray["triforcepiecesgoal"] > 0:
# To display, count must be between 1 and 254 - larger values are not yet supported # Location pool doesn't support larger values
treasure_hunt_count = max(min(customitemarray["triforcepiecesgoal"], 254), 1) treasure_hunt_count = max(min(customitemarray["triforcepiecesgoal"], max_goal), 1)
treasure_hunt_icon = 'Triforce Piece' treasure_hunt_icon = 'Triforce Piece'
# Ensure game is always possible to complete here, force sufficient pieces if the player is unwilling. # Ensure game is always possible to complete here, force sufficient pieces if the player is unwilling.
if ((customitemarray["triforcepieces"] < treasure_hunt_count) and (goal in ['triforcehunt', 'trinity']) if ((customitemarray["triforcepieces"] < treasure_hunt_count) and (goal in ['triforcehunt', 'trinity'])
@@ -1053,7 +1056,7 @@ def make_customizer_pool(world, player):
return pool, placed_items, precollected_items, clock_mode, 1 return pool, placed_items, precollected_items, clock_mode, 1
# To display, count must be between 1 and 254 - larger values are not yet supported # location pool doesn't support larger values at this time
def set_default_triforce(goal, custom_goal, custom_total): def set_default_triforce(goal, custom_goal, custom_total):
triforce_goal, triforce_total = 0, 0 triforce_goal, triforce_total = 0, 0
if goal == 'triforcehunt': if goal == 'triforcehunt':
@@ -1061,9 +1064,9 @@ def set_default_triforce(goal, custom_goal, custom_total):
elif goal == 'trinity': elif goal == 'trinity':
triforce_goal, triforce_total = 8, 10 triforce_goal, triforce_total = 8, 10
if custom_goal > 0: if custom_goal > 0:
triforce_goal = max(min(custom_goal, 254), 1) triforce_goal = max(min(custom_goal, max_goal), 1)
if custom_total > 0: if custom_total > 0:
triforce_total = max(min(custom_total, 254), triforce_goal) triforce_total = max(min(custom_total, max_goal), triforce_goal)
return triforce_goal, triforce_total return triforce_goal, triforce_total

View File

@@ -103,8 +103,8 @@ def main(args, seed=None, fish=None):
world.potshuffle = args.shufflepots.copy() world.potshuffle = args.shufflepots.copy()
world.mixed_travel = args.mixed_travel.copy() world.mixed_travel = args.mixed_travel.copy()
world.standardize_palettes = args.standardize_palettes.copy() world.standardize_palettes = args.standardize_palettes.copy()
world.treasure_hunt_count = args.triforce_goal.copy() world.treasure_hunt_count = {k: int(v) for k, v in args.triforce_goal.items()}
world.treasure_hunt_total = args.triforce_pool.copy() world.treasure_hunt_total = {k: int(v) for k, v in args.triforce_pool.items()}
world.shufflelinks = args.shufflelinks.copy() world.shufflelinks = args.shufflelinks.copy()
world.pseudoboots = args.pseudoboots.copy() world.pseudoboots = args.pseudoboots.copy()
world.overworld_map = args.overworld_map.copy() world.overworld_map = args.overworld_map.copy()

View File

@@ -157,6 +157,15 @@ Same as above but both small keys and bigs keys of the dungeon are not allowed o
#### Volatile #### Volatile
* 1.0.2.0
* Updated baserom to bleeding edge
* Pottery and enemy SRAM re-located to final destination
* Bulk of work on new font
* Updated TFH to support up to 850 pieces
* Fix for major item algorithm and pottery
* Updated map display on keysanity menu to work better with overworld_amp option
* Minor bug in crossed doors
* Minor bug in MultiClient which would count switches
* 1.0.1.13 * 1.0.1.13
* New pottery modes * New pottery modes
* Trinity goal added * Trinity goal added

7
Rom.py
View File

@@ -37,7 +37,7 @@ from source.dungeon.RoomList import Room0127
JAP10HASH = '03a63945398191337e896e5771f77173' JAP10HASH = '03a63945398191337e896e5771f77173'
RANDOMIZERBASEHASH = '3c85536ef5463d329adb2e9e3cda654a' RANDOMIZERBASEHASH = '8b87b7c4f37ab57463b93c5afd353299'
class JsonRom(object): class JsonRom(object):
@@ -1197,7 +1197,8 @@ def patch_rom(world, rom, player, team, enemized, is_mystery=False):
rom.write_byte(0x18003F, 0x01 if world.swords[player] == 'swordless' else 0x00) # hammer can harm ganon rom.write_byte(0x18003F, 0x01 if world.swords[player] == 'swordless' else 0x00) # hammer can harm ganon
rom.write_byte(0x180041, 0x01 if world.swords[player] == 'swordless' else 0x00) # swordless medallions rom.write_byte(0x180041, 0x01 if world.swords[player] == 'swordless' else 0x00) # swordless medallions
rom.write_byte(0x180044, 0x01 if world.swords[player] == 'swordless' else 0x00) # hammer activates tablets rom.write_byte(0x180044, 0x01 if world.swords[player] == 'swordless' else 0x00) # hammer activates tablets
rom.initial_sram.set_swordless_curtains() # open curtains if world.swords[player] == 'swordless':
rom.initial_sram.set_swordless_curtains() # open curtains
# set up clocks for timed modes # set up clocks for timed modes
if world.shuffle[player] == 'vanilla': if world.shuffle[player] == 'vanilla':
@@ -1245,7 +1246,7 @@ def patch_rom(world, rom, player, team, enemized, is_mystery=False):
# set up goals for treasure hunt # set up goals for treasure hunt
rom.write_bytes(0x180165, [0x0E, 0x28] if world.treasure_hunt_icon[player] == 'Triforce Piece' else [0x0D, 0x28]) rom.write_bytes(0x180165, [0x0E, 0x28] if world.treasure_hunt_icon[player] == 'Triforce Piece' else [0x0D, 0x28])
if world.goal[player] in ['triforcehunt', 'trinity']: if world.goal[player] in ['triforcehunt', 'trinity']:
rom.write_byte(0x180167, int(world.treasure_hunt_count[player]) % 256) rom.write_bytes(0x180167, int16_as_bytes(world.treasure_hunt_count[player]))
rom.write_byte(0x180194, 1) # Must turn in triforced pieces (instant win not enabled) rom.write_byte(0x180194, 1) # Must turn in triforced pieces (instant win not enabled)
rom.write_bytes(0x180213, [0x00, 0x01]) # Not a Tournament Seed rom.write_bytes(0x180213, [0x00, 0x01]) # Not a Tournament Seed

Binary file not shown.

View File

@@ -275,7 +275,7 @@ def massage_item_pool(world):
world.itempool.remove(deleted) world.itempool.remove(deleted)
discrepancy -= 1 discrepancy -= 1
if discrepancy > 0: if discrepancy > 0:
logging.getLogger('').warning(f'Too many good items in pool, something will be removed at random') raise Exception(f'Too many required items in pool, {discrepancy} items cannot be placed')
if world.item_pool_config.placeholders is not None: if world.item_pool_config.placeholders is not None:
removed = 0 removed = 0
single_rupees = [item for item in world.itempool if item.name == 'Rupee (1)'] single_rupees = [item for item in world.itempool if item.name == 'Rupee (1)']