Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use MEGA_PUNCH constant in explosion animation routine #434

Merged
merged 2 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions constants/battle_anim_constants.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
; AnimationTypePointerTable indexes (see engine/battle/animations.asm)
const_def 1
const ANIMATIONTYPE_SHAKE_SCREEN_VERTICALLY ; 1
const ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_HEAVY ; 2
const ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_SLOW ; 3
const ANIMATIONTYPE_BLINK_ENEMY_MON_SPRITE ; 4
const ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_LIGHT ; 5
const ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_SLOW_2 ; 6
14 changes: 8 additions & 6 deletions engine/battle/core.asm
Original file line number Diff line number Diff line change
Expand Up @@ -3154,9 +3154,9 @@ handleIfPlayerMoveMissed:
getPlayerAnimationType:
ld a, [wPlayerMoveEffect]
and a
ld a, 4 ; move has no effect other than dealing damage
ld a, ANIMATIONTYPE_BLINK_ENEMY_MON_SPRITE ; move has no effect other than dealing damage
jr z, playPlayerMoveAnimation
ld a, 5 ; move has effect
ld a, ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_LIGHT ; move has effect
playPlayerMoveAnimation:
push af
ld a, [wPlayerBattleStatus2]
Expand Down Expand Up @@ -5681,9 +5681,9 @@ handleIfEnemyMoveMissed:
GetEnemyAnimationType:
ld a, [wEnemyMoveEffect]
and a
ld a, $1
ld a, ANIMATIONTYPE_SHAKE_SCREEN_VERTICALLY
jr z, playEnemyMoveAnimation
ld a, $2
ld a, ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_HEAVY
jr playEnemyMoveAnimation
handleExplosionMiss:
call SwapPlayerAndEnemyLevels
Expand Down Expand Up @@ -6752,9 +6752,11 @@ HandleExplodingAnimation:
ld a, [wMoveMissed]
and a
ret nz
ld a, 5
ld a, ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_LIGHT
ld [wAnimationType], a

assert ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_LIGHT == MEGA_PUNCH
; ld a, MEGA_PUNCH
; fallthrough
PlayMoveAnimation:
ld [wAnimationID], a
vc_hook_red Reduce_move_anim_flashing_Confusion
Expand Down
4 changes: 2 additions & 2 deletions engine/battle/effects.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1460,9 +1460,9 @@ PlayBattleAnimation2:
ld [wAnimationID], a
ldh a, [hWhoseTurn]
and a
ld a, $6
ld a, ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_SLOW_2
jr z, .storeAnimationType
ld a, $3
ld a, ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_SLOW
.storeAnimationType
ld [wAnimationType], a
jp PlayBattleAnimationGotID
Expand Down
1 change: 1 addition & 0 deletions includes.asm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ INCLUDE "constants/serial_constants.asm"
INCLUDE "constants/script_constants.asm"
INCLUDE "constants/type_constants.asm"
INCLUDE "constants/battle_constants.asm"
INCLUDE "constants/battle_anim_constants.asm"
INCLUDE "constants/move_constants.asm"
INCLUDE "constants/move_animation_constants.asm"
INCLUDE "constants/move_effect_constants.asm"
Expand Down