Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/scripts/CeladonMartElevator.asm
1270 views
1
CeladonMartElevator_Script:
2
ld hl, wCurrentMapScriptFlags
3
bit BIT_CUR_MAP_LOADED_1, [hl]
4
res BIT_CUR_MAP_LOADED_1, [hl]
5
push hl
6
call nz, CeladonMartElevatorStoreWarpEntriesScript
7
pop hl
8
bit BIT_CUR_MAP_USED_ELEVATOR, [hl]
9
res BIT_CUR_MAP_USED_ELEVATOR, [hl]
10
call nz, CeladonMartElevatorShakeScript
11
xor a
12
ld [wAutoTextBoxDrawingControl], a
13
inc a
14
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
15
ret
16
17
CeladonMartElevatorStoreWarpEntriesScript:
18
ld hl, wWarpEntries
19
ld a, [wWarpedFromWhichWarp]
20
ld b, a
21
ld a, [wWarpedFromWhichMap]
22
ld c, a
23
call .StoreWarpEntry
24
; fallthrough
25
.StoreWarpEntry:
26
inc hl
27
inc hl
28
ld a, b
29
ld [hli], a
30
ld a, c
31
ld [hli], a
32
ret
33
34
CeladonMartElevatorCopyWarpMapsScript:
35
ld hl, CeladonMartElevatorFloors
36
call LoadItemList
37
ld hl, CeladonMartElevatorWarpMaps
38
ld de, wElevatorWarpMaps
39
ld bc, CeladonMartElevatorWarpMaps.End - CeladonMartElevatorWarpMaps
40
jp CopyData
41
42
CeladonMartElevatorFloors:
43
db 5 ; #
44
db FLOOR_1F
45
db FLOOR_2F
46
db FLOOR_3F
47
db FLOOR_4F
48
db FLOOR_5F
49
db -1 ; end
50
51
; These specify where the player goes after getting out of the elevator.
52
CeladonMartElevatorWarpMaps:
53
; warp number, map id
54
db 5, CELADON_MART_1F
55
db 2, CELADON_MART_2F
56
db 2, CELADON_MART_3F
57
db 2, CELADON_MART_4F
58
db 2, CELADON_MART_5F
59
.End:
60
61
CeladonMartElevatorShakeScript:
62
farjp ShakeElevator
63
64
CeladonMartElevator_TextPointers:
65
def_text_pointers
66
dw_const CeladonMartElevatorText, TEXT_CELADONMARTELEVATOR
67
68
CeladonMartElevatorText:
69
text_asm
70
call CeladonMartElevatorCopyWarpMapsScript
71
ld hl, CeladonMartElevatorWarpMaps
72
predef DisplayElevatorFloorMenu
73
jp TextScriptEnd
74
75