2017-12-26 15:45:04 -08:00
# Battle Animation Commands
2017-12-12 10:22:19 -08:00
2017-12-26 22:29:15 -08:00
Defined in [macros/scripts/battle_anims.asm ](/macros/scripts/battle_anims.asm ) and [data/moves/animations.asm:BattleAnimations ](/data/moves/animations.asm ).
2017-12-14 16:04:44 -08:00
2017-12-29 14:47:45 -08:00
## `$00`− `$CF`: `anim_wait` *length*
*length*: duration in frames
2017-12-12 10:22:19 -08:00
2017-12-25 11:40:30 -08:00
2017-12-29 10:38:04 -08:00
## `$D0`: `anim_obj` *object*, *x*, *y*, *param*
*Alternate*: `anim_obj` *object* , *x_tile* , *x* , *y_tile* , *y* , *param*
2017-12-25 11:40:30 -08:00
2017-12-29 10:38:04 -08:00
Spawns an *object* at coordinate (*x*, *y* ).
2017-12-25 11:40:30 -08:00
2017-12-29 10:38:04 -08:00
*object*: `ANIM_OBJ` constants (see [constants/battle_anim_constants.asm ](/constants/battle_anim_constants.asm ))
*x*: the x position in pixels
*y*: the x position in pixels
*x_tile*: an added x position in tiles (8 pixels)
*y_tile*: an added y position in tiles (8 pixels)
*param*: modifies the behavior of *object* . The meaning differs for each object.
2017-12-25 11:40:30 -08:00
2017-12-29 10:38:04 -08:00
*TODO: what happens for x/y values greater than 160/144 respectively?*
*TODO: useful positions*
*TODO: document each object*
2017-12-25 11:40:30 -08:00
2017-12-12 10:22:19 -08:00
## `$D1`: `anim_1gfx` *gfx*
## `$D2`: `anim_2gfx` *gfx1*, *gfx2*
## `$D3`: `anim_3gfx` *gfx1*, *gfx2*, *gfx3*
## `$D4`: `anim_4gfx` *gfx1*, *gfx2*, *gfx3*, *gfx4*
## `$D5`: `anim_5gfx` *gfx1*, *gfx2*, *gfx3*, *gfx4*, *gfx5*
2017-12-29 14:47:45 -08:00
*gfx*: `ANIM_GFX` constants (see [constants/battle_anim_constants.asm ](/constants/battle_anim_constants.asm ))
2017-12-12 10:22:19 -08:00
## `$D6`: `anim_incobj` *id*
## `$D7`: `anim_setobj` *id*, *object*
## `$D8`: `anim_incbgeffect` *effect*
2017-12-29 14:47:45 -08:00
2017-12-12 10:22:19 -08:00
## `$D9`: `anim_enemyfeetobj`
2017-12-29 14:47:45 -08:00
Temporarily creates sprites from the bottom row of the enemy frontpic, so that the player backpic can be moved around without corrupting the enemy frontpic.
2017-12-12 10:22:19 -08:00
## `$DA`: `anim_playerheadobj`
2017-12-29 14:47:45 -08:00
Temporarily creates sprites from the top row of the player backpic, so that the enemy frontpic can be moved around without corrupting the player backpic.
2017-12-12 10:22:19 -08:00
## `$DB`: `anim_checkpokeball`
2017-12-29 14:47:45 -08:00
Sets `var` to the result of [GetPokeBallWobble ](/engine/battle_anims/getpokeballwobble.asm ).
2017-12-12 10:22:19 -08:00
## `$DC`: `anim_transform`
## `$DD`: `anim_raisesub`
## `$DE`: `anim_dropsub`
## `$DF`: `anim_resetobp0`
2017-12-29 14:47:45 -08:00
## `$E0`: `anim_sound` *duration*, *tracks*, *sound_id*
Plays a sound.
2017-12-12 10:22:19 -08:00
## `$E1`: `anim_cry` *pitch*
2017-12-29 14:47:45 -08:00
Plays the user's cry.
2017-12-12 10:22:19 -08:00
## `$E2`: `anim_minimizeopp`
## `$E3`: `anim_oamon`
## `$E4`: `anim_oamoff`
2017-12-29 14:47:45 -08:00
2017-12-12 10:22:19 -08:00
## `$E5`: `anim_clearobjs`
2017-12-29 14:47:45 -08:00
Removes all active objects.
2017-12-12 10:22:19 -08:00
## `$E6`: `anim_beatup`
## `$E7`: `anim_0xe7`
## `$E8`: `anim_updateactorpic`
## `$E9`: `anim_minimize`
## `$EA`: `anim_0xea`
## `$EB`: `anim_0xeb`
## `$EC`: `anim_0xec`
## `$ED`: `anim_0xed`
## `$EE`: `anim_if_param_and` *value*, *address*
## `$EF`: `anim_jumpuntil` *address*
2017-12-29 14:47:45 -08:00
## `$F0`: `anim_bgeffect` *bg_effect*, *unknown1*, *unknown2*, *unknown3*
*bg_effect*: `ANIM_BG` constants (see [constants/battle_anim_constants.asm ](/constants/battle_anim_constants.asm ))
2017-12-12 10:22:19 -08:00
## `$F1`: `anim_bgp` *colors*
2017-12-29 14:47:45 -08:00
Sets `rBGP` to *colors* .
2017-12-12 10:22:19 -08:00
## `$F2`: `anim_obp0` *colors*
2017-12-29 14:47:45 -08:00
Sets `rOBP0` to *colors* .
2017-12-12 10:22:19 -08:00
## `$F3`: `anim_obp1` *colors*
2017-12-29 14:47:45 -08:00
Sets `rOBP1` to *colors* .
2017-12-12 10:22:19 -08:00
## `$F4`: `anim_clearsprites`
## `$F5`: `anim_0xf5`
## `$F6`: `anim_0xf6`
## `$F7`: `anim_0xf7`
## `$F8`: `anim_if_param_equal` *value*, *address*
2017-12-29 14:47:45 -08:00
Jumps to another script if `wKickCounter` is equal to *value* .
2017-12-12 10:22:19 -08:00
## `$F9`: `anim_setvar` *value*
2017-12-29 14:47:45 -08:00
Sets `var` to *value* .
2017-12-12 10:22:19 -08:00
## `$FA`: `anim_incvar`
2017-12-29 14:47:45 -08:00
Increments `var` by 1.
2017-12-12 10:22:19 -08:00
## `$FB`: `anim_if_var_equal` *value*, *address*
2017-12-29 14:47:45 -08:00
Jumps to another script if `var` is equal to *value* .
2017-12-12 10:22:19 -08:00
## `$FC`: `anim_jump` *address*
2017-12-29 14:47:45 -08:00
Jumps to another script.
2017-12-12 10:22:19 -08:00
## `$FD`: `anim_loop` *count*, *address*
2017-12-29 14:47:45 -08:00
Jumps to another script up to *count* times. Then does nothing, allowing execution to continue.
2017-12-12 10:22:19 -08:00
## `$FE`: `anim_call` *address*
2017-12-29 14:47:45 -08:00
Calls a script.
2017-12-12 10:22:19 -08:00
## `$FF`: `anim_ret`
2017-12-29 14:47:45 -08:00
Ends the script and returns to the place where it was called. If there was no caller, the animation ends.