Not allowing Lower Layer keydoors for now. vanilla Lttp engine does not handle them

Killed the restrictive Eastern key rules - in prep for real key logic
This commit is contained in:
aerinon
2019-10-07 14:32:34 -06:00
parent 19a78f2a0c
commit db155950f2
5 changed files with 20 additions and 37 deletions

View File

@@ -311,7 +311,8 @@ def shuffle_dungeon(world, player, start_region_names, dungeon_region_names):
# TODO: This is gross, don't do it this way
def maybe_connect_two_way(world, a, b, player):
# Return on unsupported types.
if a.type in [DoorType.Open, DoorType.StraightStairs, DoorType.Hole, DoorType.Warp, DoorType.Interior, DoorType.Logical]:
if a.type in [DoorType.Open, DoorType.StraightStairs, DoorType.Hole, DoorType.Warp, DoorType.Ladder,
DoorType.Interior, DoorType.Logical]:
return
# Connect supported types
if a.type == DoorType.Normal or a.type == DoorType.SpiralStairs:
@@ -847,7 +848,7 @@ def shuffle_key_doors(dungeon_sector, entrances, world, player):
# find valid combination of candidates
paired_candidates = build_pair_list(flat_candidates)
if len(paired_candidates) < num_key_doors:
raise Exception('Not enough candidates')
num_key_doors = len(paired_candidates) # reduce number of key doors
random.shuffle(paired_candidates)
combinations = ncr(len(paired_candidates), num_key_doors)
itr = 0
@@ -901,8 +902,7 @@ def find_key_door_candidates(region, checked, world, player):
position, kind = room.doorList[d.doorListPos]
if d.type == DoorType.Interior:
valid = kind in [DoorKind.Normal, DoorKind.NormalLow, DoorKind.SmallKey, DoorKind.Bombable,
DoorKind.Dashable, DoorKind.NormalLow2]
valid = kind in [DoorKind.Normal, DoorKind.SmallKey, DoorKind.Bombable, DoorKind.Dashable]
elif d.type == DoorType.SpiralStairs:
valid = kind in [DoorKind.StairKey, DoorKind.StairKey2, DoorKind.StairKeyLow]
elif d.type == DoorType.Normal:
@@ -910,8 +910,8 @@ def find_key_door_candidates(region, checked, world, player):
if d2 not in candidates:
room_b = world.get_room(d2.roomIndex, player)
pos_b, kind_b = room_b.doorList[d2.doorListPos]
okay_normals = [DoorKind.Normal, DoorKind.NormalLow, DoorKind.SmallKey, DoorKind.Bombable,
DoorKind.Dashable, DoorKind.NormalLow2, DoorKind.Warp, DoorKind.DungeonChanger]
okay_normals = [DoorKind.Normal, DoorKind.SmallKey, DoorKind.Bombable,
DoorKind.Dashable, DoorKind.Warp, DoorKind.DungeonChanger]
valid = kind in okay_normals and kind_b in okay_normals
else:
valid = True
@@ -1009,7 +1009,7 @@ def reassign_key_doors(current_doors, proposal, world, player):
while len(queue) > 0:
d = queue.pop()
if d.type is DoorType.SpiralStairs and d not in proposal:
world.get_room(d.roomIndex, player).change(d.doorListPos, DoorKind.IncognitoEntrance)
world.get_room(d.roomIndex, player).change(d.doorListPos, DoorKind.Waterfall)
d.smallKey = False
elif d.type is DoorType.Interior and d not in flat_proposal and d.dest not in flat_proposal:
world.get_room(d.roomIndex, player).change(d.doorListPos, DoorKind.Normal)
@@ -1035,6 +1035,10 @@ def reassign_key_doors(current_doors, proposal, world, player):
if dp.door_a in names and dp.door_b in names:
dp.pair = True
found = True
elif dp.door_a in names:
dp.pair = False
elif dp.door_b in names:
dp.pair = False
if not found:
world.paired_doors[player].append(PairedDoor(d1.name, d2.name))
change_door_to_small_key(d1, world, player)

View File

@@ -116,10 +116,9 @@ def create_doors(world, player):
big_key(create_dir_door(player, 'Eastern Big Key NE', DoorType.Normal, Direction.North, 0xb8, Right, High)).pos(0),
ugly_door(small_key(create_dir_door(player, 'Eastern Darkness S', DoorType.Normal, Direction.South, 0x99, Mid, High))).pos(1),
# Up is a keydoor and down is not. Only the up stairs should be considered a key door for now.
# Todo: add key door?
small_key(create_spiral_stairs(player, 'Eastern Darkness Up Stairs', DoorType.SpiralStairs, Direction.Up, 0x99, 0, HTH, Z, 0x1a, 0x6c, False, True)),
small_key(create_spiral_stairs(player, 'Eastern Darkness Up Stairs', DoorType.SpiralStairs, Direction.Up, 0x99, 0, HTH, Z, 0x1a, 0x6c, False, True)).pos(0),
ugly_door(create_spiral_stairs(player, 'Eastern Attic Start Down Stairs', DoorType.SpiralStairs, Direction.Down, 0xda, 0, HTH, Z, 0x11, 0x80, True, True)),
create_dir_door(player, 'Eastern Attic Start WS', DoorType.Normal, Direction.West, 0xda, Bot, High).pos(0),
create_dir_door(player, 'Eastern Attic Start WS', DoorType.Normal, Direction.West, 0xda, Bot, High).trap(0x4).pos(0),
create_dir_door(player, 'Eastern Attic Switches ES', DoorType.Normal, Direction.East, 0xd9, Bot, High).trap(0x1).pos(2),
create_dir_door(player, 'Eastern Attic Switches WS', DoorType.Normal, Direction.West, 0xd9, Bot, High).trap(0x4).pos(0),
create_dir_door(player, 'Eastern Eyegores ES', DoorType.Normal, Direction.East, 0xd8, Bot, High).pos(2),

View File

@@ -320,6 +320,7 @@ class DoorKind(Enum):
BigKey = 0x1E
StairKey = 0x20
StairKey2 = 0x22
HauntedStairKey = 0x24 # not a real door, can see it in dark rooms when facing left
StairKeyLow = 0x26
Dashable = 0x28
BombableEntrance = 0x2A

View File

@@ -256,12 +256,7 @@ def global_rules(world, player):
# Start of door rando rules
# TODO: Do these need to flag off when door rando is off?
# TODO: Can these replace other rules?
# Hyrule Castle: Can't get keys from guards unless you can kill said guards.
# Aerinon's note: You can use bombs? - That's usually assumed. In Standard, you get uncle weapon
# add_rule(world.get_location('Hyrule Castle - Map Guard Key Drop', player), lambda state: state.can_kill_most_things(player))
# add_rule(world.get_location('Hyrule Castle - Boomerang Guard Key Drop', player), lambda state: state.can_kill_most_things(player))
# If these generate fine rules with vanilla shuffle - then no.
# Hyrule Castle: There are three keys and we don't know how we shuffled, so we
# need three keys to be accessible before you use any of these doors.
@@ -285,10 +280,7 @@ def global_rules(world, player):
forbid_item(world.get_location('Eastern Palace - Big Chest', player), 'Big Key (Eastern Palace)', player)
set_rule(world.get_entrance('Eastern Big Key NE', player), lambda state: state.has('Big Key (Eastern Palace)', player))
set_rule(world.get_entrance('Eastern Courtyard N', player), lambda state: state.has('Big Key (Eastern Palace)', player))
# There are two keys and we don't know how we shuffled, so careful with key doors.
# TODO: Generate key rules in the shuffler. (But make sure this way works first.)
for door in ['Eastern Dark Square Key Door WN', 'Eastern Cannonball Ledge Key Door EN', 'Eastern Darkness Up Stairs']:
set_rule(world.get_entrance(door, player), lambda state: state.has_key('Small Key (Eastern Palace)', player, 2))
# TODO: Key logic for eastern
# Boss rules. Same as below but no BK or arrow requirement.
set_defeat_dungeon_boss_rule(world.get_location('Eastern Palace - Prize', player))

View File

@@ -1,24 +1,11 @@
Notes:
(Fixed?) HD Staircase up to HC Main Map Room was wrong location
(Fixed?) Key door between Hyrule Castle East Hall S <=> Sewers Key Rat Key Door N not paired
AgaTower usually doesn't have enough Key Door candidates
(Testing) Camera spots in Aga Tower: Push Statue, Lone Statue maybe?
(Fixed?) Spiral stairs without keys look funny - change to Incognito instead of Normal
(Testing Waterfall Now) Spiral stairs without keys look funny - change to Incognito instead of Normal
Key door on Layer 1 not working (Aga Tower)
Key door in HC Lobby E door not passable - look into it?
Zero camera out skips quad logic
The armory guard room and the room above have fake layers. Trap doors
Notes 2:
(Fixed) this is 0060 but looks like should be 0460 layer again
(Fixed) Wrong layer for Compass room WN?
(Fixed partially )Guardroom N Door is set to $8000, I think it was supposed to be Eastern Compass Area SW $02a8 that how this get teleported back to HC. Wrong room index. Still might be a toggle door
(Fixed) Courtyard N is set to $02D8 - typo
(Fixed) Sanc N is $0650 but should be $0250 which I think is right. typo again on the wrong layer
(Fixed) Eastern boss had wrong room
(Can't Fix yet) Key door on Layer 1 not working (Aga Tower)
(Can't Fix yet) Key door in HC Lobby E door not passable - look into it?
Pairing Notes
30-34 4f-37 #$18,-24