summaryrefslogtreecommitdiff
path: root/scripts/BillsHouse2.asm
blob: ca1a56addfcf3848e31f6674ab2c7e328c4f1d3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
Func_f2418::
	ld hl, BillsHouseText_f243b
	call PrintText
	call YesNoChoice
	ld a, [wCurrentMenuItem]
	and a
	jr nz, .asm_f2433
.asm_f2427
	ld hl, BillsHouseText_f2440
	call PrintText
	ld a, $2
	ld [wBillsHouseCurScript], a
	ret

.asm_f2433
	ld hl, BillsHouseText_f2445
	call PrintText
	jr .asm_f2427

BillsHouseText_f243b:
	text_far _BillsHouseText_1e865
	text_end

BillsHouseText_f2440:
	text_far _BillsHouseText_1e86a
	text_end

BillsHouseText_f2445:
	text_far _BillsHouseText_1e86f
	text_end

Func_f244a::
	CheckEvent EVENT_GOT_SS_TICKET
	jr nz, .asm_f247e
	ld hl, BillsHouseText_f248c
	call PrintText
	lb bc, S_S_TICKET, 1
	call GiveItem
	jr nc, .asm_f2485
	ld hl, BillsHouseText_f2491
	call PrintText
	SetEvent EVENT_GOT_SS_TICKET
	ld a, HS_CERULEAN_GUARD_1
	ld [wMissableObjectIndex], a
	predef ShowObject
	ld a, HS_CERULEAN_GUARD_2
	ld [wMissableObjectIndex], a
	predef HideObject
.asm_f247e
	ld hl, BillsHouseText_f249d
	call PrintText
	ret

.asm_f2485
	ld hl, BillsHouseText_f2498
	call PrintText
	ret

BillsHouseText_f248c:
	text_far _BillThankYouText
	text_end

BillsHouseText_f2491:
	text_far _SSTicketReceivedText
	sound_get_key_item
	text_promptbutton
	text_end

BillsHouseText_f2498:
	text_far _SSTicketNoRoomText
	text_end

BillsHouseText_f249d:
	text_far _BillsHouseText_1e8cb
	text_end

Func_f24a2::
	ld hl, BillsHouseText_f24a9
	call PrintText
	ret

BillsHouseText_f24a9:
	text_far _BillsHouseText_1e8da
	text_end

Func_f24ae::
	ld a, [wCurMap]
	cp BILLS_HOUSE
	jr nz, .asm_f24d2
	call CheckPikachuFollowingPlayer
	jr z, .asm_f24d2
	ld a, [wBillsHouseCurScript]
	cp $5
	ld e, $1b
	ret z
	cp $0
	ld e, $17
	ret z
	CheckEventHL EVENT_MET_BILL_2
	ld e, $20
	ret z
	ld e, $1f
	ret

.asm_f24d2
	ld e, $ff
	ret

Func_f24d5::
	ld a, $ff
	ld [wJoyIgnore], a
	xor a
	ld [wPlayerMovingDirection], a
	call UpdateSprites
	call UpdateSprites
	ld hl, Data_f2505
	call ApplyPikachuMovementData
	ld a, $f ; pikachu
	ld [wEmotionBubbleSpriteIndex], a
	ld a, QUESTION_BUBBLE
	ld [wWhichEmotionBubble], a
	predef EmotionBubble
	call DisablePikachuFollowingPlayer
	callfar InitializePikachuTextID
	ret

Data_f2505:
	db $00
	db $20
	db $20
	db $20
	db $1e
	db $3f

Func_f250b::
	ld hl, Data_f251c
	ld b, SPRITE_FACING_UP
	call TryApplyPikachuMovementData
	ld hl, Data_f2521
	ld b, SPRITE_FACING_RIGHT
	call TryApplyPikachuMovementData
	ret

Data_f251c:
	db $00
	db $1f
	db $1d
	db $38
	db $3f

Data_f2521:
	db $00
	db $1e
	db $1f
	db $1f
	db $1d
	db $38
	db $3f