blob: 776cd57a41b4c595a6a654494220c2cb590879ac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
#include "global.h"
#include "rom_8077ABC.h"
#include "trig.h"
#include "battle_anim.h"
#include "sound.h"
extern s16 gBattleAnimArgs[];
extern u8 gBattleAnimAttacker;
extern u8 gBattleAnimTarget;
extern u8 gBattlerSpriteIds[];
static void sub_80CF514(u8 taskId);
// withdraw (where a Pokemon leans inward to mimic the effect of withdrawing into a shell.)
// Used in Withdraw.
void sub_80CF4D8(u8 taskId)
{
PrepareBattlerSpriteForRotScale(gBattlerSpriteIds[gBattleAnimAttacker], 0);
gTasks[taskId].func = sub_80CF514;
}
void sub_80CF514(u8 taskId)
{
u8 a = gBattlerSpriteIds[gBattleAnimAttacker];
s16 b;
if (GetBattlerSide(gBattleAnimAttacker) == 0)
{
b = -gTasks[taskId].data[0];
}
else
{
b = gTasks[taskId].data[0];
}
obj_id_set_rotscale(a, 0x100, 0x100, b);
if (gTasks[taskId].data[1] == 0)
{
gTasks[taskId].data[0] += 0xB0;
gSprites[a].y2++;
}
else if (gTasks[taskId].data[1] == 1)
{
if (++gTasks[taskId].data[3] == 0x1E)
gTasks[taskId].data[1] = 2;
return;
}
else
{
gTasks[taskId].data[0] -= 0xB0;
gSprites[a].y2--;
}
sub_8078F9C(a);
if (gTasks[taskId].data[0] == 0xF20 || gTasks[taskId].data[0] == 0)
{
if (gTasks[taskId].data[1] == 2)
{
sub_8078F40(a);
DestroyAnimVisualTask(taskId);
}
else
{
gTasks[taskId].data[1]++;
}
}
}
|