34
|
1 #include "task_base.h"
|
|
2 #include "task_object.h"
|
|
3
|
|
4 SchedDefineTask1(State402, state402);
|
|
5
|
|
6 static int
|
|
7 state402(SchedTask *smanager, void *rbuf, void *wbuf)
|
|
8 {
|
|
9 int length;
|
|
10 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
|
|
11 player *jiki = (player*)smanager->get_input(rbuf, 1);
|
|
12
|
|
13 p->vx--;
|
|
14 p->x += p->vx / 8;
|
|
15 if (p->x < (jiki->x + 32))
|
|
16 {
|
|
17 p->vy--;
|
|
18 }
|
|
19 p->y += p->vy / 8;
|
|
20 if (p->dt1 % 50 == 37)
|
|
21 {
|
|
22 length = 1;
|
|
23 smanager->set_outputSize(1, sizeof(ObjContainer)+sizeof(ObjData)*(length-1));
|
|
24 smanager->setup_outputData();
|
|
25
|
|
26 ObjContainerPtr tama = (ObjContainerPtr)smanager->get_output(wbuf, 1);
|
|
27 tama->flag = true;
|
|
28 tama->length = length;
|
|
29
|
|
30 Puttama(1, p->x + 8, p->y + 24, &tama->data[0]);
|
|
31 }
|
|
32 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
|
|
33
|
|
34 p->dt1++;
|
|
35 *q = *p;
|
|
36 return 0;
|
|
37 }
|