Added Labyrinth NPCs
This commit is contained in:
parent
916e835b1f
commit
bb78f44a2f
5 changed files with 610 additions and 8 deletions
1
Makefile
1
Makefile
|
@ -77,6 +77,7 @@ SOURCES = \
|
|||
NpcAct100 \
|
||||
NpcAct120 \
|
||||
NpcAct140 \
|
||||
NpcAct160 \
|
||||
NpcAct180 \
|
||||
NpcAct200 \
|
||||
NpcAct260 \
|
||||
|
|
|
@ -159,6 +159,15 @@ void ActNpc153(NPCHAR *npc);
|
|||
void ActNpc154(NPCHAR *npc);
|
||||
void ActNpc155(NPCHAR *npc);
|
||||
void ActNpc156(NPCHAR *npc);
|
||||
void ActNpc157(NPCHAR *npc);
|
||||
|
||||
void ActNpc160(NPCHAR *npc);
|
||||
void ActNpc161(NPCHAR *npc);
|
||||
void ActNpc162(NPCHAR *npc);
|
||||
void ActNpc163(NPCHAR *npc);
|
||||
void ActNpc164(NPCHAR *npc);
|
||||
void ActNpc165(NPCHAR *npc);
|
||||
void ActNpc166(NPCHAR *npc);
|
||||
|
||||
void ActNpc192(NPCHAR *npc);
|
||||
void ActNpc193(NPCHAR *npc);
|
||||
|
|
|
@ -1694,3 +1694,127 @@ void ActNpc156(NPCHAR *npc)
|
|||
npc->cond = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//Moving block (vertical)
|
||||
void ActNpc157(NPCHAR *npc)
|
||||
{
|
||||
switch (npc->act_no)
|
||||
{
|
||||
case 0:
|
||||
npc->x += 0x1000;
|
||||
npc->y += 0x1000;
|
||||
|
||||
if (npc->direct == 0)
|
||||
npc->act_no = 10;
|
||||
else
|
||||
npc->act_no = 20;
|
||||
|
||||
npc->xm = 0;
|
||||
npc->ym = 0;
|
||||
npc->bits |= 0x40;
|
||||
break;
|
||||
|
||||
case 10:
|
||||
npc->bits &= ~0x80;
|
||||
npc->damage = 0;
|
||||
|
||||
if (gMC.y < npc->y + 0x3200 && gMC.y > npc->y - 0x32000 && gMC.x < npc->x + 0x3200 && gMC.x > npc->x - 0x3200)
|
||||
{
|
||||
npc->act_no = 11;
|
||||
npc->act_wait = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 11:
|
||||
if (++npc->act_wait % 10 == 6)
|
||||
PlaySoundObject(107, 1);
|
||||
|
||||
if (npc->flag & 2)
|
||||
{
|
||||
npc->ym = 0;
|
||||
npc->direct = 2;
|
||||
npc->act_no = 20;
|
||||
SetQuake(10);
|
||||
PlaySoundObject(26, 1);
|
||||
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gMC.flag & 2)
|
||||
{
|
||||
npc->bits |= 0x80;
|
||||
npc->damage = 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
npc->bits &= ~0x80;
|
||||
npc->damage = 0;
|
||||
}
|
||||
|
||||
npc->ym -= 0x20;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 20:
|
||||
npc->bits &= ~0x80;
|
||||
npc->damage = 0;
|
||||
|
||||
if (gMC.y > npc->y - 0x3200 && gMC.y < npc->y + 0x32000 && gMC.x < npc->x + 0x3200 && gMC.x > npc->x - 0x3200)
|
||||
{
|
||||
npc->act_no = 21;
|
||||
npc->act_wait = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 21:
|
||||
if (++npc->act_wait % 10 == 6)
|
||||
PlaySoundObject(107, 1);
|
||||
|
||||
if (npc->flag & 8)
|
||||
{
|
||||
npc->ym = 0;
|
||||
npc->direct = 0;
|
||||
npc->act_no = 10;
|
||||
SetQuake(10);
|
||||
PlaySoundObject(26, 1);
|
||||
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gMC.flag & 8)
|
||||
{
|
||||
npc->bits |= 0x80;
|
||||
npc->damage = 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
npc->bits &= ~0x80;
|
||||
npc->damage = 0;
|
||||
}
|
||||
|
||||
npc->ym += 0x20;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (npc->ym > 0x200)
|
||||
npc->ym = 0x200;
|
||||
if (npc->ym < -0x200)
|
||||
npc->ym = -0x200;
|
||||
|
||||
npc->y += npc->ym;
|
||||
|
||||
RECT rect[1];
|
||||
|
||||
rect[0] = {16, 0, 48, 32};
|
||||
|
||||
npc->rect = rect[0];
|
||||
}
|
||||
|
|
468
src/NpcAct160.cpp
Normal file
468
src/NpcAct160.cpp
Normal file
|
@ -0,0 +1,468 @@
|
|||
#include "WindowsWrapper.h"
|
||||
|
||||
#include "NpcAct.h"
|
||||
|
||||
#include "MyChar.h"
|
||||
#include "NpChar.h"
|
||||
#include "Game.h"
|
||||
#include "Sound.h"
|
||||
#include "Back.h"
|
||||
#include "Triangle.h"
|
||||
#include "Frame.h"
|
||||
|
||||
//Puu Black
|
||||
void ActNpc160(NPCHAR *npc)
|
||||
{
|
||||
switch (npc->act_no)
|
||||
{
|
||||
case 0:
|
||||
npc->bits &= ~1;
|
||||
npc->act_no = 1;
|
||||
// Fallthrough
|
||||
case 1:
|
||||
if (gMC.x > npc->x)
|
||||
npc->direct = 2;
|
||||
else
|
||||
npc->direct = 0;
|
||||
|
||||
npc->ym = 0xA00;
|
||||
|
||||
if (npc->y < 0x10000)
|
||||
{
|
||||
++npc->count1;
|
||||
}
|
||||
else
|
||||
{
|
||||
npc->bits &= ~8;
|
||||
npc->act_no = 2;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 2:
|
||||
npc->ym = 0xA00;
|
||||
|
||||
if (npc->flag & 8)
|
||||
{
|
||||
DeleteNpCharCode(161, 1);
|
||||
|
||||
for (int i = 0; i < 4; ++i)
|
||||
SetNpChar(4, npc->x + (Random(-12, 12) * 0x200), npc->y + (Random(-12, 12) * 0x200), Random(-341, 341), Random(-0x600, 0), 0, 0, 0x100);
|
||||
|
||||
npc->act_no = 3;
|
||||
npc->act_wait = 0;
|
||||
SetQuake(30);
|
||||
PlaySoundObject(26, 1);
|
||||
PlaySoundObject(72, 1);
|
||||
}
|
||||
|
||||
if (gMC.y > npc->y && gMC.flag & 8)
|
||||
npc->damage = 20;
|
||||
else
|
||||
npc->damage = 0;
|
||||
|
||||
break;
|
||||
|
||||
case 3:
|
||||
npc->damage = 20;
|
||||
npc->damage = 0; // Smart code
|
||||
|
||||
if (++npc->act_wait > 24)
|
||||
{
|
||||
npc->act_no = 4;
|
||||
npc->count1 = 0;
|
||||
npc->count2 = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 4:
|
||||
gSuperXpos = npc->x;
|
||||
gSuperYpos = npc->y;
|
||||
|
||||
if (npc->shock % 2 == 1)
|
||||
{
|
||||
SetNpChar(161, npc->x + (Random(-12, 12) * 0x200), npc->y + (Random(-12, 12) * 0x200), Random(-0x600, 0x600), Random(-0x600, 0x600), 0, 0, 0x100);
|
||||
|
||||
if (++npc->count1 > 30)
|
||||
{
|
||||
npc->count1 = 0;
|
||||
npc->act_no = 5;
|
||||
npc->ym = -0xC00;
|
||||
npc->bits |= 8;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 5:
|
||||
gSuperXpos = npc->x;
|
||||
gSuperYpos = npc->y;
|
||||
|
||||
if (++npc->count1 > 60)
|
||||
{
|
||||
npc->count1 = 0;
|
||||
npc->act_no = 6;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 6:
|
||||
gSuperXpos = gMC.x;
|
||||
gSuperYpos = 0x320000;
|
||||
|
||||
if (++npc->count1 > 110)
|
||||
{
|
||||
npc->count1 = 10;
|
||||
npc->x = gMC.x;
|
||||
npc->y = 0;
|
||||
npc->ym = 0x5FF;
|
||||
npc->act_no = 1;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
npc->y += npc->ym;
|
||||
|
||||
switch (npc->act_no)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
npc->ani_no = 3;
|
||||
break;
|
||||
case 2:
|
||||
npc->ani_no = 3;
|
||||
break;
|
||||
case 3:
|
||||
npc->ani_no = 2;
|
||||
break;
|
||||
case 4:
|
||||
npc->ani_no = 0;
|
||||
break;
|
||||
case 5:
|
||||
npc->ani_no = 3;
|
||||
break;
|
||||
case 6:
|
||||
npc->ani_no = 3;
|
||||
break;
|
||||
}
|
||||
|
||||
RECT rect_left[4];
|
||||
RECT rect_right[4];
|
||||
|
||||
rect_left[0] = {0, 0, 40, 24};
|
||||
rect_left[1] = {40, 0, 80, 24};
|
||||
rect_left[2] = {80, 0, 120, 24};
|
||||
rect_left[3] = {120, 0, 160, 24};
|
||||
|
||||
rect_right[0] = {0, 24, 40, 48};
|
||||
rect_right[1] = {40, 24, 80, 48};
|
||||
rect_right[2] = {80, 24, 120, 48};
|
||||
rect_right[3] = {120, 24, 160, 48};
|
||||
|
||||
if (npc->direct == 0)
|
||||
npc->rect = rect_left[npc->ani_no];
|
||||
else
|
||||
npc->rect = rect_right[npc->ani_no];
|
||||
}
|
||||
|
||||
//Puu Black projectile
|
||||
void ActNpc161(NPCHAR *npc)
|
||||
{
|
||||
RECT rect[3];
|
||||
|
||||
npc->exp = 0;
|
||||
|
||||
if (gSuperXpos > npc->x)
|
||||
npc->xm += 0x40;
|
||||
else
|
||||
npc->xm -= 0x40;
|
||||
|
||||
if (gSuperYpos > npc->y)
|
||||
npc->ym += 0x40;
|
||||
else
|
||||
npc->ym -= 0x40;
|
||||
|
||||
if (npc->xm < -4605)
|
||||
npc->xm = -4605;
|
||||
if (npc->xm > 4605)
|
||||
npc->xm = 4605;
|
||||
|
||||
if (npc->ym < -4605)
|
||||
npc->ym = -4605;
|
||||
if (npc->ym > 4605)
|
||||
npc->ym = 4605;
|
||||
|
||||
if (npc->life < 100)
|
||||
{
|
||||
npc->bits &= ~0x20;
|
||||
npc->bits &= ~4;
|
||||
npc->damage = 0;
|
||||
npc->ani_no = 2;
|
||||
}
|
||||
|
||||
npc->x += npc->xm;
|
||||
npc->y += npc->ym;
|
||||
|
||||
if (npc->ani_no < 2)
|
||||
{
|
||||
if (Random(0, 10) == 2)
|
||||
npc->ani_no = 0;
|
||||
else
|
||||
npc->ani_no = 1;
|
||||
}
|
||||
|
||||
rect[0] = {0, 48, 16, 64};
|
||||
rect[1] = {16, 48, 32, 64};
|
||||
rect[2] = {32, 48, 48, 64};
|
||||
|
||||
npc->rect = rect[npc->ani_no];
|
||||
}
|
||||
|
||||
//Puu Black (dead)
|
||||
void ActNpc162(NPCHAR *npc)
|
||||
{
|
||||
RECT rect_left = {40, 0, 80, 24};
|
||||
RECT rect_right = {40, 24, 80, 48};
|
||||
RECT rect_end = {0, 0, 0, 0};
|
||||
|
||||
switch (npc->act_no)
|
||||
{
|
||||
case 0:
|
||||
DeleteNpCharCode(161, 1);
|
||||
PlaySoundObject(72, 1);
|
||||
|
||||
for (int i = 0; i < 10; ++i)
|
||||
SetNpChar(4, npc->x + (Random(-12, 12) * 0x200), npc->y + (Random(-12, 12) * 0x200), Random(-0x600, 0x600), Random(-0x600, 0x600), 0, 0, 0x100);
|
||||
|
||||
if (gMC.x < npc->x)
|
||||
npc->direct = 0;
|
||||
else
|
||||
npc->direct = 2;
|
||||
|
||||
if (npc->direct == 0)
|
||||
npc->rect = rect_left;
|
||||
else
|
||||
npc->rect = rect_right;
|
||||
|
||||
npc->count1 = 0;
|
||||
npc->act_no = 1;
|
||||
// Fallthrough
|
||||
case 1:
|
||||
if (++npc->count1 % 4 == 0)
|
||||
SetNpChar(161, npc->x + (Random(-12, 12) * 0x200), npc->y + (Random(-12, 12) * 0x200), 0, 0, 0, 0, 0x100);
|
||||
|
||||
if (npc->count1 > 160)
|
||||
{
|
||||
npc->count1 = 0;
|
||||
npc->act_no = 2;
|
||||
npc->tgt_y = npc->y;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 2:
|
||||
SetQuake(2);
|
||||
|
||||
if (++npc->count1 > 240)
|
||||
{
|
||||
npc->rect = rect_end;
|
||||
|
||||
npc->count1 = 0;
|
||||
npc->act_no = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (npc->direct == 0)
|
||||
npc->rect = rect_left;
|
||||
else
|
||||
npc->rect = rect_right;
|
||||
|
||||
npc->rect.top += npc->count1 / 8;
|
||||
npc->y = npc->tgt_y + ((npc->count1 / 8) * 0x200);
|
||||
npc->rect.left -= (npc->count1 / 2) % 2;
|
||||
}
|
||||
|
||||
if (npc->count1 % 3 == 2)
|
||||
SetNpChar(161, npc->x + (Random(-12, 12) * 0x200), npc->y - 0x1800, Random(-0x200, 0x200), 0x100, 0, 0, 0x100);
|
||||
|
||||
if (npc->count1 % 4 == 2)
|
||||
PlaySoundObject(21, 1);
|
||||
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (++npc->count1 >= 60)
|
||||
{
|
||||
DeleteNpCharCode(161, 1);
|
||||
npc->cond = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
gSuperXpos = npc->x;
|
||||
gSuperYpos = -0x7D000;
|
||||
}
|
||||
|
||||
//Dr Gero
|
||||
void ActNpc163(NPCHAR *npc)
|
||||
{
|
||||
RECT rcLeft[2];
|
||||
RECT rcRight[2];
|
||||
|
||||
rcLeft[0] = {192, 0, 208, 16};
|
||||
rcLeft[1] = {208, 0, 224, 16};
|
||||
|
||||
rcRight[0] = {192, 16, 208, 32};
|
||||
rcRight[1] = {208, 16, 224, 32};
|
||||
|
||||
switch (npc->act_no)
|
||||
{
|
||||
case 0:
|
||||
npc->act_no = 1;
|
||||
npc->ani_no = 0;
|
||||
npc->ani_wait = 0;
|
||||
// Fallthrough
|
||||
case 1:
|
||||
if (Random(0, 120) == 10)
|
||||
{
|
||||
npc->act_no = 2;
|
||||
npc->act_wait = 0;
|
||||
npc->ani_no = 1;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (++npc->act_wait > 8)
|
||||
{
|
||||
npc->act_no = 1;
|
||||
npc->ani_no = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (npc->direct == 0)
|
||||
npc->rect = rcLeft[npc->ani_no];
|
||||
else
|
||||
npc->rect = rcRight[npc->ani_no];
|
||||
}
|
||||
|
||||
//Nurse Hasumi
|
||||
void ActNpc164(NPCHAR *npc)
|
||||
{
|
||||
RECT rcLeft[2];
|
||||
RECT rcRight[2];
|
||||
|
||||
rcLeft[0] = {224, 0, 240, 16};
|
||||
rcLeft[1] = {240, 0, 256, 16};
|
||||
|
||||
rcRight[0] = {224, 16, 240, 32};
|
||||
rcRight[1] = {240, 16, 256, 32};
|
||||
|
||||
switch (npc->act_no)
|
||||
{
|
||||
case 0:
|
||||
npc->act_no = 1;
|
||||
npc->ani_no = 0;
|
||||
npc->ani_wait = 0;
|
||||
// Fallthrough
|
||||
case 1:
|
||||
if (Random(0, 120) == 10)
|
||||
{
|
||||
npc->act_no = 2;
|
||||
npc->act_wait = 0;
|
||||
npc->ani_no = 1;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (++npc->act_wait > 8)
|
||||
{
|
||||
npc->act_no = 1;
|
||||
npc->ani_no = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (npc->direct == 0)
|
||||
npc->rect = rcLeft[npc->ani_no];
|
||||
else
|
||||
npc->rect = rcRight[npc->ani_no];
|
||||
}
|
||||
|
||||
//Curly (collapsed)
|
||||
void ActNpc165(NPCHAR *npc)
|
||||
{
|
||||
RECT rcRight[2];
|
||||
RECT rcLeft[1];
|
||||
|
||||
rcRight[0] = {192, 96, 208, 112};
|
||||
rcRight[1] = {208, 96, 224, 112};
|
||||
|
||||
rcLeft[0] = {144, 96, 160, 112};
|
||||
|
||||
switch (npc->act_no)
|
||||
{
|
||||
case 0:
|
||||
npc->act_no = 1;
|
||||
npc->y += 0x1400;
|
||||
// Fallthrough
|
||||
case 1:
|
||||
if (npc->direct == 2 && gMC.x > npc->x - 0x4000 && gMC.x < npc->x + 0x4000 && gMC.y > npc->y - 0x2000 && gMC.y < npc->y + 0x2000)
|
||||
npc->ani_no = 1;
|
||||
else
|
||||
npc->ani_no = 0;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (npc->direct == 0)
|
||||
npc->rect = rcLeft[0];
|
||||
else
|
||||
npc->rect = rcRight[npc->ani_no];
|
||||
}
|
||||
|
||||
//Chaba
|
||||
void ActNpc166(NPCHAR *npc)
|
||||
{
|
||||
RECT rcLeft[2];
|
||||
|
||||
rcLeft[0] = {144, 104, 184, 128};
|
||||
rcLeft[1] = {184, 104, 224, 128};
|
||||
|
||||
switch (npc->act_no)
|
||||
{
|
||||
case 0:
|
||||
npc->act_no = 1;
|
||||
npc->ani_no = 0;
|
||||
npc->ani_wait = 0;
|
||||
// Fallthrough
|
||||
case 1:
|
||||
if (Random(0, 120) == 10)
|
||||
{
|
||||
npc->act_no = 2;
|
||||
npc->act_wait = 0;
|
||||
npc->ani_no = 1;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (++npc->act_wait > 8 )
|
||||
{
|
||||
npc->act_no = 1;
|
||||
npc->ani_no = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
npc->rect = rcLeft[npc->ani_no];
|
||||
}
|
|
@ -213,16 +213,16 @@ NPCFUNCTION gpNpcFuncTbl[361] =
|
|||
ActNpc154,
|
||||
ActNpc155,
|
||||
ActNpc156,
|
||||
ActNpc157,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
ActNpc160,
|
||||
ActNpc161,
|
||||
ActNpc162,
|
||||
ActNpc163,
|
||||
ActNpc164,
|
||||
ActNpc165,
|
||||
ActNpc166,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
|
Loading…
Add table
Reference in a new issue