35
|
1 #include "task_base.h"
|
|
2 #include "task_object.h"
|
|
3
|
|
4 SchedDefineTask1(State41, state41);
|
|
5
|
|
6 static int
|
|
7 state41(SchedTask *smanager, void *rbuf, void *wbuf)
|
|
8 {
|
|
9 int enemy_part2_f = (int)smanager->get_param(1);
|
38
|
10 int rand = (int)smanager->get_param(6);
|
35
|
11
|
|
12 int length;
|
|
13 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
|
|
14 CHARACTER *kyeenemyno = (CHARACTER*)smanager->get_input(rbuf, 1);
|
58
|
15 int rinkf1 = *(int*)smanager->get_input(rbuf, 2);
|
35
|
16
|
|
17 if (enemy_part2_f == FALSE)
|
|
18 {
|
|
19 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
|
|
20 // Bom(p->x, p->y);
|
|
21 p->f = FALSE;
|
57
|
22 p->collision_task = true;
|
35
|
23
|
|
24 *q = *p;
|
|
25 return 0;
|
|
26 }
|
|
27 p->x = kyeenemyno->x - 20 - 7;
|
|
28 p->y = kyeenemyno->y + 28 + 15;
|
|
29 if ((rinkf1 == 8) && (p->dt1 % 3 == 1))
|
|
30 {
|
|
31 if ((p->dt2 < 16))
|
|
32 {
|
|
33 length = 1;
|
58
|
34 smanager->set_outputSize(1, sizeof(ObjContainer)+sizeof(ObjData)*(length-1));
|
35
|
35 smanager->setup_outputData();
|
58
|
36 ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 1);
|
35
|
37 sprite->flag = true;
|
|
38 sprite->length = length;
|
|
39
|
|
40 p->dt2++;
|
36
|
41 DefSprite(77, p->dt2, 16, 480, &sprite->data[0]); /*左腕アップアーム砲 */
|
35
|
42 }
|
|
43 else
|
|
44 {
|
|
45 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
|
|
46
|
|
47 rinkf1 = 9;
|
|
48 *q = *p;
|
|
49 return 0;
|
|
50 }
|
|
51 }
|
|
52 if (rinkf1 == 9)
|
|
53 {
|
|
54 if (p->dt1 % 15 == 1)
|
|
55 {
|
|
56 length = 1;
|
58
|
57 smanager->set_outputSize(1, sizeof(ObjContainer)+sizeof(ObjData)*(length-1));
|
35
|
58 smanager->setup_outputData();
|
58
|
59 ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 1);
|
35
|
60 sprite->flag = true;
|
|
61 sprite->length = length;
|
|
62
|
38
|
63 Puttama(9 + rand % 2, p->x, p->y, &sprite->data[0]);
|
35
|
64 }
|
|
65 }
|
|
66 if (rinkf1 == 10)
|
|
67 {
|
|
68 if (p->dt2 != 0)
|
|
69 {
|
|
70 length = 1;
|
58
|
71 smanager->set_outputSize(1, sizeof(ObjContainer)+sizeof(ObjData)*(length-1));
|
35
|
72 smanager->setup_outputData();
|
58
|
73 ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 1);
|
35
|
74 sprite->flag = true;
|
|
75 sprite->length = length;
|
|
76
|
|
77 p->dt2--;
|
36
|
78 DefSprite(77, p->dt2, 16, 480, &sprite->data[0]);
|
35
|
79 }
|
|
80 else
|
|
81 {
|
|
82 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
|
|
83
|
|
84 p->f = FALSE;
|
57
|
85 p->collision_task = true;
|
35
|
86
|
|
87 *q = *p;
|
|
88 return 0;
|
|
89 }
|
|
90 }
|
|
91 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
|
|
92
|
|
93 p->dt1++;
|
|
94 *q = *p;
|
|
95 return 0;
|
|
96 }
|