mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-22 07:02:17 +13:00
Split up engine/events/hidden_object_functions
This commit is contained in:
parent
6bd86e10c3
commit
e882708b85
29 changed files with 1174 additions and 1173 deletions
39
engine/events/hidden_objects/bookshelves.asm
Normal file
39
engine/events/hidden_objects/bookshelves.asm
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
; prints text for bookshelves in buildings without sign events
|
||||
PrintBookshelfText::
|
||||
ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
|
||||
cp SPRITE_FACING_UP
|
||||
jr nz, .noMatch
|
||||
; facing up
|
||||
ld a, [wCurMapTileset]
|
||||
ld b, a
|
||||
aCoord 8, 7
|
||||
ld c, a
|
||||
ld hl, BookshelfTileIDs
|
||||
.loop
|
||||
ld a, [hli]
|
||||
cp $ff
|
||||
jr z, .noMatch
|
||||
cp b
|
||||
jr nz, .nextBookshelfEntry1
|
||||
ld a, [hli]
|
||||
cp c
|
||||
jr nz, .nextBookshelfEntry2
|
||||
ld a, [hl]
|
||||
push af
|
||||
call EnableAutoTextBoxDrawing
|
||||
pop af
|
||||
call PrintPredefTextID
|
||||
xor a
|
||||
ld [$ffdb], a
|
||||
ret
|
||||
.nextBookshelfEntry1
|
||||
inc hl
|
||||
.nextBookshelfEntry2
|
||||
inc hl
|
||||
jr .loop
|
||||
.noMatch
|
||||
ld a, $ff
|
||||
ld [$ffdb], a
|
||||
jpba PrintCardKeyText
|
||||
|
||||
INCLUDE "data/tilesets/bookshelf_tile_ids.asm"
|
||||
Loading…
Add table
Add a link
Reference in a new issue