Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/engine/events/hidden_objects/gym_statues.asm
1271 views
1
GymStatues:
2
; if in a gym and have the corresponding badge, a = GymStatueText2_id and jp PrintPredefTextID
3
; if in a gym and don't have the corresponding badge, a = GymStatueText1_id and jp PrintPredefTextID
4
; else ret
5
call EnableAutoTextBoxDrawing
6
ld a, [wSpritePlayerStateData1FacingDirection]
7
cp SPRITE_FACING_UP
8
ret nz
9
ld hl, MapBadgeFlags
10
ld a, [wCurMap]
11
ld b, a
12
.loop
13
ld a, [hli]
14
cp $ff
15
ret z
16
cp b
17
jr z, .match
18
inc hl
19
jr .loop
20
.match
21
ld b, [hl]
22
ld a, [wBeatGymFlags]
23
and b
24
cp b
25
tx_pre_id GymStatueText2
26
jr z, .haveBadge
27
tx_pre_id GymStatueText1
28
.haveBadge
29
jp PrintPredefTextID
30
31
INCLUDE "data/maps/badge_maps.asm"
32
33
GymStatueText1::
34
text_far _GymStatueText1
35
text_end
36
37
GymStatueText2::
38
text_far _GymStatueText2
39
text_end
40
41