More First Cave objects

This commit is contained in:
Clownacy 2019-01-28 11:56:48 +00:00
parent 1b733b6a1f
commit a26f4b4bce
5 changed files with 112 additions and 2 deletions

View file

@ -60,6 +60,7 @@ SOURCES = \
NpcAct020 \
NpcAct040 \
NpcAct060 \
NpcAct100 \
NpcAct200 \
NpcAct280 \
NpcAct300 \

View file

@ -20,8 +20,12 @@ void ActNpc021(NPCHAR *npc);
void ActNpc022(NPCHAR *npc);
void ActNpc023(NPCHAR *npc);
void ActNpc030(NPCHAR *npc);
void ActNpc032(NPCHAR *npc);
void ActNpc037(NPCHAR *npc);
void ActNpc039(NPCHAR *npc);
void ActNpc059(NPCHAR *npc);
@ -35,6 +39,8 @@ void ActNpc065(NPCHAR *npc);
void ActNpc073(NPCHAR *npc);
void ActNpc119(NPCHAR *npc);
void ActNpc211(NPCHAR *npc);
void ActNpc298(NPCHAR *npc);

View file

@ -8,6 +8,7 @@
#include "Sound.h"
#include "Back.h"
#include "Triangle.h"
#include "Caret.h"
//Computer
void ActNpc020(NPCHAR *npc)
@ -107,6 +108,66 @@ void ActNpc023(NPCHAR *npc)
npc->rect = rect[npc->ani_no];
}
//Gunsmith
void ActNpc030(NPCHAR *npc)
{
RECT rc[3];
rc[0] = {48, 0, 64, 16};
rc[1] = {48, 16, 64, 32};
rc[2] = {0, 32, 16, 48};
if (npc->direct != 0)
{
switch (npc->act_no)
{
case 0:
npc->act_no = 1;
npc->y += 0x2000;
npc->ani_no = 2;
break;
}
if (++npc->act_wait > 100)
{
npc->act_wait = 0;
SetCaret(npc->x, npc->y - 0x400, 5, 0);
}
}
else
{
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 = rc[npc->ani_no];
}
//Life capsule
void ActNpc032(NPCHAR *npc)
{
@ -146,6 +207,26 @@ void ActNpc032(NPCHAR *npc)
npc->rect = rect[npc->ani_no];
}
//Signpost
void ActNpc037(NPCHAR *npc)
{
RECT rect[2];
rect[0] = {192, 64, 208, 80};
rect[1] = {208, 64, 224, 80};
if (++npc->ani_wait > 1)
{
npc->ani_wait = 0;
++npc->ani_no;
}
if (npc->ani_no > 1)
npc->ani_no = 0;
npc->rect = rect[npc->ani_no];
}
//Save sign
void ActNpc039(NPCHAR *npc)
{

20
src/NpcAct100.cpp Normal file
View file

@ -0,0 +1,20 @@
#include "WindowsWrapper.h"
#include "NpcAct.h"
#include "MyChar.h"
#include "NpChar.h"
#include "Game.h"
#include "Sound.h"
#include "Back.h"
#include "Triangle.h"
//Table and chair
void ActNpc119(NPCHAR *npc)
{
RECT rc[1];
rc[0] = {248, 184, 272, 200};
npc->rect = rc[0];
}

View file

@ -86,6 +86,8 @@ NPCFUNCTION gpNpcFuncTbl[361] =
nullptr,
nullptr,
nullptr,
ActNpc030,
nullptr,
ActNpc032,
nullptr,
nullptr,
@ -93,7 +95,7 @@ NPCFUNCTION gpNpcFuncTbl[361] =
ActNpc032,
nullptr,
nullptr,
nullptr,
ActNpc037,
nullptr,
ActNpc039,
nullptr,
@ -175,7 +177,7 @@ NPCFUNCTION gpNpcFuncTbl[361] =
nullptr,
nullptr,
nullptr,
nullptr,
ActNpc119,
nullptr,
nullptr,
nullptr,