18
|
1 #include "chara_state500.h"
|
|
2 #include "tobject.h"
|
|
3
|
|
4 SchedDefineTask(STATE500);
|
|
5
|
|
6 static int
|
|
7 run(SchedTask *smanager, void *rbuf, void *wbuf)
|
|
8 {
|
|
9 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
|
|
10
|
|
11 p->s = 0;
|
|
12
|
|
13 kyeenemyno = p;
|
|
14 p->dt2++;
|
|
15 p->dt2 %= 512;
|
|
16 p->dt1++;
|
|
17 count++;
|
|
18 DefSpriteEx(100, 16, 16);
|
|
19 // PutSprite(count, enemy[tekino].x + 16,
|
|
20 // enemy[tekino].y + 16, 100);
|
|
21 PutSpriteEx(100, p->x + 16, p->y + 16, 2, 2, p->dt1);
|
|
22
|
|
23 if (p->dt1 % (5 + p->dt2 / 8) == 1) {
|
|
24 if (rand() % 2 == 1)
|
|
25 Putenemy(24, p->x, p->y,
|
|
26 (rand() % 5 + 0.5) * (rand() % 2 ==
|
|
27 1 ? -1 : 1),
|
|
28 (rand() % 5 + 0.5) * (rand() % 2 ==
|
|
29 1 ? -1 : 1), chara_state501);
|
|
30 else
|
|
31 Putenemy(rand() % 2 + 1, p->x,
|
|
32 p->y,
|
|
33 (int) Mycos(p->dt1 / 4) * 4 /
|
|
34 SANKAKU,
|
|
35 (int) -Mysin(p->dt1 / 4) * 4 /
|
|
36 SANKAKU, chara_state501);
|
|
37 }
|
|
38 if (p->dt1 == 50) {
|
|
39 /*Putenemy(44,0,0,1,1,411); */
|
|
40 }
|
|
41 return 0;
|
|
42 }
|