aboutsummaryrefslogtreecommitdiffstats
path: root/engine/overworld/try_pushing_boulder.asm
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2020-05-20 19:40:33 -0500
committerdannye <33dannye@gmail.com>2020-05-20 20:02:53 -0500
commit10f9559eab8c93b94abb8ae8d1083704ad4e169a (patch)
tree7dbe7b152dde8a6e9b56664b5b8cdfc0d6be1253 /engine/overworld/try_pushing_boulder.asm
parentMerge pull request #39 from TiKevin83/master (diff)
downloadpokeyellow-10f9559eab8c93b94abb8ae8d1083704ad4e169a.tar.gz
pokeyellow-10f9559eab8c93b94abb8ae8d1083704ad4e169a.tar.xz
pokeyellow-10f9559eab8c93b94abb8ae8d1083704ad4e169a.zip
Sync with pokered
Diffstat (limited to 'engine/overworld/try_pushing_boulder.asm')
-rw-r--r--engine/overworld/try_pushing_boulder.asm107
1 files changed, 0 insertions, 107 deletions
diff --git a/engine/overworld/try_pushing_boulder.asm b/engine/overworld/try_pushing_boulder.asm
deleted file mode 100644
index 8a385345..00000000
--- a/engine/overworld/try_pushing_boulder.asm
+++ /dev/null
@@ -1,107 +0,0 @@
-TryPushingBoulder:
- ld a, [wd728]
- bit 0, a ; using Strength?
- ret z
-Func_f0a7:
-; where LoadMissableObjects predef points to now
- ld a, [wFlags_0xcd60]
- bit 1, a ; has boulder dust animation from previous push played yet?
- ret nz
- xor a
- ld [hSpriteIndexOrTextID], a
- call IsSpriteInFrontOfPlayer
- ld a, [hSpriteIndexOrTextID]
- ld [wBoulderSpriteIndex], a
- and a
- jp z, ResetBoulderPushFlags
- ld hl, wSpriteStateData1 + 1
- ld d, $0
- ld a, [hSpriteIndexOrTextID]
- swap a
- ld e, a
- add hl, de
- res 7, [hl]
- call GetSpriteMovementByte2Pointer
- ld a, [hl]
- cp BOULDER_MOVEMENT_BYTE_2
- jp nz, ResetBoulderPushFlags
- ld hl, wFlags_0xcd60
- bit 6, [hl]
- set 6, [hl] ; indicate that the player has tried pushing
- ret z ; the player must try pushing twice before the boulder will move
- ld a, [hJoyHeld]
- and D_RIGHT | D_LEFT | D_UP | D_DOWN
- ret z
- predef CheckForCollisionWhenPushingBoulder
- ld a, [wTileInFrontOfBoulderAndBoulderCollisionResult]
- and a ; was there a collision?
- jp nz, ResetBoulderPushFlags
- ld a, [hJoyHeld]
- ld b, a
- ld a, [wSpritePlayerStateData1FacingDirection] ; player's sprite facing direction
- cp SPRITE_FACING_UP
- jr z, .pushBoulderUp
- cp SPRITE_FACING_LEFT
- jr z, .pushBoulderLeft
- cp SPRITE_FACING_RIGHT
- jr z, .pushBoulderRight
-.pushBoulderDown
- bit 7, b
- ret z
- ld de, PushBoulderDownMovementData
- jr .done
-.pushBoulderUp
- bit 6, b
- ret z
- ld de, PushBoulderUpMovementData
- jr .done
-.pushBoulderLeft
- bit 5, b
- ret z
- ld de, PushBoulderLeftMovementData
- jr .done
-.pushBoulderRight
- bit 4, b
- ret z
- ld de, PushBoulderRightMovementData
-.done
- call MoveSprite
- ld a, SFX_PUSH_BOULDER
- call PlaySound
- ld hl, wFlags_0xcd60
- set 1, [hl]
- ret
-
-PushBoulderUpMovementData:
- db NPC_MOVEMENT_UP,$FF
-
-PushBoulderDownMovementData:
- db NPC_MOVEMENT_DOWN,$FF
-
-PushBoulderLeftMovementData:
- db NPC_MOVEMENT_LEFT,$FF
-
-PushBoulderRightMovementData:
- db NPC_MOVEMENT_RIGHT,$FF
-
-DoBoulderDustAnimation:
- ld a, [wd730]
- bit 0, a
- ret nz
- callab AnimateBoulderDust
- call DiscardButtonPresses
- ld [wJoyIgnore], a
- call ResetBoulderPushFlags
- set 7, [hl]
- ld a, [wBoulderSpriteIndex]
- ld [H_SPRITEINDEX], a
- call GetSpriteMovementByte2Pointer
- ld [hl], $10
- ld a, SFX_CUT
- jp PlaySound
-
-ResetBoulderPushFlags:
- ld hl, wFlags_0xcd60
- res 1, [hl]
- res 6, [hl]
- ret