mirror of
https://github.com/pret/pokered.git
synced 2024-10-22 22:55:31 +00:00
Use MEGA_PUNCH constant in explosion animation routine (#434)
* Use MEGA_PUNCH constant in explosion animation routine * Add AnimationType constants and assert --------- Co-authored-by: vulcandth <vulcandth@gmail.com>
This commit is contained in:
parent
66b6c51971
commit
9827190aea
4 changed files with 19 additions and 8 deletions
8
constants/battle_anim_constants.asm
Normal file
8
constants/battle_anim_constants.asm
Normal file
|
@ -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
|
|
@ -3154,9 +3154,9 @@ handleIfPlayerMoveMissed:
|
||||||
getPlayerAnimationType:
|
getPlayerAnimationType:
|
||||||
ld a, [wPlayerMoveEffect]
|
ld a, [wPlayerMoveEffect]
|
||||||
and a
|
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
|
jr z, playPlayerMoveAnimation
|
||||||
ld a, 5 ; move has effect
|
ld a, ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_LIGHT ; move has effect
|
||||||
playPlayerMoveAnimation:
|
playPlayerMoveAnimation:
|
||||||
push af
|
push af
|
||||||
ld a, [wPlayerBattleStatus2]
|
ld a, [wPlayerBattleStatus2]
|
||||||
|
@ -5681,9 +5681,9 @@ handleIfEnemyMoveMissed:
|
||||||
GetEnemyAnimationType:
|
GetEnemyAnimationType:
|
||||||
ld a, [wEnemyMoveEffect]
|
ld a, [wEnemyMoveEffect]
|
||||||
and a
|
and a
|
||||||
ld a, $1
|
ld a, ANIMATIONTYPE_SHAKE_SCREEN_VERTICALLY
|
||||||
jr z, playEnemyMoveAnimation
|
jr z, playEnemyMoveAnimation
|
||||||
ld a, $2
|
ld a, ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_HEAVY
|
||||||
jr playEnemyMoveAnimation
|
jr playEnemyMoveAnimation
|
||||||
handleExplosionMiss:
|
handleExplosionMiss:
|
||||||
call SwapPlayerAndEnemyLevels
|
call SwapPlayerAndEnemyLevels
|
||||||
|
@ -6752,9 +6752,11 @@ HandleExplodingAnimation:
|
||||||
ld a, [wMoveMissed]
|
ld a, [wMoveMissed]
|
||||||
and a
|
and a
|
||||||
ret nz
|
ret nz
|
||||||
ld a, 5
|
ld a, ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_LIGHT
|
||||||
ld [wAnimationType], a
|
ld [wAnimationType], a
|
||||||
|
assert ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_LIGHT == MEGA_PUNCH
|
||||||
|
; ld a, MEGA_PUNCH
|
||||||
|
; fallthrough
|
||||||
PlayMoveAnimation:
|
PlayMoveAnimation:
|
||||||
ld [wAnimationID], a
|
ld [wAnimationID], a
|
||||||
vc_hook_red Reduce_move_anim_flashing_Confusion
|
vc_hook_red Reduce_move_anim_flashing_Confusion
|
||||||
|
|
|
@ -1460,9 +1460,9 @@ PlayBattleAnimation2:
|
||||||
ld [wAnimationID], a
|
ld [wAnimationID], a
|
||||||
ldh a, [hWhoseTurn]
|
ldh a, [hWhoseTurn]
|
||||||
and a
|
and a
|
||||||
ld a, $6
|
ld a, ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_SLOW_2
|
||||||
jr z, .storeAnimationType
|
jr z, .storeAnimationType
|
||||||
ld a, $3
|
ld a, ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_SLOW
|
||||||
.storeAnimationType
|
.storeAnimationType
|
||||||
ld [wAnimationType], a
|
ld [wAnimationType], a
|
||||||
jp PlayBattleAnimationGotID
|
jp PlayBattleAnimationGotID
|
||||||
|
|
|
@ -23,6 +23,7 @@ INCLUDE "constants/serial_constants.asm"
|
||||||
INCLUDE "constants/script_constants.asm"
|
INCLUDE "constants/script_constants.asm"
|
||||||
INCLUDE "constants/type_constants.asm"
|
INCLUDE "constants/type_constants.asm"
|
||||||
INCLUDE "constants/battle_constants.asm"
|
INCLUDE "constants/battle_constants.asm"
|
||||||
|
INCLUDE "constants/battle_anim_constants.asm"
|
||||||
INCLUDE "constants/move_constants.asm"
|
INCLUDE "constants/move_constants.asm"
|
||||||
INCLUDE "constants/move_animation_constants.asm"
|
INCLUDE "constants/move_animation_constants.asm"
|
||||||
INCLUDE "constants/move_effect_constants.asm"
|
INCLUDE "constants/move_effect_constants.asm"
|
||||||
|
|
Loading…
Reference in a new issue