[battle, anim] woodhammer animation overhaul (#3192)

* [battle, anim] woodhammer animation overhaul

* squashme: timings

---------

Co-authored-by: sbird <sbird@no.tld>
This commit is contained in:
Philipp AUER 2023-08-02 02:10:18 +03:00 committed by GitHub
parent 15c0ea253a
commit 44eb6260cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 153 additions and 25 deletions

View File

@ -4051,31 +4051,34 @@ Move_CHARGE_BEAM:
end
Move_WOOD_HAMMER:
loadspritegfx ANIM_TAG_WOOD_HAMMER
loadspritegfx ANIM_TAG_WOOD_HAMMER_HAMMER
loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_TARGET
setalpha 12, 8
playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER
createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 18, 6, 2, 4
createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 12, 4, 2, 4
createsprite gWoodHammerHammerSpriteTemplate, ANIM_TARGET, 2
delay 60
createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_ATTACKER, 3, 0, 12, 4
delay 18
createvisualtask AnimTask_SquishTarget, 0x2
delay 6
call WoodHammerImpact
waitforvisualfinish
createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 0, 20, 0, 0, 4
delay 3
createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, 0, 10, 0, 0
createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 4, -10, 0, 1, 0
playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET
delay 1
createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 1, -16, 0, 0, 4
waitforvisualfinish
createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 4, 0, 12, 1
waitforvisualfinish
delay 2
createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 5
delay 3
createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, 1, 0, 7
waitforvisualfinish
clearmonbg ANIM_TARGET
blendoff
end
WoodHammerImpact:
playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET
createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_TARGET, 2
createsprite gWoodHammerSmallSpriteTemplate, ANIM_TARGET, 2, 0, 0, 20, 24, 14, 1
createsprite gWoodHammerSmallSpriteTemplate, ANIM_TARGET, 2, 5, 0, -20, 24, 14, 0
createsprite gWoodHammerSmallSpriteTemplate, ANIM_TARGET, 2, 0, 5, 20, -24, 14, 1
createsprite gWoodHammerSmallSpriteTemplate, ANIM_TARGET, 2, -5, 0, -20, -24, 14, 0
createsprite gWoodHammerSmallSpriteTemplate, ANIM_TARGET, 2, 0, 0, 20, 24, 20, 2
createsprite gWoodHammerSmallSpriteTemplate, ANIM_TARGET, 2, 5, 0, -20, 24, 20, 2
createsprite gWoodHammerSmallSpriteTemplate, ANIM_TARGET, 2, 0, 5, 20, -24, 20, 2
createsprite gWoodHammerSmallSpriteTemplate, ANIM_TARGET, 2, -5, 0, -20, -24, 20, 2
return
Move_AQUA_JET:
loadspritegfx ANIM_TAG_SPARKLE_6
loadspritegfx ANIM_TAG_ROUND_SHADOW

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

View File

@ -397,6 +397,7 @@
#define ANIM_TAG_STEEL_BEAM (ANIM_SPRITES_START + 383)
#define ANIM_TAG_POLTERGEIST (ANIM_SPRITES_START + 384)
#define ANIM_TAG_TEAPOT (ANIM_SPRITES_START + 385)
#define ANIM_TAG_WOOD_HAMMER_HAMMER (ANIM_SPRITES_START + 386)
// battlers

View File

@ -10161,6 +10161,8 @@ extern const u32 gBattleAnimSpriteGfx_ZMoveSymbol[];
extern const u32 gBattleAnimSpritePal_ZMoveSymbol[];
extern const u32 gBattleAnimSpriteGfx_Teapot[];
extern const u32 gBattleAnimSpritePal_Teapot[];
extern const u32 gBattleAnimSpriteGfx_WoodHammerHammer[];
extern const u32 gBattleAnimSpritePal_WoodHammerHammer[];
extern const u32 gBattleAnimBgImage_Dark[];
extern const u32 gBattleAnimBgImage_Ghost[];

View File

@ -147,6 +147,9 @@ static void AnimGrassKnotStep(struct Sprite *);
static void AnimGrassKnot(struct Sprite *);
static void AnimWoodHammerSmall(struct Sprite *);
static void AnimWoodHammerBig(struct Sprite *);
static void AnimWoodHammerHammer(struct Sprite *);
static void AnimWoodHammerHammer_WaitForPunch(struct Sprite *);
static void AnimWoodHammerHammer_WaitForDestruction(struct Sprite *);
static void AnimTask_DoubleTeam_Step(u8);
static void AnimDoubleTeam(struct Sprite *);
static void AnimNightSlash(struct Sprite *);
@ -2847,24 +2850,67 @@ const union AffineAnimCmd *const gWoodHammerBigAffineAnims[] =
gWoodHammerBigAffineAnimCmd_2,
};
const union AnimCmd gWoodHammerSmallAnimCmd_1[] =
#define WOOD_HAMMER_SCALE_STEP 5
#define WOOD_HAMMER_CC_ROTATION_STEP 2
#define WOOD_HAMMER_BACKWARDS_DURATION 40
#define WOOD_HAMMER_ROTATED_AMOUNT (WOOD_HAMMER_CC_ROTATION_STEP * WOOD_HAMMER_BACKWARDS_DURATION)
#define WOOD_HAMMER_SCALED_AMOUNT (WOOD_HAMMER_SCALE_STEP * WOOD_HAMMER_BACKWARDS_DURATION)
const union AffineAnimCmd gWoodHammerHammerAffineAnimCmd_BackwardsRotateAndScale[] =
{
ANIMCMD_FRAME(32, 1),
ANIMCMD_END,
AFFINEANIMCMD_FRAME(WOOD_HAMMER_SCALE_STEP, WOOD_HAMMER_SCALE_STEP, WOOD_HAMMER_CC_ROTATION_STEP, WOOD_HAMMER_BACKWARDS_DURATION),
AFFINEANIMCMD_END
};
const union AnimCmd gWoodHammerSmallAnimCmd_2[] =
const union AffineAnimCmd gWoodHammerHammerAffineAnimCmd_BackwardsRotateAndScaleFlipped[] =
{
AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0),
AFFINEANIMCMD_FRAME(-WOOD_HAMMER_SCALE_STEP, WOOD_HAMMER_SCALE_STEP, -WOOD_HAMMER_CC_ROTATION_STEP, WOOD_HAMMER_BACKWARDS_DURATION),
AFFINEANIMCMD_END
};
const union AffineAnimCmd gWoodHammerHammerAffineAnimCmd_PunchClockwise[] =
{
AFFINEANIMCMD_FRAME(0x100 + WOOD_HAMMER_SCALED_AMOUNT, 0x100 + WOOD_HAMMER_SCALED_AMOUNT, WOOD_HAMMER_ROTATED_AMOUNT, 0),
AFFINEANIMCMD_FRAME(0, 0, -16, 7),
AFFINEANIMCMD_END
};
const union AffineAnimCmd gWoodHammerHammerAffineAnimCmd_PunchCounterClockwise[] =
{
AFFINEANIMCMD_FRAME(-0x100 - WOOD_HAMMER_SCALED_AMOUNT, 0x100 + WOOD_HAMMER_SCALED_AMOUNT, -WOOD_HAMMER_ROTATED_AMOUNT, 0),
AFFINEANIMCMD_FRAME(0, 0, 16, 7),
AFFINEANIMCMD_END
};
// Animations 0, 2 are for the player side attacking
// Animations 1, 3 are for the opponent side attacking (flipped)
const union AffineAnimCmd *const gWoodHammerHammerAffineAnims[] =
{
gWoodHammerHammerAffineAnimCmd_BackwardsRotateAndScale,
gWoodHammerHammerAffineAnimCmd_BackwardsRotateAndScaleFlipped,
gWoodHammerHammerAffineAnimCmd_PunchClockwise,
gWoodHammerHammerAffineAnimCmd_PunchCounterClockwise,
};
const union AnimCmd gWoodHammerSmallAnimCmd_1[] =
{
ANIMCMD_FRAME(48, 1),
ANIMCMD_END,
};
const union AnimCmd gWoodHammerSmallAnimCmd_3[] =
const union AnimCmd gWoodHammerSmallAnimCmd_2[] =
{
ANIMCMD_FRAME(64, 1),
ANIMCMD_END,
};
const union AnimCmd gWoodHammerSmallAnimCmd_3[] =
{
ANIMCMD_FRAME(80, 1),
ANIMCMD_END,
};
const union AnimCmd *const gWoodHammerSmallAnims[] =
{
gWoodHammerSmallAnimCmd_1,
@ -2905,6 +2951,17 @@ const struct SpriteTemplate gWoodHammerSmallSpriteTemplate =
.callback = AnimWoodHammerSmall,
};
const struct SpriteTemplate gWoodHammerHammerSpriteTemplate =
{
.tileTag = ANIM_TAG_WOOD_HAMMER_HAMMER,
.paletteTag = ANIM_TAG_WOOD_HAMMER_HAMMER,
.oam = &gOamData_AffineDouble_ObjNormal_64x64,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gWoodHammerHammerAffineAnims,
.callback = AnimWoodHammerHammer,
};
const struct SpriteTemplate gJudgmentGrayOutwardSpikesTemplate =
{
.tileTag = ANIM_TAG_GREEN_SPIKE,
@ -3022,6 +3079,65 @@ static void AnimWoodHammerSmall(struct Sprite *sprite)
StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix);
}
#define HAMMER_X_OFFSET 40
#define HAMMER_PUNCH_WAIT_FRAMES 37
static void AnimWoodHammerHammer(struct Sprite *sprite)
{
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
{
sprite->x += HAMMER_X_OFFSET;
StartSpriteAffineAnim(sprite, 1);
}
else
{
sprite->x -= HAMMER_X_OFFSET;
StartSpriteAffineAnim(sprite, 0);
}
sprite->data[6] = HAMMER_PUNCH_WAIT_FRAMES;
sprite->callback = AnimWoodHammerHammer_WaitForPunch;
}
static void AnimWoodHammerHammer_WaitForPunch(struct Sprite *sprite)
{
if (!sprite->affineAnimEnded)
return;
if (sprite->data[6] != 0)
{
sprite->data[6]--;
if (sprite->data[6] & 1)
{
if ((sprite->data[6] / 2) & 1)
sprite->x2++;
else
sprite->x2--;
}
return;
}
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
{
StartSpriteAffineAnim(sprite, 3);
}
else
{
StartSpriteAffineAnim(sprite, 2);
}
sprite->callback = AnimWoodHammerHammer_WaitForDestruction;
}
static void AnimWoodHammerHammer_WaitForDestruction(struct Sprite *sprite)
{
if (sprite->affineAnimEnded)
{
DestroySpriteAndMatrix(sprite);
}
}
#undef HAMMER_X_OFFSET
#undef HAMMER_PUNCH_WAIT_FRAMES
// Animates the falling particles that horizontally wave back and forth.
// Used by Sleep Powder, Stun Spore, and Poison Powder.
// arg 0: initial x pixel offset

View File

@ -1451,6 +1451,7 @@ const struct CompressedSpriteSheet gBattleAnimPicTable[] =
{gBattleAnimSpriteGfx_Orbs, 0x0180, ANIM_TAG_STEEL_BEAM},
{gBattleAnimSpriteGfx_AuraSphere, 0x200, ANIM_TAG_POLTERGEIST},
{gBattleAnimSpriteGfx_Teapot, 0x1800, ANIM_TAG_TEAPOT},
{gBattleAnimSpriteGfx_WoodHammerHammer, 0x800, ANIM_TAG_WOOD_HAMMER_HAMMER},
};
const struct CompressedSpritePalette gBattleAnimPaletteTable[] =
@ -1902,6 +1903,7 @@ const struct CompressedSpritePalette gBattleAnimPaletteTable[] =
{gBattleAnimSpritePal_SteelBeam, ANIM_TAG_STEEL_BEAM},
{gBattleAnimSpritePal_Poltergeist, ANIM_TAG_POLTERGEIST},
{gBattleAnimSpritePal_Teapot, ANIM_TAG_TEAPOT},
{gBattleAnimSpritePal_WoodHammerHammer, ANIM_TAG_WOOD_HAMMER_HAMMER},
};
const struct BattleAnimBackground gBattleAnimBackgroundTable[] =

View File

@ -15,6 +15,7 @@ static const struct LevelUpMove sBulbasaurLevelUpLearnset[] = {
LEVEL_UP_MOVE(31, MOVE_WORRY_SEED),
LEVEL_UP_MOVE(33, MOVE_SYNTHESIS),
LEVEL_UP_MOVE(37, MOVE_SEED_BOMB),
LEVEL_UP_MOVE(56, MOVE_WOOD_HAMMER),
LEVEL_UP_END
};

View File

@ -449,6 +449,9 @@ const u32 gBattleAnimSpriteGfx_SpinningBall[] = INCBIN_U32("graphics/battle_anim
const u32 gBattleAnimSpritePal_SpinningBall[] = INCBIN_U32("graphics/battle_anims/unused/spinning_ball.gbapal.lz");
const u32 gBattleAnimSpritePal_SpinningBall2[] = INCBIN_U32("graphics/battle_anims/unused/spinning_ball_2.gbapal.lz");
const u32 gBattleAnimSpriteGfx_WoodHammerHammer[] = INCBIN_U32("graphics/battle_anims/sprites/wood_hammer_hammer.4bpp.lz");
const u32 gBattleAnimSpritePal_WoodHammerHammer[] = INCBIN_U32("graphics/battle_anims/sprites/wood_hammer_hammer.gbapal.lz");
// old battle interface data, unused
const u32 gOldBattleInterfaceGfx[] = INCBIN_U32("graphics/unused/obi1.4bpp.lz");