18
|
1 #include "chara_state12.h"
|
|
2 #include "tobject.h"
|
|
3
|
|
4 SchedDefineTask(STATE12);
|
|
5
|
|
6 static int
|
|
7 run(SchedTask *smanager, void *rbuf, void *wbuf)
|
|
8 {
|
|
9 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
|
|
10
|
|
11 if(fastebos > 60*60)
|
|
12 {
|
|
13 if(p->y > 240+32)
|
|
14 {
|
|
15 p->state = delete_chara;
|
|
16 }
|
|
17 p->y += 3;
|
|
18 rinky += 3;
|
|
19 count++;
|
|
20 DefSpriteEx(54, 16, 32);
|
|
21 PutSpriteEx(54, p->x, p->y, 2, 2, 1);
|
|
22 p->state = chara_state12;
|
|
23 return 0;
|
|
24 }
|
|
25 if(p->dt1 <= 60)
|
|
26 {
|
|
27 if(jiki.x + 15 - rinkx < -5)
|
|
28 {
|
|
29 p->vx = -0.8;
|
|
30 }
|
|
31 else if(jiki.x + 15 - rinkx > 5)
|
|
32 {
|
|
33 p->vx = +0.8;
|
|
34 }
|
|
35 else p->vx = 0;
|
|
36 rinkx = p->x;
|
|
37 rinky = p->y;
|
|
38 }
|
|
39 if((p->dt1 > 60) && (p->dt1 <= 70))
|
|
40 {
|
|
41 if(p->dt1 % 2 == 1)
|
|
42 {
|
|
43 Puttama(0, rinkx - 16, rinky);
|
|
44 Puttama(0, rinkx, rinky);
|
|
45 Puttama(0, rinkx + 16, rinky);
|
|
46 }
|
|
47 }
|
|
48 if((p->dt1 > 180) && (p->dt1 <= 240))
|
|
49 {
|
|
50 if(p->dt1 % 2 == 1)
|
|
51 {
|
|
52 rinkf2 = 1;
|
|
53 Puttama(2, rinkx - 16, p->y - 32);
|
|
54 Puttama(3, rinkx + 32 - 16, p->y - 32);
|
|
55 }
|
|
56 else
|
|
57 {
|
|
58 rinkf2 = 2;
|
|
59 }
|
|
60 }
|
|
61 if(p->dt1 > 240)
|
|
62 {
|
|
63 rinkf2 = 2;
|
|
64 }
|
|
65 if((p->dt1 > 240) && (p->dt1 <= 400))
|
|
66 {
|
|
67 count++;
|
|
68 PutSprite(count, rinkx - 16, rinky + 32,
|
|
69 58 + p->dt1 % 4);
|
|
70 }
|
|
71 if((p->dt1 > 300) && (p->dt1 <= 400))
|
|
72 {
|
|
73 rinkf2 = 3;
|
|
74 if(jiki.x + 15 - rinkx < -5)
|
|
75 {
|
|
76 p->vx = -1;
|
|
77 }
|
|
78 else if(jiki.x + 15 - rinkx > 5)
|
|
79 {
|
|
80 p->vx = +1;
|
|
81 }
|
|
82 else p->vx = 0;
|
|
83 p->x += p->vx;
|
|
84 rinkx = p->x;
|
|
85 rinky = p->y;
|
|
86 Puttama(4, rinkx - 8, rinky + 16);
|
|
87 }
|
|
88 if((p->dt1 > 400) && (p->dt1 <= 500))
|
|
89 {
|
|
90 rinkf2 = 4;
|
|
91 if(jiki.x + 15 - rinkx > 5)
|
|
92 {
|
|
93 p->vx = -1;
|
|
94 }
|
|
95 else if(jiki.x + 15 - rinkx > 5)
|
|
96 {
|
|
97 p->vx = +1;
|
|
98 }
|
|
99 else p->vx = 0;
|
|
100 p->x += p->vx;
|
|
101 rinkx = p->x;
|
|
102 rinky = p->y;
|
|
103 }
|
|
104 if(p->dt1 > 500)
|
|
105 {
|
|
106 rinkf2 = 5;
|
|
107 if(jiki.x + 15 - rinkx < -5)
|
|
108 {
|
|
109 p->vx = -1;
|
|
110 }
|
|
111 else if(jiki.x + 15 - rinkx > 5)
|
|
112 {
|
|
113 p->vx = +1;
|
|
114 }
|
|
115 else p->vx = 0;
|
|
116 p->x += p->vx;
|
|
117 rinkx = p->x;
|
|
118 rinky = p->y;
|
|
119 }
|
|
120 if(p->dt1 > 600)
|
|
121 {
|
|
122 rinkf2 = 0;
|
|
123 p->dt1 = 0;
|
|
124 }
|
|
125 fastebos++;
|
|
126 p->dt1++;
|
|
127 count++;
|
|
128 DefSpriteEx(54, 16, 32);
|
|
129 PutSpriteEx(54, p->x, p->y, 2, 2, 1);
|
|
130 return 0;
|
|
131 }
|