ref: f9a4ea9ed4d03e05824f03032225cd5179aea276
parent: 99474e4aefae152c231b9aa6d9888d8706147141
author: Clownacy <Clownacy@users.noreply.github.com>
date: Sun Feb 17 21:39:38 EST 2019
Fixed an inaccuracy in NPC002 (Behemoth) Was missing some calls for the sound effects, screen rumble, and smoke NPC
--- a/src/NpcAct000.cpp
+++ b/src/NpcAct000.cpp
@@ -214,14 +214,14 @@
rcLeft[5] = {128, 0, 160, 24};
rcLeft[6] = {160, 0, 192, 24};
- RECT rcUp[7];
- rcUp[0] = {32, 24, 64, 48};
- rcUp[1] = {0, 24, 32, 48};
- rcUp[2] = {32, 24, 64, 48};
- rcUp[3] = {64, 24, 96, 48};
- rcUp[4] = {96, 24, 128, 48};
- rcUp[5] = {128, 24, 160, 48};
- rcUp[6] = {160, 24, 192, 48};
+ RECT rcRight[7];
+ rcRight[0] = {32, 24, 64, 48};
+ rcRight[1] = {0, 24, 32, 48};
+ rcRight[2] = {32, 24, 64, 48};
+ rcRight[3] = {64, 24, 96, 48};
+ rcRight[4] = {96, 24, 128, 48};
+ rcRight[5] = {128, 24, 160, 48};
+ rcRight[6] = {160, 24, 192, 48};
//Turn when touching a wall
if (npc->flag & 1)
@@ -231,6 +231,28 @@
switch (npc->act_no)
{
+ case 0: //Walking
+ if (npc->direct)
+ npc->xm = 0x100;
+ else
+ npc->xm = -0x100;
+
+ if (++npc->ani_wait > 8)
+ {
+ npc->ani_wait = 0;
+ ++npc->ani_no;
+ }
+
+ if (npc->ani_no > 3)
+ npc->ani_no = 0;
+
+ if (npc->shock)
+ {
+ npc->count1 = 0;
+ npc->act_no = 1;
+ npc->ani_no = 4;
+ }
+ break;
case 1: //Shot
npc->xm = 7 * npc->xm / 8;
@@ -270,29 +292,12 @@
}
if (npc->ani_no > 6)
- npc->ani_no = 5;
- break;
- case 0: //Walking
- if (npc->direct)
- npc->xm = 0x100;
- else
- npc->xm = -0x100;
-
- if (++npc->ani_wait > 8)
{
- npc->ani_wait = 0;
- ++npc->ani_no;
+ npc->ani_no = 5;
+ PlaySoundObject(26, 1);
+ SetNpChar(4, npc->x, npc->y + 0x600, 0, 0, 0, 0, 0x100);
+ SetQuake(8);
}
-
- if (npc->ani_no > 3)
- npc->ani_no = 0;
-
- if (npc->shock)
- {
- npc->count1 = 0;
- npc->act_no = 1;
- npc->ani_no = 4;
- }
break;
}
@@ -306,10 +311,10 @@
npc->y += npc->ym;
//Set framerect
- if (npc->direct)
- npc->rect = rcUp[npc->ani_no];
- else
+ if (npc->direct == 0)
npc->rect = rcLeft[npc->ani_no];
+ else
+ npc->rect = rcRight[npc->ani_no];
}
//Dead enemy (make sure damage shown doesn't teleport to a new loaded npc)