Defined in macros/scripts/battle_anims.asm and engine/battle_anims/anim_commands.asm:BattleAnimCommands.
- length: duration in frames
Alternate: anim_obj object, x_tile, x, y_tile, y, param
Spawns an object at coordinate (x, y).
- object:
ANIM_OBJ
constants (see constants/battle_anim_constants.asm) - x: the x position in pixels
- y: the y 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.
The y position also depends on the y offset defined by the object.
- TODO: what happens for x/y values greater than 160/144 respectively? Is it 1:1 with screen coordinates?
- TODO: how are the x/y values mirrored when the opponent is attacking?
- TODO: useful positions
- TODO: document each object
Loads 1-5 sets of graphics. Will overwrite any previously loaded sets.
- gfx:
ANIM_GFX
constants (see constants/battle_anim_constants.asm)
Increments an object's state.
- object_id: the nth object in order of creation
Objects are state machines. anim_incobj
progresses the state of an object.
Sets an object's state to a specific value.
- object_id: the nth object in order of creation
- state: the state index
Objects are state machines. anim_setobj
changes the state of an object.
Increments a bg effect's state.
- bg_effect:
ANIM_BG
constants (see constants/battle_anim_constants.asm)
Since there can't be two of the same bg effect, the effect type is used. This is distinct from anim_incobj
.
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.
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.
Sets BattleAnimVar
to the result of GetPokeBallWobble.
Resets rOBP0 to the default (q0123
or %00011011
).
Plays a sound.
Plays the user's cry.
Removes all active objects.
Does nothing. Unused.
Does nothing. Unused.
Does nothing. Unused.
Does nothing. Unused.
Does nothing. Unused.
Jumps to another script and decrements param
until it reaches 0. Similar to anim_loop
.
- bg_effect:
ANIM_BG
constants (see constants/battle_anim_constants.asm)
Sets rBGP
to colors.
Sets rOBP0
to colors.
Sets rOBP1
to colors.
Does nothing. Unused.
Does nothing. Unused.
Does nothing. Unused.
Jumps to another script if wBattleAnimParam
(aka wKickCounter
or wPresentPower
) is equal to value.
Sets BattleAnimVar
to value.
Increments BattleAnimVar
by 1.
Jumps to another script if BattleAnimVar
is equal to value.
Jumps to another script.
Jumps to another script up to count times. Then does nothing, allowing execution to continue.
Calls a script.
There is no call stack. The return address is overwritten, so the maximum call depth is 1.
Ends the script and returns to where it was called from. If there was no caller, the animation ends.