2018-06-25 00:10:37 +00:00
|
|
|
HoOhChamber:
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wPartySpecies
|
2015-10-16 17:35:43 +00:00
|
|
|
ld a, [hl]
|
|
|
|
cp HO_OH ; is Ho-oh the first Pokémon in the party?
|
|
|
|
jr nz, .done ; if not, we're done
|
2018-02-03 21:58:49 +00:00
|
|
|
call GetMapAttributesPointer ; pointless?
|
2015-10-16 17:35:43 +00:00
|
|
|
ld de, EVENT_WALL_OPENED_IN_HO_OH_CHAMBER
|
|
|
|
ld b, SET_FLAG
|
|
|
|
call EventFlagAction
|
|
|
|
.done
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
OmanyteChamber:
|
2018-02-03 21:58:49 +00:00
|
|
|
call GetMapAttributesPointer ; pointless?
|
2015-10-16 17:35:43 +00:00
|
|
|
ld de, EVENT_WALL_OPENED_IN_OMANYTE_CHAMBER
|
|
|
|
ld b, CHECK_FLAG
|
|
|
|
call EventFlagAction
|
|
|
|
ld a, c
|
|
|
|
and a
|
|
|
|
jr nz, .nope
|
|
|
|
|
|
|
|
ld a, WATER_STONE
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wCurItem], a
|
|
|
|
ld hl, wNumItems
|
2015-10-16 17:35:43 +00:00
|
|
|
call CheckItem
|
|
|
|
jr c, .open
|
|
|
|
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wPartyCount]
|
2015-10-16 17:35:43 +00:00
|
|
|
ld b, a
|
|
|
|
inc b
|
|
|
|
.loop
|
|
|
|
dec b
|
|
|
|
jr z, .nope
|
|
|
|
ld a, b
|
|
|
|
dec a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wCurPartyMon], a
|
2015-10-16 17:35:43 +00:00
|
|
|
push bc
|
2015-11-04 16:19:58 +00:00
|
|
|
ld a, MON_ITEM
|
2015-10-16 17:35:43 +00:00
|
|
|
call GetPartyParamLocation
|
|
|
|
pop bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp WATER_STONE
|
|
|
|
jr nz, .loop
|
|
|
|
|
|
|
|
.open
|
2018-02-03 21:58:49 +00:00
|
|
|
call GetMapAttributesPointer ; pointless?
|
2015-10-16 17:35:43 +00:00
|
|
|
ld de, EVENT_WALL_OPENED_IN_OMANYTE_CHAMBER
|
|
|
|
ld b, SET_FLAG
|
|
|
|
call EventFlagAction
|
|
|
|
|
|
|
|
.nope
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
SpecialAerodactylChamber:
|
2015-10-16 17:35:43 +00:00
|
|
|
push de
|
|
|
|
push bc
|
|
|
|
|
2018-02-03 21:58:49 +00:00
|
|
|
call GetMapAttributesPointer
|
2015-10-16 17:35:43 +00:00
|
|
|
ld a, h
|
2018-02-03 21:58:49 +00:00
|
|
|
cp HIGH(RuinsOfAlphAerodactylChamber_MapAttributes)
|
2015-10-16 17:35:43 +00:00
|
|
|
jr nz, .nope
|
|
|
|
ld a, l
|
2018-02-03 21:58:49 +00:00
|
|
|
cp LOW(RuinsOfAlphAerodactylChamber_MapAttributes)
|
2015-10-16 17:35:43 +00:00
|
|
|
jr nz, .nope
|
|
|
|
|
|
|
|
ld de, EVENT_WALL_OPENED_IN_AERODACTYL_CHAMBER
|
|
|
|
ld b, SET_FLAG
|
|
|
|
call EventFlagAction
|
|
|
|
|
|
|
|
scf
|
|
|
|
jr .done
|
|
|
|
|
|
|
|
.nope
|
|
|
|
and a
|
|
|
|
|
|
|
|
.done
|
|
|
|
pop bc
|
|
|
|
pop de
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
SpecialKabutoChamber:
|
2015-10-16 17:35:43 +00:00
|
|
|
push hl
|
|
|
|
push de
|
|
|
|
|
2018-02-03 21:58:49 +00:00
|
|
|
call GetMapAttributesPointer
|
2015-10-16 17:35:43 +00:00
|
|
|
ld a, h
|
2018-02-03 21:58:49 +00:00
|
|
|
cp HIGH(RuinsOfAlphKabutoChamber_MapAttributes)
|
2015-10-16 17:35:43 +00:00
|
|
|
jr nz, .done
|
|
|
|
ld a, l
|
2018-02-03 21:58:49 +00:00
|
|
|
cp LOW(RuinsOfAlphKabutoChamber_MapAttributes)
|
2015-10-16 17:35:43 +00:00
|
|
|
jr nz, .done
|
|
|
|
|
|
|
|
ld de, EVENT_WALL_OPENED_IN_KABUTO_CHAMBER
|
|
|
|
ld b, SET_FLAG
|
|
|
|
call EventFlagAction
|
|
|
|
|
|
|
|
.done
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
DisplayUnownWords:
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wScriptVar]
|
2018-01-23 21:08:43 +00:00
|
|
|
ld hl, MenuHeaders_UnownWalls
|
2015-10-16 17:35:43 +00:00
|
|
|
and a
|
2016-05-01 01:20:12 +00:00
|
|
|
jr z, .load
|
2015-10-16 17:35:43 +00:00
|
|
|
|
|
|
|
ld d, $0
|
|
|
|
ld e, $5
|
2016-05-01 01:20:12 +00:00
|
|
|
.loop
|
2015-10-16 17:35:43 +00:00
|
|
|
add hl, de
|
|
|
|
dec a
|
2016-05-01 01:20:12 +00:00
|
|
|
jr nz, .loop
|
2015-10-16 17:35:43 +00:00
|
|
|
|
2016-05-01 01:20:12 +00:00
|
|
|
.load
|
2018-01-23 21:08:43 +00:00
|
|
|
call LoadMenuHeader
|
2015-10-16 17:35:43 +00:00
|
|
|
xor a
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hBGMapMode], a
|
2015-11-04 19:02:11 +00:00
|
|
|
call MenuBox
|
2015-10-16 17:35:43 +00:00
|
|
|
call UpdateSprites
|
2015-11-25 15:16:29 +00:00
|
|
|
call ApplyTilemap
|
2015-11-10 21:53:37 +00:00
|
|
|
call MenuBoxCoord2Tile
|
2015-10-16 17:35:43 +00:00
|
|
|
inc hl
|
2016-05-01 01:20:12 +00:00
|
|
|
ld d, 0
|
|
|
|
ld e, SCREEN_WIDTH
|
|
|
|
add hl, de
|
2015-10-16 17:35:43 +00:00
|
|
|
add hl, de
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wScriptVar]
|
2015-10-16 17:35:43 +00:00
|
|
|
ld c, a
|
2018-01-11 05:25:14 +00:00
|
|
|
ld de, UnownWalls
|
2015-10-16 17:35:43 +00:00
|
|
|
and a
|
2016-05-01 01:20:12 +00:00
|
|
|
jr z, .copy
|
|
|
|
.loop2
|
2015-10-16 17:35:43 +00:00
|
|
|
ld a, [de]
|
|
|
|
inc de
|
2018-01-11 03:53:42 +00:00
|
|
|
cp -1
|
2016-05-01 01:20:12 +00:00
|
|
|
jr nz, .loop2
|
2015-10-16 17:35:43 +00:00
|
|
|
dec c
|
2016-05-01 01:20:12 +00:00
|
|
|
jr nz, .loop2
|
|
|
|
.copy
|
2018-01-11 05:25:14 +00:00
|
|
|
call _DisplayUnownWords_CopyWord
|
2020-02-13 17:30:13 +00:00
|
|
|
ld bc, wAttrmap - wTilemap
|
2015-10-16 17:35:43 +00:00
|
|
|
add hl, bc
|
2018-01-11 05:25:14 +00:00
|
|
|
call _DisplayUnownWords_FillAttr
|
2015-12-11 21:59:40 +00:00
|
|
|
call WaitBGMap2
|
2015-10-17 16:58:26 +00:00
|
|
|
call JoyWaitAorB
|
2015-10-16 17:35:43 +00:00
|
|
|
call PlayClickSFX
|
2015-12-25 03:58:42 +00:00
|
|
|
call CloseWindow
|
2015-10-16 17:35:43 +00:00
|
|
|
ret
|
|
|
|
|
2018-01-26 03:19:24 +00:00
|
|
|
INCLUDE "data/events/unown_walls.asm"
|
2016-05-01 01:20:12 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
_DisplayUnownWords_FillAttr:
|
2015-10-16 17:35:43 +00:00
|
|
|
ld a, [de]
|
|
|
|
cp $ff
|
|
|
|
ret z
|
|
|
|
cp $60
|
2017-12-11 01:50:08 +00:00
|
|
|
ld a, VRAM_BANK_1 | PAL_BG_BROWN
|
2016-05-01 01:20:12 +00:00
|
|
|
jr c, .got_pal
|
|
|
|
ld a, PAL_BG_BROWN
|
2015-10-16 17:35:43 +00:00
|
|
|
|
2016-05-01 01:20:12 +00:00
|
|
|
.got_pal
|
|
|
|
call .PlaceSquare
|
|
|
|
inc hl
|
2015-10-16 17:35:43 +00:00
|
|
|
inc hl
|
|
|
|
inc de
|
2018-01-11 05:25:14 +00:00
|
|
|
jr _DisplayUnownWords_FillAttr
|
2015-10-16 17:35:43 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.PlaceSquare:
|
2015-10-16 17:35:43 +00:00
|
|
|
push hl
|
|
|
|
ld [hli], a
|
|
|
|
ld [hld], a
|
2016-05-01 01:20:12 +00:00
|
|
|
ld b, 0
|
|
|
|
ld c, SCREEN_WIDTH
|
2015-10-16 17:35:43 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hli], a
|
|
|
|
ld [hl], a
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
_DisplayUnownWords_CopyWord:
|
2015-10-16 17:35:43 +00:00
|
|
|
push hl
|
|
|
|
push de
|
2016-05-01 01:20:12 +00:00
|
|
|
.word_loop
|
2015-10-16 17:35:43 +00:00
|
|
|
ld a, [de]
|
|
|
|
cp $ff
|
2016-05-01 01:20:12 +00:00
|
|
|
jr z, .word_done
|
2015-10-16 17:35:43 +00:00
|
|
|
ld c, a
|
2016-05-01 01:20:12 +00:00
|
|
|
call .ConvertChar
|
|
|
|
inc hl
|
2015-10-16 17:35:43 +00:00
|
|
|
inc hl
|
|
|
|
inc de
|
2016-05-01 01:20:12 +00:00
|
|
|
jr .word_loop
|
2015-10-16 17:35:43 +00:00
|
|
|
|
2016-05-01 01:20:12 +00:00
|
|
|
.word_done
|
2015-10-16 17:35:43 +00:00
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.ConvertChar:
|
2015-10-16 17:35:43 +00:00
|
|
|
push hl
|
|
|
|
ld a, c
|
|
|
|
cp $60
|
2016-05-01 01:20:12 +00:00
|
|
|
jr z, .Tile60
|
2015-10-16 17:35:43 +00:00
|
|
|
cp $62
|
2016-05-01 01:20:12 +00:00
|
|
|
jr z, .Tile62
|
2015-10-16 17:35:43 +00:00
|
|
|
cp $64
|
2016-05-01 01:20:12 +00:00
|
|
|
jr z, .Tile64
|
2015-10-16 17:35:43 +00:00
|
|
|
ld [hli], a
|
|
|
|
inc a
|
|
|
|
ld [hld], a
|
|
|
|
dec a
|
2016-05-01 01:20:12 +00:00
|
|
|
ld b, 0
|
|
|
|
ld c, SCREEN_WIDTH
|
2015-10-16 17:35:43 +00:00
|
|
|
add hl, bc
|
|
|
|
ld c, $10
|
|
|
|
add c
|
|
|
|
ld [hli], a
|
|
|
|
inc a
|
|
|
|
ld [hl], a
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
2016-05-01 01:20:12 +00:00
|
|
|
.Tile60:
|
2015-10-16 17:35:43 +00:00
|
|
|
ld [hl], $5b
|
|
|
|
inc hl
|
|
|
|
ld [hl], $5c
|
2016-05-01 01:20:12 +00:00
|
|
|
ld bc, SCREEN_WIDTH - 1
|
2015-10-16 17:35:43 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $4d
|
|
|
|
inc hl
|
|
|
|
ld [hl], $5d
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
2016-05-01 01:20:12 +00:00
|
|
|
.Tile62:
|
2015-10-16 17:35:43 +00:00
|
|
|
ld [hl], $4e
|
|
|
|
inc hl
|
|
|
|
ld [hl], $4f
|
2016-05-01 01:20:12 +00:00
|
|
|
ld bc, SCREEN_WIDTH - 1
|
2015-10-16 17:35:43 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $5e
|
|
|
|
inc hl
|
|
|
|
ld [hl], $5f
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
2016-05-01 01:20:12 +00:00
|
|
|
.Tile64:
|
2015-10-16 17:35:43 +00:00
|
|
|
ld [hl], $2
|
|
|
|
inc hl
|
|
|
|
ld [hl], $3
|
2016-05-01 01:20:12 +00:00
|
|
|
ld bc, SCREEN_WIDTH - 1
|
2015-10-16 17:35:43 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $3
|
|
|
|
inc hl
|
|
|
|
ld [hl], $2
|
|
|
|
pop hl
|
|
|
|
ret
|