Mercurial > hg > Members > koba > t_dandy
view spe/chara_state35.cc @ 49:f4140672ef9f
fix.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 21 Jan 2011 22:18:28 +0900 |
parents | c330ded6d728 |
children | cfd42ee2ad28 |
line wrap: on
line source
#include "task_base.h" #include "task_object.h" SchedDefineTask1(State35, state35); static int state35(SchedTask *smanager, void *rbuf, void *wbuf) { int enemystate_15 = (int)smanager->get_param(4); int enemystate_16 = (int)smanager->get_param(5); int length; CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); CHARACTER *kyeenemyno = (CHARACTER*)smanager->get_input(rbuf, 1); int count = *(int*)smanager->get_input(rbuf, 2); int rinkf1 = *(int*)smanager->get_input(rbuf, 3); if (kyeenemyno->f == FALSE) { length = 1; smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); smanager->setup_outputData(); CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2); sprite->flag = true; sprite->length = length; Bom(p->x, p->y, &sprite->data[0]); p->f = FALSE; p->task = DELETE_CHARA; *q = *p; return 0; } p->x = kyeenemyno->x; p->y = kyeenemyno->y + 32; if (rinkf1 == 1) { p->charano = enemystate_16; } if (rinkf1 == 2) { length = 2; 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 = length; count++; PutSprite(count, p->x - 10, p->y + 16, 58 + p->dt2 % 4, &sprite->data[0]); count++; PutSprite(count, p->x + 10, p->y + 16, 58 + p->dt2 % 4, &sprite->data[1]); p->dt2++; } if (rinkf1 == 3) { 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; count++; PutSprite(count, p->x - 10, p->y + 16, 58 + p->dt2 % 4, &sprite->data[0]); count++; PutSprite(count, p->x + 10, p->y + 16, 58 + p->dt2 % 4, &sprite->data[1]); if (p->dt2 % 20 == 1) { Puttama(7, p->x, p->y + 16, &sprite->data[2]); Puttama(7, p->x + 20, p->y + 16, &sprite->data[3]); } else { length = 2; } sprite->length = length; p->dt2++; } if (rinkf1 == 4) { p->charano = enemystate_15; p->dt2 = 0; } CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); int *w_count = (int*)smanager->get_output(wbuf, 1); *w_count = count; *q = *p; return 0; }