annotate spe/chara_state28.cc @ 0:4be1ca60a49b default tip

first commit.
author tkaito
date Sat, 05 Feb 2011 02:13:58 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
1 #include "chara_state28.h"
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
2 #include "tobject.h"
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
3
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
4 SchedDefineTask(STATE28);
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
5
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
6 static int
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
7 run(SchedTask *smanager, void *rbuf, void *wbuf)
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
8 {
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
9 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
10
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
11 if (p->dt1 <= 360)
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
12 {
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
13 p->x = Mycos(p->dt1) * 30 / SANKAKU + 82 + 32;
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
14 p->y = Mysin(p->dt1) * 30 / SANKAKU + 30;
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
15 }
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
16 if (p->dt1 > 360)
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
17 {
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
18 p->x = Mycos(p->dt1) * 30 * -1 / SANKAKU + 142 + 32;
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
19 p->y = Mysin(p->dt1) * 30 / SANKAKU + 30;
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
20 }
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
21 count++;
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
22 PutSprite(count, p->x - 42, p->y, 64);
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
23 if (p->dt1 % 30 == 3)
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
24 {
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
25 Putenemy(24, p->x + 14,
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
26 p->y + 14,
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
27 (rand() % 5 + 0.5) * (rand() % 2 ==
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
28 1 ? -1 : 1),
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
29 (rand() % 5 + 0.5) * (rand() % 2 ==
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
30 1 ? -1 : 1), chara_state29);
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
31 }
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
32 p->dt1 += 3;
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
33 return 0;
4be1ca60a49b first commit.
tkaito
parents:
diff changeset
34 }