diff --git a/src/BossAlmo1.cpp b/src/BossAlmo1.cpp index 06f5a407..0204779a 100644 --- a/src/BossAlmo1.cpp +++ b/src/BossAlmo1.cpp @@ -1,5 +1,7 @@ #include "BossAlmo1.h" +#include + #include "WindowsWrapper.h" #include "Boss.h" diff --git a/src/BossAlmo2.cpp b/src/BossAlmo2.cpp index 266b5540..3d8b2591 100644 --- a/src/BossAlmo2.cpp +++ b/src/BossAlmo2.cpp @@ -1,5 +1,7 @@ #include "BossAlmo2.h" +#include + #include "WindowsWrapper.h" #include "Boss.h" @@ -610,7 +612,7 @@ void ActBossChar_Undead(void) for (i = 0; i < 100; ++i) SetNpChar(4, npc->x + (Random(-128, 128) * 0x200), npc->y + (Random(-64, 64) * 0x200), Random(-128, 128) * 0x200, Random(-128, 128) * 0x200, 0, NULL, 0); - DeleteNpCharCode(282, 1); + DeleteNpCharCode(282, TRUE); gBoss[11].bits &= ~NPC_SHOOTABLE; for (i = 0; i < 12; ++i) @@ -663,8 +665,8 @@ void ActBossChar_Undead(void) for (i = 0; i < 20; ++i) gBoss[i].cond = 0; - DeleteNpCharCode(158, 1); - DeleteNpCharCode(301, 1); + DeleteNpCharCode(158, TRUE); + DeleteNpCharCode(301, TRUE); } break; diff --git a/src/BossBallos.cpp b/src/BossBallos.cpp index f5d39e43..21d9cd44 100644 --- a/src/BossBallos.cpp +++ b/src/BossBallos.cpp @@ -1,5 +1,7 @@ #include "BossBallos.h" +#include + #include "WindowsWrapper.h" #include "Boss.h" @@ -469,7 +471,7 @@ void ActBossChar_Ballos(void) npc->act_wait = 0; npc->xm = 0; npc->ym = 0; - DeleteNpCharCode(339, 0); + DeleteNpCharCode(339, FALSE); // Fallthrough case 401: npc->y += ((159 * 0x200) - npc->y) / 8; @@ -674,8 +676,8 @@ void ActBossChar_Ballos(void) gBoss[4].cond = 0; gBoss[5].cond = 0; - DeleteNpCharCode(350, 1); - DeleteNpCharCode(348, 1); + DeleteNpCharCode(350, TRUE); + DeleteNpCharCode(348, TRUE); } break; diff --git a/src/BossIronH.cpp b/src/BossIronH.cpp index 816df71c..e1cc4998 100644 --- a/src/BossIronH.cpp +++ b/src/BossIronH.cpp @@ -167,9 +167,9 @@ void ActBossChar_Ironhead(void) for (i = 0; i < 0x20; ++i) SetNpChar(4, npc->x + (Random(-128, 128) * 0x200), npc->y + (Random(-64, 64) * 0x200), Random(-128, 128) * 0x200, Random(-128, 128) * 0x200, 0, NULL, 0x100); - DeleteNpCharCode(197, 1); - DeleteNpCharCode(271, 1); - DeleteNpCharCode(272, 1); + DeleteNpCharCode(197, TRUE); + DeleteNpCharCode(271, TRUE); + DeleteNpCharCode(272, TRUE); // Fallthrough case 1001: npc->tgt_x -= 1 * 0x200; diff --git a/src/BossOhm.cpp b/src/BossOhm.cpp index 577da46a..7530f841 100644 --- a/src/BossOhm.cpp +++ b/src/BossOhm.cpp @@ -1,6 +1,6 @@ #include "BossOhm.h" -#include +#include #include "WindowsWrapper.h" @@ -381,7 +381,7 @@ void ActBossChar_Omega(void) gBoss[0].count1 = 0; } - if (gBoss[0].act_wait < 30 && !(gBoss[0].act_wait % 5)) + if (gBoss[0].act_wait < 30 && gBoss[0].act_wait % 5 == 0) { SetNpChar(48, gBoss[0].x, gBoss[0].y - (16 * 0x200), Random(-341, 341), -0x333, 0, NULL, 0x100); PlaySoundObject(39, 1); @@ -518,6 +518,6 @@ void ActBossChar_Omega(void) gBoss[0].act_wait = 0; gBoss[0].damage = 0; gBoss[5].damage = 0; - DeleteNpCharCode(48, 1); + DeleteNpCharCode(48, TRUE); } } diff --git a/src/BossPress.cpp b/src/BossPress.cpp index c219bad6..63edd596 100644 --- a/src/BossPress.cpp +++ b/src/BossPress.cpp @@ -152,8 +152,8 @@ void ActBossChar_Press(void) npc->act_wait = 0; npc->count1 = 0; - DeleteNpCharCode(325, 1); - DeleteNpCharCode(330, 1); + DeleteNpCharCode(325, TRUE); + DeleteNpCharCode(330, TRUE); // Fallthrough case 501: if (++npc->act_wait % 0x10 == 0) diff --git a/src/BossTwinD.cpp b/src/BossTwinD.cpp index c50d4654..5e9cac15 100644 --- a/src/BossTwinD.cpp +++ b/src/BossTwinD.cpp @@ -524,7 +524,7 @@ void ActBossChar_Twin(void) case 1020: if (++gBoss[0].act_wait > 50) { - DeleteNpCharCode(211, 1); + DeleteNpCharCode(211, TRUE); gBoss[0].cond = 0; gBoss[1].cond = 0; gBoss[2].cond = 0; diff --git a/src/BossX.cpp b/src/BossX.cpp index d107a886..e4829cb7 100644 --- a/src/BossX.cpp +++ b/src/BossX.cpp @@ -1,5 +1,7 @@ #include "BossX.h" +#include + #include "WindowsWrapper.h" #include "Boss.h" @@ -259,7 +261,7 @@ static void ActBossChar03_02(NPCHAR *npc) break; } - SetNpChar(158, npc->x + x, npc->y + y, 0, 0, direct, 0, 0x100); + SetNpChar(158, npc->x + x, npc->y + y, 0, 0, direct, NULL, 0x100); PlaySoundObject(39, 1); npc->act_wait = 120; @@ -858,7 +860,7 @@ void ActBossChar_MonstX(void) for (i = 0; i < 20; ++i) gBoss[i].cond = 0; - DeleteNpCharCode(158, 1); + DeleteNpCharCode(158, TRUE); SetNpChar(159, npc->x, npc->y - (24 * 0x200), 0, 0, 0, NULL, 0); } diff --git a/src/Bullet.cpp b/src/Bullet.cpp index 668ec61f..cf1ae66c 100644 --- a/src/Bullet.cpp +++ b/src/Bullet.cpp @@ -100,53 +100,72 @@ void PutBullet(int fx, int fy) } } -BULLET_TABLE gBulTbl[46] = -{ +BULLET_TABLE gBulTbl[46] = { + // Null {0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0}}, + // Snake {4, 1, 20, 36, 4, 4, 2, 2, {8, 8, 8, 8}}, {6, 1, 23, 36, 4, 4, 2, 2, {8, 8, 8, 8}}, {8, 1, 30, 36, 4, 4, 2, 2, {8, 8, 8, 8}}, + // Polar Star {1, 1, 8, 32, 6, 6, 2, 2, {8, 8, 8, 8}}, {2, 1, 12, 32, 6, 6, 2, 2, {8, 8, 8, 8}}, {4, 1, 16, 32, 6, 6, 2, 2, {8, 8, 8, 8}}, + // Fireball {2, 2, 100, 8, 8, 16, 4, 2, {8, 8, 8, 8}}, {3, 2, 100, 8, 4, 4, 4, 2, {8, 8, 8, 8}}, {3, 2, 100, 8, 4, 4, 4, 2, {8, 8, 8, 8}}, + // Machine Gun {2, 1, 20, 32, 2, 2, 2, 2, {8, 8, 8, 8}}, {4, 1, 20, 32, 2, 2, 2, 2, {8, 8, 8, 8}}, {6, 1, 20, 32, 2, 2, 2, 2, {8, 8, 8, 8}}, + // Missile Launcher {0, 10, 50, 40, 2, 2, 2, 2, {8, 8, 8, 8}}, {0, 10, 70, 40, 4, 4, 4, 4, {8, 8, 8, 8}}, {0, 10, 90, 40, 4, 4, 0, 0, {8, 8, 8, 8}}, + // Missile Launcher explosion {1, 100, 100, 20, 16, 16, 0, 0, {0, 0, 0, 0}}, {1, 100, 100, 20, 16, 16, 0, 0, {0, 0, 0, 0}}, {1, 100, 100, 20, 16, 16, 0, 0, {0, 0, 0, 0}}, + // Bubbler {1, 1, 20, 8, 2, 2, 2, 2, {4, 4, 4, 4}}, {2, 1, 20, 8, 2, 2, 2, 2, {4, 4, 4, 4}}, {2, 1, 20, 8, 4, 4, 4, 4, {4, 4, 4, 4}}, + // Bubbler level 3 thorns {3, 1, 32, 32, 2, 2, 2, 2, {4, 4, 4, 4}}, + // Blade slashes {0, 100, 0, 36, 8, 8, 8, 8, {12, 12, 12, 12}}, + // Falling spike that deals 127 damage {127, 1, 2, 4, 8, 4, 8, 4, {0, 0, 0, 0}}, + // Blade {15, 1, 30, 36, 8, 8, 4, 2, {8, 8, 8, 8}}, {6, 3, 18, 36, 10, 10, 4, 2, {12, 12, 12, 12}}, {1, 100, 30, 36, 6, 6, 4, 4, {12, 12, 12, 12}}, + // Super Missile Launcher {0, 10, 30, 40, 2, 2, 2, 2, {8, 8, 8, 8}}, {0, 10, 40, 40, 4, 4, 4, 4, {8, 8, 8, 8}}, {0, 10, 40, 40, 4, 4, 0, 0, {8, 8, 8, 8}}, + // Super Missile Launcher explosion {2, 100, 100, 20, 12, 12, 0, 0, {0, 0, 0, 0}}, {2, 100, 100, 20, 12, 12, 0, 0, {0, 0, 0, 0}}, {2, 100, 100, 20, 12, 12, 0, 0, {0, 0, 0, 0}}, + // Nemesis {4, 4, 20, 32, 4, 4, 3, 3, {8, 8, 24, 8}}, {4, 2, 20, 32, 2, 2, 2, 2, {8, 8, 24, 8}}, {1, 1, 20, 32, 2, 2, 2, 2, {8, 8, 24, 8}}, + // Spur {4, 4, 30, 64, 6, 6, 3, 3, {8, 8, 8, 8}}, {8, 8, 30, 64, 6, 6, 3, 3, {8, 8, 8, 8}}, {12, 12, 30, 64, 6, 6, 3, 3, {8, 8, 8, 8}}, + // Spur trail {3, 100, 30, 32, 6, 6, 3, 3, {4, 4, 4, 4}}, {6, 100, 30, 32, 6, 6, 3, 3, {4, 4, 4, 4}}, {11, 100, 30, 32, 6, 6, 3, 3, {4, 4, 4, 4}}, + // Curly's Nemesis {4, 4, 20, 32, 4, 4, 3, 3, {8, 8, 24, 8}}, + // Screen-nuke that kills all enemies {0, 4, 4, 4, 0, 0, 0, 0, {0, 0, 0, 0}}, + // Whimsical Star {1, 1, 1, 36, 1, 1, 1, 1, {1, 1, 1, 1}} }; @@ -2258,6 +2277,7 @@ void ActBullet(void) switch (gBul[i].code_bullet) { + // Snake case 1: ActBullet_Frontia1(&gBul[i]); break; @@ -2267,6 +2287,8 @@ void ActBullet(void) case 3: ActBullet_Frontia2(&gBul[i], 3); break; + + // Polar Star case 4: ActBullet_PoleStar(&gBul[i], 1); break; @@ -2276,6 +2298,8 @@ void ActBullet(void) case 6: ActBullet_PoleStar(&gBul[i], 3); break; + + // Fireball case 7: ActBullet_FireBall(&gBul[i], 1); break; @@ -2285,6 +2309,8 @@ void ActBullet(void) case 9: ActBullet_FireBall(&gBul[i], 3); break; + + // Machine Gun case 10: ActBullet_MachineGun(&gBul[i], 1); break; @@ -2294,6 +2320,8 @@ void ActBullet(void) case 12: ActBullet_MachineGun(&gBul[i], 3); break; + + // Missile Launcher case 13: ActBullet_Missile(&gBul[i], 1); break; @@ -2303,6 +2331,8 @@ void ActBullet(void) case 15: ActBullet_Missile(&gBul[i], 3); break; + + // Missile Launcher explosion case 16: ActBullet_Bom(&gBul[i], 1); break; @@ -2312,6 +2342,8 @@ void ActBullet(void) case 18: ActBullet_Bom(&gBul[i], 3); break; + + // Bubbler case 19: ActBullet_Bubblin1(&gBul[i]); break; @@ -2321,15 +2353,23 @@ void ActBullet(void) case 21: ActBullet_Bubblin3(&gBul[i]); break; + + // Bubbler level 3 spines case 22: ActBullet_Spine(&gBul[i]); break; + + // Blade slashes case 23: ActBullet_Edge(&gBul[i]); break; + + // Falling spike that deals 127 damage case 24: ActBullet_Drop(&gBul[i]); break; + + // Blade case 25: ActBullet_Sword1(&gBul[i]); break; @@ -2339,6 +2379,8 @@ void ActBullet(void) case 27: ActBullet_Sword3(&gBul[i]); break; + + // Super Missile Launcher case 28: ActBullet_SuperMissile(&gBul[i], 1); break; @@ -2348,6 +2390,8 @@ void ActBullet(void) case 30: ActBullet_SuperMissile(&gBul[i], 3); break; + + // Super Missile Launcher explosion case 31: ActBullet_SuperBom(&gBul[i], 1); break; @@ -2357,6 +2401,8 @@ void ActBullet(void) case 33: ActBullet_SuperBom(&gBul[i], 3); break; + + // Nemesis case 34: // Identical to case 43 ActBullet_Nemesis(&gBul[i], 1); break; @@ -2366,6 +2412,8 @@ void ActBullet(void) case 36: ActBullet_Nemesis(&gBul[i], 3); break; + + // Spur case 37: ActBullet_Spur(&gBul[i], 1); break; @@ -2375,6 +2423,8 @@ void ActBullet(void) case 39: ActBullet_Spur(&gBul[i], 3); break; + + // Spur trail case 40: ActBullet_SpurTail(&gBul[i], 1); break; @@ -2384,12 +2434,18 @@ void ActBullet(void) case 42: ActBullet_SpurTail(&gBul[i], 3); break; + + // Curly's Nemesis case 43: // Identical to case 34 ActBullet_Nemesis(&gBul[i], 1); break; + + // Screen-nuke that kills all enemies case 44: ActBullet_EnemyClear(&gBul[i]); break; + + // Whimsical Star case 45: ActBullet_Star(&gBul[i]); break; diff --git a/src/NpcAct000.cpp b/src/NpcAct000.cpp index 901e0691..7afc6b01 100644 --- a/src/NpcAct000.cpp +++ b/src/NpcAct000.cpp @@ -1314,8 +1314,8 @@ void ActNpc012(NPCHAR *npc) npc->ani_no = 3; npc->ym = -0x800; npc->bits |= NPC_IGNORE_SOLIDITY; - DeleteNpCharCode(150, 0); - DeleteNpCharCode(117, 0); + DeleteNpCharCode(150, FALSE); + DeleteNpCharCode(117, FALSE); SetNpChar(355, 0, 0, 0, 0, 0, npc, 0x100); SetNpChar(355, 0, 0, 0, 0, 1, npc, 0x100); } diff --git a/src/NpcAct160.cpp b/src/NpcAct160.cpp index a4dc6f80..debee189 100644 --- a/src/NpcAct160.cpp +++ b/src/NpcAct160.cpp @@ -51,7 +51,7 @@ void ActNpc160(NPCHAR *npc) if (npc->flag & 8) { - DeleteNpCharCode(161, 1); + DeleteNpCharCode(161, TRUE); for (i = 0; i < 4; ++i) SetNpChar(4, npc->x + (Random(-12, 12) * 0x200), npc->y + (Random(-12, 12) * 0x200), Random(-341, 341), Random(-0x600, 0), 0, NULL, 0x100); @@ -245,7 +245,7 @@ void ActNpc162(NPCHAR *npc) switch (npc->act_no) { case 0: - DeleteNpCharCode(161, 1); + DeleteNpCharCode(161, TRUE); PlaySoundObject(72, 1); for (i = 0; i < 10; ++i) @@ -315,7 +315,7 @@ void ActNpc162(NPCHAR *npc) if (++npc->count1 < 60) break; - DeleteNpCharCode(161, 1); + DeleteNpCharCode(161, TRUE); npc->cond = 0; break; diff --git a/src/NpcAct240.cpp b/src/NpcAct240.cpp index a92a310e..902f1d8d 100644 --- a/src/NpcAct240.cpp +++ b/src/NpcAct240.cpp @@ -778,7 +778,7 @@ void ActNpc247(NPCHAR *npc) npc->xm = 0; npc->ym = 0; - DeleteNpCharCode(252, 1); + DeleteNpCharCode(252, TRUE); SetNpChar(4, npc->x, npc->y, 0, 0, 0, NULL, 0x100); SetNpChar(4, npc->x, npc->y, 0, 0, 0, NULL, 0x100); diff --git a/src/NpcAct260.cpp b/src/NpcAct260.cpp index fe7e81e2..9285a3af 100644 --- a/src/NpcAct260.cpp +++ b/src/NpcAct260.cpp @@ -1003,7 +1003,7 @@ void ActNpc267(NPCHAR *npc) break; case 500: - DeleteNpCharCode(269, 1); + DeleteNpCharCode(269, TRUE); npc->bits &= ~NPC_SHOOTABLE; npc->ani_no = 4; npc->ym += 0x20; diff --git a/src/NpcAct280.cpp b/src/NpcAct280.cpp index 111902e3..a194993c 100644 --- a/src/NpcAct280.cpp +++ b/src/NpcAct280.cpp @@ -116,7 +116,7 @@ void ActNpc281(NPCHAR *npc) case 21: if (++npc->act_wait > 250) { - DeleteNpCharCode(270, 0); + DeleteNpCharCode(270, FALSE); npc->act_no = 22; } @@ -689,7 +689,7 @@ void ActNpc284(NPCHAR *npc) npc->view.top = 16 * 0x200; npc->view.back = 16 * 0x200; npc->view.front = 16 * 0x200; - DeleteNpCharCode(257, 1); + DeleteNpCharCode(257, TRUE); break; case 20: diff --git a/src/NpcAct300.cpp b/src/NpcAct300.cpp index 3ee8e87e..7e1fe5ae 100644 --- a/src/NpcAct300.cpp +++ b/src/NpcAct300.cpp @@ -1339,7 +1339,7 @@ void ActNpc313(NPCHAR *npc) npc->ani_no = 8; npc->tgt_x = npc->x; npc->damage = 0; - DeleteNpCharCode(315, 1); + DeleteNpCharCode(315, TRUE); // Fallthrough case 501: npc->ym += 0x20; diff --git a/src/TextScr.cpp b/src/TextScr.cpp index a5dae883..ee4c8582 100644 --- a/src/TextScr.cpp +++ b/src/TextScr.cpp @@ -1098,7 +1098,7 @@ int TextScriptProc(void) else if (IS_COMMAND('D','N','A')) { z = GetTextScriptNo(gTS.p_read + 4); - DeleteNpCharCode(z, 1); + DeleteNpCharCode(z, TRUE); gTS.p_read += 8; } else if (IS_COMMAND('B','O','A'))