34
|
1 #include "task_base.h"
|
|
2 #include "task_object.h"
|
|
3 #include "Sankaku.h"
|
|
4
|
|
5 SchedDefineTask1(State28, state28);
|
|
6
|
|
7 static int
|
|
8 state28(SchedTask *smanager, void *rbuf, void *wbuf)
|
|
9 {
|
67
|
10 long rand = (long)smanager->get_param(2);
|
38
|
11
|
34
|
12 int length = 2;
|
|
13 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
|
|
14 int count = *(int*)smanager->get_input(rbuf, 1);
|
|
15
|
|
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
|
|
24 if (p->dt1 <= 360)
|
|
25 {
|
|
26 p->x = Mycos(p->dt1) * 30 / SANKAKU + 82 + 32;
|
|
27 p->y = Mysin(p->dt1) * 30 / SANKAKU + 30;
|
|
28 }
|
|
29 if (p->dt1 > 360)
|
|
30 {
|
|
31 p->x = Mycos(p->dt1) * 30 * -1 / SANKAKU + 142 + 32;
|
|
32 p->y = Mysin(p->dt1) * 30 / SANKAKU + 30;
|
|
33 }
|
|
34 count++;
|
|
35 PutSprite(count, p->x - 42, p->y, 64, &sprite->data[0]);
|
|
36 if (p->dt1 % 30 == 3)
|
|
37 {
|
|
38 Putenemy(24, p->x + 14,
|
|
39 p->y + 14,
|
38
|
40 (rand % 5 + 0.5) * (rand % 2 ==
|
34
|
41 1 ? -1 : 1),
|
38
|
42 (rand % 5 + 0.5) * (rand % 2 ==
|
34
|
43 1 ? -1 : 1), STATE29, &sprite->data[1]);
|
35
|
44 } else {
|
|
45 length = 1;
|
34
|
46 }
|
|
47 p->dt1 += 3;
|
35
|
48
|
|
49 sprite->length = length;
|
34
|
50 *q = *p;
|
|
51 *w_count = count;
|
|
52 return 0;
|
|
53 }
|