aboutsummaryrefslogtreecommitdiffstats
path: root/engine/events/hidden_events/gym_statues.asm
diff options
context:
space:
mode:
authorRangi <35663410+Rangi42@users.noreply.github.com>2026-01-07 22:05:37 -0500
committerGitHub <noreply@github.com>2026-01-07 22:05:37 -0500
commit0e49aef88ef94b9d3e80d89e4eb718e9425045df (patch)
treec63433287b9e2aceda14ff977cc06875cd0735d3 /engine/events/hidden_events/gym_statues.asm
parentUse macros to enforce "missable/hide/show object" constraints, and rename the... (diff)
downloadpokeyellow-0e49aef88ef94b9d3e80d89e4eb718e9425045df.tar.gz
pokeyellow-0e49aef88ef94b9d3e80d89e4eb718e9425045df.tar.xz
pokeyellow-0e49aef88ef94b9d3e80d89e4eb718e9425045df.zip
Use macros to enforce "hidden object" constraints, and rename them to "hidden events" (#559)
Diffstat (limited to 'engine/events/hidden_events/gym_statues.asm')
-rw-r--r--engine/events/hidden_events/gym_statues.asm39
1 files changed, 39 insertions, 0 deletions
diff --git a/engine/events/hidden_events/gym_statues.asm b/engine/events/hidden_events/gym_statues.asm
new file mode 100644
index 00000000..1c7eb970
--- /dev/null
+++ b/engine/events/hidden_events/gym_statues.asm
@@ -0,0 +1,39 @@
+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