silphcoelevator.asm 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. SilphCoElevatorScript:
  2. ld hl, wCurrentMapScriptFlags
  3. bit 5, [hl]
  4. res 5, [hl]
  5. push hl
  6. call nz, SilphCoElevatorScript_457dc
  7. pop hl
  8. bit 7, [hl]
  9. res 7, [hl]
  10. call nz, SilphCoElevatorScript_45827
  11. xor a
  12. ld [wAutoTextBoxDrawingControl], a
  13. inc a
  14. ld [wDoNotWaitForButtonPressAfterDisplayingText], a
  15. ret
  16. SilphCoElevatorScript_457dc:
  17. ld hl, wWarpEntries
  18. ld a, [wWarpedFromWhichWarp]
  19. ld b, a
  20. ld a, [wWarpedFromWhichMap]
  21. ld c, a
  22. call SilphCoElevatorScript_457ea
  23. SilphCoElevatorScript_457ea:
  24. inc hl
  25. inc hl
  26. ld a, b
  27. ld [hli], a
  28. ld a, c
  29. ld [hli], a
  30. ret
  31. SilphCoElevatorScript_457f1:
  32. ld hl, SilphCoElavatorFloors
  33. call LoadItemList
  34. ld hl, SilphCoElevatorWarpMaps
  35. ld de, wElevatorWarpMaps
  36. ld bc, SilphCoElevatorWarpMapsEnd - SilphCoElevatorWarpMaps
  37. call CopyData
  38. ret
  39. SilphCoElavatorFloors:
  40. db $0B ; num elements in list
  41. db FLOOR_1F
  42. db FLOOR_2F
  43. db FLOOR_3F
  44. db FLOOR_4F
  45. db FLOOR_5F
  46. db FLOOR_6F
  47. db FLOOR_7F
  48. db FLOOR_8F
  49. db FLOOR_9F
  50. db FLOOR_10F
  51. db FLOOR_11F
  52. db $FF ; terminator
  53. SilphCoElevatorWarpMaps:
  54. ; first byte is warp number
  55. ; second byte is map number
  56. ; These specify where the player goes after getting out of the elevator.
  57. db $03, SILPH_CO_1F
  58. db $02, SILPH_CO_2F
  59. db $02, SILPH_CO_3F
  60. db $02, SILPH_CO_4F
  61. db $02, SILPH_CO_5F
  62. db $02, SILPH_CO_6F
  63. db $02, SILPH_CO_7F
  64. db $02, SILPH_CO_8F
  65. db $02, SILPH_CO_9F
  66. db $02, SILPH_CO_10F
  67. db $01, SILPH_CO_11F
  68. SilphCoElevatorWarpMapsEnd:
  69. SilphCoElevatorScript_45827:
  70. call Delay3
  71. callba ShakeElevator
  72. ret
  73. SilphCoElevatorTextPointers:
  74. dw SilphCoElevatorText1
  75. SilphCoElevatorText1:
  76. TX_ASM
  77. call SilphCoElevatorScript_457f1
  78. ld hl, SilphCoElevatorWarpMaps
  79. predef DisplayElevatorFloorMenu
  80. jp TextScriptEnd