view spe/chara_state602.cc @ 70:cee55c8365e9 default tip

fix
author Kazuma
date Thu, 19 May 2016 18:52:26 +0900
parents c330ded6d728
children f4140672ef9f
line wrap: on
line source

#include "chara_state602.h"
#include "tobject.h"

SchedDefineTask(STATE602);

static int
run(SchedTask *smanager, void *rbuf, void *wbuf)
{
    CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);

    p->dt2++;
    Putenemy(24, p->x + 14, p->y + 14,
	     (rand() % 5 + 0.5) * (rand() % 2 == 1 ? -1 : 1),
	     (rand() % 5 + 0.5) * (rand() % 2 == 1 ? -1 : 1),
	     chara_state29);
    if (p->dt2 > 1024) {
	p->task = STATE600;
	p->dt2 = 0;
    }
    return 0;
}