comparison spe/chara_state27.cc @ 18:c330ded6d728

add task file.
author koba <koba@cr.ie.u-ryukyu.ac.jp>
date Fri, 17 Dec 2010 22:18:11 +0900
parents
children f4140672ef9f
comparison
equal deleted inserted replaced
17:927401604461 18:c330ded6d728
1 #include "chara_state27.h"
2 #include "tobject.h"
3
4 SchedDefineTask(STATE27);
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((p->dt2 > 50) && (p->dt2 < 60) && (p->x > -24) && (p->y > -24))
12 {
13 rinkf1 = 6;
14 rinkx -= 4;
15 p->x -= 4;
16 p->y -= 4;
17 }
18 if(p->dt2 == 80)
19 {
20 rinkf1 = 7;
21 }
22 if(p->dt2 == 81)
23 {
24 rinkf1 = 8;
25 }
26 if(p->dt2 == 124)
27 {
28 rinkf1 = 9;
29 }
30 if(p->dt2 == 400)
31 {
32 rinkf1 = 10;
33 }
34 if(p->dt2 == 444)
35 {
36 rinkf1 = 11;
37 }
38 if(p->dt2 == 500)
39 {
40 rinkf1 = 12;
41 }
42 if((p->dt2 > 80) && (p->dt2 < 200))
43 {
44 if((rinkx != 0) && (p->dt2 % 2 == 1))
45 {
46 rinkx++;
47 p->x++;
48 p->y++;
49 }
50 }
51 count++;
52 PutSprite(count, p->x - 32, p->y, 6);
53 if(rinkf1 == 12)
54 {
55 p->dt2 = 0;
56 rinkf1 = 0;
57 rinkx = 0;
58 p->task = STATE25;
59 return 0;
60 }
61 p->dt2++;
62 return 0;
63 }