Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/engine/events/hidden_objects/bills_house_pc.asm
1271 views
1
BillsHousePC:
2
call EnableAutoTextBoxDrawing
3
ld a, [wSpritePlayerStateData1FacingDirection]
4
cp SPRITE_FACING_UP
5
ret nz
6
CheckEvent EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING
7
jr nz, .displayBillsHousePokemonList
8
CheckEventReuseA EVENT_USED_CELL_SEPARATOR_ON_BILL
9
jr nz, .displayBillsHouseMonitorText
10
CheckEventReuseA EVENT_BILL_SAID_USE_CELL_SEPARATOR
11
jr nz, .doCellSeparator
12
.displayBillsHouseMonitorText
13
tx_pre_jump BillsHouseMonitorText
14
.doCellSeparator
15
ld a, $1
16
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
17
tx_pre BillsHouseInitiatedText
18
ld c, 32
19
call DelayFrames
20
ld a, SFX_TINK
21
call PlaySound
22
call WaitForSoundToFinish
23
ld c, 80
24
call DelayFrames
25
ld a, SFX_SHRINK
26
call PlaySound
27
call WaitForSoundToFinish
28
ld c, 48
29
call DelayFrames
30
ld a, SFX_TINK
31
call PlaySound
32
call WaitForSoundToFinish
33
ld c, 32
34
call DelayFrames
35
ld a, SFX_GET_ITEM_1
36
call PlaySound
37
call WaitForSoundToFinish
38
call PlayDefaultMusic
39
SetEvent EVENT_USED_CELL_SEPARATOR_ON_BILL
40
ret
41
.displayBillsHousePokemonList
42
ld a, $1
43
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
44
tx_pre BillsHousePokemonList
45
ret
46
47
BillsHouseMonitorText::
48
text_far _BillsHouseMonitorText
49
text_end
50
51
BillsHouseInitiatedText::
52
text_far _BillsHouseInitiatedText
53
text_promptbutton
54
text_asm
55
ld a, SFX_STOP_ALL_MUSIC
56
ld [wNewSoundID], a
57
call PlaySound
58
ld c, 16
59
call DelayFrames
60
ld a, SFX_SWITCH
61
call PlaySound
62
call WaitForSoundToFinish
63
ld c, 60
64
call DelayFrames
65
jp TextScriptEnd
66
67
BillsHousePokemonList::
68
text_asm
69
call SaveScreenTilesToBuffer1
70
ld hl, BillsHousePokemonListText1
71
call PrintText
72
xor a
73
ld [wMenuItemOffset], a ; not used
74
ld [wCurrentMenuItem], a
75
ld [wLastMenuItem], a
76
ld a, PAD_A | PAD_B
77
ld [wMenuWatchedKeys], a
78
ld a, 4
79
ld [wMaxMenuItem], a
80
ld a, 2
81
ld [wTopMenuItemY], a
82
ld a, 1
83
ld [wTopMenuItemX], a
84
.billsPokemonLoop
85
ld hl, wStatusFlags5
86
set BIT_NO_TEXT_DELAY, [hl]
87
hlcoord 0, 0
88
ld b, 10
89
ld c, 9
90
call TextBoxBorder
91
hlcoord 2, 2
92
ld de, BillsMonListText
93
call PlaceString
94
ld hl, BillsHousePokemonListText2
95
call PrintText
96
call SaveScreenTilesToBuffer2
97
call HandleMenuInput
98
bit B_PAD_B, a
99
jr nz, .cancel
100
ld a, [wCurrentMenuItem]
101
add EEVEE
102
cp EEVEE
103
jr z, .displayPokedex
104
cp FLAREON
105
jr z, .displayPokedex
106
cp JOLTEON
107
jr z, .displayPokedex
108
cp VAPOREON
109
jr z, .displayPokedex
110
jr .cancel
111
.displayPokedex
112
call DisplayPokedex
113
call LoadScreenTilesFromBuffer2
114
jr .billsPokemonLoop
115
.cancel
116
ld hl, wStatusFlags5
117
res BIT_NO_TEXT_DELAY, [hl]
118
call LoadScreenTilesFromBuffer2
119
jp TextScriptEnd
120
121
BillsHousePokemonListText1:
122
text_far _BillsHousePokemonListText1
123
text_end
124
125
BillsMonListText:
126
db "EEVEE"
127
next "FLAREON"
128
next "JOLTEON"
129
next "VAPOREON"
130
next "CANCEL@"
131
132
BillsHousePokemonListText2:
133
text_far _BillsHousePokemonListText2
134
text_end
135
136