ref: 5719c5aabdbbb06874a86d22f5d59b29da7b948f
dir: /src/NpcAct320.cpp/
#include "WindowsWrapper.h"
#include "NpcAct.h"
#include "MyChar.h"
#include "NpChar.h"
#include "Game.h"
#include "Sound.h"
#include "Back.h"
#include "Triangle.h"
//Sweat
void ActNpc334(NPCHAR *npc)
{
RECT rcLeft[2];
RECT rcRight[2];
rcLeft[0] = {160, 184, 168, 200};
rcLeft[1] = {168, 184, 176, 200};
rcRight[0] = {176, 184, 184, 200};
rcRight[1] = {184, 184, 192, 200};
switch (npc->act_no)
{
case 0:
npc->act_no = 10;
if (npc->direct == 0)
{
npc->x += 0x1400;
npc->y -= 0x2400;
}
else
{
npc->x = gMC.x - 0x1400;
npc->y = gMC.y - 0x400;
}
// Fallthrough
case 10:
if (++npc->act_wait / 8 & 1)
npc->ani_no = 0;
else
npc->ani_no = 1;
if (npc->act_wait >= 64)
npc->cond = 0;
break;
}
if (npc->direct == 0)
npc->rect = rcLeft[npc->ani_no];
else
npc->rect = rcRight[npc->ani_no];
}
//Ikachan
void ActNpc335(NPCHAR *npc)
{
RECT rc[3];
rc[0] = {0, 16, 16, 32};
rc[1] = {16, 16, 32, 32};
rc[2] = {32, 16, 48, 32};
switch (npc->act_no)
{
case 0:
npc->act_no = 1;
npc->act_wait = Random(3, 20);
// Fallthrough
case 1:
if (--npc->act_wait <= 0)
{
npc->act_no = 2;
npc->act_wait = Random(10, 50);
npc->ani_no = 1;
npc->xm = 0x600;
}
break;
case 2:
if (--npc->act_wait <= 0)
{
npc->act_no = 3;
npc->act_wait = Random(40, 50);
npc->ani_no = 2;
npc->ym = Random(-0x100, 0x100);
}
break;
case 3:
if (--npc->act_wait <= 0)
{
npc->act_no = 1;
npc->act_wait = 0;
npc->ani_no = 0;
}
break;
}
npc->xm -= 0x10;
npc->x += npc->xm;
npc->y += npc->ym;
npc->rect = rc[npc->ani_no];
}
//Ikachan generator
void ActNpc336(NPCHAR *npc)
{
switch (npc->act_no)
{
case 0:
if (gMC.shock)
npc->cond = 0;
break;
case 10:
if (++npc->act_wait % 4 == 1 )
SetNpChar(335, npc->x, npc->y + (Random(0, 13) * 0x2000), 0, 0, 0, 0, 0);
break;
}
}
//Numhachi
void ActNpc337(NPCHAR *npc)
{
RECT rcLeft[2];
rcLeft[0] = {256, 112, 288, 152};
rcLeft[1] = {288, 112, 320, 152};
switch (npc->act_no)
{
case 0:
npc->act_no = 1;
npc->y -= 0x1000;
// Fallthrough
case 1:
npc->xm = 0;
npc->act_no = 2;
npc->ani_no = 0;
// Fallthrough
case 2:
if (++npc->ani_wait > 50)
{
npc->ani_wait = 0;
++npc->ani_no;
}
if (npc->ani_no > 1)
npc->ani_no = 0;
break;
}
npc->ym += 0x40;
if (npc->ym > 0x5FF)
npc->ym = 0x5FF;
npc->x += npc->xm;
npc->y += npc->ym;
npc->rect = rcLeft[npc->ani_no];
}