hidden_object_functions3.asm 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. ; prints text for bookshelves in buildings without sign events
  2. PrintBookshelfText:
  3. ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
  4. cp SPRITE_FACING_UP
  5. jr nz, .noMatch
  6. ; facing up
  7. ld a, [wCurMapTileset]
  8. ld b, a
  9. aCoord 8, 7
  10. ld c, a
  11. ld hl, BookshelfTileIDs
  12. .loop
  13. ld a, [hli]
  14. cp $ff
  15. jr z, .noMatch
  16. cp b
  17. jr nz, .nextBookshelfEntry1
  18. ld a, [hli]
  19. cp c
  20. jr nz, .nextBookshelfEntry2
  21. ld a, [hl]
  22. push af
  23. call EnableAutoTextBoxDrawing
  24. pop af
  25. call PrintPredefTextID
  26. xor a
  27. ld [$ffdb], a
  28. ret
  29. .nextBookshelfEntry1
  30. inc hl
  31. .nextBookshelfEntry2
  32. inc hl
  33. jr .loop
  34. .noMatch
  35. ld a, $ff
  36. ld [$ffdb], a
  37. jpba PrintCardKeyText
  38. ; format: db tileset id, bookshelf tile id, text id
  39. BookshelfTileIDs:
  40. db PLATEAU, $30
  41. db_tx_pre IndigoPlateauStatues
  42. db HOUSE, $3D
  43. db_tx_pre TownMapText
  44. db HOUSE, $1E
  45. db_tx_pre BookOrSculptureText
  46. db MANSION, $32
  47. db_tx_pre BookOrSculptureText
  48. db REDS_HOUSE_1, $32
  49. db_tx_pre BookOrSculptureText
  50. db LAB, $28
  51. db_tx_pre BookOrSculptureText
  52. db LOBBY, $16
  53. db_tx_pre ElevatorText
  54. db GYM, $1D
  55. db_tx_pre BookOrSculptureText
  56. db DOJO, $1D
  57. db_tx_pre BookOrSculptureText
  58. db GATE, $22
  59. db_tx_pre BookOrSculptureText
  60. db MART, $54
  61. db_tx_pre PokemonStuffText
  62. db MART, $55
  63. db_tx_pre PokemonStuffText
  64. db POKECENTER, $54
  65. db_tx_pre PokemonStuffText
  66. db POKECENTER, $55
  67. db_tx_pre PokemonStuffText
  68. db LOBBY, $50
  69. db_tx_pre PokemonStuffText
  70. db LOBBY, $52
  71. db_tx_pre PokemonStuffText
  72. db SHIP, $36
  73. db_tx_pre BookOrSculptureText
  74. db $FF
  75. IndigoPlateauStatues:
  76. TX_ASM
  77. ld hl, IndigoPlateauStatuesText1
  78. call PrintText
  79. ld a, [wXCoord]
  80. bit 0, a
  81. ld hl, IndigoPlateauStatuesText2
  82. jr nz, .ok
  83. ld hl, IndigoPlateauStatuesText3
  84. .ok
  85. call PrintText
  86. jp TextScriptEnd
  87. IndigoPlateauStatuesText1:
  88. TX_FAR _IndigoPlateauStatuesText1
  89. db "@"
  90. IndigoPlateauStatuesText2:
  91. TX_FAR _IndigoPlateauStatuesText2
  92. db "@"
  93. IndigoPlateauStatuesText3:
  94. TX_FAR _IndigoPlateauStatuesText3
  95. db "@"
  96. BookOrSculptureText:
  97. TX_ASM
  98. ld hl, PokemonBooksText
  99. ld a, [wCurMapTileset]
  100. cp MANSION ; Celadon Mansion tileset
  101. jr nz, .ok
  102. aCoord 8, 6
  103. cp $38
  104. jr nz, .ok
  105. ld hl, DiglettSculptureText
  106. .ok
  107. call PrintText
  108. jp TextScriptEnd
  109. PokemonBooksText:
  110. TX_FAR _PokemonBooksText
  111. db "@"
  112. DiglettSculptureText:
  113. TX_FAR _DiglettSculptureText
  114. db "@"
  115. ElevatorText:
  116. TX_FAR _ElevatorText
  117. db "@"
  118. TownMapText:
  119. TX_FAR _TownMapText
  120. TX_BLINK
  121. TX_ASM
  122. ld a, $1
  123. ld [wDoNotWaitForButtonPressAfterDisplayingText], a
  124. ld hl, wd730
  125. set 6, [hl]
  126. call GBPalWhiteOutWithDelay3
  127. xor a
  128. ld [hWY], a
  129. inc a
  130. ld [H_AUTOBGTRANSFERENABLED], a
  131. call LoadFontTilePatterns
  132. callba DisplayTownMap
  133. ld hl, wd730
  134. res 6, [hl]
  135. ld de, TextScriptEnd
  136. push de
  137. ld a, [H_LOADEDROMBANK]
  138. push af
  139. jp CloseTextDisplay
  140. PokemonStuffText:
  141. TX_FAR _PokemonStuffText
  142. db "@"