mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-09-17 02:40:50 +12:00
40 lines
749 B
NASM
40 lines
749 B
NASM
GymStatues:
|
|
; if in a gym and have the corresponding badge, a = GymStatueText2_id and jp PrintPredefTextID
|
|
; if in a gym and don't have the corresponding badge, a = GymStatueText1_id and jp PrintPredefTextID
|
|
; else ret
|
|
call EnableAutoTextBoxDrawing
|
|
ld a, [wSpritePlayerStateData1FacingDirection]
|
|
cp SPRITE_FACING_UP
|
|
ret nz
|
|
ld hl, MapBadgeFlags
|
|
ld a, [wCurMap]
|
|
ld b, a
|
|
.loop
|
|
ld a, [hli]
|
|
cp $ff
|
|
ret z
|
|
cp b
|
|
jr z, .match
|
|
inc hl
|
|
jr .loop
|
|
.match
|
|
ld b, [hl]
|
|
ld a, [wBeatGymFlags]
|
|
and b
|
|
cp b
|
|
tx_pre_id GymStatueText2
|
|
jr z, .haveBadge
|
|
tx_pre_id GymStatueText1
|
|
.haveBadge
|
|
jp PrintPredefTextID
|
|
|
|
INCLUDE "data/maps/badge_maps.asm"
|
|
|
|
GymStatueText1::
|
|
text_far _GymStatueText1
|
|
text_end
|
|
|
|
GymStatueText2::
|
|
text_far _GymStatueText2
|
|
text_end
|