More NPCs

This commit is contained in:
Clownacy 2019-02-09 13:44:19 +00:00
parent 5719c5aabd
commit 3934705d3f
5 changed files with 1634 additions and 19 deletions

View file

@ -281,16 +281,29 @@ void ActNpc275(NPCHAR *npc);
void ActNpc276(NPCHAR *npc);
void ActNpc277(NPCHAR *npc);
void ActNpc278(NPCHAR *npc);
void ActNpc279(NPCHAR *npc);
void ActNpc280(NPCHAR *npc);
void ActNpc281(NPCHAR *npc);
void ActNpc282(NPCHAR *npc);
void ActNpc283(NPCHAR *npc);
void ActNpc284(NPCHAR *npc);
void ActNpc285(NPCHAR *npc);
void ActNpc286(NPCHAR *npc);
void ActNpc287(NPCHAR *npc);
void ActNpc288(NPCHAR *npc);
void ActNpc289(NPCHAR *npc);
void ActNpc290(NPCHAR *npc);
void ActNpc291(NPCHAR *npc);
void ActNpc292(NPCHAR *npc);
void ActNpc293(NPCHAR *npc);
void ActNpc294(NPCHAR *npc);
void ActNpc295(NPCHAR *npc);
void ActNpc296(NPCHAR *npc);
void ActNpc297(NPCHAR *npc);
void ActNpc298(NPCHAR *npc);
void ActNpc299(NPCHAR *npc);
void ActNpc300(NPCHAR *npc);
void ActNpc301(NPCHAR *npc);
void ActNpc302(NPCHAR *npc);
void ActNpc303(NPCHAR *npc);
void ActNpc304(NPCHAR *npc);

View file

@ -2101,3 +2101,105 @@ void ActNpc278(NPCHAR *npc)
break;
}
}
//Falling block (large)
void ActNpc279(NPCHAR *npc)
{
RECT rc[2];
rc[0] = {0, 16, 32, 48};
rc[1] = {16, 0, 32, 16};
switch (npc->act_no)
{
case 0:
switch (npc->direct)
{
case 0:
npc->act_no = 100;
npc->bits |= 4;
npc->ani_no = 0;
break;
case 1:
npc->ani_no = 0;
npc->act_no = 10;
break;
case 2:
npc->act_no = 100;
npc->bits |= 4;
npc->ani_no = 1;
npc->view.back = 0x1000;
npc->view.front = 0x1000;
npc->view.top = 0x1000;
npc->view.bottom = 0x1000;
npc->hit.back = 0x1000;
npc->hit.front = 0x1000;
npc->hit.top = 0x1000;
npc->hit.bottom = 0x1000;
break;
}
if (npc->direct != 1)
break;
// Fallthrough
case 10:
npc->act_no = 11;
npc->act_wait = 16;
// Fallthrough
case 11:
npc->act_wait -= 2;
if (npc->act_wait <= 0)
{
npc->act_no = 100;
npc->bits |= 4;
}
break;
case 100:
npc->ym += 0x40;
if (npc->ym > 0x700)
npc->ym = 0x700;
if (npc->y > 0x10000)
npc->bits &= ~8;
if (npc->flag & 8)
{
npc->ym = -0x200;
npc->act_no = 110;
npc->bits |= 8;
PlaySoundObject(26, 1);
SetQuake(10);
for (int i = 0; i < 4; ++i)
SetNpChar(4, npc->x + (Random(-12, 12) * 0x200), npc->y + 0x2000, Random(-341, 341), Random(-0x600, 0), 0, 0, 0x100);
}
break;
case 110:
npc->ym += 0x40;
if (npc->y > (gMap.length + 2) * 0x2000)
npc->cond = 0;
break;
}
if (gMC.y > npc->y)
npc->damage = 10;
else
npc->damage = 0;
npc->y += npc->ym;
npc->rect = rc[npc->ani_no];
if (npc->act_no == 11)
{
npc->rect.top += npc->act_wait;
npc->rect.bottom -= npc->act_wait;
npc->view.top = (16 - npc->act_wait) * 0x200;
}
}

File diff suppressed because it is too large Load diff

View file

@ -35,6 +35,73 @@ void ActNpc300(NPCHAR *npc)
npc->rect = rc[0];
}
//Fish missile (Misery)
void ActNpc301(NPCHAR *npc)
{
RECT rect[8];
rect[0] = {144, 0, 160, 16};
rect[1] = {160, 0, 176, 16};
rect[2] = {176, 0, 192, 16};
rect[3] = {192, 0, 208, 16};
rect[4] = {144, 16, 160, 32};
rect[5] = {160, 16, 176, 32};
rect[6] = {176, 16, 192, 32};
rect[7] = {192, 16, 208, 32};
int dir;
switch (npc->act_no)
{
case 0:
npc->act_no = 1;
npc->count1 = npc->direct;
// Fallthrough
case 1:
npc->xm = 2 * GetCos(npc->count1);
npc->ym = 2 * GetSin(npc->count1);
npc->y += npc->ym;
npc->x += npc->xm;
dir = GetArktan(npc->x - gMC.x, npc->y - gMC.y);
if (dir < npc->count1)
{
if (npc->count1 - dir < 0x80)
--npc->count1;
else
++npc->count1;
}
else
{
if (dir - npc->count1 < 0x80)
++npc->count1;
else
--npc->count1;
}
if (npc->count1 > 0xFF)
npc->count1 -= 0x100;
if (npc->count1 < 0)
npc->count1 += 0x100;
break;
}
if (++npc->ani_wait > 2)
{
npc->ani_wait = 0;
SetCaret(npc->x, npc->y, 7, 4);
}
npc->ani_no = (npc->count1 + 0x10) / 0x20;
if (npc->ani_no > 7)
npc->ani_no = 7;
npc->rect = rect[npc->ani_no];
}
//Camera focus marker
void ActNpc302(NPCHAR *npc)
{

View file

@ -335,29 +335,29 @@ NPCFUNCTION gpNpcFuncTbl[361] =
ActNpc276,
ActNpc277,
ActNpc278,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
ActNpc279,
ActNpc280,
ActNpc281,
ActNpc282,
ActNpc283,
ActNpc284,
ActNpc285,
ActNpc286,
ActNpc287,
ActNpc288,
ActNpc289,
ActNpc290,
ActNpc291,
ActNpc292,
nullptr,
nullptr,
ActNpc293,
ActNpc294,
ActNpc295,
ActNpc296,
ActNpc297,
ActNpc298,
ActNpc299,
ActNpc300,
nullptr,
ActNpc301,
ActNpc302,
ActNpc303,
ActNpc304,