mirror of
https://github.com/pret/pokeemerald.git
synced 2026-03-21 09:45:09 -05:00
Added macro for Surf/Muddy Water's animation (#2232)
Some checks failed
CI / build (push) Has been cancelled
Some checks failed
CI / build (push) Has been cancelled
This commit is contained in:
parent
63390a940e
commit
064ca5c243
|
|
@ -579,3 +579,7 @@
|
|||
.macro shake_battle_platforms priority=2, x_offset:req, y_offset:req, shakes:req, delay:req
|
||||
createvisualtask AnimTask_ShakeBattlePlatforms, \priority, \x_offset, \y_offset, \shakes, \delay
|
||||
.endm
|
||||
|
||||
.macro create_surf_wave priority=2, palette:req
|
||||
createvisualtask AnimTask_CreateSurfWave, \priority, \palette
|
||||
.endm
|
||||
|
|
|
|||
|
|
@ -6296,7 +6296,7 @@ Move_CRABHAMMER:
|
|||
end
|
||||
|
||||
Move_SURF:
|
||||
createvisualtask AnimTask_CreateSurfWave, 2, FALSE
|
||||
create_surf_wave palette=ANIM_SURF_PAL_SURF
|
||||
delay 24
|
||||
panse SE_M_SURF, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
|
||||
waitforvisualfinish
|
||||
|
|
@ -8594,7 +8594,7 @@ ArmThrustLeft:
|
|||
|
||||
Move_MUDDY_WATER:
|
||||
panse SE_M_WHIRLPOOL, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
|
||||
createvisualtask AnimTask_CreateSurfWave, 2, TRUE
|
||||
create_surf_wave palette=ANIM_SURF_PAL_MUDDY_WATER
|
||||
waitforvisualfinish
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -420,6 +420,10 @@
|
|||
#define ANIM_WEATHER_SANDSTORM 3
|
||||
#define ANIM_WEATHER_HAIL 4
|
||||
|
||||
// Surf wave palettes
|
||||
#define ANIM_SURF_PAL_SURF 0
|
||||
#define ANIM_SURF_PAL_MUDDY_WATER 1
|
||||
|
||||
// Flags given to various functions to indicate which palettes to consider.
|
||||
// Handled by UnpackSelectedBattlePalettes
|
||||
#define F_PAL_BG (1 << 0)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "global.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_anim_internal.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "graphics.h"
|
||||
#include "palette.h"
|
||||
|
|
@ -514,7 +515,7 @@ static void AnimRainDrop_Step(struct Sprite *sprite)
|
|||
if (++sprite->data[0] <= 13)
|
||||
{
|
||||
//
|
||||
// Make the raindrop fall, but only until it reaches the
|
||||
// Make the raindrop fall, but only until it reaches the
|
||||
// impact/splash frames of its animation.
|
||||
//
|
||||
sprite->x2++;
|
||||
|
|
@ -812,6 +813,8 @@ static void AnimSmallBubblePair_Step(struct Sprite *sprite)
|
|||
|
||||
void AnimTask_CreateSurfWave(u8 taskId)
|
||||
{
|
||||
CMD_ARGS(palette);
|
||||
|
||||
struct BattleAnimBgData animBg;
|
||||
u8 taskId2;
|
||||
u16 *x;
|
||||
|
|
@ -838,7 +841,7 @@ void AnimTask_CreateSurfWave(u8 taskId)
|
|||
AnimLoadCompressedBgTilemapHandleContest(&animBg, gBattleAnimBgTilemap_SurfContest, TRUE);
|
||||
}
|
||||
AnimLoadCompressedBgGfx(animBg.bgId, gBattleAnimBgImage_Surf, animBg.tilesOffset);
|
||||
if (gBattleAnimArgs[0] == 0)
|
||||
if (cmd->palette == ANIM_SURF_PAL_SURF)
|
||||
LoadCompressedPalette(gBattleAnimBgPalette_Surf, BG_PLTT_ID(animBg.paletteId), PLTT_SIZE_4BPP);
|
||||
else
|
||||
LoadCompressedPalette(gBattleAnimBackgroundImageMuddyWater_Pal, BG_PLTT_ID(animBg.paletteId), PLTT_SIZE_4BPP);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user