Skip to content

Commit

Permalink
draco meteor anim
Browse files Browse the repository at this point in the history
tmp
  • Loading branch information
AlexOn1ine committed Jan 14, 2024
1 parent 1520cb3 commit 20cb81f
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 30 deletions.
97 changes: 80 additions & 17 deletions data/battle_anim_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -3316,28 +3316,91 @@ InitRoomAnimation:
createvisualtask AnimTask_ScaleMonAndRestore, 5, -6, -6, 15, ANIM_TARGET, 1
return

@ Credits to Skeli
Move_DRACO_METEOR:
loadspritegfx ANIM_TAG_WARM_ROCK
loadspritegfx ANIM_TAG_GOLD_STARS
loadspritegfx ANIM_TAG_IMPACT
loadspritegfx ANIM_TAG_ICE_SPIKES
playsewithpan SE_M_CHARGE, SOUND_PAN_TARGET
fadetobg BG_COSMIC
waitbgfadein
loadspritegfx ANIM_TAG_ROCKS @Rocks
loadspritegfx ANIM_TAG_FAIRY_LOCK_CHAINS @Gray Colour
loadspritegfx ANIM_TAG_WATER_GUN @Sparkles Trail
loadspritegfx ANIM_TAG_FIRE_PLUME @Eruption
createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 1, 0, 12, 0x2C41
createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_WATER_GUN, 0, 10, 10, RGB_PURPLE @;Purple
monbg ANIM_TARGET
setalpha 12, 8
waitforvisualfinish
createsprite gDracoMeteorSmashSpriteTemplate, 131, 5, -47, -63, 72, 32, 30
delay 10
createsprite gDracoMeteorSmashSpriteTemplate, 131, 5, -111, -63, 8, 32, 30
delay 40
createsprite gDracoMetorSpriteTemplate, 131, 4, 0, 0, 0, 30
createsprite gDracoMeteorSmashSpriteTemplate, 131, 5, -79, -63, 40, 32, 30
delay 20
playsewithpan SE_FALL, SOUND_PAN_ATTACKER
@setblends 0x80C
call DracoMeteor1
delay 7
call DracoMeteor2
playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET
delay 10
restorebg
waitbgfadein
createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 7, 4, 2
createsprite gDragonRageFirePlumeSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0x28, 0x20 @; For Meteor 1
createvisualtask AnimTask_HorizontalShake, 5, 3, 5, 2, 0x1
delay 7
call DracoMeteor3
playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET
createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 7, 4, 2
createsprite gDragonRageFirePlumeSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0xFFF8, 0x20 @; For Meteor 2
delay 7
call DracoMeteor4
playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET
createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 7, 4, 2
createsprite gDragonRageFirePlumeSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0x15, 0x20 @; For Meteor 3
delay 7
call DracoMeteor1
playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET
createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 7, 4, 2
createsprite gDragonRageFirePlumeSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0xFFF8, 0x20 @; For Meteor 4
createvisualtask AnimTask_HorizontalShake, 5, 3, 5, 2, 0x1
delay 7
call DracoMeteor2
playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET
createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 7, 4, 2
createsprite gDragonRageFirePlumeSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0x28, 0x20 @; For Meteor 1
delay 7
call DracoMeteor3
playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET
createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 7, 4, 2
createsprite gDragonRageFirePlumeSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0x15, 0x20 @; For Meteor 3
delay 15
playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET
createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 7, 4, 2
createsprite gDragonRageFirePlumeSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0x15, 0x20 @; For Meteor 3
createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 2, 1
delay 7
createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 1, 12, 0, 0x2C41
waitforvisualfinish
clearmonbg ANIM_TARGET
blendoff
end
DracoMeteor1:
createsprite gDracoMeteorRocksSpriteTemplate 0x83, 5, 0xffd0, 0xffc0, 0x28, 0x20, 0x19
delay 2
createsprite gDracoMeteorTailSpriteTemplate 0x83, 5, 0xffd0, 0xffc0, 0x28, 0x20, 0x19
delay 2
createsprite gDracoMeteorTailSpriteTemplate 0x83, 5, 0xffd0, 0xffc0, 0x28, 0x20, 0x19
return
DracoMeteor2:
createsprite gDracoMeteorRocksSpriteTemplate 0x83, 5, 0xff90, 0xffc0, 0xFFF8, 0x20, 0x19
delay 2
createsprite gDracoMeteorTailSpriteTemplate 0x83, 5, 0xff90, 0xffc0, 0xFFF8, 0x20, 0x19
delay 2
createsprite gDracoMeteorTailSpriteTemplate 0x83, 5, 0xff90, 0xffc0, 0xFFF8, 0x20, 0x19
return
DracoMeteor3:
createsprite gDracoMeteorRocksSpriteTemplate 0x83, 5, 0xffb0, 0xffc0, 0x18, 0x20, 0x19
delay 2
createsprite gDracoMeteorTailSpriteTemplate 0x83, 5, 0xffb0, 0xffc0, 0x18, 0x20, 0x19
delay 2
createsprite gDracoMeteorTailSpriteTemplate 0x83, 5, 0xffb0, 0xffc0, 0x18, 0x20, 0x19
return
DracoMeteor4:
createsprite gDracoMeteorRocksSpriteTemplate 0x83, 5, 0xffb0, 0xffc0, 0xFFF8, 0x20, 0x19
delay 2
createsprite gDracoMeteorTailSpriteTemplate 0x83, 5, 0xffb0, 0xffc0, 0xFFF8, 0x20, 0x19
delay 2
createsprite gDracoMeteorTailSpriteTemplate 0x83, 5, 0xffb0, 0xffc0, 0xFFF8, 0x20, 0x19
return

Move_DISCHARGE:
loadspritegfx ANIM_TAG_IMPACT
Expand Down
3 changes: 3 additions & 0 deletions include/battle_anim.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ extern const union AffineAnimCmd *const gSwiftStarAffineAnimTable[];
extern const union AnimCmd *const gMetronomeThroughtBubbleAnimTable[];
extern const union AffineAnimCmd *const gStockpileAbsorptionOrbAffineAnimTable[];
extern const union AnimCmd *const gSlashSliceAnimTable[];
extern const union AffineAnimCmd* const sSpriteAffineAnimTable_HydroCannonBall[];
extern const union AffineAnimCmd sSpriteAffineAnim_HydroCannonBall[];

// battle_anim_effects_2.c
void AnimUproarRing(struct Sprite *sprite);
Expand Down Expand Up @@ -544,6 +546,7 @@ void AnimDragonFireToTarget(struct Sprite *sprite);
void AnimDragonDanceOrb(struct Sprite *sprite);
void AnimOverheatFlame(struct Sprite *sprite);
void AnimOutrageFlame(struct Sprite *sprite);
void AnimDracoMeteorRock(struct Sprite *sprite);

// battle_anim_new.c
void CoreEnforcerLoadBeamTarget(struct Sprite *sprite);
Expand Down
61 changes: 61 additions & 0 deletions src/battle_anim_dragon.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ static void UpdateDragonDanceScanlineEffect(struct Task *);
static void AnimDragonRushStep(struct Sprite *sprite);
static void AnimSpinningDracoMeteor(struct Sprite *sprite);
static void AnimSpinningDracoMeteorFinish(struct Sprite *sprite);
static void AnimDracoMeteorRock_Step(struct Sprite *sprite);

EWRAM_DATA static u16 sUnusedOverheatData[7] = {0};

Expand Down Expand Up @@ -185,6 +186,30 @@ const struct SpriteTemplate gOverheatFlameSpriteTemplate =
.callback = AnimOverheatFlame,
};

// Draco Meteor Rocks
const struct SpriteTemplate gDracoMeteorRocksSpriteTemplate =
{
.tileTag = ANIM_TAG_ROCKS,
.paletteTag = ANIM_TAG_FAIRY_LOCK_CHAINS,
.oam = &gOamData_AffineNormal_ObjNormal_32x32,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimDracoMeteorRock,
};

// Draco Meteor Tail
const struct SpriteTemplate gDracoMeteorTailSpriteTemplate =
{
.tileTag = ANIM_TAG_WATER_GUN,
.paletteTag = ANIM_TAG_WATER_GUN,
.oam = &gOamData_AffineNormal_ObjNormal_16x16,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = sSpriteAffineAnimTable_HydroCannonBall,
.callback = AnimDracoMeteorRock,
};

const union AnimCmd gDragonRushAnimCmds[] =
{
ANIMCMD_FRAME(0, 4),
Expand Down Expand Up @@ -566,3 +591,39 @@ static void AnimOverheatFlame_Step(struct Sprite *sprite)
if (++sprite->data[0] > sprite->data[3])
DestroyAnimSprite(sprite);
}

void AnimDracoMeteorRock(struct Sprite *sprite)
{
if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
{
sprite->data[0] = sprite->x - gBattleAnimArgs[0];
sprite->data[2] = sprite->x - gBattleAnimArgs[2];
}
else
{
sprite->data[0] = sprite->x + gBattleAnimArgs[0];
sprite->data[2] = sprite->x + gBattleAnimArgs[2];
}

sprite->data[1] = sprite->y + gBattleAnimArgs[1];
sprite->data[3] = sprite->y + gBattleAnimArgs[3];
sprite->data[4] = gBattleAnimArgs[4];

sprite->data[6] = gBattleAnimArgs[2];
sprite->data[7] = gBattleAnimArgs[3];

sprite->x = sprite->data[0];
sprite->y = sprite->data[1];
sprite->callback = AnimDracoMeteorRock_Step;
}

static void AnimDracoMeteorRock_Step(struct Sprite *sprite)
{
sprite->x2 = ((sprite->data[2] - sprite->data[0]) * sprite->data[5]) / sprite->data[4];
sprite->y2 = ((sprite->data[3] - sprite->data[1]) * sprite->data[5]) / sprite->data[4];

if (sprite->data[5] == sprite->data[4])
DestroyAnimSprite(sprite);

sprite->data[5]++;
}
11 changes: 0 additions & 11 deletions src/battle_anim_effects_3.c
Original file line number Diff line number Diff line change
Expand Up @@ -4803,17 +4803,6 @@ static void AnimForesightMagnifyingGlass_Step(struct Sprite *sprite)
}
}

const struct SpriteTemplate gDracoMeteorSmashSpriteTemplate =
{
.tileTag = ANIM_TAG_WARM_ROCK,
.paletteTag = ANIM_TAG_WARM_ROCK,
.oam = &gOamData_AffineOff_ObjNormal_32x32,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimMeteorMashStar,
};

static void AnimMeteorMashStar_Step(struct Sprite *sprite)
{
sprite->x2 = ((sprite->data[2] - sprite->data[0]) * sprite->data[5]) / sprite->data[4];
Expand Down
4 changes: 2 additions & 2 deletions src/battle_anim_new.c
Original file line number Diff line number Diff line change
Expand Up @@ -4241,11 +4241,11 @@ const struct SpriteTemplate gSpriteTemplate_SpiritBreakExplode = {
};

// chloroblast
static const union AffineAnimCmd sSpriteAffineAnim_HydroCannonBall[] = {
const union AffineAnimCmd sSpriteAffineAnim_HydroCannonBall[] = {
AFFINEANIMCMD_FRAME(16, 16, 0, 16), //Double in size
AFFINEANIMCMD_END
};
static const union AffineAnimCmd* const sSpriteAffineAnimTable_HydroCannonBall[] = {
const union AffineAnimCmd* const sSpriteAffineAnimTable_HydroCannonBall[] = {
sSpriteAffineAnim_HydroCannonBall,
};
const struct SpriteTemplate gSpriteTemplate_ChloroblastShot = {
Expand Down

0 comments on commit 20cb81f

Please sign in to comment.