Merge branch 'accurate' into portable

This commit is contained in:
Clownacy 2020-04-04 01:49:39 +01:00
commit c2f6ccdeb6
16 changed files with 94 additions and 30 deletions

View file

@ -1,5 +1,7 @@
#include "BossAlmo1.h"
#include <stddef.h>
#include "WindowsWrapper.h"
#include "Boss.h"

View file

@ -1,5 +1,7 @@
#include "BossAlmo2.h"
#include <stddef.h>
#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;

View file

@ -1,5 +1,7 @@
#include "BossBallos.h"
#include <stddef.h>
#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;

View file

@ -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;

View file

@ -1,6 +1,6 @@
#include "BossOhm.h"
#include <string.h>
#include <stddef.h>
#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);
}
}

View file

@ -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)

View file

@ -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;

View file

@ -1,5 +1,7 @@
#include "BossX.h"
#include <stddef.h>
#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);
}

View file

@ -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;

View file

@ -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);
}

View file

@ -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;

View file

@ -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);

View file

@ -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;

View file

@ -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:

View file

@ -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;

View file

@ -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'))