celadonmartelevator.asm 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. CeladonMartElevatorScript:
  2. ld hl, wCurrentMapScriptFlags
  3. bit 5, [hl]
  4. res 5, [hl]
  5. push hl
  6. call nz, CeladonMartElevatorScript_4861c
  7. pop hl
  8. bit 7, [hl]
  9. res 7, [hl]
  10. call nz, CeladonMartElevatorScript_48654
  11. xor a
  12. ld [wAutoTextBoxDrawingControl], a
  13. inc a
  14. ld [wDoNotWaitForButtonPressAfterDisplayingText], a
  15. ret
  16. CeladonMartElevatorScript_4861c:
  17. ld hl, wWarpEntries
  18. ld a, [wWarpedFromWhichWarp]
  19. ld b, a
  20. ld a, [wWarpedFromWhichMap]
  21. ld c, a
  22. call CeladonMartElevatorScript_4862a
  23. CeladonMartElevatorScript_4862a:
  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. CeladonMartElevatorScript_48631:
  32. ld hl, CeladonMartElevatorFloors
  33. call LoadItemList
  34. ld hl, CeladonMartElevatorWarpMaps
  35. ld de, wElevatorWarpMaps
  36. ld bc, CeladonMartElevatorWarpMapsEnd - CeladonMartElevatorWarpMaps
  37. jp CopyData
  38. CeladonMartElevatorFloors:
  39. db 5 ; number of elements in list
  40. db FLOOR_1F
  41. db FLOOR_2F
  42. db FLOOR_3F
  43. db FLOOR_4F
  44. db FLOOR_5F
  45. db $FF
  46. CeladonMartElevatorWarpMaps:
  47. ; first byte is warp number
  48. ; second byte is map number
  49. ; These specify where the player goes after getting out of the elevator.
  50. db $05, CELADON_MART_1
  51. db $02, CELADON_MART_2
  52. db $02, CELADON_MART_3
  53. db $02, CELADON_MART_4
  54. db $02, CELADON_MART_5
  55. CeladonMartElevatorWarpMapsEnd:
  56. CeladonMartElevatorScript_48654:
  57. jpba ShakeElevator
  58. CeladonMartElevatorTextPointers:
  59. dw CeladonMartElevatorText1
  60. CeladonMartElevatorText1:
  61. TX_ASM
  62. call CeladonMartElevatorScript_48631
  63. ld hl, CeladonMartElevatorWarpMaps
  64. predef DisplayElevatorFloorMenu
  65. jp TextScriptEnd