18
|
1 #include "chara_state28.h"
|
|
2 #include "tobject.h"
|
|
3
|
|
4 SchedDefineTask(STATE28);
|
|
5
|
|
6 static int
|
|
7 run(SchedTask *smanager, void *rbuf, void *wbuf)
|
|
8 {
|
|
9 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
|
|
10
|
|
11 if (p->dt1 <= 360)
|
|
12 {
|
|
13 p->x = Mycos(p->dt1) * 30 / SANKAKU + 82 + 32;
|
|
14 p->y = Mysin(p->dt1) * 30 / SANKAKU + 30;
|
|
15 }
|
|
16 if (p->dt1 > 360)
|
|
17 {
|
|
18 p->x = Mycos(p->dt1) * 30 * -1 / SANKAKU + 142 + 32;
|
|
19 p->y = Mysin(p->dt1) * 30 / SANKAKU + 30;
|
|
20 }
|
|
21 count++;
|
|
22 PutSprite(count, p->x - 42, p->y, 64);
|
|
23 if (p->dt1 % 30 == 3)
|
|
24 {
|
|
25 Putenemy(24, p->x + 14,
|
|
26 p->y + 14,
|
|
27 (rand() % 5 + 0.5) * (rand() % 2 ==
|
|
28 1 ? -1 : 1),
|
|
29 (rand() % 5 + 0.5) * (rand() % 2 ==
|
|
30 1 ? -1 : 1), chara_state29);
|
|
31 }
|
|
32 p->dt1 += 3;
|
|
33 return 0;
|
|
34 }
|