18
|
1 #include "chara_state601.h"
|
|
2 #include "tobject.h"
|
|
3
|
|
4 SchedDefineTask(STATE601);
|
|
5
|
|
6 static int
|
|
7 run(SchedTask *smanager, void *rbuf, void *wbuf)
|
|
8 {
|
|
9 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
|
|
10
|
|
11 p->dt2++;
|
|
12 if (p->x < jiki.x)
|
|
13 p->vx++;
|
|
14 if (p->x > jiki.x)
|
|
15 p->vx--;
|
|
16 p->x += p->vx;
|
|
17 Putenemy(6, p->x + 16 + rand() % 32,
|
|
18 p->y, 0, rand() % 4, chara_state400);
|
|
19 if (p->x < 0)
|
|
20 p->x = 0;
|
|
21 if (p->x > 260)
|
|
22 p->x = 260;
|
|
23 if (p->y < 0)
|
|
24 p->y = 0;
|
|
25 if (p->y > 232)
|
|
26 p->y = 232;
|
|
27 if (p->dt2 > 800) {
|
|
28 p->task = STATE602;
|
|
29 }
|
|
30 return 0;
|
|
31 }
|