diff --git a/src/NpcAct.h b/src/NpcAct.h index c7471e21..7b05fa08 100644 --- a/src/NpcAct.h +++ b/src/NpcAct.h @@ -86,7 +86,7 @@ void ActNpc090(NPCHAR *npc); void ActNpc091(NPCHAR *npc); void ActNpc092(NPCHAR *npc); void ActNpc093(NPCHAR *npc); - +void ActNpc094(NPCHAR *npc); void ActNpc095(NPCHAR *npc); void ActNpc096(NPCHAR *npc); void ActNpc097(NPCHAR *npc); diff --git a/src/NpcAct080.cpp b/src/NpcAct080.cpp index 3a608faf..6bd867f8 100644 --- a/src/NpcAct080.cpp +++ b/src/NpcAct080.cpp @@ -1401,6 +1401,155 @@ void ActNpc093(NPCHAR *npc) npc->rect = rcRight[npc->ani_no]; } +//Kulala +void ActNpc094(NPCHAR *npc) +{ + RECT rect[5]; + + rect[0] = {272, 0, 320, 24}; + rect[1] = {272, 24, 320, 48}; + rect[2] = {272, 48, 320, 72}; + rect[3] = {272, 72, 320, 96}; + rect[4] = {272, 96, 320, 120}; + + switch (npc->act_no) + { + case 0: + npc->ani_no = 4; + + if (npc->shock) + { + npc->ani_no = 0; + npc->act_no = 10; + npc->act_wait = 0; + } + + break; + + case 10: + npc->bits |= 0x20; + npc->bits &= ~4; + + if (++npc->act_wait > 40) + { + npc->act_wait = 0; + npc->ani_wait = 0; + npc->act_no = 11; + } + + break; + + case 11: + if (++npc->ani_wait > 5) + { + npc->ani_wait = 0; + ++npc->ani_no; + } + + if (npc->ani_no > 2) + { + npc->act_no = 12; + npc->ani_no = 3; + } + + break; + + case 12: + npc->ym = -0x155; + + if (++npc->act_wait > 20) + { + npc->act_wait = 0; + npc->act_no = 10; + npc->ani_no = 0; + } + + break; + + case 20: + npc->xm /= 2; + npc->ym += 0x20; + + if (npc->shock == 0) + { + npc->act_wait = 30; + npc->act_no = 10; + npc->ani_no = 0; + } + + break; + } + + if (npc->shock) + { + if (++npc->count2 > 12) + { + npc->act_no = 20; + npc->ani_no = 4; + npc->bits &= ~0x20; + npc->bits |= 4; + } + } + else + { + npc->count2 = 0; + } + + if (npc->act_no >= 10) + { + if (npc->flag & 1) + { + npc->count1 = 50; + npc->direct = 2; + } + + if (npc->flag & 4) + { + npc->count1 = 50; + npc->direct = 0; + } + + if (npc->count1) + { + --npc->count1; + + if (npc->direct == 0) + npc->xm -= 0x80; + else + npc->xm += 0x80; + } + else + { + npc->count1 = 50; + + if (gMC.x < npc->x) + npc->direct = 0; + else + npc->direct = 2; + } + + npc->ym += 0x10; + + if (npc->flag & 8) + npc->ym = -0x400; + } + + if (npc->xm > 0x100) + npc->xm = 0x100; + if (npc->xm < -0x100) + npc->xm = -0x100; + + if (npc->ym > 0x300) + npc->ym = 0x300; + if (npc->ym < -0x300) + npc->ym = -0x300; + + npc->x += npc->xm; + npc->y += npc->ym; + + npc->rect = rect[npc->ani_no]; +} + //Jelly void ActNpc095(NPCHAR *npc) { diff --git a/src/NpcTbl.cpp b/src/NpcTbl.cpp index 9c5b1bc3..761602b0 100644 --- a/src/NpcTbl.cpp +++ b/src/NpcTbl.cpp @@ -150,7 +150,7 @@ NPCFUNCTION gpNpcFuncTbl[361] = ActNpc091, ActNpc092, ActNpc093, - nullptr, + ActNpc094, ActNpc095, ActNpc096, ActNpc097, diff --git a/src/TextScr.cpp b/src/TextScr.cpp index 5b0ae388..a7273654 100644 --- a/src/TextScr.cpp +++ b/src/TextScr.cpp @@ -899,7 +899,7 @@ int TextScriptProc() else gTS.p_read += 13; } - else if (IS_COMMAND('E','C','J')) + else if (IS_COMMAND('N','C','J')) { x = GetTextScriptNo(gTS.p_read + 4); z = GetTextScriptNo(gTS.p_read + 9);