Fix Power Gem anim

This commit is contained in:
DizzyEggg 2020-01-18 20:28:36 +01:00
parent 5c486c15dd
commit 1d13004a0b
3 changed files with 48 additions and 139 deletions

View File

@ -2124,40 +2124,38 @@ Move_DRAGON_RUSH:
blendoff
end
Move_POWER_GEM:
createsprite gSimplePaletteBlendSpriteTemplate, 2, 5, 1, 1, 0, 7, 0
waitforvisualfinish
Move_POWER_GEM: @ Copy of Hidden Power with background blackened
loadspritegfx ANIM_TAG_POWER_GEM
playsewithpan 152, SOUND_PAN_ATTACKER
createvisualtask AnimTask_ScaleMonAndRestore, 5, -7, -7, 11, 0, 0
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 5, 1, 1, 0, 7, RGB_BLACK
waitforvisualfinish
playsewithpan SE_W036, SOUND_PAN_ATTACKER
createvisualtask AnimTask_ScaleMonAndRestore, 5, -7, -7, 11, ANIM_ATTACKER, 0
waitforvisualfinish
delay 30
createvisualtask AnimTask_BlendMonInAndOut 5, 5, 0, RGB(31, 31, 31), 12, 5, 1
delay 4
createvisualtask AnimTask_ScaleMonAndRestore, 5, -7, -7, 11, 0, 0
createvisualtask AnimTask_BlendMonInAndOut, 5, ANIM_ATTACKER, RGB_WHITE, 12, 5, 1
delay 4
createvisualtask AnimTask_ScaleMonAndRestore, 5, -7, -7, 11, ANIM_ATTACKER, 0
playsewithpan SE_W179, SOUND_PAN_ATTACKER
createsprite gPowerGemOrbSpriteTemplate 2, 2, 26, 0
createsprite gPowerGemOrbSpriteTemplate 2, 2, 26, 42
createsprite gPowerGemOrbSpriteTemplate 2, 2, 26, 84
createsprite gPowerGemOrbSpriteTemplate 2, 2, 26, 126
createsprite gPowerGemOrbSpriteTemplate 2, 2, 26, 168
createsprite gPowerGemOrbSpriteTemplate 2, 2, 26, 210
createsprite gPowerGemOrbSpriteTemplate, ANIM_ATTACKER, 2, 26, 0
createsprite gPowerGemOrbSpriteTemplate, ANIM_ATTACKER, 2, 26, 42
createsprite gPowerGemOrbSpriteTemplate, ANIM_ATTACKER, 2, 26, 84
createsprite gPowerGemOrbSpriteTemplate, ANIM_ATTACKER, 2, 26, 126
createsprite gPowerGemOrbSpriteTemplate, ANIM_ATTACKER, 2, 26, 168
createsprite gPowerGemOrbSpriteTemplate, ANIM_ATTACKER, 2, 26, 210
delay 52
setarg 7, -1
setarg 7, -1
playsewithpan SE_W115, SOUND_PAN_ATTACKER
createvisualtask AnimTask_ScaleMonAndRestore, 5, -7, -7, 11, 0, 0
createsprite gPowerGemScatterSpriteTemplate 130, 1, 0
createsprite gPowerGemScatterSpriteTemplate 130, 1, 32
createsprite gPowerGemScatterSpriteTemplate 130, 1, 64
createsprite gPowerGemScatterSpriteTemplate 130, 1, 96
createsprite gPowerGemScatterSpriteTemplate 130, 1, 128
createsprite gPowerGemScatterSpriteTemplate 130, 1, 160
createsprite gPowerGemScatterSpriteTemplate 130, 1, SOUND_PAN_ATTACKER
createsprite gPowerGemScatterSpriteTemplate 130, 1, 224
waitforvisualfinish
clearmonbg ANIM_DEF_PARTNER
createsprite gSimplePaletteBlendSpriteTemplate 2, 5, 1, 1, 7, 0, 0
blendoff
createvisualtask AnimTask_ScaleMonAndRestore, 5, -7, -7, 11, ANIM_ATTACKER, 0
createsprite gPowerGemOrbScatterSpriteTemplate, ANIM_TARGET, 2, 0
createsprite gPowerGemOrbScatterSpriteTemplate, ANIM_TARGET, 2, 32
createsprite gPowerGemOrbScatterSpriteTemplate, ANIM_TARGET, 2, 64
createsprite gPowerGemOrbScatterSpriteTemplate, ANIM_TARGET, 2, 96
createsprite gPowerGemOrbScatterSpriteTemplate, ANIM_TARGET, 2, 128
createsprite gPowerGemOrbScatterSpriteTemplate, ANIM_TARGET, 2, 160
createsprite gPowerGemOrbScatterSpriteTemplate, ANIM_TARGET, 2, 192
createsprite gPowerGemOrbScatterSpriteTemplate, ANIM_TARGET, 2, 224
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 5, 1, 1, 7, 0, RGB_BLACK
waitforvisualfinish
end
Move_DRAIN_PUNCH:

View File

@ -980,6 +980,28 @@ const struct SpriteTemplate gHiddenPowerOrbScatterSpriteTemplate =
.callback = AnimOrbitScatter,
};
const struct SpriteTemplate gPowerGemOrbSpriteTemplate =
{
.tileTag = ANIM_TAG_POWER_GEM,
.paletteTag = ANIM_TAG_POWER_GEM,
.oam = &gOamData_AffineNormal_ObjNormal_16x16,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gHiddenPowerOrbAffineAnimTable,
.callback = AnimOrbitFast,
};
const struct SpriteTemplate gPowerGemOrbScatterSpriteTemplate =
{
.tileTag = ANIM_TAG_POWER_GEM,
.paletteTag = ANIM_TAG_POWER_GEM,
.oam = &gOamData_AffineDouble_ObjNormal_16x16,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gHiddenPowerOrbAffineAnimTable,
.callback = AnimOrbitScatter,
};
const union AffineAnimCmd gSpitUpOrbAffineAnimCmds[] =
{
AFFINEANIMCMD_FRAME(0x80, 0x80, 0, 0),

View File

@ -312,52 +312,6 @@ const struct SpriteTemplate gUnknown_08596CE0 =
.callback = sub_80A8EE4,
};
const union AffineAnimCmd gPowerGemScatterAffineAnimCmd[] =
{
AFFINEANIMCMD_FRAME(0x80, 0x80, 0, 0),
AFFINEANIMCMD_FRAME(0x8, 0x8, 0, 1),
AFFINEANIMCMD_JUMP(1),
};
const union AffineAnimCmd *const gPowerGemScatterAffineAnims[] =
{
gPowerGemScatterAffineAnimCmd,
};
const union AffineAnimCmd gPowerGemOrbAffineAnimCmd[] =
{
AFFINEANIMCMD_FRAME(0x80, 0x80, 0, 0),
AFFINEANIMCMD_FRAME(0x8, 0x8, 0, 1),
AFFINEANIMCMD_JUMP(1),
};
const union AffineAnimCmd *const gPowerGemOrbAffineAnims[] =
{
gPowerGemOrbAffineAnimCmd,
};
const struct SpriteTemplate gPowerGemScatterSpriteTemplate =
{
.tileTag = ANIM_TAG_POWER_GEM,
.paletteTag = ANIM_TAG_POWER_GEM,
.oam = &gOamData_AffineDouble_ObjNormal_16x16,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gPowerGemScatterAffineAnims,
.callback = AnimPowerGemScatter,
};
const struct SpriteTemplate gPowerGemOrbSpriteTemplate =
{
.tileTag = ANIM_TAG_POWER_GEM,
.paletteTag = ANIM_TAG_POWER_GEM,
.oam = &gOamData_AffineNormal_ObjNormal_16x16,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gPowerGemOrbAffineAnims,
.callback = AnimPowerGemOrbitFast,
};
const struct SpriteTemplate gStoneEdgeSpriteTemplate =
{
.tileTag = ANIM_TAG_STONE_EDGE,
@ -420,71 +374,6 @@ static void AnimStealthRockStep2(struct Sprite *sprite)
DestroyAnimSprite(sprite);
}
void AnimPowerGemScatter(struct Sprite *sprite)
{
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3);
sprite->data[0] = Sin(gBattleAnimArgs[0], 10);
sprite->data[1] = Cos(gBattleAnimArgs[0], 7);
sprite->callback = AnimPowerGemScatterStep;
}
static void AnimPowerGemScatterStep(struct Sprite *sprite)
{
sprite->pos2.x += sprite->data[0];
sprite->pos2.y += sprite->data[1];
if (sprite->pos1.x + sprite->pos2.x + 16 > 272u || sprite->pos1.y + sprite->pos2.y > 160 || sprite->pos1.y + sprite->pos2.y < -16)
DestroyAnimSprite(sprite);
}
void AnimPowerGemOrbitFast(struct Sprite *sprite)
{
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3);
sprite->affineAnimPaused = 1;
sprite->data[0] = gBattleAnimArgs[0];
sprite->data[1] = gBattleAnimArgs[1];
sprite->data[7] = GetBattlerSpriteSubpriority(gBattleAnimAttacker);
sprite->callback = AnimPowerGemOrbitFastStep;
sprite->callback(sprite);
}
static void AnimPowerGemOrbitFastStep(struct Sprite *sprite)
{
if (sprite->data[1] >= 64 && sprite->data[1] <= 191)
sprite->subpriority = sprite->data[7] + 1;
else
sprite->subpriority = sprite->data[7] - 1;
sprite->pos2.x = Sin(sprite->data[1], sprite->data[2] >> 8);
sprite->pos2.y = Cos(sprite->data[1], sprite->data[3] >> 8);
sprite->data[1] = (sprite->data[1] + 9) & 0xFF;
switch (sprite->data[5])
{
case 1:
sprite->data[2] -= 0x400;
sprite->data[3] -= 0x100;
if (++sprite->data[4] == sprite->data[0])
{
sprite->data[5] = 2;
return;
}
break;
case 0:
sprite->data[2] += 0x400;
sprite->data[3] += 0x100;
if (++sprite->data[4] == sprite->data[0])
{
sprite->data[4] = 0;
sprite->data[5] = 1;
}
break;
}
if ((u16)gBattleAnimArgs[7] == 0xFFFF)
DestroyAnimSprite(sprite);
}
void sub_81109F0(struct Sprite *sprite)
{
if (gBattleAnimArgs[3] != 0)