More First Cave objects. Also added opening objects.

This commit is contained in:
Clownacy 2019-01-28 11:37:53 +00:00
parent daa858f09c
commit 1b733b6a1f
6 changed files with 217 additions and 4 deletions

View file

@ -61,6 +61,8 @@ SOURCES = \
NpcAct040 \ NpcAct040 \
NpcAct060 \ NpcAct060 \
NpcAct200 \ NpcAct200 \
NpcAct280 \
NpcAct300 \
NpcAct340 \ NpcAct340 \
NpChar \ NpChar \
NpcHit \ NpcHit \

View file

@ -20,6 +20,8 @@ void ActNpc021(NPCHAR *npc);
void ActNpc022(NPCHAR *npc); void ActNpc022(NPCHAR *npc);
void ActNpc023(NPCHAR *npc); void ActNpc023(NPCHAR *npc);
void ActNpc032(NPCHAR *npc);
void ActNpc039(NPCHAR *npc); void ActNpc039(NPCHAR *npc);
void ActNpc059(NPCHAR *npc); void ActNpc059(NPCHAR *npc);
@ -35,4 +37,8 @@ void ActNpc073(NPCHAR *npc);
void ActNpc211(NPCHAR *npc); void ActNpc211(NPCHAR *npc);
void ActNpc298(NPCHAR *npc);
void ActNpc299(NPCHAR *npc);
void ActNpc300(NPCHAR *npc);
void ActNpc359(NPCHAR *npc); void ActNpc359(NPCHAR *npc);

View file

@ -126,6 +126,26 @@ void ActNpc032(NPCHAR *npc)
npc->rect = rect[npc->ani_no]; npc->rect = rect[npc->ani_no];
} }
//Life capsule
void ActNpc032(NPCHAR *npc)
{
RECT rect[2];
rect[0] = {32, 96, 48, 112};
rect[1] = {48, 96, 64, 112};
if (++npc->ani_wait > 2)
{
npc->ani_wait = 0;
++npc->ani_no;
}
if ( npc->ani_no > 1 )
npc->ani_no = 0;
npc->rect = rect[npc->ani_no];
}
//Save sign //Save sign
void ActNpc039(NPCHAR *npc) void ActNpc039(NPCHAR *npc)
{ {

153
src/NpcAct280.cpp Normal file
View file

@ -0,0 +1,153 @@
#include "WindowsWrapper.h"
#include "NpcAct.h"
#include "MyChar.h"
#include "NpChar.h"
#include "Game.h"
#include "Sound.h"
#include "Back.h"
#include "Triangle.h"
//Doctor (opening)
void ActNpc298(NPCHAR *npc)
{
RECT rc[8];
rc[0] = {72, 128, 88, 160};
rc[1] = {88, 128, 104, 160};
rc[2] = {104, 128, 120, 160};
rc[3] = {72, 128, 88, 160};
rc[4] = {120, 128, 136, 160};
rc[5] = {72, 128, 88, 160};
rc[6] = {104, 160, 120, 192};
rc[7] = {120, 160, 136, 192};
switch (npc->act_no)
{
case 0:
npc->act_no = 1;
npc->y -= 0x1000;
// Fallthrough
case 1:
npc->ani_no = 0;
break;
case 10:
npc->act_no = 11;
npc->ani_no = 0;
npc->ani_wait = 0;
npc->count1 = 0;
// Fallthrough
case 11:
if (++npc->ani_wait > 6)
{
npc->ani_wait = 0;
++npc->ani_no;
}
if (npc->ani_no > 1)
{
npc->ani_no = 0;
if (++npc->count1 > 7)
{
npc->ani_no = 0;
npc->act_no = 1;
}
}
break;
case 20:
npc->act_no = 21;
npc->ani_no = 2;
npc->ani_wait = 0;
// Fallthrough
case 21:
if (++npc->ani_wait > 10)
{
npc->ani_wait = 0;
++npc->ani_no;
}
if ( npc->ani_no > 5 )
npc->ani_no = 2;
npc->x += 0x100;
break;
case 30:
npc->ani_no = 6;
break;
case 40:
npc->act_no = 41;
npc->ani_no = 6;
npc->ani_wait = 0;
npc->count1 = 0;
// Fallthrough
case 41:
if (++npc->ani_wait > 6)
{
npc->ani_wait = 0;
++npc->ani_no;
}
if (npc->ani_no > 7)
{
npc->ani_no = 6;
if (++npc->count1 > 7)
{
npc->ani_no = 6;
npc->act_no = 30;
}
}
break;
}
npc->rect = rc[npc->ani_no];
}
//Balrog/Misery (opening)
void ActNpc299(NPCHAR *npc)
{
RECT rc[2];
rc[0] = {0, 0, 48, 48};
rc[1] = {48, 0, 96, 48};
switch (npc->act_no)
{
case 0:
npc->act_no = 1;
if (npc->direct == 0)
{
npc->ani_no = 1;
npc->act_wait = 25;
npc->y -= 1600;
}
else
{
npc->ani_no = 0;
npc->act_wait = 0;
}
break;
}
if (++npc->act_wait / 50 % 2)
npc->y += 0x40;
else
npc->y -= 0x40;
npc->rect = rc[npc->ani_no];
}

32
src/NpcAct300.cpp Normal file
View file

@ -0,0 +1,32 @@
#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 "Caret.h"
//Demon crown (opening)
void ActNpc300(NPCHAR *npc)
{
RECT rc[1];
rc[0] = {192, 80, 208, 96};
switch (npc->act_no)
{
case 0:
npc->act_no = 1;
npc->y += 0xC00;
break;
}
if (++npc->ani_wait % 8 == 1)
SetCaret(npc->x + (Random(-8, 8) * 0x200), npc->y + 0x1000, 13, 1);
npc->rect = rc[0];
}

View file

@ -86,7 +86,7 @@ NPCFUNCTION gpNpcFuncTbl[361] =
nullptr, nullptr,
nullptr, nullptr,
nullptr, nullptr,
nullptr, ActNpc032,
nullptr, nullptr,
nullptr, nullptr,
nullptr, nullptr,
@ -354,9 +354,9 @@ NPCFUNCTION gpNpcFuncTbl[361] =
nullptr, nullptr,
nullptr, nullptr,
nullptr, nullptr,
nullptr, ActNpc298,
nullptr, ActNpc299,
nullptr, ActNpc300,
nullptr, nullptr,
nullptr, nullptr,
nullptr, nullptr,