Mercurial > hg > Members > koba > t_dandy
view ppe/chara_state41.cc @ 64:07bc996c8e49
fix t_dandy on ps3.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 11 Feb 2011 18:20:30 +0900 |
parents | e0018f39f7e1 |
children | b97628fca317 |
line wrap: on
line source
#include "task_base.h" #include "task_object.h" SchedDefineTask1(State41, state41); static int state41(SchedTask *smanager, void *rbuf, void *wbuf) { int enemy_part2_f = (int)smanager->get_param(1); int rand = (int)smanager->get_param(6); int length; CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); CHARACTER *kyeenemyno = (CHARACTER*)smanager->get_input(rbuf, 1); int rinkf1 = *(int*)smanager->get_input(rbuf, 2); if (enemy_part2_f == FALSE) { CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); // Bom(p->x, p->y); p->f = FALSE; p->collision_task = true; *q = *p; return 0; } p->x = kyeenemyno->x - 20 - 7; p->y = kyeenemyno->y + 28 + 15; if ((rinkf1 == 8) && (p->dt1 % 3 == 1)) { if ((p->dt2 < 16)) { length = 1; smanager->set_outputSize(1, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); smanager->setup_outputData(); ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 1); sprite->flag = true; sprite->length = length; p->dt2++; DefSprite(77, p->dt2, 16, 480, &sprite->data[0]); /*左腕アップアーム砲 */ } else { CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); rinkf1 = 9; *q = *p; return 0; } } if (rinkf1 == 9) { if (p->dt1 % 15 == 1) { length = 1; smanager->set_outputSize(1, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); smanager->setup_outputData(); ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 1); sprite->flag = true; sprite->length = length; Puttama(9 + rand % 2, p->x, p->y, &sprite->data[0]); } } if (rinkf1 == 10) { if (p->dt2 != 0) { length = 1; smanager->set_outputSize(1, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); smanager->setup_outputData(); ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 1); sprite->flag = true; sprite->length = length; p->dt2--; DefSprite(77, p->dt2, 16, 480, &sprite->data[0]); } else { CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); p->f = FALSE; p->collision_task = true; *q = *p; return 0; } } CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); p->dt1++; *q = *p; return 0; }