Torch keys counted like chest

Moved the total key counter to a count down on the left.
Added the BK indicator
Attempt to fix dungeon counters and fish error in Mystery.py
Removed double rom patch
AT map added.
5 chests min for all dungeons
This commit is contained in:
aerinon
2020-04-07 16:50:02 -06:00
parent bb402ff7f2
commit 114ed784f1
11 changed files with 63 additions and 38 deletions

View File

@@ -706,12 +706,10 @@ def cross_dungeon(world, player):
check_required_paths(paths, world, player)
hc = world.get_dungeon('Hyrule Castle', player)
del hc.dungeon_items[0] # removes map
hc.dungeon_items.append(ItemFactory('Compass (Escape)', player))
at = world.get_dungeon('Agahnims Tower', player)
at.dungeon_items.append(ItemFactory('Compass (Agahnims Tower)', player))
gt = world.get_dungeon('Ganons Tower', player)
del gt.dungeon_items[0] # removes map
at.dungeon_items.append(ItemFactory('Map (Agahnims Tower)', player))
assign_cross_keys(dungeon_builders, world, player)
all_dungeon_items = [y for x in world.dungeons if x.player == player for y in x.all_items]

View File

@@ -1237,7 +1237,7 @@ def assign_location_sectors(dungeon_map, free_location_sectors, global_pole):
totals[choice] += sector.chest_locations
valid = True
for d_name, idx in d_idx.items():
if totals[idx] < minimal_locations(d_name):
if totals[idx] < 5: # min locations for dungeons is 5 (bk exception)
valid = False
break
for i, choice in enumerate(choices):
@@ -1268,18 +1268,6 @@ def weighted_random_locations(dungeon_map, free_location_sectors):
return choices, d_idx, totals
def minimal_locations(dungeon_name):
# bump to 5 if maps do something useful for all these dungeons
if dungeon_name == 'Hyrule Castle':
return 4 # bk + compass + 2 others
if dungeon_name == 'Agahnims Tower':
return 4
if dungeon_name == 'Ganons Tower':
return 4
# reduce gt to 4 once compasses work
return 5
def assign_crystal_switch_sectors(dungeon_map, crystal_switches, global_pole, assign_one=False):
population = []
some_c_switches_present = False

View File

@@ -130,6 +130,7 @@ item_table = {'Bow': (True, False, None, 0x0B, 'You have\nchosen the\narcher cla
'Small Key (Agahnims Tower)': (False, False, 'SmallKey', 0xA4, 'A small key to Agahnim', 'and the key', 'the unlocking kid', 'keys for sale', 'unlock the fungus', 'key boy opens door again', 'a small key to Castle Tower'),
'Big Key (Agahnims Tower)': (False, False, 'BigKey', 0x9B, 'A big key to Agahnim', 'and the big key', 'the big-unlock kid', 'big key for sale', 'face key fungus', 'key boy opens chest again', 'a big key to Castle Tower'),
'Compass (Agahnims Tower)': (False, True, 'Compass', 0x8B, 'Now you can find Aga1!', 'and the compass', 'the magnetic kid', 'compass for sale', 'magnetic fungus', 'compass boy finds null again', 'a compass to Castle Tower'),
'Map (Agahnims Tower)': (False, True, 'Map', 0x7B, 'A tightly folded map rests here', 'and the map', 'cartography kid', 'map for sale', 'a map to shrooms', 'map boy navigates again', 'a map to Castle Tower'),
'Small Key (Palace of Darkness)': (False, False, 'SmallKey', 0xA6, 'A small key to darkness', 'and the key', 'the unlocking kid', 'keys for sale', 'unlock the fungus', 'key boy opens door again', 'a small key to Palace of Darkness'),
'Big Key (Palace of Darkness)': (False, False, 'BigKey', 0x99, 'A big key to darkness', 'and the big key', 'the big-unlock kid', 'big key for sale', 'face key fungus', 'key boy opens chest again', 'a big key to Palace of Darkness'),
'Compass (Palace of Darkness)': (False, True, 'Compass', 0x89, 'Now you can find Helmasaur King!', 'and the compass', 'the magnetic kid', 'compass for sale', 'magnetic fungus', 'compass boy finds boss again', 'a compass to Palace of Darkness'),

View File

@@ -200,8 +200,6 @@ def main(args, seed=None, fish=None):
rom = JsonRom() if args.jsonout or use_enemizer else LocalRom(args.rom)
patch_rom(world, rom, player, team, use_enemizer)
if use_enemizer and (args.enemizercli or not args.jsonout):
if args.rom and not(os.path.isfile(args.rom)):
raise RuntimeError("Could not find valid base rom for enemizing at expected path %s." % args.rom)

View File

@@ -7,6 +7,7 @@ import re
from DungeonRandomizer import parse_cli
from Main import main as DRMain
from source.classes.BabelFish import BabelFish
def parse_yaml(txt):
def strip(s):
@@ -100,7 +101,7 @@ def main():
loglevel = {'error': logging.ERROR, 'info': logging.INFO, 'warning': logging.WARNING, 'debug': logging.DEBUG}[erargs.loglevel]
logging.basicConfig(format='%(message)s', level=loglevel)
DRMain(erargs, seed)
DRMain(erargs, seed, BabelFish())
def get_weights(path):
try:
@@ -150,6 +151,10 @@ def roll_settings(weights):
ret.door_shuffle = door_shuffle if door_shuffle != 'none' else 'vanilla'
ret.experimental = get_choice('experimental') == 'on'
ret.dungeon_counters = get_choice('dungeon_counters')
if ret.dungeon_counters == 'default':
ret.dungeon_counters = 'pickup' if ret.door_shuffle != 'vanilla' or ret.compassshuffle == 'on' else 'off'
goal = get_choice('goals')
ret.goal = {'ganon': 'ganon',
'fast_ganon': 'crystals',

View File

@@ -4,7 +4,12 @@ Mirror Scroll no longer erases blocks, the real mirror still will. (Sorry!)
Standard+Crossed Dungeon now gives you a little magic, a few bombs, and a few arrows if you die or S&Q after meeting your uncle (also works with mirror/scroll)
Dungeon reminder added to hud for Crossed dungeons
Blinking red square added to hud and it indicates a boss room is close by. Only appears if you have the compass. (Basic & Crossed)
Key counters added to hud if you have found the map. (Crossed only)
## Map Features (Crossed only)
Key counters added to hud. Indicates number of keys in chests: found/total)
Big Key indicator added to hud. Indicates if BK is not in the dungeon, or if BnC guard has it
Total key indicator added to hud if you have found the map. Counts down from the total number of keys in dungeon to 0 as you collect them.
# Bug Fixes

5
Rom.py
View File

@@ -22,7 +22,7 @@ from EntranceShuffle import door_addresses, exit_ids
JAP10HASH = '03a63945398191337e896e5771f77173'
RANDOMIZERBASEHASH = 'a06d24c7d1473717e2610c3cf45809ff'
RANDOMIZERBASEHASH = '9106102ce69cf290fe2f4fce1e95a89b'
class JsonRom(object):
@@ -600,11 +600,10 @@ def patch_rom(world, rom, player, team, enemized):
offset = compass_data[name][4]//2
rom.write_byte(0x13f01c+offset, layout.max_chests + layout.max_drops)
rom.write_byte(0x13f02a+offset, layout.max_chests)
rom.write_byte(0x13f038+offset, layout.max_drops)
builder = world.dungeon_layouts[player][name]
bk_status = 1 if builder.bk_required else 0
bk_status = 2 if builder.bk_provided else bk_status
rom.write_byte(0x13f046+offset, bk_status)
rom.write_byte(0x13f038+offset*2, bk_status)
rom.write_byte(0x151f1, 2)
rom.write_byte(0x15270, 2)
rom.write_byte(0x1597b, 2)

View File

@@ -552,10 +552,8 @@ TotalKeys: ;27f01c
db $04, $04, $02, $04, $04, $06, $06, $06, $05, $06, $01, $03, $06, $08
ChestKeys: ;27f02a
db $01, $01, $00, $01, $02, $01, $06, $03, $03, $02, $01, $01, $04, $04
OtherKeys: ;27f038
db $03, $03, $02, $03, $02, $05, $00, $03, $02, $04, $00, $02, $02, $04
BigKeyStatus: ;27f046 (status 2 indicate BnC guard)
db $02, $02, $01, $01, $00, $01, $01, $01, $01, $01, $01, $01, $01, $01
BigKeyStatus: ;27f038 (status 2 indicate BnC guard)
dw $0002, $0002, $0001, $0001, $0000, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001
DungeonReminderTable: ;27f054
dw $2D50, $2D50, $2D51, $2D52, $2D54, $2D56, $2D55, $2D5A, $2D57, $2D59, $2D53, $2D58, $2D5B, $2D5C
;27f070

View File

@@ -96,6 +96,9 @@ org $098638 ; rando's hooks.asm line 2192
jsl CountChestKeys
org $06D192 ; rando's hooks.asm line 457
jsl CountAbsorbedKeys
; rando's hooks.asm line 1020
org $05FC7E ; <- 2FC7E - sprite_dash_item.asm : 118 (LDA $7EF36F : INC A : STA $7EF36F)
jsl CountBonkItem
; 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

View File

@@ -15,17 +15,29 @@ HudAdditions:
lda $1a : and #$0010 : beq +
lda #$345e : sta $7ec790 : bra .next
+ lda #$207f : sta $7ec790
.next lda DRMode : and #$0002 : beq .restore
.next lda DRMode : and #$0002 : bne + : plb : rts : +
lda DungeonReminderTable, x : sta $7ec702
lda $7ef368 : and.l $0098c0, x : beq .restore
txa : lsr : tax
lda $7ef4b0, x : jsr ConvertToDisplay : sta $7ec7a2
lda #$2830 : sta $7ec7a4
lda TotalKeys, x : jsr ConvertToDisplay : sta $7ec7a6
lda #$2811 : sta $7ec740
lda $7ef366 : and.l $0098c0, x : bne .check
lda BigKeyStatus, x : and #$00ff : bne + ;todo: "and" is redundant or change table to one byte
lda #$2574 : bra ++
+ cmp #$0002 : bne +
lda #$2420 : bra ++
+ lda #$207f : bra ++
.check lda #$2826
++ sta $7ec742
+ txa : lsr : tax
lda $7ef4e0, x : jsr ConvertToDisplay : sta $7ec7a2
lda #$2830 : sta $7ec7a4
lda ChestKeys, x : jsr ConvertToDisplay : sta $7ec7a6
lda #$2871 : sta $7ec780
lda TotalKeys, x
sep #$20 : !sub $7ef4b0, x : rep #$20
jsr ConvertToDisplay : sta $7ec782
lda $7ef4e0, x : jsr ConvertToDisplay : sta $7ec7e2
lda #$2830 : sta $7ec7e4
lda ChestKeys, x : jsr ConvertToDisplay : sta $7ec7e6
.restore
plb : rts
}
@@ -40,6 +52,10 @@ ConvertToDisplay:
CountChestKeys:
jsl ItemDowngradeFix
jsr CountChest
rtl
CountChest:
cpy #$24 : beq +
cpy #$a0 : !blt .end
cpy #$ae : !bge .end
@@ -53,7 +69,7 @@ CountChestKeys:
lda $7ef4b0, x : inc : sta $7ef4b0, x
lda $7ef4e0, x : inc : sta $7ef4e0, x
.restore plx : pla
.end rtl
.end rts
CountAbsorbedKeys:
jsl IncrementSmallKeysNoPrimary : phx
@@ -61,3 +77,17 @@ CountAbsorbedKeys:
lsr : tax
lda $7ef4b0, x : inc : sta $7ef4b0, x
+ plx : rtl
CountBonkItem:
jsl GiveBonkItem
lda $a0 ; check room ID - only bonk keys in 2 rooms so we're just checking the lower byte
cmp #115 : bne + ; Desert Bonk Key
lda.l BonkKey_Desert
bra ++
+ : cmp #140 : bne + ; GTower Bonk Key
lda.l BonkKey_GTower
bra ++
+ lda.b #$24 ; default to small key
++
phy : tay : jsr CountChest : ply
rtl

File diff suppressed because one or more lines are too long