Skip to content

Commit

Permalink
dark void, clangorous soulblaze, vortex animation fixes (rh-hideout#5650
Browse files Browse the repository at this point in the history
)
  • Loading branch information
TheTrueSadfish authored and iriv24 committed Nov 26, 2024
1 parent ac7949a commit 4f1ce00
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 11 deletions.
8 changes: 4 additions & 4 deletions data/battle_anim_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -3688,15 +3688,15 @@ gBattleAnimMove_DarkVoid::
loopsewithpan SE_M_CONFUSE_RAY, SOUND_PAN_ATTACKER, 5, 2
delay 48
createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, -768, 21, 0, 112 @Last is duration
createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, ANIM_DEF_PARTNER, -768, 21, 0, 112 @Last is duration
createsprite gSlideMonToOffsetPartnerSpriteTemplate, ANIM_ATTACKER, 2, ANIM_DEF_PARTNER, -768, 21, 0, 112 @Last is duration
delay 64
invisible ANIM_TARGET
invisible ANIM_DEF_PARTNER
createsprite gDarkVoidPurpleStarsTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_TARGET, 0, 32, 60
createsprite gDarkVoidPurpleStarsTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_DEF_PARTNER, 0, 32, 60
waitforvisualfinish
createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0, 16
createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, ANIM_DEF_PARTNER, 0, 16
createsprite gSlideMonToOriginalPosPartnerSpriteTemplate, ANIM_ATTACKER, 2, ANIM_DEF_PARTNER, 0, 16
delay 32
call UnsetPsychicBg
visible ANIM_TARGET
Expand Down Expand Up @@ -33578,7 +33578,7 @@ gBattleAnimMove_ClangorousSoulblaze::
delay 0x2
createvisualtask AnimTask_StartSlidingBg, 0x5, 0x0, 0xFFE0, 0x1, 0xffff
createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0xfd00, 0xa, 0x0, 0x2a
createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, ANIM_DEF_PARTNER, 0xfd00, 0xa, 0x0, 0x2a
createsprite gSlideMonToOffsetPartnerSpriteTemplate, ANIM_ATTACKER, 2, ANIM_DEF_PARTNER, 0xfd00, 0xa, 0x0, 0x2a
delay 0x20
createvisualtask AnimTask_StartSlidingBg, 0x5, 0x0, 0x20, 0x1, 0xffff
delay 0xC
Expand Down Expand Up @@ -33770,7 +33770,7 @@ FINISH_SOULBLAZE:
call ResetFromWhiteScreen
blendoff
createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0x0, 0x10
createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, ANIM_DEF_PARTNER, 0x0, 0x10
createsprite gSlideMonToOriginalPosPartnerSpriteTemplate, ANIM_ATTACKER, 2, ANIM_DEF_PARTNER, 0x0, 0x10
waitforvisualfinish
end
ClangorousSoulblazeEnergySwirl:
Expand Down
1 change: 0 additions & 1 deletion src/battle_anim_flying.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ static void AnimEllipticalGustCentered(struct Sprite *sprite)
InitSpritePosToAnimTargetsCentre(sprite, FALSE);
else
InitSpritePosToAnimTarget(sprite, FALSE);

sprite->y += 20;
sprite->data[1] = 191;
sprite->callback = AnimEllipticalGust_Step;
Expand Down
103 changes: 100 additions & 3 deletions src/battle_anim_mon_movement.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ static void ReverseHorizontalLungeDirection(struct Sprite *sprite);
static void DoVerticalDip(struct Sprite *sprite);
static void ReverseVerticalDipDirection(struct Sprite *sprite);
static void SlideMonToOriginalPos(struct Sprite *sprite);
static void SlideMonToOriginalPosPartner(struct Sprite *sprite);
static void SlideMonToOriginalPos_Step(struct Sprite *sprite);
static void SlideMonToOffset(struct Sprite *sprite);
static void SlideMonToOffsetPartner(struct Sprite *sprite);
static void SlideMonToOffsetAndBack(struct Sprite *sprite);
static void SlideMonToOffsetAndBack_End(struct Sprite *sprite);
static void AnimTask_WindUpLunge_Step1(u8 taskId);
Expand Down Expand Up @@ -63,6 +65,17 @@ const struct SpriteTemplate gSlideMonToOriginalPosSpriteTemplate =
.callback = SlideMonToOriginalPos,
};

const struct SpriteTemplate gSlideMonToOriginalPosPartnerSpriteTemplate =
{
.tileTag = 0,
.paletteTag = 0,
.oam = &gDummyOamData,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SlideMonToOriginalPosPartner,
};

const struct SpriteTemplate gSlideMonToOffsetSpriteTemplate =
{
.tileTag = 0,
Expand All @@ -74,6 +87,17 @@ const struct SpriteTemplate gSlideMonToOffsetSpriteTemplate =
.callback = SlideMonToOffset,
};

const struct SpriteTemplate gSlideMonToOffsetPartnerSpriteTemplate =
{
.tileTag = 0,
.paletteTag = 0,
.oam = &gDummyOamData,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SlideMonToOffsetPartner,
};

const struct SpriteTemplate gSlideMonToOffsetAndBackSpriteTemplate =
{
.tileTag = 0,
Expand Down Expand Up @@ -487,7 +511,41 @@ static void ReverseVerticalDipDirection(struct Sprite *sprite)
// arg 2: duration
static void SlideMonToOriginalPos(struct Sprite *sprite)
{
u32 monSpriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]);
u32 monSpriteId;
if (!gBattleAnimArgs[0])
monSpriteId = gBattlerSpriteIds[gBattleAnimAttacker];
else
monSpriteId = gBattlerSpriteIds[gBattleAnimTarget];

sprite->data[0] = gBattleAnimArgs[2];
sprite->data[1] = gSprites[monSpriteId].x + gSprites[monSpriteId].x2;
sprite->data[2] = gSprites[monSpriteId].x;
sprite->data[3] = gSprites[monSpriteId].y + gSprites[monSpriteId].y2;
sprite->data[4] = gSprites[monSpriteId].y;
InitSpriteDataForLinearTranslation(sprite);
sprite->data[3] = 0;
sprite->data[4] = 0;
sprite->data[5] = gSprites[monSpriteId].x2;
sprite->data[6] = gSprites[monSpriteId].y2;
sprite->invisible = TRUE;

if (gBattleAnimArgs[1] == 1)
sprite->data[2] = 0;
else if (gBattleAnimArgs[1] == 2)
sprite->data[1] = 0;

sprite->data[7] = gBattleAnimArgs[1];
sprite->data[7] |= monSpriteId << 8;
sprite->callback = SlideMonToOriginalPos_Step;
}

static void SlideMonToOriginalPosPartner(struct Sprite *sprite)
{
u32 monSpriteId;
if (!gBattleAnimArgs[0])
monSpriteId = gBattlerSpriteIds[BATTLE_PARTNER(gBattleAnimAttacker)];
else
monSpriteId = gBattlerSpriteIds[BATTLE_PARTNER(gBattleAnimTarget)];

sprite->data[0] = gBattleAnimArgs[2];
sprite->data[1] = gSprites[monSpriteId].x + gSprites[monSpriteId].x2;
Expand Down Expand Up @@ -550,9 +608,48 @@ static void SlideMonToOriginalPos_Step(struct Sprite *sprite)
// arg 4: duration
static void SlideMonToOffset(struct Sprite *sprite)
{
u8 monSpriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]);
u8 battler;
u8 monSpriteId;
if (!gBattleAnimArgs[0])
battler = gBattleAnimAttacker;
else
battler = gBattleAnimTarget;

monSpriteId = gBattlerSpriteIds[battler];
if (GetBattlerSide(battler) != B_SIDE_PLAYER)
{
gBattleAnimArgs[1] = -gBattleAnimArgs[1];
if (gBattleAnimArgs[3] == 1)
{
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
}
}

sprite->data[0] = gBattleAnimArgs[4];
sprite->data[1] = gSprites[monSpriteId].x;
sprite->data[2] = gSprites[monSpriteId].x + gBattleAnimArgs[1];
sprite->data[3] = gSprites[monSpriteId].y;
sprite->data[4] = gSprites[monSpriteId].y + gBattleAnimArgs[2];
InitSpriteDataForLinearTranslation(sprite);
sprite->data[3] = 0;
sprite->data[4] = 0;
sprite->data[5] = monSpriteId;
sprite->invisible = TRUE;
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
sprite->callback = TranslateSpriteLinearByIdFixedPoint;
}

static void SlideMonToOffsetPartner(struct Sprite *sprite)
{
u8 battler;
u8 monSpriteId;
if (!gBattleAnimArgs[0])
battler = BATTLE_PARTNER(gBattleAnimAttacker);
else
battler = BATTLE_PARTNER(gBattleAnimTarget);

if (GetBattlerSide(gBattleAnimArgs[0]) != B_SIDE_PLAYER)
monSpriteId = gBattlerSpriteIds[battler];
if (GetBattlerSide(battler) != B_SIDE_PLAYER)
{
gBattleAnimArgs[1] = -gBattleAnimArgs[1];
if (gBattleAnimArgs[3] == 1)
Expand Down
7 changes: 4 additions & 3 deletions src/battle_anim_rock.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,14 +478,15 @@ void AnimRockFragment(struct Sprite *sprite)
// Swirls particle in vortex. Used for moves like Fire Spin or Sand Tomb
void AnimParticleInVortex(struct Sprite *sprite)
{
if (IsDoubleBattle() //got a little lazy here will fix later
&& (gAnimMoveIndex == MOVE_BLEAKWIND_STORM
if (IsDoubleBattle()
&& (gAnimMoveIndex == MOVE_BLEAKWIND_STORM
|| gAnimMoveIndex == MOVE_SANDSEAR_STORM
|| gAnimMoveIndex == MOVE_SPRINGTIDE_STORM
|| gAnimMoveIndex == MOVE_WILDBOLT_STORM))
InitSpritePosToAnimTargetsCentre(sprite, FALSE);
else
InitSpritePosToAnimTarget(sprite, FALSE);
InitSpritePosToAnimBattler(gBattleAnimArgs[6], sprite, FALSE);

sprite->data[0] = gBattleAnimArgs[3];
sprite->data[1] = gBattleAnimArgs[2];
sprite->data[2] = gBattleAnimArgs[4];
Expand Down

0 comments on commit 4f1ce00

Please sign in to comment.