Fix Poison Gas Anim for MOVE_TARGET_BOTH (#2608)

* poison gas anim handles MOVE_TARGET_BOTH

* fix sprite position fields

* fix it again

---------

Co-authored-by: ghoulslash <pokevoyager0@gmail.com>
This commit is contained in:
ghoulslash 2023-02-07 06:14:36 -05:00 committed by GitHub
parent 04ce8ec213
commit 0c4c3fbbb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 1 deletions

View File

@ -21119,7 +21119,11 @@ Move_POISON_GAS:
createsprite gPoisonGasCloudSpriteTemplate, ANIM_TARGET, 0, 64, 0, 0, -32, -6, 4192, 1072, 0
delay 40
loopsewithpan SE_M_MIST, SOUND_PAN_TARGET, 28, 6
.if B_UPDATED_MOVE_DATA >= GEN_5
createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_DEF_SIDE, 6, 2, 0, 12, RGB(26, 0, 26)
.else
createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 6, 2, 0, 12, RGB(26, 0, 26)
.endif
waitforvisualfinish
blendoff
clearmonbg ANIM_DEF_PARTNER

View File

@ -1289,6 +1289,18 @@ static void InitPoisonGasCloudAnim(struct Sprite *sprite)
sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2);
sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET);
#if B_UPDATED_MOVE_DATA >= GEN_5
{
s16 x, y;
SetAverageBattlerPositions(gBattleAnimTarget, gBattleAnimArgs[7], &x, &y);
sprite->data[1] = sprite->x + gBattleAnimArgs[1];
sprite->data[2] = x + gBattleAnimArgs[3];
sprite->data[3] = sprite->y + gBattleAnimArgs[2];
sprite->data[4] = y + gBattleAnimArgs[4];
sprite->data[7] |= GetBattlerSpriteBGPriority(gBattleAnimTarget) << 8;
}
#else
if (gBattleAnimArgs[7])
{
sprite->data[1] = sprite->x + gBattleAnimArgs[1];
@ -1305,6 +1317,7 @@ static void InitPoisonGasCloudAnim(struct Sprite *sprite)
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + gBattleAnimArgs[4];
sprite->data[7] |= GetBattlerSpriteBGPriority(gBattleAnimTarget) << 8;
}
#endif
if (IsContest())
{
@ -1333,8 +1346,14 @@ static void MovePoisonGasCloud(struct Sprite *sprite)
if (sprite->data[0] <= 0)
{
#if B_UPDATED_MOVE_DATA >= GEN_5
s16 x, y;
SetAverageBattlerPositions(gBattleAnimTarget, 0, &x, &y);
sprite->x = x;
#else
sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X);
#endif
sprite->data[0] = 80;
sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X);
sprite->data[1] = sprite->x;
sprite->data[2] = sprite->x;
sprite->y += sprite->y2;