Mercurial > hg > Members > koba > t_dandy
view ppe/chara_state40.cc @ 37:6989f8cb0259
fix.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 09 Jan 2011 23:14:26 +0900 |
parents | 4516141d844a |
children | 978097c6427a 21ac9f57a6d4 |
line wrap: on
line source
#include "task_base.h" #include "task_object.h" SchedDefineTask1(State40, state40); static int state40(SchedTask *smanager, void *rbuf, void *wbuf) { int enemy_part1_f = (int)smanager->get_param(0); int length; CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); int rinkf1 = *(int*)smanager->get_input(rbuf, 3); if (enemy_part1_f == FALSE) { CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); // Bom(p->x, p->y); p->f = FALSE; p->task = DELETE_CHARA; *q = *p; return 0; } if ((rinkf1 == 8) && (p->dt1 % 3 == 1)) { if ((p->dt2 < 16)) { length = 1; 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; p->dt2++; DefSprite(76, 16, p->dt2, 480, &sprite->data[0]); } else { //rinkf1=9; CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); *q = *p; return 0; } } if (rinkf1 == 9) { if (p->dt1 % 15 == 1) { length = 1; 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; Puttama(8, p->x, p->y, &sprite->data[0]); } } if (rinkf1 == 10) { if (p->dt2 != 0) { length = 1; 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; p->dt2--; DefSprite(76, 16, p->dt2, 480, &sprite->data[0]); } else { //rinkf1=11; p->f = FALSE; p->task = DELETE_CHARA; } } CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); p->dt1++; *q = *p; return 0; }