aboutsummaryrefslogtreecommitdiffstats
path: root/engine/overworld/field_move_messages.asm
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2016-12-31 17:23:54 -0800
committerYamaArashi <shadow962@live.com>2016-12-31 17:23:54 -0800
commitbf67f7174d8e3f1348c786618ee5a3a076d1eff8 (patch)
tree41dfcd420ce30d4b077d2055e096ea40e4a229a5 /engine/overworld/field_move_messages.asm
parentuse hardware constants in pic.asm (diff)
downloadpokeyellow-bf67f7174d8e3f1348c786618ee5a3a076d1eff8.tar.gz
pokeyellow-bf67f7174d8e3f1348c786618ee5a3a076d1eff8.tar.xz
pokeyellow-bf67f7174d8e3f1348c786618ee5a3a076d1eff8.zip
split code out of main.asm
Diffstat (limited to 'engine/overworld/field_move_messages.asm')
-rw-r--r--engine/overworld/field_move_messages.asm57
1 files changed, 57 insertions, 0 deletions
diff --git a/engine/overworld/field_move_messages.asm b/engine/overworld/field_move_messages.asm
new file mode 100644
index 00000000..69914bfc
--- /dev/null
+++ b/engine/overworld/field_move_messages.asm
@@ -0,0 +1,57 @@
+PrintStrengthTxt:
+ ld hl, wd728
+ set 0, [hl]
+ ld hl, UsedStrengthText
+ call PrintText
+ ld hl, CanMoveBouldersText
+ jp PrintText
+
+UsedStrengthText:
+ TX_FAR _UsedStrengthText
+ TX_ASM
+ ld a, [wcf91]
+ call PlayCry
+ call Delay3
+ jp TextScriptEnd
+
+CanMoveBouldersText:
+ TX_FAR _CanMoveBouldersText
+ db "@"
+
+IsSurfingAllowed:
+; Returns whether surfing is allowed in bit 1 of wd728.
+; Surfing isn't allowed on the Cycling Road or in the lowest level of the
+; Seafoam Islands before the current has been slowed with boulders.
+ ld hl, wd728
+ set 1, [hl]
+ ld a, [wd732]
+ bit 5, a
+ jr nz, .forcedToRideBike
+ ld a, [wCurMap]
+ cp SEAFOAM_ISLANDS_5
+ ret nz
+ CheckBothEventsSet EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM4_BOULDER2_DOWN_HOLE
+ ret z
+ ld hl, CoordsData_cdf7
+ call ArePlayerCoordsInArray
+ ret nc
+ ld hl, wd728
+ res 1, [hl]
+ ld hl, CurrentTooFastText
+ jp PrintText
+.forcedToRideBike
+ ld hl, wd728
+ res 1, [hl]
+ ld hl, CyclingIsFunText
+ jp PrintText
+
+CoordsData_cdf7:
+ db $0B,$07,$FF
+
+CurrentTooFastText:
+ TX_FAR _CurrentTooFastText
+ db "@"
+
+CyclingIsFunText:
+ TX_FAR _CyclingIsFunText
+ db "@"