34
|
1 #include "task_base.h"
|
|
2 #include "task_object.h"
|
|
3
|
|
4 SchedDefineTask1(State27, state27);
|
|
5
|
|
6 static int
|
|
7 state27(SchedTask *smanager, void *rbuf, void *wbuf)
|
|
8 {
|
|
9 int length = 1;
|
|
10 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
|
|
11 int count = *(int*)smanager->get_input(rbuf, 1);
|
|
12 int rinkx = *(int*)smanager->get_input(rbuf, 2);
|
|
13 int rinkf1 = *(int*)smanager->get_input(rbuf, 3);
|
|
14
|
|
15 smanager->set_outputSize(4, sizeof(ObjContainer)+sizeof(ObjData)*(length-1));
|
|
16 smanager->setup_outputData();
|
|
17
|
|
18 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
|
|
19 int *w_count = (int*)smanager->get_output(wbuf, 1);
|
|
20 int *w_rinkx = (int*)smanager->get_output(wbuf, 2);
|
|
21 int *w_rinkf1 = (int*)smanager->get_output(wbuf, 3);
|
|
22 ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 4);
|
|
23 sprite->flag = true;
|
|
24 sprite->length = length;
|
|
25
|
|
26 if((p->dt2 > 50) && (p->dt2 < 60) && (p->x > -24) && (p->y > -24))
|
|
27 {
|
|
28 rinkf1 = 6;
|
|
29 rinkx -= 4;
|
|
30 p->x -= 4;
|
|
31 p->y -= 4;
|
|
32 }
|
|
33 if(p->dt2 == 80)
|
|
34 {
|
|
35 rinkf1 = 7;
|
|
36 }
|
|
37 if(p->dt2 == 81)
|
|
38 {
|
|
39 rinkf1 = 8;
|
|
40 }
|
|
41 if(p->dt2 == 124)
|
|
42 {
|
|
43 rinkf1 = 9;
|
|
44 }
|
|
45 if(p->dt2 == 400)
|
|
46 {
|
|
47 rinkf1 = 10;
|
|
48 }
|
|
49 if(p->dt2 == 444)
|
|
50 {
|
|
51 rinkf1 = 11;
|
|
52 }
|
|
53 if(p->dt2 == 500)
|
|
54 {
|
|
55 rinkf1 = 12;
|
|
56 }
|
|
57 if((p->dt2 > 80) && (p->dt2 < 200))
|
|
58 {
|
|
59 if((rinkx != 0) && (p->dt2 % 2 == 1))
|
|
60 {
|
|
61 rinkx++;
|
|
62 p->x++;
|
|
63 p->y++;
|
|
64 }
|
|
65 }
|
|
66 count++;
|
|
67 PutSprite(count, p->x - 32, p->y, 6, &sprite->data[0]);
|
|
68 if(rinkf1 == 12)
|
|
69 {
|
|
70 p->dt2 = 0;
|
|
71 rinkf1 = 0;
|
|
72 rinkx = 0;
|
|
73
|
|
74 p->task = STATE25;
|
|
75 *q = *p;
|
|
76 *w_count = count;
|
|
77 *w_rinkx = rinkx;
|
|
78 *w_rinkf1 = rinkf1;
|
|
79 return 0;
|
|
80 }
|
|
81 p->dt2++;
|
|
82
|
|
83 *q = *p;
|
|
84 *w_count = count;
|
|
85 *w_rinkx = rinkx;
|
|
86 *w_rinkf1 = rinkf1;
|
|
87 return 0;
|
|
88 }
|