diff --git a/Makefile b/Makefile index f266dab4..cd49268d 100644 --- a/Makefile +++ b/Makefile @@ -84,6 +84,7 @@ SOURCES = \ NpcAct260 \ NpcAct280 \ NpcAct300 \ + NpcAct320 \ NpcAct340 \ NpChar \ NpcHit \ diff --git a/src/NpcAct.h b/src/NpcAct.h index 374a988c..b32e8cc8 100644 --- a/src/NpcAct.h +++ b/src/NpcAct.h @@ -197,6 +197,8 @@ void ActNpc300(NPCHAR *npc); void ActNpc302(NPCHAR *npc); +void ActNpc334(NPCHAR *npc); + void ActNpc355(NPCHAR *npc); void ActNpc359(NPCHAR *npc); diff --git a/src/NpcAct320.cpp b/src/NpcAct320.cpp new file mode 100644 index 00000000..345be7fd --- /dev/null +++ b/src/NpcAct320.cpp @@ -0,0 +1,56 @@ +#include "WindowsWrapper.h" + +#include "NpcAct.h" + +#include "MyChar.h" +#include "NpChar.h" +#include "Game.h" +#include "Sound.h" +#include "Back.h" +#include "Triangle.h" + +//Sweat +void ActNpc334(NPCHAR *npc) +{ + RECT rcLeft[2]; + RECT rcRight[2]; + + rcLeft[0] = {160, 184, 168, 200}; + rcLeft[1] = {168, 184, 176, 200}; + + rcRight[0] = {176, 184, 184, 200}; + rcRight[1] = {184, 184, 192, 200}; + + switch (npc->act_no) + { + case 0: + npc->act_no = 10; + + if (npc->direct == 0) + { + npc->x += 0x1400; + npc->y -= 0x2400; + } + else + { + npc->x = gMC.x - 0x1400; + npc->y = gMC.y - 0x400; + } + // Fallthrough + case 1: + if (++npc->act_wait / 8 & 1) + npc->ani_no = 0; + else + npc->ani_no = 1; + + if (npc->act_wait >= 64) + npc->cond = 0; + + break; + } + + if (npc->direct == 0) + npc->rect = rcLeft[npc->ani_no]; + else + npc->rect = rcRight[npc->ani_no]; +} diff --git a/src/NpcTbl.cpp b/src/NpcTbl.cpp index 90b45d6f..db21d811 100644 --- a/src/NpcTbl.cpp +++ b/src/NpcTbl.cpp @@ -390,7 +390,7 @@ NPCFUNCTION gpNpcFuncTbl[361] = nullptr, nullptr, nullptr, - nullptr, + ActNpc334, nullptr, nullptr, nullptr,