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)
This commit is contained in:
aerinon
2020-04-03 15:45:55 -06:00
parent e30f66742b
commit bb402ff7f2
9 changed files with 130 additions and 5 deletions

View File

@@ -2256,3 +2256,19 @@ compass_data = {
'Turtle Rock': (0x11F, 0xcb, 0x15e, 0, 0x18),
'Ganons Tower': (0x13A, 0xcc, 0x170, 2, 0x1a)
}
# For compass boss indicator
boss_indicator = {
'Eastern Palace': (0x04, 'Eastern Boss SE'),
'Desert Palace': (0x06, 'Desert Boss SW'),
'Agahnims Tower': (0x08, 'Tower Agahnim 1 SW'),
'Swamp Palace': (0x0a, 'Swamp Boss SW'),
'Palace of Darkness': (0x0c, 'PoD Boss SE'),
'Misery Mire': (0x0e, 'Mire Boss SW'),
'Skull Woods': (0x10, 'Skull Spike Corner SW'),
'Ice Palace': (0x12, 'Ice Antechamber NE'),
'Tower of Hera': (0x14, 'Hera Boss Down Stairs'),
'Thieves Town': (0x16, 'Thieves Boss SE'),
'Turtle Rock': (0x18, 'TR Boss SW'),
'Ganons Tower': (0x1a, 'GT Agahnim 2 SW')
}

View File

@@ -24,7 +24,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.20.2u'
__version__ = '0.0.20.3u'
class EnemizerError(RuntimeError):

View File

@@ -2,6 +2,9 @@
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)
# Bug Fixes

20
Rom.py
View File

@@ -10,7 +10,7 @@ import sys
import subprocess
from BaseClasses import CollectionState, ShopType, Region, Location, DoorType
from DoorShuffle import compass_data, DROptions
from DoorShuffle import compass_data, DROptions, boss_indicator
from Dungeons import dungeon_music_addresses
from Regions import location_table
from Text import MultiByteTextMapper, CompressedTextMapper, text_addresses, Credits, TextTable
@@ -22,7 +22,7 @@ from EntranceShuffle import door_addresses, exit_ids
JAP10HASH = '03a63945398191337e896e5771f77173'
RANDOMIZERBASEHASH = 'b7b962ea562962200c4c88c0b615f8fe'
RANDOMIZERBASEHASH = 'a06d24c7d1473717e2610c3cf45809ff'
class JsonRom(object):
@@ -596,6 +596,15 @@ def patch_rom(world, rom, player, team, enemized):
dr_flags = DROptions.Eternal_Mini_Bosses if world.doorShuffle[player] == 'vanilla' or not world.experimental[player] else DROptions.Town_Portal
if world.doorShuffle[player] == 'crossed':
rom.write_byte(0x139004, 2)
for name, layout in world.key_layout[player].items():
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(0x151f1, 2)
rom.write_byte(0x15270, 2)
rom.write_byte(0x1597b, 2)
@@ -619,6 +628,13 @@ def patch_rom(world, rom, player, team, enemized):
if builder.pre_open_stonewall:
if builder.pre_open_stonewall.name == 'Desert Wall Slide NW':
dr_flags |= DROptions.Open_Desert_Wall
for name, pair in boss_indicator.items():
dungeon_id, boss_door = pair
opposite_door = world.get_door(boss_door, player).dest
if opposite_door.roomIndex > -1:
dungeon_name = opposite_door.entrance.parent_region.dungeon.name
dungeon_id = boss_indicator[dungeon_name][0]
rom.write_byte(0x13f000+dungeon_id, opposite_door.roomIndex)
rom.write_byte(0x139006, dr_flags.value)
if dr_flags & DROptions.Town_Portal and world.mode[player] == 'inverted':
rom.write_byte(0x139008, 1)

View File

@@ -21,6 +21,7 @@ incsrc keydoors.asm
incsrc overrides.asm
;incsrc edges.asm
;incsrc math.asm
incsrc hudadditions.asm
warnpc $279000
; Data Section

View File

@@ -540,4 +540,23 @@ db $a0,$a0,$50 ; DP Main Lobby
db $58,$50,$30, $98,$50,$70 ; TT Ambush
db $58,$50,$30 ; TT Nook
MultDivInfo: ; (1placeholder, 1, 2, 3, 4, 5, 6, 10, 20)
db $01, $01, $02, $03, $04, $05, $06, $0a, $14
db $01, $01, $02, $03, $04, $05, $06, $0a, $14
; dungeon tables
; HC HC EP DP AT SP PD MM SW IP TH TT TR GT
org $27f000
CompassBossIndicator:
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
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
DungeonReminderTable: ;27f054
dw $2D50, $2D50, $2D51, $2D52, $2D54, $2D56, $2D55, $2D5A, $2D57, $2D59, $2D53, $2D58, $2D5B, $2D5C
;27f070

View File

@@ -89,6 +89,13 @@ jsl FixShopCode
org $1ddeea ; <- Bank1D.asm : 286 (JSL Sprite_LoadProperties)
jsl VitreousKeyReset
; also rando's hooks.asm line 1360
org $a0ee11 ; <- 6FC4C - headsup_display.asm : 836 (LDA $7EF36E : AND.w #$00FF : ADD.w #$0007 : AND.w #$FFF8 : TAX)
jsl DrHudOverride
org $098638 ; rando's hooks.asm line 2192
jsl CountChestKeys
org $06D192 ; rando's hooks.asm line 457
jsl CountAbsorbedKeys
; 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

63
asm/hudadditions.asm Normal file
View File

@@ -0,0 +1,63 @@
DrHudOverride:
{
jsl.l NewDrawHud
jsr HudAdditions
rtl
}
HudAdditions:
{
ldx $040c : cpx #$ff : bne + : rts : +
lda DRMode : bne + : rts : +
phb : phk : plb
lda $7ef364 : and.l $0098c0, x : beq +
lda CompassBossIndicator, x : and #$00ff : cmp $a0 : bne +
lda $1a : and #$0010 : beq +
lda #$345e : sta $7ec790 : bra .next
+ lda #$207f : sta $7ec790
.next lda DRMode : and #$0002 : beq .restore
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 $7ef4e0, x : jsr ConvertToDisplay : sta $7ec7e2
lda #$2830 : sta $7ec7e4
lda ChestKeys, x : jsr ConvertToDisplay : sta $7ec7e6
.restore
plb : rts
}
ConvertToDisplay:
and #$00ff : cmp #$000a : !blt +
!add #$2553 : rts
+ !add #$2490 : rts
; and $18c0, x
;207f is blank
CountChestKeys:
jsl ItemDowngradeFix
cpy #$24 : beq +
cpy #$a0 : !blt .end
cpy #$ae : !bge .end
pha : phx
tya : and #$0f : bne ++
inc a
++ tax : bra .count
+ pha : phx
lda $040c : lsr : tax
.count
lda $7ef4b0, x : inc : sta $7ef4b0, x
lda $7ef4e0, x : inc : sta $7ef4e0, x
.restore plx : pla
.end rtl
CountAbsorbedKeys:
jsl IncrementSmallKeysNoPrimary : phx
lda $040c : cmp #$ff : beq +
lsr : tax
lda $7ef4b0, x : inc : sta $7ef4b0, x
+ plx : rtl

File diff suppressed because one or more lines are too long