add potlergeist animation

This commit is contained in:
hamish 2022-05-23 08:53:08 -04:00
parent 6be8151981
commit 307d5d93c4
8 changed files with 110 additions and 2 deletions

View File

@ -14193,7 +14193,42 @@ Move_LASH_OUT::
end @to do:
Move_POLTERGEIST::
end @to do:
loadspritegfx ANIM_TAG_EYE_SPARKLE
loadspritegfx ANIM_TAG_WHITE_SHADOW @Destiny Bond
loadspritegfx ANIM_TAG_QUICK_GUARD_HAND @Black Colour
loadspritegfx ANIM_TAG_IMPACT
loadspritegfx ANIM_TAG_POLTERGEIST
fadetobg BG_NIGHTMARE
waitbgfadein
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 0, 0, 16, RGB_BLACK
waitforvisualfinish
createsprite gEyeSparkleSpriteTemplate, ANIM_ATTACKER, 0, -16, -8
createsprite gEyeSparkleSpriteTemplate, ANIM_ATTACKER, 0, 16, -8
playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER
waitforvisualfinish
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 0, 16, 0, RGB_BLACK
playsewithpan SE_M_FAINT_ATTACK, SOUND_PAN_ATTACKER
delay 0x1
launchtask AnimTask_DestinyBondWhiteShadow 0x5 0x2 0x0 0x24
delay 0x30
playsewithpan SE_M_SAND_ATTACK, SOUND_PAN_TARGET
createvisualtask AnimTask_PoltergeistItem, 2
waitforvisualfinish
setalpha 12, 8
launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1
launchtask AnimTask_ShakeMon 0x5 0x5 0x1 0x0 0x5 0x5 0x1
launchtemplate gComplexPaletteBlendSpriteTemplate 0x2 0x7 0x7 0x5 0x1 0x0 0xa 0x0 0x0
playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET
waitforvisualfinish
launchtask AnimTask_NightmareClone 0x2 0x0
launchtask AnimTask_ShakeMon 0x2 0x5 0x1 0x3 0x0 0x28 0x1
playsewithpan SE_M_NIGHTMARE, SOUND_PAN_TARGET
waitforvisualfinish
restorebg
waitbgfadein
clearmonbg 0x3
blendoff
end
Move_CORROSIVE_GAS::
end @to do:

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
246 246 246
246 246 246
213 197 230
213 197 230
180 148 213
180 148 213
180 148 213
148 98 197
115 65 164
82 32 131
82 32 131
82 32 131
0 0 0
0 0 0
0 0 0

View File

@ -395,6 +395,7 @@
#define ANIM_TAG_OMEGA_SYMBOL (ANIM_SPRITES_START + 383)
#define ANIM_TAG_PRIMAL_PARTICLES (ANIM_SPRITES_START + 384)
#define ANIM_TAG_STEEL_BEAM (ANIM_SPRITES_START + 385)
#define ANIM_TAG_POLTERGEIST (ANIM_SPRITES_START + 386)
// battlers
#define ANIM_ATTACKER 0

View File

@ -4906,6 +4906,7 @@ extern const u32 gBattleAnimSpriteGfx_StonePillar[];
extern const u32 gBattleAnimSpritePal_StonePillar[];
extern const u32 gBattleAnimSpriteGfx_StraightBeam[];
extern const u32 gBattleAnimSpritePal_StraightBeam[];
extern const u32 gBattleAnimSpritePal_Poltergeist[];
extern const u32 gBattleAnimSpriteGfx_SubstituteBack[];
extern const u32 gBattleAnimSpriteGfx_SubstituteFront[];
extern const u32 gBattleAnimSpritePal_SubstituteFront[];

View File

@ -2,6 +2,7 @@
#include "battle.h"
#include "battle_anim.h"
#include "gpu_regs.h"
#include "item_icon.h"
#include "palette.h"
#include "constants/rgb.h"
#include "scanline_effect.h"
@ -39,6 +40,7 @@ static void AnimGhostStatusSprite_Step(struct Sprite *);
static void AnimGrudgeFlame(struct Sprite *);
static void AnimMonMoveCircular(struct Sprite *);
static void AnimMonMoveCircular_Step(struct Sprite *);
static void AnimPoltergeistItem(struct Sprite *);
static const union AffineAnimCmd sAffineAnim_ConfuseRayBallBounce[] =
{
@ -270,6 +272,17 @@ const struct SpriteTemplate gFlashCannonBallMovementTemplate =
.callback = AnimShadowBall
};
const struct SpriteTemplate gPoltergeistEffectTemplate =
{
.tileTag = ANIM_TAG_POLTERGEIST,
.paletteTag = ANIM_TAG_POLTERGEIST,
.oam = &gOamData_AffineNormal_ObjNormal_32x32,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gAffineAnims_ShadowBall,
.callback = AnimPoltergeistItem,
};
static void AnimConfuseRayBallBounce(struct Sprite *sprite)
{
InitSpritePosToAnimAttacker(sprite, TRUE);
@ -870,7 +883,8 @@ void AnimTask_DestinyBondWhiteShadow(u8 taskId)
&& battler != (gBattleAnimAttacker ^ 2)
&& IsBattlerSpriteVisible(battler))
{
if (gAnimMoveIndex == MOVE_DARK_VOID)
if (gAnimMoveIndex == MOVE_DARK_VOID
|| gAnimMoveIndex == MOVE_POLTERGEIST)
spriteId = CreateSprite(&gDarkVoidBlackHoleTemplate, baseX, baseY, 55); //dark void
else
spriteId = CreateSprite(&gDestinyBondWhiteShadowSpriteTemplate, baseX, baseY, 55); //destiny bond
@ -1395,3 +1409,36 @@ static void AnimMonMoveCircular_Step(struct Sprite *sprite)
sprite->callback = DestroySpriteAndMatrix;
}
}
void AnimTask_PoltergeistItem(u8 taskId)
{
struct Task *task = &gTasks[taskId];
u8 x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X);
u8 y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + (GetBattlerSpriteCoordAttr(gBattleAnimTarget, BATTLER_COORD_ATTR_HEIGHT) / 2);
task->data[0] = AddItemIconSprite(ANIM_TAG_ITEM_BAG, ANIM_TAG_ITEM_BAG, gLastUsedItem);
gSprites[task->data[0]].x = x + 4;
gSprites[task->data[0]].y = y + 4;
gSprites[task->data[0]].data[0] = x + 4;
gSprites[task->data[0]].data[1] = y + 4;
gSprites[task->data[0]].callback = AnimPoltergeistItem;
task->data[1] = CreateSprite(&gPoltergeistEffectTemplate, x, y, 1);
gSprites[task->data[1]].data[0] = x;
gSprites[task->data[1]].data[1] = y;
gAnimVisualTaskCount += 2;
DestroyAnimVisualTask(taskId);
}
static void AnimPoltergeistItem(struct Sprite *sprite)
{
sprite->data[2] += 4;
sprite->x = sprite->data[0] + Sin(sprite->data[2], 24);
sprite->y = sprite->data[1] + (Cos(sprite->data[2], 24) - 24);
if (sprite->data[2] == 256)
DestroyAnimSprite(sprite);
}

View File

@ -9448,6 +9448,7 @@ static void Cmd_various(void)
else
{
PREPARE_ITEM_BUFFER(gBattleTextBuff1, gBattleMons[gActiveBattler].item);
gLastUsedItem = gBattleMons[gActiveBattler].item;
gBattlescriptCurrInstr += 7;
}
return;

View File

@ -1451,6 +1451,7 @@ const struct CompressedSpriteSheet gBattleAnimPicTable[] =
{gBattleAnimSpriteGfx_OmegaSymbol, 0x0200, ANIM_TAG_OMEGA_SYMBOL},
{gBattleAnimSpriteGfx_PrimalParticles, 0x0180, ANIM_TAG_PRIMAL_PARTICLES},
{gBattleAnimSpriteGfx_Orbs, 0x0180, ANIM_TAG_STEEL_BEAM},
{gBattleAnimSpriteGfx_AuraSphere, 0x200, ANIM_TAG_POLTERGEIST},
};
const struct CompressedSpritePalette gBattleAnimPaletteTable[] =
@ -1902,6 +1903,7 @@ const struct CompressedSpritePalette gBattleAnimPaletteTable[] =
{gBattleAnimSpritePal_OmegaSymbol, ANIM_TAG_OMEGA_SYMBOL},
{gBattleAnimSpritePal_PrimalParticles, ANIM_TAG_PRIMAL_PARTICLES},
{gBattleAnimSpritePal_SteelBeam, ANIM_TAG_STEEL_BEAM},
{gBattleAnimSpritePal_Poltergeist, ANIM_TAG_POLTERGEIST},
};
const struct BattleAnimBackground gBattleAnimBackgroundTable[] =

View File

@ -269,6 +269,8 @@ const u32 gBattleAnimSpritePal_Steamroller[] = INCBIN_U32("graphics/battle_anims
const u32 gBattleAnimSpriteGfx_StonePillar[] = INCBIN_U32("graphics/battle_anims/sprites/new/stone_pillar.4bpp.lz");
const u32 gBattleAnimSpritePal_StonePillar[] = INCBIN_U32("graphics/battle_anims/sprites/new/stone_pillar.gbapal.lz");
const u32 gBattleAnimSpritePal_Poltergeist[] = INCBIN_U32("graphics/battle_anims/sprites/new/poltergeist.gbapal.lz");
const u32 gBattleAnimSpriteGfx_StraightBeam[] = INCBIN_U32("graphics/battle_anims/sprites/new/straight_beam.4bpp.lz");
const u32 gBattleAnimSpritePal_StraightBeam[] = INCBIN_U32("graphics/battle_anims/sprites/new/straight_beam.gbapal.lz");