49
|
1 #include "task_base.h"
|
|
2 #include "task_object.h"
|
18
|
3
|
49
|
4 SchedDefineTask1(State31, state31);
|
18
|
5
|
|
6 static int
|
49
|
7 state31(SchedTask *smanager, void *rbuf, void *wbuf)
|
18
|
8 {
|
49
|
9 int part3_f = (int)smanager->get_param(2);
|
|
10
|
|
11 int length;
|
18
|
12 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
|
49
|
13 CHARACTER *kyeenemyno = (CHARACTER*)smanager->get_input(rbuf, 1);
|
|
14 int count = *(int*)smanager->get_input(rbuf, 2);
|
|
15 int rinkf1 = *(int*)smanager->get_input(rbuf, 3);
|
18
|
16
|
49
|
17 if((part3_f == FALSE) || (kyeenemyno->f == FALSE))
|
18
|
18 {
|
49
|
19 length = 1;
|
|
20 smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1));
|
|
21 smanager->setup_outputData();
|
|
22 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
|
|
23 ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2);
|
|
24 sprite->flag = true;
|
|
25 sprite->length = length;
|
|
26
|
|
27 Bom(p->x, p->y, &sprite->data[0]);
|
18
|
28 p->f = FALSE;
|
49
|
29 p->task = DELETE_CHARA;
|
|
30
|
|
31 *q = *p;
|
18
|
32 return 0;
|
|
33 }
|
|
34
|
|
35 if(rinkf1 == 0)
|
|
36 {
|
|
37 p->x = kyeenemyno->x + 40;
|
|
38 p->y = kyeenemyno->y + 28;
|
|
39 p->dt2 = 0;
|
|
40 }
|
|
41 if(rinkf1 == 5)
|
|
42 {
|
49
|
43 length = 1;
|
|
44 smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1));
|
|
45 smanager->setup_outputData();
|
|
46 ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2);
|
|
47 sprite->flag = true;
|
|
48 sprite->length = length;
|
|
49
|
18
|
50 p->x = kyeenemyno->x + 52;
|
|
51 p->y = kyeenemyno->y;
|
|
52 count++;
|
49
|
53 PutSprite(count, p->x - 4, p->y - 20, 80 + p->dt2 % 4, &sprite->data[0]);
|
18
|
54 p->dt2++;
|
|
55 }
|
|
56 if(rinkf1 == 6)
|
|
57 {
|
|
58 if(p->y < 240 - 40)
|
|
59 {
|
|
60 p->y += 6;
|
|
61 }
|
|
62 else
|
|
63 {
|
49
|
64 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
|
|
65 *q = *p;
|
18
|
66 return 0;
|
|
67 }
|
49
|
68 length = 1;
|
|
69 smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1));
|
|
70 smanager->setup_outputData();
|
|
71 ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2);
|
|
72 sprite->flag = true;
|
|
73 sprite->length = length;
|
|
74
|
18
|
75 count++;
|
49
|
76
|
|
77 PutSprite(count, p->x - 4, p->y - 20, 90 + p->dt2 % 4, &sprite->data[0]);
|
18
|
78 p->dt2++;
|
|
79 }
|
|
80 if(rinkf1 == 7)
|
|
81 {
|
49
|
82 length = 1;
|
|
83 smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1));
|
|
84 smanager->setup_outputData();
|
|
85 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
|
|
86 ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2);
|
|
87 sprite->flag = true;
|
|
88 sprite->length = length;
|
|
89
|
|
90 Putenemy(22, p->x + 14, p->y + 14, 0, 0, STATE40, &sprite->data[0]);
|
|
91 *q = *p;
|
18
|
92 return 0;
|
|
93 }
|
|
94 if(rinkf1 == 11)
|
|
95 {
|
|
96 if(p->y + 20 != p->y)
|
|
97 {
|
|
98 p->y--;
|
|
99 }
|
|
100 else
|
|
101 {
|
49
|
102 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
|
|
103 *q = *p;
|
18
|
104 return 0;
|
|
105 }
|
49
|
106 length = 1;
|
|
107 smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1));
|
|
108 smanager->setup_outputData();
|
|
109 ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2);
|
|
110 sprite->flag = true;
|
|
111 sprite->length = length;
|
|
112
|
18
|
113 count++;
|
49
|
114 PutSprite(count, p->x + 8, p->y + 44, 58 + p->dt2 % 4, &sprite->data[0]);
|
18
|
115 p->dt2++;
|
|
116 }
|
49
|
117 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
|
|
118 int *w_count = (int*)smanager->get_output(wbuf, 1);
|
|
119
|
|
120 *q = *p;
|
|
121 *w_count = count;
|
18
|
122 return 0;
|
|
123 }
|