18
|
1 #include "chara_state411.h"
|
|
2 #include "tobject.h"
|
|
3
|
|
4 SchedDefineTask(STATE411);
|
|
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->dt2 > 356)
|
|
12 {
|
|
13 p->vx = -1;
|
|
14 }
|
|
15 if (p->dt2 < -398)
|
|
16 {
|
|
17 p->vx = 1;
|
|
18 }
|
|
19 if ((p->dt1) % 62 == 0)
|
|
20 Putenemy(41,
|
|
21 p->x,
|
|
22 p->y,
|
|
23 (int) -Mycos(p->dt1 / 16) * 4 /
|
|
24 SANKAKU,
|
|
25 (int) -Mysin(p->dt1 / 16) * 4 /
|
|
26 SANKAKU, chara_state7);
|
|
27 if ((p->dt1) % 13 == 0)
|
|
28 Puttama(11, p->x + 32,
|
|
29 p->y + 32);
|
|
30
|
|
31 p->dt2 += p->vx;
|
|
32 p->dt1 += p->dt2 / 4;
|
|
33
|
|
34 p->x = jiki.x - 16 +
|
|
35 Mycos(p->dt1 / 16) * 128 / SANKAKU;
|
|
36 p->y = jiki.y - 16 +
|
|
37 Mysin(p->dt1 / 16) * 128 / SANKAKU;
|
|
38 if (p->x < 0)
|
|
39 {
|
|
40 p->x = 0;
|
|
41 }
|
|
42 if (p->x > 260)
|
|
43 {
|
|
44 p->x = 260;
|
|
45 }
|
|
46 if (p->y < 0)
|
|
47 {
|
|
48 p->y = 0;
|
|
49 }
|
|
50 if (p->y > 232)
|
|
51 {
|
|
52 p->y = 232;
|
|
53 }
|
|
54 return 0;
|
|
55 }
|