Mercurial > hg > Members > koba > t_dandy
view ppe/chara_state500.cc @ 37:6989f8cb0259
fix.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 09 Jan 2011 23:14:26 +0900 |
parents | c122e3d2302e |
children | 6626e451a09d |
line wrap: on
line source
#include "task_base.h" #include "task_object.h" #include "Sankaku.h" SchedDefineTask1(State500, state500); static int state500(SchedTask *smanager, void *rbuf, void *wbuf) { CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); int count = *(int*)smanager->get_input(rbuf, 1); int length = 4; smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); smanager->setup_outputData(); ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2); sprite->flag = true; sprite->length = 2; p->s = 0; p->dt2++; p->dt2 %= 512; p->dt1++; count++; DefSpriteEx(100, 16, 16, &sprite->data[0]); PutSpriteEx(100, p->x + 16, p->y + 16, 2, 2, p->dt1, &sprite->data[1]); if (p->dt1 % (5 + p->dt2 / 8) == 1) { sprite->length = 3; if (rand() % 2 == 1) Putenemy(24, p->x, p->y, (rand() % 5 + 0.5) * (rand() % 2 == 1 ? -1 : 1), (rand() % 5 + 0.5) * (rand() % 2 == 1 ? -1 : 1), STATE501, &sprite->data[2]); else Putenemy(rand() % 2 + 1, p->x, p->y, (int) Mycos(p->dt1 / 4) * 4 / SANKAKU, (int) -Mysin(p->dt1 / 4) * 4 / SANKAKU, STATE501, &sprite->data[2]); } if (p->dt1 == 50) { /*Putenemy(44,0,0,1,1,411); */ } CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); int *w_count = (int*)smanager->get_output(wbuf, 1); *q = *p; *w_count = count; return 0; }