33
|
1 #include "task_base.h"
|
|
2 #include "task_object.h"
|
|
3
|
|
4 SchedDefineTask1(State9, state9);
|
|
5
|
|
6 static int
|
|
7 state9(SchedTask *smanager, void *rbuf, void *wbuf)
|
|
8 {
|
|
9 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
|
34
|
10 int count = *(int*)smanager->get_input(rbuf, 1);
|
33
|
11 int length;
|
|
12
|
|
13 if(p->s <= 2)
|
|
14 {
|
|
15 length = 2;
|
|
16 smanager->set_outputSize(4, 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, 4);
|
|
22 sprite->flag = true;
|
|
23 sprite->length = length;
|
|
24
|
|
25 p->s += 0.05;
|
|
26 p->y -= 12;
|
|
27
|
|
28 count++;
|
|
29 *w_count = count;
|
|
30
|
|
31 DefSpriteEx(54, 16*4, 32*4, &sprite->data[0]);
|
|
32 PutSpriteEx(54, (p->x * 4), (p->y * 4), p->s, p->s, 1, &sprite->data[1]);
|
|
33
|
|
34 p->task = STATE9;
|
|
35 *q = *p;
|
|
36 return 0;
|
|
37 }
|
|
38 length = 4;
|
|
39 smanager->set_outputSize(4, sizeof(ObjContainer)+sizeof(ObjData)*(length-1));
|
|
40 smanager->setup_outputData();
|
|
41
|
|
42 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
|
|
43 int *w_rinkx = (int*)smanager->get_output(wbuf, 2);
|
|
44 int *w_rinky = (int*)smanager->get_output(wbuf, 3);
|
|
45 ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 4);
|
|
46 sprite->flag = true;
|
|
47 sprite->length = length;
|
|
48
|
|
49 count++;
|
|
50
|
|
51
|
|
52 DefSpriteEx(54, 16, 32, &sprite->data[0]);
|
|
53 PutSpriteEx(54, p->x, p->y, p->s, p->s, 1, &sprite->data[1]);
|
|
54 *w_rinkx = p->x;
|
|
55 *w_rinky = p->y;
|
|
56 Putenemy(5, *w_rinkx - 16, *w_rinky - 16, 1, 0, STATE10, &sprite->data[2]);
|
|
57 Putenemy(5, *w_rinkx - 16, *w_rinky - 16, -1, 0, STATE10, &sprite->data[3]);
|
|
58 p->dt1 = 8192;
|
|
59
|
|
60 p->task = STATE11;
|
|
61
|
|
62 *q = *p;
|
|
63 return 0;
|
|
64 }
|