From db4a56510450dd9308ef4af540be4126c4c14dbf Mon Sep 17 00:00:00 2001 From: cuckydev Date: Wed, 30 Jan 2019 18:53:48 -0500 Subject: [PATCH] Fixed some issues --- src/Caret.cpp | 34 +++++++++++++++++++++++++++++++++- src/NpcHit.cpp | 3 +++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/Caret.cpp b/src/Caret.cpp index 385ab305..83f246da 100644 --- a/src/Caret.cpp +++ b/src/Caret.cpp @@ -182,6 +182,38 @@ void ActCaret09(CARET *crt) crt->rect = {0, 80, 16, 96}; } +void ActCaret10(CARET *crt) +{ + RECT rcLeft[2]; + RECT rcRight[2]; + rcLeft[0] = {0, 0, 56, 16}; + rcLeft[1] = {0, 16, 56, 32}; + rcRight[0] = {0, 96, 56, 112}; + rcRight[1] = {0, 112, 56, 128}; + + ++crt->ani_wait; + + if (crt->direct) + { + if (crt->ani_wait < 20) + crt->y -= 0x200; + if (crt->ani_wait == 80) + crt->cond = 0; + } + else + { + if (crt->ani_wait < 20) + crt->y -= 0x400; + if (crt->ani_wait == 80) + crt->cond = 0; + } + + if (crt->direct) + crt->rect = rcRight[crt->ani_wait / 2 % 2]; + else + crt->rect = rcLeft[crt->ani_wait / 2 % 2]; +} + void ActCaret11(CARET *crt) { if (!crt->act_no) @@ -291,7 +323,7 @@ CARETFUNCTION gpCaretFuncTbl[] = nullptr, //ActCaret07, ActCaret08, ActCaret09, - nullptr, //ActCaret10, + ActCaret10, ActCaret11, nullptr, //ActCaret12, ActCaret13, diff --git a/src/NpcHit.cpp b/src/NpcHit.cpp index bbcf8a4c..01380858 100644 --- a/src/NpcHit.cpp +++ b/src/NpcHit.cpp @@ -505,6 +505,9 @@ void HitNpCharBullet() PlaySoundObject(gNPC[n].hit_voice, 1); gNPC[n].shock = 16; } + + if (gNPC[n].bits & npc_showDamage) + gNPC[n].damage_view -= gBul[b].damage; } else {