Fixes for mirror scroll
Fix for Stonewall + Ice Cross Fix for Ice Cross key doors Changed how key doors are chosen in a slightly better manner (pairs them earlier)
This commit is contained in:
@@ -779,6 +779,8 @@ def assign_cross_keys(dungeon_builders, world, player):
|
||||
# Last Step: Adjust Small Key Dungeon Pool
|
||||
if not world.retro[player]:
|
||||
for name, builder in dungeon_builders.items():
|
||||
reassign_key_doors(builder, world, player)
|
||||
log_key_logic(builder.name, world.key_logic[player][builder.name])
|
||||
actual_chest_keys = max(builder.key_doors_num - builder.key_drop_cnt, 0)
|
||||
dungeon = world.get_dungeon(name, player)
|
||||
if actual_chest_keys == 0:
|
||||
@@ -893,9 +895,11 @@ def shuffle_key_doors(builder, world, player):
|
||||
builder.key_doors_num = num_key_doors
|
||||
find_small_key_door_candidates(builder, start_regions, world, player)
|
||||
find_valid_combination(builder, start_regions, world, player)
|
||||
reassign_key_doors(builder, world, player)
|
||||
log_key_logic(builder.name, world.key_logic[player][builder.name])
|
||||
|
||||
|
||||
def find_current_key_doors(builder, world, player):
|
||||
def find_current_key_doors(builder):
|
||||
current_doors = []
|
||||
for region in builder.master_sector.regions:
|
||||
for ext in region.exits:
|
||||
@@ -982,8 +986,7 @@ def find_valid_combination(builder, start_regions, world, player, drop_keys=True
|
||||
if player not in world.key_logic.keys():
|
||||
world.key_logic[player] = {}
|
||||
analyze_dungeon(key_layout, world, player)
|
||||
reassign_key_doors(builder, proposal, world, player)
|
||||
log_key_logic(builder.name, key_layout.key_logic)
|
||||
builder.key_door_proposal = proposal
|
||||
world.key_logic[player][builder.name] = key_layout.key_logic
|
||||
return True
|
||||
|
||||
@@ -1040,7 +1043,9 @@ def find_key_door_candidates(region, checked, world, player):
|
||||
while len(queue) > 0:
|
||||
current, last_door, last_region = queue.pop()
|
||||
for ext in current.exits:
|
||||
d = world.check_for_door(ext.name, player)
|
||||
d = ext.door
|
||||
if d and d.controller:
|
||||
d = d.controller
|
||||
if d is not None and not d.blocked and d.dest is not last_door and d.dest is not last_region and d not in checked_doors:
|
||||
valid = False
|
||||
if 0 <= d.doorListPos < 4 and d.type in [DoorType.Interior, DoorType.Normal, DoorType.SpiralStairs]:
|
||||
@@ -1059,6 +1064,8 @@ def find_key_door_candidates(region, checked, world, player):
|
||||
okay_normals = [DoorKind.Normal, DoorKind.SmallKey, DoorKind.Bombable,
|
||||
DoorKind.Dashable, DoorKind.DungeonChanger]
|
||||
valid = kind in okay_normals and kind_b in okay_normals
|
||||
if valid and 0 <= d2.doorListPos < 4:
|
||||
candidates.append(d2)
|
||||
else:
|
||||
valid = True
|
||||
if valid:
|
||||
@@ -1092,10 +1099,11 @@ def ncr(n, r):
|
||||
return numerator / denominator
|
||||
|
||||
|
||||
def reassign_key_doors(builder, proposal, world, player):
|
||||
def reassign_key_doors(builder, world, player):
|
||||
logger = logging.getLogger('')
|
||||
proposal = builder.key_door_proposal
|
||||
flat_proposal = flatten_pair_list(proposal)
|
||||
queue = deque(find_current_key_doors(builder, world, player))
|
||||
queue = deque(find_current_key_doors(builder))
|
||||
while len(queue) > 0:
|
||||
d = queue.pop()
|
||||
if d.type is DoorType.SpiralStairs and d not in proposal:
|
||||
|
||||
@@ -447,9 +447,12 @@ def stonewall_valid(stonewall):
|
||||
if bad_door.blocked:
|
||||
return True # great we're done with this one
|
||||
loop_region = stonewall.entrance.parent_region
|
||||
start_region = bad_door.entrance.parent_region
|
||||
queue = deque([start_region])
|
||||
visited = {start_region}
|
||||
start_regions = [bad_door.entrance.parent_region]
|
||||
if bad_door.dependents:
|
||||
for dep in bad_door.dependents:
|
||||
start_regions.append(dep.entrance.parent_region)
|
||||
queue = deque(start_regions)
|
||||
visited = set(start_regions)
|
||||
while len(queue) > 0:
|
||||
region = queue.popleft()
|
||||
if region == loop_region:
|
||||
@@ -1027,6 +1030,7 @@ class DungeonBuilder(object):
|
||||
self.key_doors_num = None
|
||||
self.combo_size = None
|
||||
self.flex = 0
|
||||
self.key_door_proposal = None
|
||||
|
||||
if name in dungeon_dead_end_allowance.keys():
|
||||
self.allowance = dungeon_dead_end_allowance[name]
|
||||
|
||||
2
Main.py
2
Main.py
@@ -23,7 +23,7 @@ from Fill import distribute_items_cutoff, distribute_items_staleness, distribute
|
||||
from ItemList import generate_itempool, difficulties, fill_prizes
|
||||
from Utils import output_path, parse_player_names
|
||||
|
||||
__version__ = '0.0.14pre'
|
||||
__version__ = '0.0.15pre'
|
||||
|
||||
|
||||
def main(args, seed=None):
|
||||
|
||||
4
Rom.py
4
Rom.py
@@ -22,7 +22,7 @@ from EntranceShuffle import door_addresses, exit_ids
|
||||
|
||||
|
||||
JAP10HASH = '03a63945398191337e896e5771f77173'
|
||||
RANDOMIZERBASEHASH = '818b2c659a610cb4112804cf612ffd37'
|
||||
RANDOMIZERBASEHASH = '746b52b20a116648b624ebe58af9e54b'
|
||||
|
||||
|
||||
class JsonRom(object):
|
||||
@@ -618,6 +618,8 @@ def patch_rom(world, rom, player, team, enemized):
|
||||
if builder.pre_open_stonewall.name == 'Desert Wall Slide NW':
|
||||
dr_flags |= DROptions.Open_Desert_Wall
|
||||
rom.write_byte(0x139006, dr_flags.value)
|
||||
if dr_flags & DROptions.Town_Portal and world.mode[player] == 'inverted':
|
||||
rom.write_byte(0x139008, 1)
|
||||
|
||||
# fix skull woods exit, if not fixed during exit patching
|
||||
if world.fix_skullwoods_exit[player] and world.shuffle[player] == 'vanilla':
|
||||
|
||||
@@ -27,6 +27,8 @@ DRMode:
|
||||
dw 0
|
||||
DRFlags:
|
||||
dw 0
|
||||
DRScroll:
|
||||
db 0
|
||||
|
||||
; Vert 0,6,0 Horz 2,0,8
|
||||
org $279010
|
||||
|
||||
@@ -72,6 +72,13 @@ jsl GtBossHeartCheckOverride : bcs .not_in_ganons_tower
|
||||
nop : stz $0dd0, X : rts
|
||||
.not_in_ganons_tower
|
||||
|
||||
|
||||
org $2081f2
|
||||
jsl MirrorCheckOverride2
|
||||
org $20825c
|
||||
jsl MirrorCheckOverride2
|
||||
|
||||
|
||||
; These two, if enabled together, have implications for vanilla BK doors in IP/Hera/Mire
|
||||
; IPBJ is common enough to consider not doing this. Mire is not a concern for vanilla - maybe glitched modes
|
||||
; Hera BK door back can be seen with Pot clipping - likely useful for no logic seeds
|
||||
|
||||
@@ -43,9 +43,13 @@ OnFileLoadOverride:
|
||||
+ rtl
|
||||
|
||||
MirrorCheckOverride:
|
||||
lda $8A : and #$40 ; what I wrote over
|
||||
beq +
|
||||
lda DRFlags : and #$02 : beq ++
|
||||
lda $7ef353 : cmp #$01 : beq +
|
||||
++ lda #$01
|
||||
+ rtl
|
||||
++ lda $8A : and #$40 ; what I wrote over
|
||||
rtl
|
||||
+ lda DRScroll : rtl
|
||||
|
||||
MirrorCheckOverride2:
|
||||
lda $7ef353 : cmp #$02 : beq +
|
||||
sep #$02 ; clear zero flag, I think
|
||||
+ rtl
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user