added acupressure and wring out

This commit is contained in:
Karathan 2019-07-03 03:02:22 +02:00
parent f1c82abc7e
commit e9884154a9
9 changed files with 144 additions and 0 deletions

View File

@ -968,6 +968,11 @@ Move_TAILWIND:
end end
Move_ACUPRESSURE: Move_ACUPRESSURE:
loadspritegfx ANIM_TAG_ACCUPRESSURE
loadspritegfx ANIM_TAG_SPARK_2
createsprite gAccupressureSpriteTemplate, ANIM_ATTACKER, 40, 0, -40, 40
waitforvisualfinish
call ElectricityEffect
end end
Move_METAL_BURST: Move_METAL_BURST:
@ -1231,6 +1236,9 @@ Move_HEAL_BLOCK:
end end
Move_WRING_OUT: Move_WRING_OUT:
loadspritegfx ANIM_TAG_WRING_OUT
createsprite gWringOutHandSpriteTemplate, ANIM_TARGET, 40, 0, 0, 48, 3, 32
waitforvisualfinish
end end
Move_POWER_TRICK: Move_POWER_TRICK:

View File

@ -608,6 +608,8 @@ BattleScript_EffectAcupressureTry:
attackstring attackstring
ppreduce ppreduce
tryaccupressure BS_TARGET, BattleScript_ButItFailed tryaccupressure BS_TARGET, BattleScript_ButItFailed
attackanimation
waitanimation
setgraphicalstatchangevalues setgraphicalstatchangevalues
playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
statbuffchange MOVE_EFFECT_CERTAIN, BattleScript_MoveEnd statbuffchange MOVE_EFFECT_CERTAIN, BattleScript_MoveEnd

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

View File

@ -307,6 +307,8 @@
#define ANIM_TAG_MEGA_PARTICLES (ANIM_SPRITES_START + 297) #define ANIM_TAG_MEGA_PARTICLES (ANIM_SPRITES_START + 297)
#define ANIM_TAG_TRUMP_CARD (ANIM_SPRITES_START + 298) #define ANIM_TAG_TRUMP_CARD (ANIM_SPRITES_START + 298)
#define ANIM_TAG_TRUMP_CARD_PARTICLES (ANIM_SPRITES_START + 299) #define ANIM_TAG_TRUMP_CARD_PARTICLES (ANIM_SPRITES_START + 299)
#define ANIM_TAG_ACCUPRESSURE (ANIM_SPRITES_START + 300)
#define ANIM_TAG_WRING_OUT (ANIM_SPRITES_START + 301)
// battlers // battlers
#define ANIM_ATTACKER 0 #define ANIM_ATTACKER 0

View File

@ -4413,6 +4413,8 @@ extern const u32 gBattleAnimSpriteGfx_Bird[];
extern const u32 gBattleAnimSpriteGfx_CrossImpact[]; extern const u32 gBattleAnimSpriteGfx_CrossImpact[];
extern const u32 gBattleAnimSpriteGfx_TrumpCard[]; extern const u32 gBattleAnimSpriteGfx_TrumpCard[];
extern const u32 gBattleAnimSpriteGfx_TrumpCardParticles[]; extern const u32 gBattleAnimSpriteGfx_TrumpCardParticles[];
extern const u32 gBattleAnimSpriteGfx_Accupressure[];
extern const u32 gBattleAnimSpriteGfx_WringOut[];
extern const u32 gBattleAnimSpritePal_Bone[]; extern const u32 gBattleAnimSpritePal_Bone[];
extern const u32 gBattleAnimSpritePal_Spark[]; extern const u32 gBattleAnimSpritePal_Spark[];
@ -4700,6 +4702,8 @@ extern const u32 gBattleAnimSpritePal_WhipHit[];
extern const u32 gBattleAnimSpritePal_BlueRing2[]; extern const u32 gBattleAnimSpritePal_BlueRing2[];
extern const u32 gBattleAnimSpritePal_TrumpCard[]; extern const u32 gBattleAnimSpritePal_TrumpCard[];
extern const u32 gBattleAnimSpritePal_TrumpCardParticles[]; extern const u32 gBattleAnimSpritePal_TrumpCardParticles[];
extern const u32 gBattleAnimSpritePal_Accupressure[];
extern const u32 gBattleAnimSpritePal_WringOut[];
extern const u32 gBattleAnimBgImage_Dark[]; extern const u32 gBattleAnimBgImage_Dark[];
extern const u32 gBattleAnimBgImage_Ghost[]; extern const u32 gBattleAnimBgImage_Ghost[];
@ -4753,6 +4757,7 @@ extern const u32 gBattleAnimBgTilemap_InAir[];
extern const u32 gBattleAnimBgTilemap_Aurora[]; extern const u32 gBattleAnimBgTilemap_Aurora[];
extern const u32 gBattleAnimBgTilemap_Fissure[]; extern const u32 gBattleAnimBgTilemap_Fissure[];
extern const u32 gMetalShineGfx[]; extern const u32 gMetalShineGfx[];
extern const u32 gMetalShinePalette[]; extern const u32 gMetalShinePalette[];
extern const u32 gMetalShineTilemap[]; extern const u32 gMetalShineTilemap[];

View File

@ -1425,6 +1425,8 @@ const struct CompressedSpriteSheet gBattleAnimPicTable[] =
{gBattleAnimSpriteGfx_MegaParticles, 0x0180, ANIM_TAG_MEGA_PARTICLES}, {gBattleAnimSpriteGfx_MegaParticles, 0x0180, ANIM_TAG_MEGA_PARTICLES},
{gBattleAnimSpriteGfx_TrumpCard, 0x0180, ANIM_TAG_TRUMP_CARD}, {gBattleAnimSpriteGfx_TrumpCard, 0x0180, ANIM_TAG_TRUMP_CARD},
{gBattleAnimSpriteGfx_TrumpCardParticles, 0x0060, ANIM_TAG_TRUMP_CARD_PARTICLES}, {gBattleAnimSpriteGfx_TrumpCardParticles, 0x0060, ANIM_TAG_TRUMP_CARD_PARTICLES},
{gBattleAnimSpriteGfx_Accupressure, 0x0200, ANIM_TAG_ACCUPRESSURE},
{gBattleAnimSpriteGfx_WringOut, 0x0200, ANIM_TAG_WRING_OUT},
}; };
const struct CompressedSpritePalette gBattleAnimPaletteTable[] = const struct CompressedSpritePalette gBattleAnimPaletteTable[] =
@ -1729,6 +1731,8 @@ const struct CompressedSpritePalette gBattleAnimPaletteTable[] =
{gBattleAnimSpritePal_MegaParticles, ANIM_TAG_MEGA_PARTICLES}, {gBattleAnimSpritePal_MegaParticles, ANIM_TAG_MEGA_PARTICLES},
{gBattleAnimSpritePal_TrumpCard, ANIM_TAG_TRUMP_CARD}, {gBattleAnimSpritePal_TrumpCard, ANIM_TAG_TRUMP_CARD},
{gBattleAnimSpritePal_TrumpCardParticles, ANIM_TAG_TRUMP_CARD_PARTICLES}, {gBattleAnimSpritePal_TrumpCardParticles, ANIM_TAG_TRUMP_CARD_PARTICLES},
{gBattleAnimSpritePal_Accupressure, ANIM_TAG_ACCUPRESSURE},
{gBattleAnimSpritePal_WringOut, ANIM_TAG_WRING_OUT}
}; };
const struct BattleAnimBackground gBattleAnimBackgroundTable[] = const struct BattleAnimBackground gBattleAnimBackgroundTable[] =

View File

@ -158,6 +158,8 @@ static void AnimMoveFeintSwipe(struct Sprite *);
static void AnimMoveFeintZoom(struct Sprite *); static void AnimMoveFeintZoom(struct Sprite *);
static void AnimMoveTrumpCard(struct Sprite *); static void AnimMoveTrumpCard(struct Sprite *);
static void AnimMoveTrumpCardParticle(struct Sprite* sprite); static void AnimMoveTrumpCardParticle(struct Sprite* sprite);
static void AnimMoveAccupressure(struct Sprite* sprite);
static void AnimMoveWringOut(struct Sprite* sprite);
const union AnimCmd gUnknown_085920F0[] = const union AnimCmd gUnknown_085920F0[] =
{ {
@ -279,6 +281,47 @@ static const union AnimCmd * const sTrumpCardParticleAnims[] =
sTrumpCardParticleFrame2, sTrumpCardParticleFrame2,
}; };
static const union AffineAnimCmd sAccupressureTurn[] =
{
AFFINEANIMCMD_FRAME(0, 0, 1, 20),
AFFINEANIMCMD_FRAME(0, 0, -1, 40),
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd sAccupressureStill[] =
{
AFFINEANIMCMD_FRAME(256, 256, 0, 0),
AFFINEANIMCMD_END
};
static const union AffineAnimCmd * const sAccupressureAffineAnims[] =
{
sAccupressureStill,
sAccupressureTurn
};
const struct SpriteTemplate gAccupressureSpriteTemplate =
{
.tileTag = ANIM_TAG_ACCUPRESSURE,
.paletteTag = ANIM_TAG_ACCUPRESSURE,
.oam = &gUnknown_085249D4,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = sAccupressureAffineAnims,
.callback = AnimMoveAccupressure,
};
const struct SpriteTemplate gWringOutHandSpriteTemplate =
{
.tileTag = ANIM_TAG_WRING_OUT,
.paletteTag = ANIM_TAG_WRING_OUT,
.oam = &gUnknown_085249D4,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimMoveWringOut,
};
const struct SpriteTemplate gTrumpCardParticleSpriteTempalte = const struct SpriteTemplate gTrumpCardParticleSpriteTempalte =
{ {
.tileTag = ANIM_TAG_TRUMP_CARD_PARTICLES, .tileTag = ANIM_TAG_TRUMP_CARD_PARTICLES,
@ -2969,6 +3012,80 @@ static void AnimMoveTrumpCardParticle(struct Sprite* sprite)
sprite->callback = AnimMoveTrumpCardParticleAlive; sprite->callback = AnimMoveTrumpCardParticleAlive;
} }
static void AnimMoveAccupressureTransition(struct Sprite* sprite)
{
switch(sprite->data[5])
{
case 0:
if(AnimTranslateLinear(sprite))
{
StartSpriteAffineAnim(sprite, 1);
sprite->data[5]++;
}
break;
case 1:
if(sprite->affineAnimEnded)
{
DestroyAnimSprite(sprite);
}
break;
}
}
static void AnimMoveAccupressure(struct Sprite* sprite)
{
InitSpritePosToAnimTarget(sprite, TRUE);
sprite->data[0] = gBattleAnimArgs[2];
sprite->data[1] = sprite->pos1.x;
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X);
sprite->data[3] = sprite->pos1.y;
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y);
sprite->data[5] = 0;
InitAnimLinearTranslation(sprite);
sprite->callback = AnimMoveAccupressureTransition;
}
static void AnimMoveWringOutCircle(struct Sprite* sprite)
{
sprite->pos2.x = Cos(sprite->data[3], sprite->data[2]);
sprite->pos2.y = Sin(sprite->data[3], sprite->data[2]);
if(sprite->data[1] > 0)
{
if(sprite->data[3] + sprite->data[0] >= 256)
{
AGBPrintf("Hit the crit section: step: %d, angle: %d", sprite->data[0], sprite->data[3]);
sprite->data[3] = (sprite->data[0] + sprite->data[3]) % 256;
sprite->data[1]--;
AGBPrintf("Crit New angle: %d", sprite->data[3]);
}
else
{
AGBPrintf("New angle: %d", sprite->data[3]);
sprite->data[3] += sprite->data[0];
}
}
else if(sprite->data[3] < 64)
{
//We need to go for an extra 90°
sprite->data[3] += sprite->data[0];
}
else
{
DestroyAnimSprite(sprite);
}
}
static void AnimMoveWringOut(struct Sprite* sprite)
{
InitSpritePosToAnimTarget(sprite, TRUE);
sprite->data[0] = 256 / gBattleAnimArgs[2]; //step size
sprite->data[1] = gBattleAnimArgs[3]; //Number of circle spins
sprite->data[2] = gBattleAnimArgs[4]; //radius
sprite->data[3] = 64; //current angle 90°
sprite->callback = AnimMoveWringOutCircle;
}
// seed (sprouts a sapling from a seed.) // seed (sprouts a sapling from a seed.)
// Used by Leech Seed. // Used by Leech Seed.
// arg 0: initial x pixel offset // arg 0: initial x pixel offset

View File

@ -125,6 +125,12 @@ const u32 gBattleAnimSpritePal_TrumpCard[] = INCBIN_U32("graphics/battle_anims/s
const u32 gBattleAnimSpriteGfx_TrumpCardParticles[] = INCBIN_U32("graphics/battle_anims/sprites/trump_card_particles.4bpp.lz"); const u32 gBattleAnimSpriteGfx_TrumpCardParticles[] = INCBIN_U32("graphics/battle_anims/sprites/trump_card_particles.4bpp.lz");
const u32 gBattleAnimSpritePal_TrumpCardParticles[] = INCBIN_U32("graphics/battle_anims/sprites/trump_card_particles.gbapal.lz"); const u32 gBattleAnimSpritePal_TrumpCardParticles[] = INCBIN_U32("graphics/battle_anims/sprites/trump_card_particles.gbapal.lz");
const u32 gBattleAnimSpriteGfx_Accupressure[] = INCBIN_U32("graphics/battle_anims/sprites/accupressure.4bpp.lz");
const u32 gBattleAnimSpritePal_Accupressure[] = INCBIN_U32("graphics/battle_anims/sprites/accupressure.gbapal.lz");
const u32 gBattleAnimSpriteGfx_WringOut[] = INCBIN_U32("graphics/battle_anims/sprites/wring_out.4bpp.lz");
const u32 gBattleAnimSpritePal_WringOut[] = INCBIN_U32("graphics/battle_anims/sprites/wring_out.gbapal.lz");
const u32 gBattleAnimSpriteGfx_ClosingEye[] = INCBIN_U32("graphics/battle_anims/sprites/closing_eye.4bpp.lz"); const u32 gBattleAnimSpriteGfx_ClosingEye[] = INCBIN_U32("graphics/battle_anims/sprites/closing_eye.4bpp.lz");
const u32 gBattleAnimSpritePal_ClosingEye[] = INCBIN_U32("graphics/battle_anims/sprites/closing_eye.gbapal.lz"); const u32 gBattleAnimSpritePal_ClosingEye[] = INCBIN_U32("graphics/battle_anims/sprites/closing_eye.gbapal.lz");