ref: a26f4b4bce273d36825a3bcf201e0c6cd904de80
parent: 1b733b6a1fcb50d4a45c845dd86dcbbab2a16862
author: Clownacy <[email protected]>
date: Mon Jan 28 06:56:48 EST 2019
More First Cave objects
--- a/Makefile
+++ b/Makefile
@@ -60,6 +60,7 @@
NpcAct020 \
NpcAct040 \
NpcAct060 \
+ NpcAct100 \
NpcAct200 \
NpcAct280 \
NpcAct300 \
--- a/src/NpcAct.h
+++ b/src/NpcAct.h
@@ -20,8 +20,12 @@
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);
@@ -34,6 +38,8 @@
void ActNpc065(NPCHAR *npc);
void ActNpc073(NPCHAR *npc);
+
+void ActNpc119(NPCHAR *npc);
void ActNpc211(NPCHAR *npc);
--- a/src/NpcAct020.cpp
+++ b/src/NpcAct020.cpp
@@ -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 @@
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)
{
@@ -141,6 +202,26 @@
}
if ( npc->ani_no > 1 )
+ npc->ani_no = 0;
+
+ 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];
--- /dev/null
+++ b/src/NpcAct100.cpp
@@ -1,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];
+}
--- a/src/NpcTbl.cpp
+++ b/src/NpcTbl.cpp
@@ -86,6 +86,8 @@
nullptr,
nullptr,
nullptr,
+ ActNpc030,
+ nullptr,
ActNpc032,
nullptr,
nullptr,
@@ -93,8 +95,8 @@
ActNpc032,
nullptr,
nullptr,
+ ActNpc037,
nullptr,
- nullptr,
ActNpc039,
nullptr,
nullptr,
@@ -175,7 +177,7 @@
nullptr,
nullptr,
nullptr,
- nullptr,
+ ActNpc119,
nullptr,
nullptr,
nullptr,