33
|
1 #include "task_base.h"
|
|
2 #include "task_object.h"
|
|
3
|
|
4 SchedDefineTask1(State8, state8);
|
|
5
|
|
6 static int
|
|
7 state8(SchedTask *smanager, void *rbuf, void *wbuf)
|
|
8 {
|
|
9 int count = (int)smanager->get_param(0);
|
|
10 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
|
|
11 int length;
|
|
12
|
|
13 if(p->y < 520)
|
|
14 {
|
|
15 length = 2;
|
|
16 smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1));
|
|
17 smanager->setup_outputData();
|
|
18
|
|
19 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
|
|
20 int *w_count = (int*)smanager->get_output(wbuf, 1);
|
|
21 ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2);
|
|
22 sprite->flag = true;
|
|
23 sprite->length = length;
|
|
24
|
|
25 p->y += p->vy;
|
|
26 count++;
|
|
27
|
|
28 DefSpriteEx(p->charano, 16*4, 32*4, &sprite->data[0]);
|
|
29 PutSpriteEx(p->charano, (p->x * 4), (p->y * 4), 0.2, 0.2, 1, &sprite->data[1]);
|
|
30
|
|
31 p->dt1 = 512;
|
|
32 p->s = 0.125;
|
|
33 p->task = STATE8;
|
|
34
|
|
35 *w_count = count;
|
|
36 *q = *p;
|
|
37 return 0;
|
|
38 }
|
|
39
|
|
40 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
|
|
41 p->task = STATE9;
|
|
42
|
|
43 *q = *p;
|
|
44 return 0;
|
|
45 }
|