shithub: cstory

Download patch

ref: 3e34136f699d679d217653faf1893621cc986ac8
parent: ce8b5651bc33720a4f34309c81d0b12d7ce5791e
author: Clownacy <Clownacy@users.noreply.github.com>
date: Wed Aug 21 13:59:06 EDT 2019

Overhauled the NPC_flags, and applied them everywhere

No more raw values floating about in the decompiled code.
Been wanting to do this for ages.

--- a/src/Boss.cpp
+++ b/src/Boss.cpp
@@ -50,7 +50,7 @@
 			{
 				a = 0;
 
-				if (gBoss[b].bits & npc_showDamage && gBoss[b].damage_view)
+				if (gBoss[b].bits & NPC_SHOW_DAMAGE && gBoss[b].damage_view)
 				{
 					SetValueView(&gBoss[b].x, &gBoss[b].y, gBoss[b].damage_view);
 					gBoss[b].damage_view = 0;
@@ -100,13 +100,13 @@
 
 			// Check if bullet touches boss
 			bHit = FALSE;
-			if (gBoss[bos].bits & npc_shootable
+			if (gBoss[bos].bits & NPC_SHOOTABLE
 				&& gBoss[bos].x - gBoss[bos].hit.back < gBul[bul].x + gBul[bul].enemyXL
 				&& gBoss[bos].x + gBoss[bos].hit.back > gBul[bul].x - gBul[bul].enemyXL
 				&& gBoss[bos].y - gBoss[bos].hit.top < gBul[bul].y + gBul[bul].enemyYL
 				&& gBoss[bos].y + gBoss[bos].hit.bottom > gBul[bul].y - gBul[bul].enemyYL)
 				bHit = TRUE;
-			else if (gBoss[bos].bits & npc_invulnerable
+			else if (gBoss[bos].bits & NPC_INVULNERABLE
 				&& gBoss[bos].x - gBoss[bos].hit.back < gBul[bul].x + gBul[bul].blockXL
 				&& gBoss[bos].x + gBoss[bos].hit.back > gBul[bul].x - gBul[bul].blockXL
 				&& gBoss[bos].y - gBoss[bos].hit.top < gBul[bul].y + gBul[bul].blockYL
@@ -116,7 +116,7 @@
 			if (bHit)
 			{
 				// Damage boss
-				if (gBoss[bos].bits & npc_shootable)
+				if (gBoss[bos].bits & NPC_SHOOTABLE)
 				{
 					if (gBoss[bos].cond & 0x10)
 						bos_ = 0;
@@ -129,7 +129,7 @@
 					{
 						gBoss[bos_].life = bos_;
 
-						if ((gMC.cond & 0x80) && gBoss[bos_].bits & npc_eventDie)
+						if ((gMC.cond & 0x80) && gBoss[bos_].bits & NPC_EVENT_WHEN_KILLED)
 						{
 							StartTextScript(gBoss[bos_].code_event);
 						}
@@ -282,7 +282,7 @@
 		if ((gBoss[b].cond & 0x80) == 0)
 			continue;
 
-		if (gBoss[b].bits & npc_ignoreSolid)
+		if (gBoss[b].bits & NPC_IGNORE_SOLIDITY)
 			continue;
 
 		if (gBoss[b].size >= 3)
@@ -306,7 +306,7 @@
 			switch (atrb[j])
 			{
 				case 0x44:
-					if (gBoss[b].bits & npc_ignore44)
+					if (gBoss[b].bits & NPC_IGNORE_TILE_44)
 						break;
 					// Fallthrough
 				case 0x05:
--- a/src/BossAlmo1.cpp
+++ b/src/BossAlmo1.cpp
@@ -25,7 +25,7 @@
 		case 10:
 			npc->act_no = 11;
 			npc->ani_no = 2;
-			npc->bits = 8;
+			npc->bits = NPC_IGNORE_SOLIDITY;
 			npc->view.front = 0x4800;
 			npc->view.top = 0x7000;
 			// Fallthrough
@@ -73,7 +73,7 @@
 		case 10:
 			npc->act_no = 11;
 			npc->ani_no = 0;
-			npc->bits = 8;
+			npc->bits = NPC_IGNORE_SOLIDITY;
 			npc->view.front = 0x5800;
 			npc->view.top = 0x7000;
 			// Fallthrough
@@ -125,7 +125,7 @@
 	{
 		case 10:
 			npc->ani_no = 2;
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			break;
 
 		case 100:
@@ -134,7 +134,7 @@
 			npc->act_wait = 0;
 			npc->tgt_x = gBoss[0].x + (Random(-0x80, 0x20) * 0x200);
 			npc->tgt_y = gBoss[0].y + (Random(-0x40, 0x40) * 0x200);
-			npc->bits |= 0x20;
+			npc->bits |= NPC_SHOOTABLE;
 			// Fallthrough
 		case 101:
 			npc->x += (npc->tgt_x - npc->x) / 16;
@@ -255,7 +255,7 @@
 			npc->act_no = 10;
 			npc->exp = 1;
 			npc->cond = 0x80;
-			npc->bits = 0x800C;
+			npc->bits = (NPC_INVULNERABLE | NPC_IGNORE_SOLIDITY | NPC_SHOW_DAMAGE);
 			npc->life = 650;
 			npc->hit_voice = 114;
 			npc->x = 0x9A000;
@@ -263,7 +263,7 @@
 			npc->xm = 0;
 			npc->ym = 0;
 			npc->code_event = 1000;
-			npc->bits |= 0x200;
+			npc->bits |= NPC_EVENT_WHEN_KILLED;
 
 			gBoss[4].cond = 0x80;
 			gBoss[4].act_no = 10;
@@ -272,7 +272,7 @@
 			gBoss[5].act_no = 10;
 
 			gBoss[8].cond = 0x80;
-			gBoss[8].bits = 12;
+			gBoss[8].bits = (NPC_INVULNERABLE | NPC_IGNORE_SOLIDITY);
 			gBoss[8].view.front = 0;
 			gBoss[8].view.top = 0;
 			gBoss[8].hit.back = 0x5000;
@@ -301,7 +301,7 @@
 
 			gBoss[1].cond = 0x80;
 			gBoss[1].act_no = 10;
-			gBoss[1].bits = 44;
+			gBoss[1].bits = (NPC_INVULNERABLE | NPC_IGNORE_SOLIDITY | NPC_SHOOTABLE);
 			gBoss[1].life = 1000;
 			gBoss[1].hit_voice = 54;
 			gBoss[1].hit.back = 0x3000;
@@ -332,7 +332,7 @@
 		case 200:
 			npc->act_no = 201;
 			npc->act_wait = 0;
-			gBoss[11].bits &= ~0x20;
+			gBoss[11].bits &= ~NPC_SHOOTABLE;
 			gSuperYpos = 0;
 			CutNoise();
 			// Fallthrough
@@ -368,7 +368,7 @@
 			npc->act_no = 211;
 			npc->act_wait = 0;
 			npc->count2 = npc->life;
-			gBoss[11].bits |= 0x20;
+			gBoss[11].bits |= NPC_SHOOTABLE;
 			// Fallthrough
 		case 211:
 			npc->tgt_x = gMC.x;
@@ -417,7 +417,7 @@
 			npc->act_no = 221;
 			npc->act_wait = 0;
 			gSuperYpos = 1;
-			gBoss[11].bits |= 0x20u;
+			gBoss[11].bits |= NPC_SHOOTABLE;
 			SetQuake(100);
 			SetNoise(1, 1000);
 			// Fallthrough
@@ -486,7 +486,7 @@
 				SetNpChar(4, npc->x + (Random(-0x80, 0x80) * 0x200), npc->y + (Random(-0x40, 0x40) * 0x200), Random(-0x80, 0x80) * 0x200, Random(-0x80, 0x80) * 0x200, 0, 0, 0x100);
 
 			for (i = 0; i < 12; ++i)
-				gBoss[i].bits &= ~0x24;
+				gBoss[i].bits &= ~(NPC_INVULNERABLE | NPC_SHOOTABLE);
 
 			// Fallthrough
 		case 501:
@@ -514,10 +514,10 @@
 			npc->act_no = 601;
 			gBoss[4].act_no = 50;
 			gBoss[5].act_no = 50;
-			gBoss[8].bits &= ~4;
-			gBoss[9].bits &= ~4;
-			gBoss[10].bits &= ~4;
-			gBoss[11].bits &= ~4;
+			gBoss[8].bits &= ~NPC_INVULNERABLE;
+			gBoss[9].bits &= ~NPC_INVULNERABLE;
+			gBoss[10].bits &= ~NPC_INVULNERABLE;
+			gBoss[11].bits &= ~NPC_INVULNERABLE;
 			// Fallthrough
 		case 601:
 			if (++npc->act_wait / 2 % 2)
--- a/src/BossAlmo2.cpp
+++ b/src/BossAlmo2.cpp
@@ -26,7 +26,7 @@
 		case 10:
 			npc->act_no = 11;
 			npc->ani_no = 2;
-			npc->bits = 8;
+			npc->bits = NPC_IGNORE_SOLIDITY;
 			npc->view.front = 0x4800;
 			npc->view.top = 0x7000;
 			// Fallthrough
@@ -72,7 +72,7 @@
 		case 10:
 			npc->act_no = 11;
 			npc->ani_no = 0;
-			npc->bits = 8;
+			npc->bits = NPC_IGNORE_SOLIDITY;
 			npc->view.front = 0x5800;
 			npc->view.top = 0x7000;
 			// Fallthrough
@@ -165,7 +165,7 @@
 	npc->x = gBoss[0].x - 0x4800;
 	npc->y = gBoss[0].y + 0x800;
 
-	npc->bits = 8;
+	npc->bits = NPC_IGNORE_SOLIDITY;
 
 	npc->rect = rect[npc->ani_no];
 }
@@ -188,12 +188,12 @@
 	switch (npc->act_no)
 	{
 		case 0:
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			break;
 
 		case 5:
 			npc->ani_no = 0;
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			++npc->count2;
 			npc->count2 %= 0x100;
 			break;
@@ -200,7 +200,7 @@
 
 		case 10:
 			npc->ani_no = 0;
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			npc->count2 += 2;
 			npc->count2 %= 0x100;
 			break;
@@ -207,7 +207,7 @@
 
 		case 20:
 			npc->ani_no = 1;
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			npc->count2 += 2;
 			npc->count2 %= 0x100;
 			break;
@@ -214,7 +214,7 @@
 
 		case 30:
 			npc->ani_no = 0;
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			npc->count2 += 4;
 			npc->count2 %= 0x100;
 			break;
@@ -295,7 +295,7 @@
 			npc->act_no = 10;
 			npc->exp = 1;
 			npc->cond = 0x80;
-			npc->bits = 0x800C;
+			npc->bits = (NPC_INVULNERABLE | NPC_IGNORE_SOLIDITY | NPC_SHOW_DAMAGE);
 			npc->life = 700;
 			npc->hit_voice = 114;
 			npc->x = 0x4A000;
@@ -303,7 +303,7 @@
 			npc->xm = 0;
 			npc->ym = 0;
 			npc->code_event = 1000;
-			npc->bits |= 0x200;
+			npc->bits |= NPC_EVENT_WHEN_KILLED;
 
 			gBoss[3].cond = 0x80;
 			gBoss[3].act_no = 0;
@@ -315,7 +315,7 @@
 			gBoss[5].act_no = 10;
 
 			gBoss[8].cond = 0x80;
-			gBoss[8].bits = 8;
+			gBoss[8].bits = NPC_IGNORE_SOLIDITY;
 			gBoss[8].view.front = 0;
 			gBoss[8].view.top = 0;
 			gBoss[8].hit.back = 0x5000;
@@ -344,7 +344,7 @@
 
 			gBoss[1].cond = 0x80;
 			gBoss[1].act_no = 0;
-			gBoss[1].bits = 40;
+			gBoss[1].bits = (NPC_IGNORE_SOLIDITY | NPC_SHOOTABLE);
 			gBoss[1].life = 1000;
 			gBoss[1].hit_voice = 54;
 			gBoss[1].hit.back = 0x3000;
@@ -392,10 +392,10 @@
 			gBoss[3].act_no = 0;
 			gBoss[4].ani_no = 2;
 			gBoss[5].ani_no = 0;
-			gBoss[8].bits &= ~4;
-			gBoss[9].bits &= ~4;
-			gBoss[10].bits &= ~4;
-			gBoss[11].bits &= ~0x20;
+			gBoss[8].bits &= ~NPC_INVULNERABLE;
+			gBoss[9].bits &= ~NPC_INVULNERABLE;
+			gBoss[10].bits &= ~NPC_INVULNERABLE;
+			gBoss[11].bits &= ~NPC_SHOOTABLE;
 			gSuperYpos = 0;
 			CutNoise();
 			bShock = TRUE;
@@ -427,10 +427,10 @@
 			npc->act_no = 211;
 			npc->act_wait = 0;
 			gBoss[3].act_no = 10;
-			gBoss[8].bits |= 4;
-			gBoss[9].bits |= 4;
-			gBoss[10].bits |= 4;
-			gBoss[11].bits |= 0x20;
+			gBoss[8].bits |= NPC_INVULNERABLE;
+			gBoss[9].bits |= NPC_INVULNERABLE;
+			gBoss[10].bits |= NPC_INVULNERABLE;
+			gBoss[11].bits |= NPC_SHOOTABLE;
 			life = npc->life;
 			bShock = TRUE;
 			// Fallthrough
@@ -475,10 +475,10 @@
 			npc->count1 = 0;
 			gSuperYpos = 1;
 			gBoss[3].act_no = 20;
-			gBoss[8].bits |= 4;
-			gBoss[9].bits |= 4;
-			gBoss[10].bits |= 4;
-			gBoss[11].bits |= 0x20;
+			gBoss[8].bits |= NPC_INVULNERABLE;
+			gBoss[9].bits |= NPC_INVULNERABLE;
+			gBoss[10].bits |= NPC_INVULNERABLE;
+			gBoss[11].bits |= NPC_SHOOTABLE;
 			SetQuake(100);
 			life = npc->life;
 			bShock = TRUE;
@@ -533,10 +533,10 @@
 			npc->act_no = 231;
 			npc->act_wait = 0;
 			gBoss[3].act_no = 30;
-			gBoss[8].bits |= 4;
-			gBoss[9].bits |= 4;
-			gBoss[10].bits |= 4;
-			gBoss[11].bits |= 0x20;
+			gBoss[8].bits |= NPC_INVULNERABLE;
+			gBoss[9].bits |= NPC_INVULNERABLE;
+			gBoss[10].bits |= NPC_INVULNERABLE;
+			gBoss[11].bits |= NPC_SHOOTABLE;
 			PlaySoundObject(25, 1);
 			SetNpChar(285, gBoss[3].x - 0x2000, gBoss[3].y, 0, 0, 0, 0, 0x100);
 			SetNpChar(285, gBoss[3].x - 0x2000, gBoss[3].y, 0, 0, 0x400, 0, 0x100);
@@ -595,10 +595,10 @@
 				SetNpChar(4, npc->x + (Random(-0x80, 0x80) * 0x200), npc->y + (Random(-0x40, 0x40) * 0x200), Random(-0x80, 0x80) * 0x200, Random(-0x80, 0x80) * 0x200, 0, 0, 0);
 
 			DeleteNpCharCode(282, 1);
-			gBoss[11].bits &= ~0x20;
+			gBoss[11].bits &= ~NPC_SHOOTABLE;
 
 			for (i = 0; i < 12; ++i)
-				gBoss[i].bits &= ~4;
+				gBoss[i].bits &= ~NPC_INVULNERABLE;
 			// Fallthrough
 		case 501:
 			++npc->act_wait;
--- a/src/BossBallos.cpp
+++ b/src/BossBallos.cpp
@@ -91,9 +91,9 @@
 	if (npc->act_no >= 0 && npc->act_no < 300)
 	{
 		if (npc->ani_no != 3)
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 		else
-			npc->bits |= 0x20;
+			npc->bits |= NPC_SHOOTABLE;
 	}
 
 	if (npc->direct == 0)
@@ -154,7 +154,7 @@
 			npc->hit.top = 0x6000;
 			npc->hit.back = 0x4000;
 			npc->hit.bottom = 0x6000;
-			npc->bits = 0x8248;
+			npc->bits = (NPC_IGNORE_SOLIDITY | NPC_SOLID_HARD | NPC_EVENT_WHEN_KILLED | NPC_SHOW_DAMAGE);
 			npc->size = 3;
 			npc->damage = 0;
 			npc->code_event = 1000;
@@ -163,7 +163,7 @@
 			// Initialize eyes
 			gBoss[1].cond = 0x90;
 			gBoss[1].direct = 0;
-			gBoss[1].bits = 8;
+			gBoss[1].bits = NPC_IGNORE_SOLIDITY;
 			gBoss[1].life = 10000;
 			gBoss[1].view.front = 0x1800;
 			gBoss[1].view.top = 0;
@@ -179,7 +179,7 @@
 
 			// Initialize the body
 			gBoss[3].cond = 0x90;
-			gBoss[3].bits = 0xD;
+			gBoss[3].bits = (NPC_SOLID_SOFT | NPC_INVULNERABLE | NPC_IGNORE_SOLIDITY);
 			gBoss[3].view.front = 0x7800;
 			gBoss[3].view.top = 0x7800;
 			gBoss[3].view.back = 0x7800;
@@ -190,7 +190,7 @@
 			gBoss[3].hit.bottom = 0x4000;
 
 			gBoss[4].cond = 0x90;
-			gBoss[4].bits = 0xD;
+			gBoss[4].bits = (NPC_SOLID_SOFT | NPC_INVULNERABLE | NPC_IGNORE_SOLIDITY);
 			gBoss[4].hit.front = 0x4000;
 			gBoss[4].hit.top = 0x1000;
 			gBoss[4].hit.back = 0x4000;
@@ -197,7 +197,7 @@
 			gBoss[4].hit.bottom = 0x1000;
 
 			gBoss[5].cond = 0x90;
-			gBoss[5].bits = 0x4C;
+			gBoss[5].bits = (NPC_INVULNERABLE | NPC_IGNORE_SOLIDITY | NPC_SOLID_HARD);
 			gBoss[5].hit.front = 0x4000;
 			gBoss[5].hit.top = 0;
 			gBoss[5].hit.back = 0x4000;
@@ -598,13 +598,17 @@
 			gBoss[1].act_no = 300;
 			gBoss[2].act_no = 300;
 
-			gBoss[1].act_no &= ~0x41;
-			gBoss[2].act_no &= ~0x41;
+#ifndef FIX_BUGS
+			// This code makes absolutely no sense.
+			// Luckily, it doesn't cause any bugs.
+			gBoss[1].act_no &= ~(NPC_SOLID_SOFT | NPC_SOLID_HARD);
+			gBoss[2].act_no &= ~(NPC_SOLID_SOFT | NPC_SOLID_HARD);
+#endif
 
-			gBoss[0].bits &= ~0x41;
-			gBoss[3].bits &= ~0x41;
-			gBoss[4].bits &= ~0x41;
-			gBoss[5].bits &= ~0x41;
+			gBoss[0].bits &= ~(NPC_SOLID_SOFT | NPC_SOLID_HARD);
+			gBoss[3].bits &= ~(NPC_SOLID_SOFT | NPC_SOLID_HARD);
+			gBoss[4].bits &= ~(NPC_SOLID_SOFT | NPC_SOLID_HARD);
+			gBoss[5].bits &= ~(NPC_SOLID_SOFT | NPC_SOLID_HARD);
 			// Fallthrough
 		case 1001:
 			++gBoss[0].act_wait;
@@ -646,9 +650,9 @@
 
 	if (npc->act_no > 420 && npc->act_no < 500)
 	{
-		gBoss[3].bits |= 0x20;
-		gBoss[4].bits |= 0x20;
-		gBoss[5].bits |= 0x20;
+		gBoss[3].bits |= NPC_SHOOTABLE;
+		gBoss[4].bits |= NPC_SHOOTABLE;
+		gBoss[5].bits |= NPC_SHOOTABLE;
 
 		if (++npc->act_wait > 300)
 		{
--- a/src/BossFrog.cpp
+++ b/src/BossFrog.cpp
@@ -32,7 +32,7 @@
 			boss->hit.back = 0x2000;
 			boss->hit.bottom = 0x2000;
 			boss->size = 3;
-			boss->bits = 4;
+			boss->bits = NPC_INVULNERABLE;
 			break;
 
 		case 1:
@@ -71,7 +71,7 @@
 			boss->hit.back = 0x3000;
 			boss->hit.bottom = 0x2000;
 			boss->size = 3;
-			boss->bits = 4;
+			boss->bits = NPC_INVULNERABLE;
 			break;
 
 		case 1:
@@ -138,7 +138,7 @@
 			boss->size = 3;
 			boss->exp = 1;
 			boss->code_event = 1000;
-			boss->bits |= 0x8200;
+			boss->bits |= (NPC_EVENT_WHEN_KILLED | NPC_SHOW_DAMAGE);
 			boss->life = 300;
 			break;
 
@@ -282,7 +282,7 @@
 				boss->act_wait = 0;
 				boss->ani_no = 3;
 				boss->count1 = 16;
-				gBoss[1].bits |= 0x20;
+				gBoss[1].bits |= NPC_SHOOTABLE;
 				boss->tgt_x = boss->life;
 			}
 
@@ -332,7 +332,7 @@
 					boss->act_wait = 0;
 					boss->ani_no = 2;
 					boss->ani_wait = 0;
-					gBoss[1].bits &= ~0x20;
+					gBoss[1].bits &= ~NPC_SHOOTABLE;
 				}
 			}
 
@@ -507,7 +507,7 @@
 			{
 				boss->ani_no = 8;
 				boss->ym = -0xA00;
-				boss->bits |= 8;
+				boss->bits |= NPC_IGNORE_SOLIDITY;
 				boss->act_no = 143;
 			}
 
--- a/src/BossIronH.cpp
+++ b/src/BossIronH.cpp
@@ -34,7 +34,7 @@
 			npc->hit.top = 0x1400;
 			npc->hit.back = 0x2000;
 			npc->hit.bottom = 0x1400;
-			npc->bits = 0x8228;
+			npc->bits = (NPC_IGNORE_SOLIDITY | NPC_SHOOTABLE | NPC_EVENT_WHEN_KILLED | NPC_SHOW_DAMAGE);
 			npc->size = 3;
 			npc->damage = 10;
 			npc->code_event = 1000;
@@ -43,7 +43,7 @@
 
 		case 100:
 			npc->act_no = 101;
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			npc->act_wait = 0;
 			// Fallthrough
 		case 101:
@@ -78,7 +78,7 @@
 			npc->ym = Random(-0x200, 0x200);
 			npc->xm = Random(-0x200, 0x200);
 
-			npc->bits |= 0x20;
+			npc->bits |= NPC_SHOOTABLE;
 			// Fallthrough
 		case 251:
 			if (npc->direct == 2)
@@ -148,7 +148,7 @@
 			break;
 
 		case 1000:
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			npc->ani_no = 8;
 			npc->damage = 0;
 			npc->act_no = 1001;
--- a/src/BossOhm.cpp
+++ b/src/BossOhm.cpp
@@ -97,7 +97,7 @@
 	switch (gBoss[5].act_no)
 	{
 		case 0:
-			gBoss[5].bits |= npc_solidSoft | npc_ignoreSolid;
+			gBoss[5].bits |= (NPC_SOLID_SOFT | NPC_IGNORE_SOLIDITY);
 
 			gBoss[5].hit.front = 0x2800;
 			gBoss[5].hit.top = 0x4800;
@@ -136,7 +136,7 @@
 			gBoss[0].hit.back = 0x1000;
 			gBoss[0].hit.bottom = 0x2000;
 
-			gBoss[0].bits = (npc_ignoreSolid | npc_eventDie | npc_showDamage);
+			gBoss[0].bits = (NPC_IGNORE_SOLIDITY | NPC_EVENT_WHEN_KILLED | NPC_SHOW_DAMAGE);
 			gBoss[0].size = 3;
 			gBoss[0].exp = 1;
 			gBoss[0].code_event = 210;
@@ -149,7 +149,7 @@
 			gBoss[1].view.back = 0x1800;
 			gBoss[1].view.bottom = 0x1000;
 
-			gBoss[1].bits = npc_ignoreSolid;
+			gBoss[1].bits = NPC_IGNORE_SOLIDITY;
 
 			gBoss[2] = gBoss[1];
 
@@ -170,7 +170,7 @@
 			gBoss[3].hit.back = 0x1000;
 			gBoss[3].hit.bottom = 0x1000;
 
-			gBoss[3].bits = npc_ignoreSolid;
+			gBoss[3].bits = NPC_IGNORE_SOLIDITY;
 
 			gBoss[3].x = gBoss[0].x - 0x2000;
 			gBoss[3].y = gBoss[0].y;
@@ -205,10 +205,10 @@
 
 				gBoss[0].act_no = 110;
 
-				gBoss[0].bits |= npc_shootable;
-				gBoss[0].bits &= ~npc_ignoreSolid;
-				gBoss[3].bits &= ~npc_ignoreSolid;
-				gBoss[4].bits &= ~npc_ignoreSolid;
+				gBoss[0].bits |= NPC_SHOOTABLE;
+				gBoss[0].bits &= ~NPC_IGNORE_SOLIDITY;
+				gBoss[3].bits &= ~NPC_IGNORE_SOLIDITY;
+				gBoss[4].bits &= ~NPC_IGNORE_SOLIDITY;
 
 				gBoss[3].act_no = 3;
 				gBoss[4].act_no = 3;
@@ -238,7 +238,7 @@
 			{
 				gBoss[0].act_no = 60;
 				gBoss[0].act_wait = 0;
-				gBoss[0].bits |= npc_shootable;
+				gBoss[0].bits |= NPC_SHOOTABLE;
 				gBoss[0].hit.front = 0x2000;
 				gBoss[0].hit.back = 0x2000;
 			}
@@ -281,7 +281,7 @@
 				gBoss[0].act_no = 80;
 				gBoss[0].act_wait = 0;
 
-				gBoss[0].bits &= ~npc_shootable;
+				gBoss[0].bits &= ~NPC_SHOOTABLE;
 
 				gBoss[0].hit.front = 0x3000;
 				gBoss[0].hit.back = 0x3000;
@@ -369,7 +369,7 @@
 			if (!gBoss[0].count2)
 			{
 				gBoss[0].act_no = 140;
-				gBoss[0].bits |= npc_shootable;
+				gBoss[0].bits |= NPC_SHOOTABLE;
 
 				gBoss[0].hit.front = 0x2000;
 				gBoss[0].hit.back = 0x2000;
--- a/src/BossPress.cpp
+++ b/src/BossPress.cpp
@@ -35,7 +35,7 @@
 			npc->hit.top = 0x7800;
 			npc->hit.back = 0x5000;
 			npc->hit.bottom = 0x6000;
-			npc->bits = 0x8248;
+			npc->bits = (NPC_IGNORE_SOLIDITY | NPC_SOLID_HARD | NPC_EVENT_WHEN_KILLED | NPC_SHOW_DAMAGE);
 			npc->size = 3;
 			npc->damage = 10;
 			npc->code_event = 1000;
@@ -61,7 +61,7 @@
 			npc->act_no = 21;
 			npc->x = 0x14000;
 			npc->y = 0x33A00;
-			npc->bits &= ~0x40;
+			npc->bits &= ~NPC_SOLID_HARD;
 			gBoss[1].cond = 0;
 			gBoss[2].cond = 0;
 			// Fallthrough
@@ -107,12 +107,12 @@
 			gBoss[1].hit.back = 0x1C00;
 			gBoss[1].hit.top = 0x1000;
 			gBoss[1].hit.bottom = 0x1000;
-			gBoss[1].bits = 12;
+			gBoss[1].bits = (NPC_INVULNERABLE | NPC_IGNORE_SOLIDITY);
 
 			gBoss[2] = gBoss[1];
 
 			gBoss[3].cond = 0x90;
-			gBoss[3].bits |= 0x20;
+			gBoss[3].bits |= NPC_SHOOTABLE;
 			gBoss[3].hit.front = 0xC00;
 			gBoss[3].hit.back = 0xC00;
 			gBoss[3].hit.top = 0x1000;
@@ -148,7 +148,7 @@
 			break;
 
 		case 500:
-			gBoss[3].bits &= ~0x20;
+			gBoss[3].bits &= ~NPC_SHOOTABLE;
 
 			npc->act_no = 501;
 			npc->act_wait = 0;
--- a/src/BossTwinD.cpp
+++ b/src/BossTwinD.cpp
@@ -58,7 +58,7 @@
 
 		case 1000:
 			npc->act_no = 1001;
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			// Fallthrough
 		case 1001:
 			deg = ((npc->pNpc->count1 / 4) + npc->count1) % 0x100;
@@ -120,7 +120,7 @@
 			npc->act_no = 200;
 			// Fallthrough
 		case 200:
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			npc->ani_no = 0;
 			npc->hit.front = 0x2000;
 			npc->act_no = 201;
@@ -148,7 +148,7 @@
 			{
 				npc->ani_no = 2;
 				npc->hit.front = 0x1000;
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 				npc->count2 = 0;
 			}
 
@@ -205,7 +205,7 @@
 			npc->act_wait = 0;
 			npc->ani_no = 0;
 			npc->hit.front = 0x2000;
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			// Fallthrough
 		case 401:
 			if (++npc->act_wait == 3)
@@ -215,7 +215,7 @@
 			{
 				npc->ani_no = 2;
 				npc->hit.front = 0x1000;
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 				npc->count2 = 0;
 			}
 
@@ -237,7 +237,7 @@
 			break;
 
 		case 1000:
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			npc->ani_no = 3;
 			break;
 	}
@@ -279,8 +279,8 @@
 			npc->hit.top = 0x1000;
 			npc->hit.back = 0x1000;
 			npc->hit.bottom = 0x1000;
-			npc->bits = 8;
-			npc->bits |= 0x200;
+			npc->bits = NPC_IGNORE_SOLIDITY;
+			npc->bits |= NPC_EVENT_WHEN_KILLED;
 			npc->size = 3;
 			npc->damage = 0;
 			npc->code_event = 1000;
@@ -298,7 +298,7 @@
 			gBoss[2].hit.front = 0x1800;
 			gBoss[2].hit.top = 0x1400;
 			gBoss[2].hit.bottom = 0x1400;
-			gBoss[2].bits = 12;
+			gBoss[2].bits = (NPC_INVULNERABLE | NPC_IGNORE_SOLIDITY);
 			gBoss[2].pNpc = &gBoss[3];
 			gBoss[2].cond |= 0x10;
 			gBoss[2].damage = 10;
@@ -312,7 +312,7 @@
 			gBoss[3].hit.front = 0x1800;
 			gBoss[3].hit.top = 0x400;
 			gBoss[3].hit.bottom = 0x2000;
-			gBoss[3].bits = 8;
+			gBoss[3].bits = NPC_IGNORE_SOLIDITY;
 			gBoss[3].pNpc = npc;
 			gBoss[3].damage = 10;
 
--- a/src/BossX.cpp
+++ b/src/BossX.cpp
@@ -35,11 +35,11 @@
 	{
 		case 10:
 			npc->ani_no = 0;
-			npc->bits &= ~0x10;
+			npc->bits &= ~NPC_BOUNCY;
 			break;
 
 		case 100:
-			npc->bits |= 0x10;
+			npc->bits |= NPC_BOUNCY;
 			npc->act_no = 101;
 			npc->act_wait = 0;
 			npc->ani_no = 2;
@@ -62,7 +62,7 @@
 			break;
 
 		case 102:
-			npc->bits &= ~0x10;
+			npc->bits &= ~NPC_BOUNCY;
 			npc->act_no = 103;
 			npc->ani_no = 0;
 			npc->ani_wait = 0;
@@ -83,8 +83,8 @@
 			break;
 
 		case 200:
-			npc->bits |= 0x10;
-			npc->bits |= 0x80;
+			npc->bits |= NPC_BOUNCY;
+			npc->bits |= NPC_REAR_AND_TOP_DONT_HURT;
 			npc->act_no = 201;
 			npc->act_wait = 0;
 			npc->ani_no = 4;
@@ -107,7 +107,7 @@
 			break;
 
 		case 202:
-			npc->bits &= ~0x10;
+			npc->bits &= ~NPC_BOUNCY;
 			npc->act_no = 203;
 			npc->ani_no = 0;
 			npc->ani_wait = 0;
@@ -131,7 +131,7 @@
 			npc->act_no = 301;
 			npc->ani_no = 4;
 			npc->ani_wait = 0;
-			npc->bits |= 0x10;
+			npc->bits |= NPC_BOUNCY;
 			// Fallthrough
 		case 301:
 			if (++npc->ani_wait > 0)
@@ -157,7 +157,7 @@
 			npc->act_no = 401;
 			npc->ani_no = 2;
 			npc->ani_wait = 0;
-			npc->bits |= 0x10;
+			npc->bits |= NPC_BOUNCY;
 			// Fallthrough
 		case 401:
 			if (++npc->ani_wait > 0)
@@ -189,12 +189,12 @@
 	if (npc->act_no >= 100 && gMC.y < npc->y + 0x800 && gMC.y > npc->y - 0x800)
 	{
 		npc->damage = 10;
-		npc->bits |= 0x80;
+		npc->bits |= NPC_REAR_AND_TOP_DONT_HURT;
 	}
 	else
 	{
 		npc->damage = 0;
-		npc->bits &= ~0x80;
+		npc->bits &= ~NPC_REAR_AND_TOP_DONT_HURT;
 	}
 
 	if (npc->xm > 0x400)
@@ -380,7 +380,7 @@
 	switch (npc->act_no)
 	{
 		case 0:
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			npc->ani_no = 0;
 			break;
 
@@ -387,7 +387,7 @@
 		case 10:
 			npc->act_no = 11;
 			npc->act_wait = 10 * npc->tgt_x + 40;
-			npc->bits |= 0x20;
+			npc->bits |= NPC_SHOOTABLE;
 			// Fallthrough
 		case 11:
 			if (npc->act_wait < 16 && npc->act_wait / 2 % 2)
@@ -449,7 +449,7 @@
 	switch (npc->act_no)
 	{
 		case 0:
-			gBoss[0].bits &= ~0x20;
+			gBoss[0].bits &= ~NPC_SHOOTABLE;
 			npc->ani_no = 0;
 			break;
 
@@ -456,7 +456,7 @@
 		case 10:
 			npc->act_no = 11;
 			npc->act_wait = 10 * npc->tgt_x + 40;
-			gBoss[0].bits |= 0x20;
+			gBoss[0].bits |= NPC_SHOOTABLE;
 			// Fallthrough
 		case 11:
 			if (gBoss[0].shock)
@@ -507,7 +507,7 @@
 			npc->hit.top = 0x3000;
 			npc->hit.back = 0x3000;
 			npc->hit.bottom = 0x3000;
-			npc->bits = 0x8208;
+			npc->bits = (NPC_IGNORE_SOLIDITY | NPC_EVENT_WHEN_KILLED | NPC_SHOW_DAMAGE);
 			npc->size = 3;
 			npc->code_event = 1000;
 			npc->ani_no = 0;
@@ -518,7 +518,7 @@
 			gBoss[1].view.top = 0x3000;
 			gBoss[1].view.back = 0x3000;
 			gBoss[1].view.bottom = 0x3000;
-			gBoss[1].bits = 8;
+			gBoss[1].bits = NPC_IGNORE_SOLIDITY;
 			gBoss[2] = gBoss[1];
 			gBoss[2].direct = 2;
 			gBoss[3].cond = 0x80;
@@ -535,7 +535,7 @@
 			gBoss[3].hit.back = 0xA00;
 			gBoss[3].hit.top = 0xA00;
 			gBoss[3].hit.bottom = 0xA00;
-			gBoss[3].bits = 8;
+			gBoss[3].bits = NPC_IGNORE_SOLIDITY;
 			gBoss[3].tgt_x = 0;
 			gBoss[4] = gBoss[3];
 			gBoss[4].tgt_x = 1;
@@ -557,7 +557,7 @@
 			gBoss[7].hit.top = 0x3000;
 			gBoss[7].hit.back = 0x1000;
 			gBoss[7].hit.bottom = 0x2000;
-			gBoss[7].bits = 8;
+			gBoss[7].bits = NPC_IGNORE_SOLIDITY;
 			gBoss[7].size = 3;
 			gBoss[7].ani_no = 0;
 			gBoss[9].cond = 0x80;
@@ -574,7 +574,7 @@
 			gBoss[9].hit.top = 0x1000;
 			gBoss[9].hit.back = 0x3800;
 			gBoss[9].hit.bottom = 0x2000;
-			gBoss[9].bits = 141;
+			gBoss[9].bits = (NPC_SOLID_SOFT | NPC_INVULNERABLE | NPC_IGNORE_SOLIDITY | NPC_REAR_AND_TOP_DONT_HURT);
 			gBoss[9].size = 3;
 			gBoss[10] = gBoss[9];
 			gBoss[10].x = 0x108000;
@@ -596,25 +596,25 @@
 			gBoss[13].view.back = 0x5400;
 			gBoss[13].count1 = 9;
 			gBoss[13].ani_no = 0;
-			gBoss[13].bits = 8;
+			gBoss[13].bits = NPC_IGNORE_SOLIDITY;
 			gBoss[14] = gBoss[13];
 			gBoss[14].view.front = 0x5400;
 			gBoss[14].view.back = 0x3C00;
 			gBoss[14].count1 = 10;
 			gBoss[14].ani_no = 1;
-			gBoss[14].bits = 8;
+			gBoss[14].bits = NPC_IGNORE_SOLIDITY;
 			gBoss[15] = gBoss[13];
 			gBoss[15].view.top = 0x2000;
 			gBoss[15].view.bottom = 0x2000;
 			gBoss[15].count1 = 11;
 			gBoss[15].ani_no = 2;
-			gBoss[15].bits = 8;
+			gBoss[15].bits = NPC_IGNORE_SOLIDITY;
 			gBoss[16] = gBoss[15];
 			gBoss[16].view.front = 0x5400;
 			gBoss[16].view.back = 0x3C00;
 			gBoss[16].count1 = 12;
 			gBoss[16].ani_no = 3;
-			gBoss[16].bits = 8;
+			gBoss[16].bits = NPC_IGNORE_SOLIDITY;
 			npc->act_no = 2;
 			break;
 
--- a/src/MycHit.cpp
+++ b/src/MycHit.cpp
@@ -624,7 +624,7 @@
 		&& gMC.y + gMC.hit.bottom > npc->y - npc->hit.top
 		&& gMC.hit.bottom + gMC.y < npc->y + 0x600)
 	{
-		if (npc->bits & npc_bouncy)
+		if (npc->bits & NPC_BOUNCY)
 		{
 			gMC.ym = npc->ym - 0x200;
 			hit |= 8;
@@ -720,7 +720,7 @@
 					gMC.y = npc->y - npc->hit.top - gMC.hit.bottom + 0x200;
 					hit |= 8;
 				}
-				else if (npc->bits & npc_bouncy)
+				else if (npc->bits & NPC_BOUNCY)
 				{
 					gMC.ym = npc->ym - 0x200;
 					hit |= 8;
@@ -780,12 +780,12 @@
 
 		hit = 0;
 
-		if (gNPC[i].bits & npc_solidSoft)
+		if (gNPC[i].bits & NPC_SOLID_SOFT)
 		{
 			hit = JudgeHitMyCharNPC(&gNPC[i]);
 			gMC.flag |= hit;
 		}
-		else if (gNPC[i].bits & npc_solidHard)
+		else if (gNPC[i].bits & NPC_SOLID_HARD)
 		{
 			hit = JudgeHitMyCharNPC4(&gNPC[i]);
 			gMC.flag |= hit;
@@ -818,13 +818,13 @@
 		}
 
 		// Run event on contact
-		if ((g_GameFlags & 4) == 0 && hit && gNPC[i].bits & npc_eventTouch)
+		if ((g_GameFlags & 4) == 0 && hit && gNPC[i].bits & NPC_EVENT_WHEN_TOUCHED)
 			StartTextScript(gNPC[i].code_event);
 
 		// NPC damage
-		if (g_GameFlags & 2 && (gNPC[i].bits & npc_interact) == 0)
+		if (g_GameFlags & 2 && (gNPC[i].bits & NPC_INTERACTABLE) == 0)
 		{
-			if (gNPC[i].bits & npc_rearTop)
+			if (gNPC[i].bits & NPC_REAR_AND_TOP_DONT_HURT)
 			{
 				if (hit & 4 && gNPC[i].xm < 0)
 					DamageMyChar(gNPC[i].damage);
@@ -842,7 +842,7 @@
 		}
 
 		// Interaction
-		if ((g_GameFlags & 4) == 0 && hit && gMC.cond & 1 && gNPC[i].bits & npc_interact)
+		if ((g_GameFlags & 4) == 0 && hit && gMC.cond & 1 && gNPC[i].bits & NPC_INTERACTABLE)
 		{
 			StartTextScript(gNPC[i].code_event);
 			gMC.xm = 0;
@@ -869,12 +869,12 @@
 
 		hit = 0;
 
-		if (gBoss[b].bits & npc_solidSoft)
+		if (gBoss[b].bits & NPC_SOLID_SOFT)
 		{
 			hit = JudgeHitMyCharNPC(&gBoss[b]);
 			gMC.flag |= hit;
 		}
-		else if (gBoss[b].bits & npc_solidHard)
+		else if (gBoss[b].bits & NPC_SOLID_HARD)
 		{
 			hit = JudgeHitMyCharNPC4(&gBoss[b]);
 			gMC.flag |= hit;
@@ -884,13 +884,13 @@
 			hit = JudgeHitMyCharNPC3(&gBoss[b]);
 		}
 
-		if (!(g_GameFlags & 4) && hit && gBoss[b].bits & npc_eventTouch)
+		if (!(g_GameFlags & 4) && hit && gBoss[b].bits & NPC_EVENT_WHEN_TOUCHED)
 		{
 			StartTextScript(gBoss[b].code_event);
 			gMC.ques = 0;
 		}
 
-		if (gBoss[b].bits & npc_rearTop)
+		if (gBoss[b].bits & NPC_REAR_AND_TOP_DONT_HURT)
 		{
 			if (hit & 4 && gBoss[b].xm < 0)
 				DamageMyChar(gBoss[b].damage);
@@ -902,7 +902,7 @@
 			DamageMyChar(gBoss[b].damage);
 		}
 
-		if (!(g_GameFlags & 4) && hit && (gMC.cond & 1) && gBoss[b].bits & npc_interact)
+		if (!(g_GameFlags & 4) && hit && (gMC.cond & 1) && gBoss[b].bits & NPC_INTERACTABLE)
 		{
 			StartTextScript(gBoss[b].code_event);
 			gMC.xm = 0;
--- a/src/NpChar.cpp
+++ b/src/NpChar.cpp
@@ -105,7 +105,7 @@
 #endif
 
 		// Set NPC parameters
-		gNPC[n].direct = (eve.bits & npc_altDir) ? 2 : 0;
+		gNPC[n].direct = (eve.bits & NPC_SPAWN_IN_OTHER_DIRECTION) ? 2 : 0;
 		gNPC[n].code_char = eve.code_char;
 		gNPC[n].code_event = eve.code_event;
 		gNPC[n].code_flag = eve.code_flag;
@@ -117,12 +117,12 @@
 		SetUniqueParameter(&gNPC[n]);
 
 		// Check flags
-		if (gNPC[n].bits & npc_appearSet)
+		if (gNPC[n].bits & NPC_APPEAR_WHEN_FLAG_SET)
 		{
 			if (GetNPCFlag(gNPC[n].code_flag) == TRUE)
 				gNPC[n].cond |= 0x80;
 		}
-		else if (gNPC[n].bits & npc_hideSet)
+		else if (gNPC[n].bits & NPC_HIDE_WHEN_FLAG_SET)
 		{
 			if (GetNPCFlag(gNPC[n].code_flag) == FALSE)
 				gNPC[n].cond |= 0x80;
@@ -346,7 +346,7 @@
 			else
 			{
 				a = 0;
-				if (gNPC[n].bits & npc_showDamage && gNPC[n].damage_view)
+				if (gNPC[n].bits & NPC_SHOW_DAMAGE && gNPC[n].damage_view)
 				{
 					SetValueView(&gNPC[n].x, &gNPC[n].y, gNPC[n].damage_view);
 					gNPC[n].damage_view = 0;
@@ -391,7 +391,7 @@
 	{
 		if ((gNPC[n].cond & 0x80) && gNPC[n].code_event == code_event)
 		{
-			gNPC[n].bits &= (npc_eventTouch | npc_eventDie | 0x400 | npc_appearSet | npc_altDir | npc_interact | npc_hideSet);
+			gNPC[n].bits &= ~(NPC_SOLID_SOFT | NPC_IGNORE_TILE_44 | NPC_INVULNERABLE | NPC_IGNORE_SOLIDITY | NPC_BOUNCY | NPC_SHOOTABLE | NPC_SOLID_HARD | NPC_REAR_AND_TOP_DONT_HURT | NPC_SHOW_DAMAGE);	// Clear these flags
 			gNPC[n].code_char = code_char;
 			gNPC[n].bits |= gNpcTable[gNPC[n].code_char].bits;
 			gNPC[n].exp = gNpcTable[gNPC[n].code_char].exp;
@@ -433,8 +433,8 @@
 	{
 		if ((gNPC[n].cond & 0x80) != 0 && gNPC[n].code_event == code_event)
 		{
-			gNPC[n].bits &= ~(npc_showDamage | npc_rearTop | npc_solidHard | npc_shootable | npc_bouncy | npc_ignoreSolid | npc_invulnerable | npc_ignore44 | npc_solidSoft);
-			gNPC[n].bits |= npc_interact;
+			gNPC[n].bits &= ~(NPC_SOLID_SOFT | NPC_IGNORE_TILE_44 | NPC_INVULNERABLE | NPC_IGNORE_SOLIDITY | NPC_BOUNCY | NPC_SHOOTABLE | NPC_SOLID_HARD | NPC_REAR_AND_TOP_DONT_HURT | NPC_SHOW_DAMAGE);	// Clear these flags
+			gNPC[n].bits |= NPC_INTERACTABLE;
 			gNPC[n].code_char = code_char;
 			gNPC[n].bits |= gNpcTable[gNPC[n].code_char].bits;
 			gNPC[n].exp = gNpcTable[gNPC[n].code_char].exp;
--- a/src/NpChar.h
+++ b/src/NpChar.h
@@ -6,23 +6,24 @@
 
 #define NPC_MAX 0x200
 
-enum NPC_flags
+// Be careful when changing these: they're baked into the 'npc.tbl' file
+enum NPCFlags
 {
-	npc_solidSoft = 0x1, //Pushes quote out
-	npc_ignore44 = 0x2, //Ignores tile 44 (No NPC)
-	npc_invulnerable = 0x4, //Can't get hit
-	npc_ignoreSolid = 0x8, //Doesn't collide with anything
-	npc_bouncy = 0x10, //Quote bounces on the top
-	npc_shootable = 0x20, //Can be shot
-	npc_solidHard = 0x40, //Essentially acts as level tiles
-	npc_rearTop = 0x80, //Rear and top don't hurt
-	npc_eventTouch = 0x100, //Run event when touched
-	npc_eventDie = 0x200, //Run event when killed
-	npc_appearSet = 0x800, //Only appear when flag is set
-	npc_altDir = 0x1000, //Spawn facing to the right (or however the npc interprets the direction as)
-	npc_interact = 0x2000, //Run event when interacted with
-	npc_hideSet = 0x4000, //Hide when flag is set
-	npc_showDamage = 0x8000 //Show #Damage taken
+	NPC_SOLID_SOFT = 1<<0,                // Pushes Quote out
+	NPC_IGNORE_TILE_44 = 1<<1,            // Ignores tile 44, which normally blocks NPCs
+	NPC_INVULNERABLE = 1<<2,              // Can't be hurt
+	NPC_IGNORE_SOLIDITY = 1<<3,           // Doesn't collide with anything
+	NPC_BOUNCY = 1<<4,                    // Quote bounces on top of NPC
+	NPC_SHOOTABLE = 1<<5,                 // Can be shot
+	NPC_SOLID_HARD = 1<<6,                // Essentially acts as level tiles
+	NPC_REAR_AND_TOP_DONT_HURT = 1<<7,    // Rear and top don't hurt when touched
+	NPC_EVENT_WHEN_TOUCHED = 1<<8,        // Run event when touched
+	NPC_EVENT_WHEN_KILLED = 1<<9,         // Run event when killed
+	NPC_APPEAR_WHEN_FLAG_SET = 1<<11,     // Only appear when flag is set
+	NPC_SPAWN_IN_OTHER_DIRECTION = 1<<12, // Spawn facing to the right (or however the NPC interprets the direction)
+	NPC_INTERACTABLE = 1<<13,             // Run event when interacted with
+	NPC_HIDE_WHEN_FLAG_SET = 1<<14,       // Hide when flag is set
+	NPC_SHOW_DAMAGE = 1<<15               // Show the number of damage taken when harmed
 };
 
 struct NPCHAR
--- a/src/NpcAct000.cpp
+++ b/src/NpcAct000.cpp
@@ -746,7 +746,7 @@
 		case 0:
 			if (gMC.x < npc->x + 0x2000 && gMC.x > npc->x - 0x2000)
 			{
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 				npc->ym = -0x100;
 				npc->tgt_y = npc->y;
 				npc->act_no = 1;
@@ -765,7 +765,7 @@
 			}
 			else
 			{
-				npc->bits &= ~0x20;
+				npc->bits &= ~NPC_SHOOTABLE;
 				npc->rect.right = 0;
 				npc->damage = 0;
 				npc->xm = 0;
@@ -851,8 +851,8 @@
 			}
 			else
 			{
-				npc->bits &= ~8;
-				npc->bits |= 1;
+				npc->bits &= ~NPC_IGNORE_SOLIDITY;
+				npc->bits |= NPC_SOLID_SOFT;
 			}
 
 			if (npc->flag & 8)
@@ -1125,7 +1125,7 @@
 				npc->act_wait = 0;
 				npc->ani_no = 3;
 				npc->ym = -0x800;
-				npc->bits |= 8;
+				npc->bits |= NPC_IGNORE_SOLIDITY;
 			}
 
 			break;
@@ -1308,7 +1308,7 @@
 				npc->act_wait = 0;
 				npc->ani_no = 3;
 				npc->ym = -0x800;
-				npc->bits |= 8;
+				npc->bits |= NPC_IGNORE_SOLIDITY;
 				DeleteNpCharCode(150, 0);
 				DeleteNpCharCode(117, 0);
 				SetNpChar(355, 0, 0, 0, 0, 0, npc, 0x100);
@@ -1475,7 +1475,7 @@
 	{
 		case 0:
 			npc->act_no = 1;
-			npc->bits |= 0x2000u;
+			npc->bits |= NPC_INTERACTABLE;
 
 			if (npc->direct == 2)
 			{
@@ -1536,12 +1536,12 @@
 	switch (npc->act_no)
 	{
 		case 0:
-			npc->bits |= 0x2000;
+			npc->bits |= NPC_INTERACTABLE;
 			npc->act_no = 1;
 
 			if (npc->direct == 2)
 			{
-				npc->bits &= ~0x2000;
+				npc->bits &= ~NPC_INTERACTABLE;
 				npc->ym = -0x200;
 
 				for (int i = 0; i < 4; ++i)
@@ -1551,7 +1551,7 @@
 			// Fallthrough
 		case 1:
 			if (npc->flag & 8)
-				npc->bits |= 0x2000;
+				npc->bits |= NPC_INTERACTABLE;
 
 			break;
 	}
--- a/src/NpcAct020.cpp
+++ b/src/NpcAct020.cpp
@@ -465,7 +465,7 @@
 					npc->xm /= 2;
 					npc->ym = 0;
 					npc->act_no = 3;
-					npc->bits &= ~8;
+					npc->bits &= ~NPC_IGNORE_SOLIDITY;
 				}
 			}
 
@@ -482,7 +482,7 @@
 				npc->xm *= 2;
 				npc->count1 = 0;
 				npc->act_no = 1;
-				npc->bits |= 8;
+				npc->bits |= NPC_IGNORE_SOLIDITY;
 			}
 
 			break;
@@ -1027,7 +1027,7 @@
 		npc->act_no = 3;
 		npc->act_wait = 0;
 		npc->ani_no = 2;
-		npc->bits &= ~0x20;
+		npc->bits &= ~NPC_SHOOTABLE;
 		npc->damage = 0;
 	}
 
--- a/src/NpcAct040.cpp
+++ b/src/NpcAct040.cpp
@@ -678,7 +678,7 @@
 {
 	RECT rect = {0, 0, 16, 16};
 
-	npc->bits |= 0x100;
+	npc->bits |= NPC_EVENT_WHEN_TOUCHED;
 
 	if (npc->direct == 0)
 	{
@@ -708,10 +708,10 @@
 			npc->act_no = 1;
 			npc->act_wait = 0;
 			npc->tgt_y = npc->y;
-			npc->bits &= ~0x20;
-			npc->bits &= ~4;
-			npc->bits &= ~1;
-			npc->bits &= ~8;
+			npc->bits &= ~NPC_SHOOTABLE;
+			npc->bits &= ~NPC_INVULNERABLE;
+			npc->bits &= ~NPC_SOLID_SOFT;
+			npc->bits &= ~NPC_IGNORE_SOLIDITY;
 			// Fallthrough
 		case 1:
 			if (gMC.x > npc->x - 0x1000 && gMC.x < npc->x + 0x1000 && gMC.y > npc->y && gMC.y < npc->y + 0x1000)
@@ -741,7 +741,7 @@
 
 			if (npc->ani_no == 4)
 			{
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 				npc->act_no = 3;
 				npc->act_wait = 0;
 			}
@@ -749,7 +749,7 @@
 			break;
 
 		case 3:
-			npc->bits |= 1;
+			npc->bits |= NPC_SOLID_SOFT;
 			npc->damage = 0;
 			++npc->act_wait;
 
@@ -762,13 +762,13 @@
 			break;
 
 		case 4:
-			npc->bits |= 8;
+			npc->bits |= NPC_IGNORE_SOLIDITY;
 			npc->y += 0x200;
 
 			if (++npc->act_wait == 32)
 			{
-				npc->bits &= ~1;
-				npc->bits &= ~0x20;
+				npc->bits &= ~NPC_SOLID_SOFT;
+				npc->bits &= ~NPC_SHOOTABLE;
 				npc->act_no = 5;
 				npc->act_wait = 0;
 			}
@@ -827,8 +827,8 @@
 
 	if (npc->direct == 2)
 	{
-		npc->bits &= ~npc_shootable;
-		npc->bits |= npc_invulnerable;
+		npc->bits &= ~NPC_SHOOTABLE;
+		npc->bits |= NPC_INVULNERABLE;
 	}
 
 	npc->ym += 5;
@@ -1808,7 +1808,7 @@
 		case 0:
 			if (gMC.x < npc->x + 0x2000 && gMC.x > npc->x - 0x2000)
 			{
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 				npc->ym = -0x100;
 				npc->tgt_x = npc->x;
 				npc->tgt_y = npc->y;
@@ -1835,7 +1835,7 @@
 				npc->damage = 0;
 				npc->xm = 0;
 				npc->ym = 0;
-				npc->bits &= ~0x20;
+				npc->bits &= ~NPC_SHOOTABLE;
 			}
 
 			break;
--- a/src/NpcAct060.cpp
+++ b/src/NpcAct060.cpp
@@ -165,7 +165,7 @@
 			{
 				npc->act_no = 12;
 				npc->ani_no = 7;
-				npc->bits |= 0x2000;
+				npc->bits |= NPC_INTERACTABLE;
 			}
 
 			break;
@@ -520,7 +520,7 @@
 			// Fallthrough
 		case 1:
 			if (npc->ym > 0)
-				npc->bits &= ~8;
+				npc->bits &= ~NPC_IGNORE_SOLIDITY;
 
 			if (++npc->ani_wait > 2)
 			{
@@ -569,7 +569,7 @@
 			}
 
 			if (npc->act_wait > 35)
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 
 			if (npc->direct == 0)
 				npc->xm -= 0x40;
@@ -581,7 +581,7 @@
 				npc->act_no = 4;
 				npc->ani_no = 4;
 				npc->ym = -0x400;
-				npc->bits &= ~0x20;
+				npc->bits &= ~NPC_SHOOTABLE;
 				npc->damage = 0;
 			}
 
@@ -596,7 +596,7 @@
 			if (npc->act_wait++ && npc->flag & 8)
 			{
 				npc->act_no = 5;
-				npc->bits |= 0x2000;
+				npc->bits |= NPC_INTERACTABLE;
 			}
 
 			break;
@@ -942,7 +942,7 @@
 				PlaySoundObject(23, 1);
 				npc->ym = 0;
 				npc->act_no = 14;
-				npc->bits |= 8;
+				npc->bits |= NPC_IGNORE_SOLIDITY;
 				npc->ani_no = 2;
 			}
 
@@ -969,7 +969,7 @@
 			npc->act_no = 21;
 			npc->ani_no = 0;
 			npc->ym = 0;
-			npc->bits |= 8;
+			npc->bits |= NPC_IGNORE_SOLIDITY;
 			// Fallthrough
 		case 21:
 			npc->ym -= 0x20;
--- a/src/NpcAct080.cpp
+++ b/src/NpcAct080.cpp
@@ -39,7 +39,7 @@
 	switch (npc->act_no)
 	{
 		case 0:
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			npc->act_no = 1;
 			npc->damage = 0;
 			npc->hit.front = 0x800;
@@ -58,7 +58,7 @@
 				npc->ani_no = 1;
 				npc->ani_wait = 0;
 				npc->act_no = 2;
-				npc->bits &= ~0x20;
+				npc->bits &= ~NPC_SHOOTABLE;
 			}
 
 			if (gMC.x < npc->x)
@@ -83,7 +83,7 @@
 				npc->hit.front = 0x2400;
 				npc->act_wait = 0;
 				npc->act_no = 3;
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 				PlaySoundObject(34, 1);
 
 				if (npc->direct == 0)
@@ -365,7 +365,7 @@
 			npc->act_no = 21;
 			npc->ani_no = 0;
 			npc->ym = 0;
-			npc->bits |= 8;
+			npc->bits |= NPC_IGNORE_SOLIDITY;
 			// Fallthrough
 		case 21:
 			npc->ym -= 0x20;
@@ -1446,8 +1446,8 @@
 			break;
 
 		case 10:
-			npc->bits |= 0x20;
-			npc->bits &= ~4;
+			npc->bits |= NPC_SHOOTABLE;
+			npc->bits &= ~NPC_INVULNERABLE;
 
 			if (++npc->act_wait > 40)
 			{
@@ -1505,8 +1505,8 @@
 		{
 			npc->act_no = 20;
 			npc->ani_no = 4;
-			npc->bits &= ~0x20;
-			npc->bits |= 4;
+			npc->bits &= ~NPC_SHOOTABLE;
+			npc->bits |= NPC_INVULNERABLE;
 		}
 	}
 	else
--- a/src/NpcAct100.cpp
+++ b/src/NpcAct100.cpp
@@ -163,7 +163,7 @@
 				else
 					npc->direct = 2;
 
-				npc->bits |= 8;
+				npc->bits |= NPC_IGNORE_SOLIDITY;
 				npc->ani_no = 2;
 				npc->act_no = 3;
 				break;
@@ -170,7 +170,7 @@
 			}
 			else
 			{
-				npc->bits &= ~8;
+				npc->bits &= ~NPC_IGNORE_SOLIDITY;
 			}
 			// Fallthrough
 		case 1:
@@ -209,7 +209,7 @@
 
 		case 3:
 			if (++npc->act_wait > 40)
-				npc->bits &= ~8;
+				npc->bits &= ~NPC_IGNORE_SOLIDITY;
 
 			if (npc->flag & 8)
 			{
@@ -631,7 +631,7 @@
 				else
 					npc->direct = 2;
 
-				npc->bits |= 8;
+				npc->bits |= NPC_IGNORE_SOLIDITY;
 				npc->ani_no = 2;
 				npc->act_no = 3;
 
@@ -639,7 +639,7 @@
 			}
 			else
 			{
-				npc->bits &= ~8;
+				npc->bits &= ~NPC_IGNORE_SOLIDITY;
 			}
 			// Fallthrough
 		case 1:
@@ -678,7 +678,7 @@
 
 		case 3:
 			if (++npc->act_wait > 40)
-				npc->bits &= ~8;
+				npc->bits &= ~NPC_IGNORE_SOLIDITY;
 
 			if (npc->flag & 8)
 			{
@@ -1096,12 +1096,12 @@
 
 			if (gMC.y > npc->y)
 			{
-				npc->bits &= ~0x40;
+				npc->bits &= ~NPC_SOLID_HARD;
 				npc->damage = 0x7F;
 			}
 			else
 			{
-				npc->bits |= 0x40;
+				npc->bits |= NPC_SOLID_HARD;
 				npc->damage = 0;
 			}
 
@@ -1119,7 +1119,7 @@
 				npc->act_no = 1;
 				npc->ani_no = 0;
 				npc->damage = 0;
-				npc->bits |= 0x40;
+				npc->bits |= NPC_SOLID_HARD;
 			}
 
 			break;
@@ -1261,7 +1261,7 @@
 			npc->ani_no = 4;
 			npc->damage = 0;
 			npc->ym = -0x200;
-			npc->bits &= ~0x21;
+			npc->bits &= ~(NPC_SOLID_SOFT | NPC_SHOOTABLE);
 			PlaySoundObject(51, 1);
 			// Fallthrough
 		case 51:
@@ -1558,8 +1558,8 @@
 			else
 				npc->direct = 2;
 
-			npc->bits |= 0x20;
-			npc->bits &= ~4;
+			npc->bits |= NPC_SHOOTABLE;
+			npc->bits &= ~NPC_INVULNERABLE;
 			// Fallthrough
 		case 11:
 			if (npc->act_wait)
@@ -1600,7 +1600,7 @@
 			}
 			else
 			{
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 				npc->act_no = 20;
 				npc->act_wait = 0;
 				PlaySoundObject(103, 1);
@@ -1683,8 +1683,8 @@
 		npc->act_wait = 0;
 		npc->act_no = 30;
 		npc->ani_no = 7;
-		npc->bits &= ~0x20;
-		npc->bits |= 4;
+		npc->bits &= ~NPC_SHOOTABLE;
+		npc->bits |= NPC_INVULNERABLE;
 		npc->xm = 0;
 	}
 
--- a/src/NpcAct120.cpp
+++ b/src/NpcAct120.cpp
@@ -185,7 +185,7 @@
 			}
 			else
 			{
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 				npc->act_no = 15;
 				npc->ani_no = 2;
 				npc->ym = -0x200;
@@ -197,7 +197,7 @@
 		case 15:
 			if (npc->flag & 8)
 			{
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 				npc->xm = 0;
 				npc->act_no = 10;
 				npc->damage = 0;
@@ -229,7 +229,7 @@
 			}
 			else
 			{
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 				npc->life = 1000;
 				npc->act_no = 11;
 				npc->act_wait = Random(0, 50);
@@ -244,7 +244,7 @@
 		npc->act_no = 20;
 		npc->ym = -0x200;
 		npc->ani_no = Random(6, 7);
-		npc->bits &= ~0x20;
+		npc->bits &= ~NPC_SHOOTABLE;
 	}
 
 	npc->ym += 0x20;
@@ -366,7 +366,7 @@
 			npc->y += 0x1000;
 			// Fallthrough
 		case 1:
-			npc->bits &= ~8;
+			npc->bits &= ~NPC_IGNORE_SOLIDITY;
 			npc->ani_no = 0;
 			break;
 
@@ -374,7 +374,7 @@
 			npc->act_no = 11;
 			npc->ani_no = 1;
 			npc->act_wait = 0;
-			npc->bits |= 8;
+			npc->bits |= NPC_IGNORE_SOLIDITY;
 			// Fallthrough
 		case 11:
 			switch (npc->direct)
@@ -547,9 +547,9 @@
 	}
 
 	if (gKeyTrg & gKeyDown)
-		npc->bits |= 0x2000;
+		npc->bits |= NPC_INTERACTABLE;
 	else
-		npc->bits &= ~0x2000;
+		npc->bits &= ~NPC_INTERACTABLE;
 
 	npc->ym += 0x40;
 	if (npc->ym > 0x5FF)
@@ -725,7 +725,7 @@
 			npc->act_no = 1;
 			npc->ani_no = 0;
 			npc->ani_wait = 0;
-			npc->bits |= 0x2000;
+			npc->bits |= NPC_INTERACTABLE;
 			// Fallthrough
 		case 1:
 			if (Random(0, 120) == 10)
@@ -1009,15 +1009,15 @@
 		case 0:
 			npc->act_no = 1;
 			npc->ani_no = 2;
-			npc->bits &= ~0x20;
-			npc->bits |= 4;
+			npc->bits &= ~NPC_SHOOTABLE;
+			npc->bits |= NPC_INVULNERABLE;
 			// Fallthrough
 		case 1:
 			if (gMC.x > npc->x - 0x28000 && gMC.x < npc->x + 0x28000 && gMC.y > npc->y - 0x14000 && gMC.y < npc->y + 0x8000)	// TODO: Maybe do something about this for widescreen/tallscreen?
 			{
 				npc->act_no = 10;
-				npc->bits |= 0x20;
-				npc->bits &= ~4;
+				npc->bits |= NPC_SHOOTABLE;
+				npc->bits &= ~NPC_INVULNERABLE;
 			}
 
 			break;
@@ -1047,8 +1047,8 @@
 				npc->act_no = 20;
 				npc->act_wait = 0;
 				npc->ani_no = 2;
-				npc->bits &= ~0x20;
-				npc->bits |= 4;
+				npc->bits &= ~NPC_SHOOTABLE;
+				npc->bits |= NPC_INVULNERABLE;
 			}
 
 			break;
@@ -1059,8 +1059,8 @@
 				npc->act_no = 10;
 				npc->ani_no = 0;
 				npc->ani_wait = 0;
-				npc->bits |= 0x20;
-				npc->bits &= ~4;
+				npc->bits |= NPC_SHOOTABLE;
+				npc->bits &= ~NPC_INVULNERABLE;
 			}
 
 			break;
@@ -1207,7 +1207,7 @@
 	switch (npc->act_no)
 	{
 		case 0:
-			npc->bits &= ~0x2000;
+			npc->bits &= ~NPC_INTERACTABLE;
 			npc->act_no = 1;
 			npc->ani_no = 0;
 			npc->ani_wait = 0;
@@ -1291,7 +1291,7 @@
 			npc->act_no = 11;
 			npc->ani_no = 1;
 			npc->act_wait = 0;
-			npc->bits |= 8;
+			npc->bits |= NPC_IGNORE_SOLIDITY;
 			// Fallthrough
 		case 11:
 			if (++npc->act_wait % 8 == 0)
--- a/src/NpcAct140.cpp
+++ b/src/NpcAct140.cpp
@@ -58,7 +58,7 @@
 			npc->act_no = 1;
 			npc->ani_no = 9;
 			npc->act_wait = 0;
-			npc->bits &= ~0x2000;
+			npc->bits &= ~NPC_INTERACTABLE;
 			// Fallthrough
 		case 1:
 			if (++npc->act_wait > 50)
@@ -87,7 +87,7 @@
 			if (++npc->act_wait > 50)
 			{
 				npc->act_no = 10;
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 			}
 
 			break;
@@ -244,7 +244,7 @@
 		case 100:
 			npc->ani_no = 3;
 			npc->act_no = 101;
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			npc->damage = 0;
 
 			for (i = 0; i < 8; ++i)
@@ -438,8 +438,8 @@
 				npc->ani_no = 0;
 				npc->act_no = 20;
 				npc->xm = 0;
-				npc->bits &= ~4;
-				npc->bits |= 0x20;
+				npc->bits &= ~NPC_INVULNERABLE;
+				npc->bits |= NPC_SHOOTABLE;
 				npc->damage = 1;
 			}
 
@@ -981,11 +981,11 @@
 			npc->xm = 0;
 			npc->ym = 0;
 
-			npc->bits |= 0x40;
+			npc->bits |= NPC_SOLID_HARD;
 			break;
 
 		case 10:
-			npc->bits &= ~0x80;
+			npc->bits &= ~NPC_REAR_AND_TOP_DONT_HURT;
 			npc->damage = 0;
 
 			if (gMC.x < npc->x + 0x3200 && gMC.x > npc->x - 0x32000 && gMC.y < npc->y + 0x3200 && gMC.y > npc->y - 0x3200)
@@ -1015,12 +1015,12 @@
 			{
 				if (gMC.flag & 1)
 				{
-					npc->bits |= 0x80;
+					npc->bits |= NPC_REAR_AND_TOP_DONT_HURT;
 					npc->damage = 100;
 				}
 				else
 				{
-					npc->bits &= ~0x80;
+					npc->bits &= ~NPC_REAR_AND_TOP_DONT_HURT;
 					npc->damage = 0;
 				}
 
@@ -1030,7 +1030,7 @@
 			break;
 
 		case 20:
-			npc->bits &= ~0x80;
+			npc->bits &= ~NPC_REAR_AND_TOP_DONT_HURT;
 			npc->damage = 0;
 
 			if (gMC.x > npc->x - 0x3200 && gMC.x < npc->x + 0x32000 && gMC.y < npc->y + 0x3200 && gMC.y > npc->y - 0x3200)
@@ -1060,12 +1060,12 @@
 			{
 				if (gMC.flag & 4)
 				{
-					npc->bits |= 0x80;
+					npc->bits |= NPC_REAR_AND_TOP_DONT_HURT;
 					npc->damage = 100;
 				}
 				else
 				{
-					npc->bits &= ~0x80;
+					npc->bits &= ~NPC_REAR_AND_TOP_DONT_HURT;
 					npc->damage = 0;
 				}
 
@@ -1549,8 +1549,8 @@
 	switch (npc->act_no)
 	{
 		case 0:
-			npc->bits &= ~0x20;
-			npc->bits &= ~8;
+			npc->bits &= ~NPC_SHOOTABLE;
+			npc->bits &= ~NPC_IGNORE_SOLIDITY;
 			npc->damage = 0;
 			npc->act_no = 1;
 			npc->ani_no = 9;
@@ -1759,11 +1759,11 @@
 
 			npc->xm = 0;
 			npc->ym = 0;
-			npc->bits |= 0x40;
+			npc->bits |= NPC_SOLID_HARD;
 			break;
 
 		case 10:
-			npc->bits &= ~0x80;
+			npc->bits &= ~NPC_REAR_AND_TOP_DONT_HURT;
 			npc->damage = 0;
 
 			if (gMC.y < npc->y + 0x3200 && gMC.y > npc->y - 0x32000 && gMC.x < npc->x + 0x3200 && gMC.x > npc->x - 0x3200)
@@ -1793,12 +1793,12 @@
 			{
 				if (gMC.flag & 2)
 				{
-					npc->bits |= 0x80;
+					npc->bits |= NPC_REAR_AND_TOP_DONT_HURT;
 					npc->damage = 100;
 				}
 				else
 				{
-					npc->bits &= ~0x80;
+					npc->bits &= ~NPC_REAR_AND_TOP_DONT_HURT;
 					npc->damage = 0;
 				}
 
@@ -1808,7 +1808,7 @@
 			break;
 
 		case 20:
-			npc->bits &= ~0x80;
+			npc->bits &= ~NPC_REAR_AND_TOP_DONT_HURT;
 			npc->damage = 0;
 
 			if (gMC.y > npc->y - 0x3200 && gMC.y < npc->y + 0x32000 && gMC.x < npc->x + 0x3200 && gMC.x > npc->x - 0x3200)
@@ -1838,12 +1838,12 @@
 			{
 				if (gMC.flag & 8)
 				{
-					npc->bits |= 0x80;
+					npc->bits |= NPC_REAR_AND_TOP_DONT_HURT;
 					npc->damage = 100;
 				}
 				else
 				{
-					npc->bits &= ~0x80;
+					npc->bits &= ~NPC_REAR_AND_TOP_DONT_HURT;
 					npc->damage = 0;
 				}
 
--- a/src/NpcAct160.cpp
+++ b/src/NpcAct160.cpp
@@ -21,7 +21,7 @@
 	switch (npc->act_no)
 	{
 		case 0:
-			npc->bits &= ~1;
+			npc->bits &= ~NPC_SOLID_SOFT;
 			npc->act_no = 1;
 			// Fallthrough
 		case 1:
@@ -38,7 +38,7 @@
 			}
 			else
 			{
-				npc->bits &= ~8;
+				npc->bits &= ~NPC_IGNORE_SOLIDITY;
 				npc->act_no = 2;
 			}
 
@@ -94,7 +94,7 @@
 					npc->count1 = 0;
 					npc->act_no = 5;
 					npc->ym = -0xC00;
-					npc->bits |= 8;
+					npc->bits |= NPC_IGNORE_SOLIDITY;
 				}
 			}
 
@@ -205,8 +205,8 @@
 
 	if (npc->life < 100)
 	{
-		npc->bits &= ~0x20;
-		npc->bits &= ~4;
+		npc->bits &= ~NPC_SHOOTABLE;
+		npc->bits &= ~NPC_INVULNERABLE;
 		npc->damage = 0;
 		npc->ani_no = 2;
 	}
@@ -1321,7 +1321,7 @@
 		LoseNpChar(npc, 0);
 		npc->act_no = 10;
 		npc->ani_no = 1;
-		npc->bits &= ~0x20;
+		npc->bits &= ~NPC_SHOOTABLE;
 		npc->damage = 0;
 	}
 
@@ -1371,7 +1371,7 @@
 		LoseNpChar(npc, 0);
 		npc->act_no = 10;
 		npc->ani_no = 2;
-		npc->bits &= ~0x20;
+		npc->bits &= ~NPC_SHOOTABLE;
 		npc->damage = 0;
 	}
 
--- a/src/NpcAct180.cpp
+++ b/src/NpcAct180.cpp
@@ -103,7 +103,7 @@
 		case 41:
 			if (++npc->act_wait == 750)
 			{
-				npc->bits &= ~0x2000;
+				npc->bits &= ~NPC_INTERACTABLE;
 				npc->ani_no = 0;
 			}
 
@@ -586,7 +586,7 @@
 			npc->act_no = 11;
 			npc->ani_no = 1;
 			npc->act_wait = 0;
-			npc->bits |= npc_ignoreSolid;
+			npc->bits |= NPC_IGNORE_SOLIDITY;
 			// Fallthrough
 		case 11:
 			switch (npc->direct)
@@ -650,7 +650,7 @@
 			npc->act_no = 11;
 			npc->ani_no = 1;
 			npc->act_wait = 0;
-			npc->bits |= npc_ignoreSolid;
+			npc->bits |= NPC_IGNORE_SOLIDITY;
 			// Fallthrough
 		case 11:
 			switch (npc->direct)
@@ -705,7 +705,7 @@
 			npc->act_no = 11;
 			npc->ani_no = 1;
 			npc->act_wait = 0;
-			npc->bits |= 8;
+			npc->bits |= NPC_IGNORE_SOLIDITY;
 			// Fallthrough
 		case 11:
 			switch (npc->direct)
--- a/src/NpcAct200.cpp
+++ b/src/NpcAct200.cpp
@@ -42,7 +42,7 @@
 		SetDestroyNpChar(npc->x, npc->y, npc->view.back, 8);
 		SetExpObjects(npc->x, npc->y, npc->exp);
 		npc->act_no = 100;
-		npc->bits &= ~0x20;
+		npc->bits &= ~NPC_SHOOTABLE;
 		npc->damage = 0;
 	}
 
@@ -385,18 +385,18 @@
 
 			if (gMC.y > npc->y)
 			{
-				npc->bits &= ~0x40;
+				npc->bits &= ~NPC_SOLID_HARD;
 				npc->damage = 0x7F;
 			}
 			else
 			{
-				npc->bits |= 0x40;
+				npc->bits |= NPC_SOLID_HARD;
 				npc->damage = 0;
 			}
 
 			if (++npc->act_wait > 8 && npc->flag & 0xFF)
 			{
-				npc->bits |= 0x40;
+				npc->bits |= NPC_SOLID_HARD;
 				npc->act_no = 4;
 				npc->act_wait = 0;
 				npc->ym = 0;
@@ -413,7 +413,7 @@
 			if (++npc->act_wait > 4)
 			{
 				npc->act_no = 5;
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 			}
 
 			break;
@@ -599,7 +599,7 @@
 		case 0:
 			if (gMC.x < npc->x + 0x2000 && gMC.x > npc->x - 0x2000)
 			{
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 				npc->ym = -0x200;
 				npc->tgt_x = npc->x;
 				npc->tgt_y = npc->y;
@@ -626,7 +626,7 @@
 				npc->damage = 0;
 				npc->xm = 0;
 				npc->ym = 0;
-				npc->bits &= ~0x20;
+				npc->bits &= ~NPC_SHOOTABLE;
 			}
 
 			return;
@@ -786,7 +786,7 @@
 		case 0:
 			if (gMC.x < npc->x + 0x2000 && gMC.x > npc->x - 0x2000)
 			{
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 				npc->ym = -0x200;
 				npc->tgt_y = npc->y;
 				npc->act_no = 1;
@@ -805,7 +805,7 @@
 			}
 			else
 			{
-				npc->bits &= ~0x20;
+				npc->bits &= ~NPC_SHOOTABLE;
 				npc->rect.right = 0;
 				npc->damage = 0;
 				npc->xm = 0;
@@ -919,7 +919,7 @@
 			npc->tgt_y = npc->y - 0x2000;
 			npc->tgt_x = npc->x - 0xC00;
 			npc->ym = 0;
-			npc->bits |= 8;
+			npc->bits |= NPC_IGNORE_SOLIDITY;
 			// Fallthrough
 		case 11:
 			if (npc->x < npc->tgt_x)
@@ -948,7 +948,7 @@
 
 		case 20:
 			npc->act_no = 21;
-			npc->bits |= 8;
+			npc->bits |= NPC_IGNORE_SOLIDITY;
 			// Fallthrough
 		case 21:
 			if (npc->y < npc->tgt_y)
@@ -1030,7 +1030,7 @@
 				npc->act_wait = 0;
 				npc->ani_no = 1;
 				npc->ym = 0;
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 			}
 
 			break;
@@ -1174,7 +1174,7 @@
 	{
 		case 0:
 			npc->act_no = 1;
-			npc->bits |= 8;
+			npc->bits |= NPC_IGNORE_SOLIDITY;
 			// Fallthrough
 		case 1:
 			if (++npc->ani_wait > 2)
@@ -1192,7 +1192,7 @@
 			npc->y += npc->ym;
 
 			if (npc->xm < 0)
-				npc->bits &= ~8;
+				npc->bits &= ~NPC_IGNORE_SOLIDITY;
 
 			if (npc->flag & 0xFF)
 			{
@@ -1217,10 +1217,10 @@
 			npc->act_no = 1;
 			npc->act_wait = 0;
 			npc->tgt_y = npc->y;
-			npc->bits &= ~0x20;
-			npc->bits &= ~4;
-			npc->bits &= ~1;
-			npc->bits &= ~8;
+			npc->bits &= ~NPC_SHOOTABLE;
+			npc->bits &= ~NPC_INVULNERABLE;
+			npc->bits &= ~NPC_SOLID_SOFT;
+			npc->bits &= ~NPC_IGNORE_SOLIDITY;
 			// Fallthrough
 		case 1:
 			if (gMC.x > npc->x - 0x1800 && gMC.x < npc->x + 0x1800 && gMC.y > npc->y && gMC.y < npc->y + 0x1000)
@@ -1252,7 +1252,7 @@
 
 			if (npc->ani_no == 4)
 			{
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 				npc->act_no = 30;
 				npc->act_wait = 0;
 			}
@@ -1260,7 +1260,7 @@
 			break;
 
 		case 30:
-			npc->bits |= 1;
+			npc->bits |= NPC_SOLID_SOFT;
 			npc->damage = 0;
 			++npc->act_wait;
 
@@ -1273,13 +1273,13 @@
 			break;
 
 		case 40:
-			npc->bits |= 8;
+			npc->bits |= NPC_IGNORE_SOLIDITY;
 			npc->y += 0x200;
 
 			if (++npc->act_wait == 32)
 			{
-				npc->bits &= ~1;
-				npc->bits &= ~0x20;
+				npc->bits &= ~NPC_SOLID_SOFT;
+				npc->bits &= ~NPC_SHOOTABLE;
 				npc->act_no = 50;
 				npc->act_wait = 0;
 			}
--- a/src/NpcAct220.cpp
+++ b/src/NpcAct220.cpp
@@ -597,7 +597,7 @@
 			break;
 
 		case 12:
-			npc->bits &= ~0x2000;
+			npc->bits &= ~NPC_INTERACTABLE;
 			npc->act_no = 13;
 			npc->act_wait = 0;
 			npc->ani_no = 1;
@@ -653,7 +653,7 @@
 
 			if (npc->flag & 8)
 			{
-				npc->bits |= 0x2000;
+				npc->bits |= NPC_INTERACTABLE;
 				npc->act_no = 1;
 				npc->ani_no = 0;
 			}
@@ -796,7 +796,7 @@
 					npc->xm /= 4;
 					npc->ym = 0;
 					npc->act_no = 3;
-					npc->bits &= ~8;
+					npc->bits &= ~NPC_IGNORE_SOLIDITY;
 				}
 			}
 
@@ -813,7 +813,7 @@
 				npc->xm *= 2;
 				npc->count1 = 0;
 				npc->act_no = 1;
-				npc->bits |= 8;
+				npc->bits |= NPC_IGNORE_SOLIDITY;
 			}
 
 			break;
--- a/src/NpcAct240.cpp
+++ b/src/NpcAct240.cpp
@@ -455,12 +455,12 @@
 
 			if (gMC.y > npc->y)
 			{
-				npc->bits &= ~0x40;
+				npc->bits &= ~NPC_SOLID_HARD;
 				npc->damage = 0x7F;
 			}
 			else
 			{
-				npc->bits |= 0x40;
+				npc->bits |= NPC_SOLID_HARD;
 				npc->damage = 0;
 			}
 
@@ -478,7 +478,7 @@
 				npc->act_no = 20;
 				npc->ani_no = 0;
 				npc->ani_wait = 0;
-				npc->bits |= 0x40;
+				npc->bits |= NPC_SOLID_HARD;
 				npc->damage = 0;
 			}
 
@@ -590,7 +590,7 @@
 			npc->act_wait = 0;
 			npc->ani_no = 0;
 			npc->xm = 0;
-			npc->bits |= 0x20;
+			npc->bits |= NPC_SHOOTABLE;
 			npc->count2 = npc->life;
 			// Fallthrough
 		case 101:
@@ -622,7 +622,7 @@
 			npc->act_wait = 0;
 			npc->xm = 0;
 			npc->ym = 0;
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			// Fallthrough
 		case 111:
 			if (++npc->act_wait % 2)
@@ -699,7 +699,7 @@
 			{
 				npc->act_wait = 0;
 				npc->ym = -0x200;
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 				npc->x = npc->tgt_x;
 				npc->y = npc->tgt_y;
 
@@ -759,7 +759,7 @@
 			break;
 
 		case 1000:
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			npc->act_no = 1001;
 			npc->act_wait = 0;
 			npc->ani_no = 4;
@@ -1025,9 +1025,9 @@
 
 		case 10:
 			npc->act_no = 11;
-			npc->bits |= 0x20;
-			npc->bits &= ~4;
-			npc->bits &= ~8;
+			npc->bits |= NPC_SHOOTABLE;
+			npc->bits &= ~NPC_INVULNERABLE;
+			npc->bits &= ~NPC_IGNORE_SOLIDITY;
 
 			deg = GetArktan(npc->x - gMC.x, npc->y - gMC.y);
 			deg += (unsigned char)Random(-3, 3);
@@ -1386,7 +1386,7 @@
 	switch (npc->act_no)
 	{
 		case 0:
-			npc->bits &= ~0x2000;
+			npc->bits &= ~NPC_INTERACTABLE;
 			npc->act_no = 1;
 			// Fallthrough
 		case 1:
--- a/src/NpcAct260.cpp
+++ b/src/NpcAct260.cpp
@@ -232,7 +232,7 @@
 
 		case 10:
 			npc->ym += 0x80;
-			npc->bits |= 0x20;
+			npc->bits |= NPC_SHOOTABLE;
 			npc->damage = 3;
 
 			if (npc->flag & 8)
@@ -300,7 +300,7 @@
 			npc->act_wait = 0;
 			npc->ani_no = 6;
 			npc->tgt_x = npc->x;
-			npc->bits |= 0x20;
+			npc->bits |= NPC_SHOOTABLE;
 			// Fallthrough
 		case 31:
 			if (++npc->act_wait / 2 % 2)
@@ -333,7 +333,7 @@
 
 		case 100:
 			npc->act_no = 101;
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			npc->damage = 0;
 			npc->act_wait = 0;
 			PlaySoundObject(29, 1);
@@ -375,7 +375,7 @@
 
 			if (npc->act_wait <= 0)
 			{
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 				npc->damage = 3;
 
 				if (npc->count1 < 3)
@@ -393,7 +393,7 @@
 			break;
 
 		case 500:
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			npc->ani_no = 6;
 			npc->ym += 0x10;
 
@@ -660,7 +660,7 @@
 			break;
 
 		case 10:
-			npc->bits |= 4;
+			npc->bits |= NPC_INVULNERABLE;
 			npc->xm = 0;
 			npc->act_no = 11;
 			npc->act_wait = 0;
@@ -841,8 +841,8 @@
 		case 30:
 			npc->act_no = 31;
 			npc->act_wait = 0;
-			npc->bits |= 1;
-			npc->bits &= ~0x20;
+			npc->bits |= NPC_SOLID_SOFT;
+			npc->bits &= ~NPC_SHOOTABLE;
 			// Fallthrough
 		case 31:
 			npc->ani_no = 3;
@@ -852,7 +852,7 @@
 				npc->act_no = 32;
 				npc->act_wait = 0;
 				npc->ani_no = 7;
-				npc->bits |= 0x80;
+				npc->bits |= NPC_REAR_AND_TOP_DONT_HURT;
 				npc->damage = 10;
 				PlaySoundObject(25, 1);
 
@@ -878,8 +878,8 @@
 				npc->act_wait = 0;
 				npc->act_no = 18;
 				npc->damage = 5;
-				npc->bits &= ~0x81;
-				npc->bits |= 0x20;
+				npc->bits &= ~(NPC_SOLID_SOFT | NPC_REAR_AND_TOP_DONT_HURT);
+				npc->bits |= NPC_SHOOTABLE;
 			}
 
 			if (npc->flag & 1 || npc->flag & 4)
@@ -887,8 +887,8 @@
 				npc->act_no = 15;
 				npc->act_wait = 0;
 				npc->damage = 5;
-				npc->bits &= ~0x81;
-				npc->bits |= 0x20;
+				npc->bits &= ~(NPC_SOLID_SOFT | NPC_REAR_AND_TOP_DONT_HURT);
+				npc->bits |= NPC_SHOOTABLE;
 			}
 
 			break;
@@ -944,7 +944,7 @@
 		case 100:
 			npc->act_no = 101;
 			npc->act_wait = 0;
-			npc->bits &= ~0x24;
+			npc->bits &= ~(NPC_INVULNERABLE | NPC_SHOOTABLE);
 			npc->damage = 0;
 			PlaySoundObject(29, 1);
 			// Fallthrough
@@ -994,7 +994,7 @@
 
 			if (npc->act_wait <= 0)
 			{
-				npc->bits |= 0x24;
+				npc->bits |= (NPC_INVULNERABLE | NPC_SHOOTABLE);
 				npc->damage = 5;
 				npc->act_no = 16;
 				npc->ym = -0x200;
@@ -1005,7 +1005,7 @@
 
 		case 500:
 			DeleteNpCharCode(269, 1);
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			npc->ani_no = 4;
 			npc->ym += 0x20;
 			npc->xm = 0;
@@ -1040,7 +1040,7 @@
 			npc->ani_no = 9;
 			npc->tgt_x = npc->x;
 			npc->y += 0x2000;
-			npc->bits |= 8;
+			npc->bits |= NPC_IGNORE_SOLIDITY;
 			// Fallthrough
 		case 511:
 			SetQuake(2);
@@ -1432,7 +1432,7 @@
 		{
 			case 0:
 				npc->act_no = 1;
-				npc->bits |= 8;
+				npc->bits |= NPC_IGNORE_SOLIDITY;
 
 				npc->xm = 3 * Random(-0x200, 0x200);
 				npc->ym = 3 * Random(-0x200, 0x200);
@@ -1859,7 +1859,7 @@
 			npc->act_no = 11;
 			npc->act_wait = 0;
 			npc->ani_no = 3;
-			npc->bits |= 0x20;
+			npc->bits |= NPC_SHOOTABLE;
 			// Fallthrough
 		case 11:
 			switch (++npc->act_wait)
@@ -1955,7 +1955,7 @@
 			break;
 
 		case 50:
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			npc->damage = 0;
 
 			if (npc->flag & 8)
@@ -2165,13 +2165,13 @@
 			{
 				case 0:
 					npc->act_no = 100;
-					npc->bits |= 4;
+					npc->bits |= NPC_INVULNERABLE;
 					npc->ani_no = 0;
 					break;
 
 				case 2:
 					npc->act_no = 100;
-					npc->bits |= 4;
+					npc->bits |= NPC_INVULNERABLE;
 					npc->ani_no = 1;
 					npc->view.back = 0x1000;
 					npc->view.front = 0x1000;
@@ -2202,7 +2202,7 @@
 			if (npc->act_wait <= 0)
 			{
 				npc->act_no = 100;
-				npc->bits |= 4;
+				npc->bits |= NPC_INVULNERABLE;
 			}
 
 			break;
@@ -2213,13 +2213,13 @@
 				npc->ym = 0x700;
 
 			if (npc->y > 0x10000)
-				npc->bits &= ~8;
+				npc->bits &= ~NPC_IGNORE_SOLIDITY;
 
 			if (npc->flag & 8)
 			{
 				npc->ym = -0x200;
 				npc->act_no = 110;
-				npc->bits |= 8;
+				npc->bits |= NPC_IGNORE_SOLIDITY;
 				PlaySoundObject(26, 1);
 				SetQuake(10);
 
--- a/src/NpcAct280.cpp
+++ b/src/NpcAct280.cpp
@@ -172,22 +172,22 @@
 
 			if (gMC.flag & 1 && gMC.x < npc->x - npc->hit.back && gMC.x > npc->x - npc->hit.back - 0x1000 && gMC.y + gMC.hit.bottom > npc->y - npc->hit.top && gMC.y - gMC.hit.top < npc->y + npc->hit.bottom)
 			{
-				npc->bits &= ~0x40;
+				npc->bits &= ~NPC_SOLID_HARD;
 				npc->ani_no = 1;
 			}
 			else if (gMC.flag & 4 && gMC.x > npc->x + npc->hit.back && gMC.x < npc->x + npc->hit.back + 0x1000 && gMC.y + gMC.hit.bottom > npc->y - npc->hit.top && gMC.y - gMC.hit.top < npc->y + npc->hit.bottom)
 			{
-				npc->bits &= ~0x40;
+				npc->bits &= ~NPC_SOLID_HARD;
 				npc->ani_no = 1;
 			}
 			else if (gMC.flag & 2 && gMC.y < npc->y - npc->hit.top && gMC.y > npc->y - npc->hit.top - 0x1000 && gMC.x + gMC.hit.front > npc->x - npc->hit.back && gMC.x - gMC.hit.back < npc->x + npc->hit.front)
 			{
-				npc->bits &= ~0x40;
+				npc->bits &= ~NPC_SOLID_HARD;
 				npc->ani_no = 1;
 			}
 			else if (gMC.flag & 8 && gMC.y > npc->y + npc->hit.bottom - 0x800 && gMC.y < npc->y + npc->hit.bottom + 0x1800 && gMC.x + gMC.hit.front > npc->x - npc->hit.back - 0x800 && gMC.x - gMC.hit.back < npc->x + npc->hit.front + 0x800)
 			{
-				npc->bits &= ~0x40;
+				npc->bits &= ~NPC_SOLID_HARD;
 				npc->ani_no = 1;
 			}
 	}
@@ -569,7 +569,7 @@
 			npc->xm = 0;
 			npc->ym = 0;
 			npc->ani_no = 9;
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			break;
 
 		case 100:
@@ -576,8 +576,8 @@
 			npc->act_no = 101;
 			npc->ani_no = 9;
 			npc->damage = 0;
-			npc->bits &= ~0x20;
-			npc->bits |= 8;
+			npc->bits &= ~NPC_SHOOTABLE;
+			npc->bits |= NPC_IGNORE_SOLIDITY;
 			npc->ym = -0x200;
 			npc->shock += 50;
 			npc->hit.bottom = 0x1800;
@@ -695,8 +695,8 @@
 			npc->ani_no = 0;
 			npc->ani_wait = 0;
 			npc->damage = 0;
-			npc->bits |= 0x20;
-			npc->bits &= ~8;
+			npc->bits |= NPC_SHOOTABLE;
+			npc->bits &= ~NPC_IGNORE_SOLIDITY;
 			// Fallthrough
 		case 21:
 			npc->xm = 7 * npc->xm / 8;
@@ -762,7 +762,7 @@
 		case 32:
 			npc->act_no = 33;
 			npc->act_wait = 0;
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 
 			if (gMC.x < npc->x)
 				npc->tgt_x = gMC.x - 0x14000;
@@ -774,21 +774,21 @@
 			deg = GetArktan(npc->x - npc->tgt_x, npc->y - npc->tgt_y);
 			npc->xm = 3 * GetCos(deg);
 			npc->ym = 3 * GetSin(deg);
-			npc->bits &= ~8;
+			npc->bits &= ~NPC_IGNORE_SOLIDITY;
 
 			if (npc->x < (gMap.width * 0x200 * 0x10) / 2 && npc->xm > 0)
 			{
 				if (npc->y < (gMap.length * 0x200 * 0x10) / 2 && npc->ym > 0)
-					npc->bits |= 8;
+					npc->bits |= NPC_IGNORE_SOLIDITY;
 				if (npc->y > (gMap.length * 0x200 * 0x10) / 2 && npc->ym < 0)
-					npc->bits |= 8;
+					npc->bits |= NPC_IGNORE_SOLIDITY;
 			}
 			if (npc->x > (gMap.width * 0x200 * 0x10) / 2 && npc->xm < 0)
 			{
 				if (npc->y < (gMap.length * 0x200 * 0x10) / 2 && npc->ym > 0)
-					npc->bits |= 8;
+					npc->bits |= NPC_IGNORE_SOLIDITY;
 				if (npc->y > (gMap.length * 0x200 * 0x10) / 2 && npc->ym < 0)
-					npc->bits |= 8;
+					npc->bits |= NPC_IGNORE_SOLIDITY;
 			}
 
 			if (npc->xm > 0)
@@ -818,22 +818,22 @@
 			deg = GetArktan(npc->x - npc->tgt_x, npc->y - npc->tgt_y);
 			npc->ym = 3 * GetSin(deg);
 			npc->xm = 3 * GetCos(deg);
-			npc->bits &= ~8;
+			npc->bits &= ~NPC_IGNORE_SOLIDITY;
 
 			if (npc->x < (gMap.width * 0x200 * 0x10) / 2 && npc->xm > 0)
 			{
 				if (npc->y < (gMap.length * 0x200 * 0x10) / 2 && npc->ym > 0)
-					npc->bits |= 8;
+					npc->bits |= NPC_IGNORE_SOLIDITY;
 				if (npc->y > (gMap.length * 0x200 * 0x10) / 2 && npc->ym < 0)
-					npc->bits |= 8;
+					npc->bits |= NPC_IGNORE_SOLIDITY;
 			}
 
 			if (npc->x > (gMap.width * 0x200 * 0x10) / 2 && npc->xm < 0)
 			{
 				if (npc->y < (gMap.length * 0x200 * 0x10) / 2 && npc->ym > 0)
-					npc->bits |= 8;
+					npc->bits |= NPC_IGNORE_SOLIDITY;
 				if (npc->y > (gMap.length * 0x200 * 0x10) / 2 && npc->ym < 0)
-					npc->bits |= 8;
+					npc->bits |= NPC_IGNORE_SOLIDITY;
 			}
 
 			if (npc->xm > 0)
@@ -870,7 +870,7 @@
 			npc->act_wait = 0;
 			npc->ani_no = 2;
 			npc->damage = 0;
-			npc->bits &= ~8;
+			npc->bits &= ~NPC_IGNORE_SOLIDITY;
 			// Fallthrough
 		case 41:
 			npc->xm = 7 * npc->xm / 8;
@@ -921,7 +921,7 @@
 			npc->xm = 0;
 			npc->ym = 0;
 			npc->ani_no = 9;
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			break;
 
 		case 100:
@@ -928,8 +928,8 @@
 			npc->act_no = 101;
 			npc->ani_no = 9;
 			npc->damage = 0;
-			npc->bits &= ~0x20;
-			npc->bits |= 8;
+			npc->bits &= ~NPC_SHOOTABLE;
+			npc->bits |= NPC_IGNORE_SOLIDITY;
 			npc->ym = -0x200;
 			npc->shock += 50;
 			++gBoss[0].ani_no;
@@ -1121,7 +1121,7 @@
 			PlaySoundObject(44, 1);
 			npc->act_no = 3;
 			npc->act_wait = 0;
-			npc->bits |= 8;
+			npc->bits |= NPC_IGNORE_SOLIDITY;
 			npc->ym = 0;
 
 			if (npc->x > gMC.x)
@@ -1191,7 +1191,7 @@
 				npc->view.top = 0x1000;
 				npc->view.bottom = 0x1000;
 				npc->damage = 2;
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 			}
 
 			break;
@@ -1234,7 +1234,7 @@
 			break;
 
 		case 12:
-			npc->bits |= 8;
+			npc->bits |= NPC_IGNORE_SOLIDITY;
 
 			if (npc->y > gMap.length * 0x200 * 0x10)
 			{
@@ -1301,7 +1301,7 @@
 				npc->view.top = 0x1000;
 				npc->view.bottom = 0x1000;
 				npc->damage = 2;
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 				npc->tgt_y = npc->y;
 				npc->ym = 0x400;
 			}
@@ -1369,7 +1369,7 @@
 
 			if (npc->direct == 2)
 			{
-				npc->bits &= ~0x40;
+				npc->bits &= ~NPC_SOLID_HARD;
 				npc->ani_no = 1;
 			}
 
--- a/src/NpcAct300.cpp
+++ b/src/NpcAct300.cpp
@@ -543,7 +543,7 @@
 
 		case 10:
 			npc->act_no = 11;
-			npc->bits |= 0x20;
+			npc->bits |= NPC_SHOOTABLE;
 			npc->damage = 5;
 			// Fallthrough
 		case 11:
@@ -632,8 +632,8 @@
 	{
 		case 0:
 			npc->act_no = 1;
-			npc->bits &= ~0x20;
-			npc->bits |= 4;
+			npc->bits &= ~NPC_SHOOTABLE;
+			npc->bits |= NPC_INVULNERABLE;
 			npc->damage = 0;
 			// Fallthrough
 		case 1:
@@ -653,8 +653,8 @@
 			npc->xm = 0;
 			npc->act_no = 11;
 			npc->act_wait = 0;
-			npc->bits &= ~0x20;
-			npc->bits |= 4;
+			npc->bits &= ~NPC_SHOOTABLE;
+			npc->bits |= NPC_INVULNERABLE;
 			npc->damage = 0;
 			npc->ani_no = 0;
 			// Fallthrough
@@ -667,8 +667,8 @@
 		case 20:
 			npc->act_no = 21;
 			npc->act_wait = 0;
-			npc->bits &= ~4;
-			npc->bits |= 0x20;
+			npc->bits &= ~NPC_INVULNERABLE;
+			npc->bits |= NPC_SHOOTABLE;
 			npc->damage = 0;
 
 			if (npc->x > gMC.x)
@@ -949,7 +949,7 @@
 			++npc->act_wait;
 
 			if (npc->act_wait == 4)
-				npc->bits &= ~8;
+				npc->bits &= ~NPC_IGNORE_SOLIDITY;
 
 			if (npc->act_wait > 10)
 				npc->act_no = 10;
@@ -1102,7 +1102,7 @@
 			npc->act_no = 110;
 			npc->act_wait = 0;
 			npc->count1 = 0;
-			npc->bits |= 0x20;
+			npc->bits |= NPC_SHOOTABLE;
 			// Fallthrough
 		case 110:
 			npc->damage = 1;
@@ -1147,7 +1147,7 @@
 			npc->ym += 0x80;
 
 			if (npc->y > 0x10000)
-				npc->bits &= ~8;
+				npc->bits &= ~NPC_IGNORE_SOLIDITY;
 
 			if (npc->xm < 0 && npc->flag & 1)
 				npc->xm *= -1;
@@ -1206,8 +1206,8 @@
 					npc->xm = 0x5FF;
 
 				PlaySoundObject(25, 1);
-				npc->bits &= ~0x20;
-				npc->bits |= 4;
+				npc->bits &= ~NPC_SHOOTABLE;
+				npc->bits |= NPC_INVULNERABLE;
 				npc->damage = 10;
 			}
 
@@ -1242,8 +1242,8 @@
 			{
 				npc->count1 = 0;
 				npc->act_no = 130;
-				npc->bits |= 0x20;
-				npc->bits &= ~4;
+				npc->bits |= NPC_SHOOTABLE;
+				npc->bits &= ~NPC_INVULNERABLE;
 				npc->damage = 3;
 			}
 
@@ -1286,9 +1286,9 @@
 				npc->ani_no = 12;
 				npc->ym = -0x800;
 				PlaySoundObject(25, 1);
-				npc->bits |= 8;
-				npc->bits &= ~0x20;
-				npc->bits |= 4;
+				npc->bits |= NPC_IGNORE_SOLIDITY;
+				npc->bits &= ~NPC_SHOOTABLE;
+				npc->bits |= NPC_INVULNERABLE;
 				npc->damage = 10;
 			}
 
@@ -1321,8 +1321,8 @@
 			{
 				npc->count1 = 0;
 				npc->act_no = 130;
-				npc->bits |= 0x20;
-				npc->bits &= ~4;
+				npc->bits |= NPC_SHOOTABLE;
+				npc->bits &= ~NPC_INVULNERABLE;
 				npc->damage = 3;
 			}
 
@@ -1329,7 +1329,7 @@
 			break;
 
 		case 500:
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			npc->act_no = 501;
 			npc->act_wait = 0;
 			npc->ani_no = 8;
@@ -1352,13 +1352,13 @@
 	{
 		if (IsActiveSomeBullet())
 		{
-			npc->bits &= ~0x20;
-			npc->bits |= 4;
+			npc->bits &= ~NPC_SHOOTABLE;
+			npc->bits |= NPC_INVULNERABLE;
 		}
 		else
 		{
-			npc->bits |= 0x20;
-			npc->bits &= ~4;
+			npc->bits |= NPC_SHOOTABLE;
+			npc->bits &= ~NPC_INVULNERABLE;
 		}
 	}
 
@@ -1388,7 +1388,7 @@
 		case 0:
 			npc->count2 = 0;
 			npc->act_no = 100;
-			npc->bits |= 4;
+			npc->bits |= NPC_INVULNERABLE;
 			npc->ani_no = Random(0, 2);
 			// Fallthrough
 		case 100:
@@ -1398,13 +1398,13 @@
 				npc->ym = 0x700;
 
 			if (npc->y > 0x10000)
-				npc->bits &= ~8;
+				npc->bits &= ~NPC_IGNORE_SOLIDITY;
 
 			if (npc->flag & 8)
 			{
 				npc->ym = -0x200;
 				npc->act_no = 110;
-				npc->bits |= 8;
+				npc->bits |= NPC_IGNORE_SOLIDITY;
 				PlaySoundObject(12, 1);
 				SetQuake(10);
 
@@ -1471,7 +1471,7 @@
 			if (npc->y > 0x10000)
 			{
 				npc->act_no = 130;
-				npc->bits &= ~8;
+				npc->bits &= ~NPC_IGNORE_SOLIDITY;
 			}
 
 			break;
@@ -1480,7 +1480,7 @@
 			npc->act_no = 110;
 			npc->act_wait = 0;
 			npc->count1 = 0;
-			npc->bits |= 0x20;
+			npc->bits |= NPC_SHOOTABLE;
 			// Fallthrough
 		case 110:
 			if (npc->x > gMC.x)
@@ -1548,7 +1548,7 @@
 			if (++npc->act_wait > 4)
 			{
 				npc->act_no = 110;
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 			}
 
 			break;
@@ -1558,13 +1558,13 @@
 	{
 		if (IsActiveSomeBullet())
 		{
-			npc->bits &= ~0x20;
-			npc->bits |= 4;
+			npc->bits &= ~NPC_SHOOTABLE;
+			npc->bits |= NPC_INVULNERABLE;
 		}
 		else
 		{
-			npc->bits |= 0x20;
-			npc->bits &= ~4;
+			npc->bits |= NPC_SHOOTABLE;
+			npc->bits &= ~NPC_INVULNERABLE;
 		}
 	}
 
@@ -1605,8 +1605,8 @@
 	switch (npc->act_no)
 	{
 		case 0:
-			npc->bits &= ~0x20;
-			npc->bits &= ~8;
+			npc->bits &= ~NPC_SHOOTABLE;
+			npc->bits &= ~NPC_IGNORE_SOLIDITY;
 			npc->damage = 0;
 			npc->act_no = 1;
 			npc->ani_no = 0;
@@ -1779,9 +1779,9 @@
 	switch (npc->act_no)
 	{
 		case 0:
-			npc->bits &= ~0x20;
-			npc->bits &= ~8;
-			npc->bits &= ~1;
+			npc->bits &= ~NPC_SHOOTABLE;
+			npc->bits &= ~NPC_IGNORE_SOLIDITY;
+			npc->bits &= ~NPC_SOLID_SOFT;
 			npc->damage = 0;
 			npc->act_no = 1;
 			npc->ani_no = 0;
@@ -1880,7 +1880,7 @@
 
 		case 2:
 			if (++npc->act_wait == 4)
-				npc->bits &= ~8;
+				npc->bits &= ~NPC_IGNORE_SOLIDITY;
 
 			npc->ym += 0x2A;
 			if (npc->ym > 0x5FF)
--- a/src/NpcAct320.cpp
+++ b/src/NpcAct320.cpp
@@ -190,8 +190,8 @@
 	{
 		npc->act_no = 2;
 		npc->act_wait = 0;
-		npc->bits &= ~0x20;
-		npc->bits |= 4;
+		npc->bits &= ~NPC_SHOOTABLE;
+		npc->bits |= NPC_INVULNERABLE;
 		PlaySoundObject(22, 1);
 	}
 
@@ -314,7 +314,7 @@
 			// Fallthrough
 		case 1:
 			if (++npc->act_wait == 16)
-				npc->bits &= ~8;
+				npc->bits &= ~NPC_IGNORE_SOLIDITY;
 
 			npc->x += npc->xm;
 			npc->y += npc->ym;
@@ -356,8 +356,8 @@
 		npc->code_char = 309;
 		npc->ani_no = 0;
 		npc->act_no = 11;
-		npc->bits |= 0x20;
-		npc->bits &= ~8;
+		npc->bits |= NPC_SHOOTABLE;
+		npc->bits &= ~NPC_IGNORE_SOLIDITY;
 		npc->damage = 5;
 		npc->view.top = 0x1000;
 	}
@@ -1079,7 +1079,7 @@
 			npc->view.top = 0x1000;
 			npc->view.bottom = 0x1000;
 			npc->damage = 3;
-			npc->bits |= 0x20;
+			npc->bits |= NPC_SHOOTABLE;
 			npc->tgt_y = npc->y;
 			npc->ym = (Random(-10, 10) * 0x200) / 2;
 			// Fallthrough
--- a/src/NpcAct340.cpp
+++ b/src/NpcAct340.cpp
@@ -49,7 +49,7 @@
 			npc->ani_no = 1;
 			npc->ani_wait = 0;
 			npc->damage = 4;
-			npc->bits |= 0x20;
+			npc->bits |= NPC_SHOOTABLE;
 			// Fallthrough
 		case 110:
 			npc->act_no = 111;
@@ -453,7 +453,7 @@
 			npc->ani_no = 10;
 			npc->tgt_x = npc->x;
 			npc->xm = 0;
-			npc->bits &= ~0x20;
+			npc->bits &= ~NPC_SHOOTABLE;
 			SetDestroyNpChar(npc->x, npc->y, 0x10, 0x10);
 			PlaySoundObject(72, 1);
 			// Fallthrough
@@ -498,7 +498,7 @@
 				npc->ani_no = 3;
 				npc->ym -= 0xA00;
 				npc->direct = 0;
-				npc->bits |= 8;
+				npc->bits |= NPC_IGNORE_SOLIDITY;
 			}
 
 			break;
@@ -633,7 +633,7 @@
 
 		case 20:
 			npc->act_no = 21;
-			npc->bits |= 0x20;
+			npc->bits |= NPC_SHOOTABLE;
 			npc->life = 1000;
 			// Fallthrough
 		case 21:
@@ -657,7 +657,7 @@
 			if (npc->life < 900)
 			{
 				npc->act_no = 22;
-				npc->bits &= ~0x20;
+				npc->bits &= ~NPC_SHOOTABLE;
 				SetDestroyNpChar(npc->x, npc->y, 0x2000, 0x20);
 				PlaySoundObject(71, 1);
 			}
@@ -699,7 +699,7 @@
 			npc->damage = 10;
 
 			if (npc->direct == 0)
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 
 			npc->ym = 0;
 			// Fallthrough
@@ -710,7 +710,7 @@
 			if (npc->count2 > 0x100)
 				--npc->count2;
 
-			if (npc->bits & 0x20)
+			if (npc->bits & NPC_SHOOTABLE)
 			{
 				if (npc->shock)
 				{
@@ -740,7 +740,7 @@
 			npc->ym = 0;
 			npc->ani_no = 2;
 			npc->damage = 5;
-			npc->bits &= ~0x28;
+			npc->bits &= ~(NPC_IGNORE_SOLIDITY | NPC_SHOOTABLE);
 			SetDestroyNpChar(npc->x, npc->y, 0x2000, 0x20);
 			PlaySoundObject(71, 1);
 			// Fallthrough
@@ -775,7 +775,7 @@
 			npc->xm = 0;
 			npc->ym = 0;
 			npc->ani_no = 2;
-			npc->bits &= ~0x28;
+			npc->bits &= ~(NPC_IGNORE_SOLIDITY | NPC_SHOOTABLE);
 			npc->damage = 0;
 			npc->count1 /= 4;
 			npc->exp = 0;
@@ -922,7 +922,7 @@
 				npc->ym = 0x700;
 
 			if (npc->y > 0x10000)
-				npc->bits &= ~8;
+				npc->bits &= ~NPC_IGNORE_SOLIDITY;
 
 			if (npc->act_wait++ / 2 % 2)
 				SetNpChar(4, npc->x, npc->y, 0, 0, 0, 0, 0x100);
@@ -931,7 +931,7 @@
 			{
 				npc->ym = -0x200;
 				npc->act_no = 110;
-				npc->bits |= 8;
+				npc->bits |= NPC_IGNORE_SOLIDITY;
 				PlaySoundObject(12, 1);
 				SetQuake(10);
 
@@ -1055,7 +1055,7 @@
 			npc->act_no = 1001;
 			npc->xm = 0;
 			npc->ym = 0;
-			npc->bits &= ~0x40;
+			npc->bits &= ~NPC_SOLID_HARD;
 			// Fallthrough
 		case 1001:
 			npc->ym += 0x40;
@@ -1069,9 +1069,9 @@
 	if (npc->act_no < 1000)
 	{
 		if (gMC.y > npc->y - 0x1000 && gMC.ym < 0)
-			npc->bits &= ~0x40;
+			npc->bits &= ~NPC_SOLID_HARD;
 		else
-			npc->bits |= 0x40;
+			npc->bits |= NPC_SOLID_HARD;
 
 		deg = npc->count1 / 4;
 		npc->tgt_x = npc->pNpc->x + npc->count2 * GetCos(deg) / 4;
@@ -1461,7 +1461,7 @@
 			else
 			{
 				npc->act_no = 11;
-				npc->bits |= 0x20;
+				npc->bits |= NPC_SHOOTABLE;
 			}
 			// Fallthrough
 		case 11:
@@ -1632,7 +1632,7 @@
 			++npc->act_wait;
 
 			if (npc->act_wait == 8)
-				npc->bits &= ~8;
+				npc->bits &= ~NPC_IGNORE_SOLIDITY;
 
 			npc->x += npc->xm;
 			npc->y += npc->ym;
@@ -1654,8 +1654,8 @@
 		case 10:
 			npc->act_no = 11;
 			npc->ani_no = 0;
-			npc->bits |= 0x20;
-			npc->bits &= ~8;
+			npc->bits |= NPC_SHOOTABLE;
+			npc->bits &= ~NPC_IGNORE_SOLIDITY;
 			npc->damage = 5;
 			npc->view.top = 0x1000;
 			// Fallthrough
--- a/src/NpcHit.cpp
+++ b/src/NpcHit.cpp
@@ -299,7 +299,7 @@
 		if ((gNPC[i].cond & 0x80) == 0)
 			continue;
 
-		if (gNPC[i].bits & 8)
+		if (gNPC[i].bits & NPC_IGNORE_SOLIDITY)
 			continue;
 
 		if (gNPC[i].size >= 3)
@@ -323,7 +323,7 @@
 			{
 				// No NPC block
 				case 0x44:
-					if (gNPC[i].bits & npc_ignore44)
+					if (gNPC[i].bits & NPC_IGNORE_TILE_44)
 						break;
 					// Fallthrough
 				// Block
@@ -518,9 +518,9 @@
 	SetNPCFlag(npc->code_flag);
 
 	// Create value view
-	if (npc->bits & npc_showDamage)
+	if (npc->bits & NPC_SHOW_DAMAGE)
 	{
-		if ((npc->bits & npc_showDamage) && npc->damage_view)
+		if ((npc->bits & NPC_SHOW_DAMAGE) && npc->damage_view)
 			SetValueView(&npc->x, &npc->y, npc->damage_view);
 		if (bVanish)
 			VanishNpChar(npc);
@@ -542,7 +542,7 @@
 		if ((gNPC[n].cond & 0x80) == 0)
 			continue;
 
-		if (gNPC[n].bits & npc_shootable && gNPC[n].bits & npc_interact)
+		if (gNPC[n].bits & NPC_SHOOTABLE && gNPC[n].bits & NPC_INTERACTABLE)
 			continue;
 
 		for (b = 0; b < BULLET_MAX; b++)
@@ -555,13 +555,13 @@
 
 			// Check if bullet touches npc
 			bHit = FALSE;
-			if (gNPC[n].bits & npc_shootable
+			if (gNPC[n].bits & NPC_SHOOTABLE
 				&& gNPC[n].x - gNPC[n].hit.back < gBul[b].x + gBul[b].enemyXL
 				&& gNPC[n].x + gNPC[n].hit.back > gBul[b].x - gBul[b].enemyXL
 				&& gNPC[n].y - gNPC[n].hit.top < gBul[b].y + gBul[b].enemyYL
 				&& gNPC[n].y + gNPC[n].hit.bottom > gBul[b].y - gBul[b].enemyYL)
 				bHit = TRUE;
-			else if (gNPC[n].bits & npc_invulnerable
+			else if (gNPC[n].bits & NPC_INVULNERABLE
 				&& gNPC[n].x - gNPC[n].hit.back < gBul[b].x + gBul[b].blockXL
 				&& gNPC[n].x + gNPC[n].hit.back > gBul[b].x - gBul[b].blockXL
 				&& gNPC[n].y - gNPC[n].hit.top < gBul[b].y + gBul[b].blockYL
@@ -571,7 +571,7 @@
 			if (bHit)
 			{
 				// Damage NPC
-				if (gNPC[n].bits & npc_shootable)
+				if (gNPC[n].bits & NPC_SHOOTABLE)
 				{
 					gNPC[n].life -= gBul[b].damage;
 
@@ -579,10 +579,10 @@
 					{
 						gNPC[n].life = 0;
 
-						if (gNPC[n].bits & npc_showDamage)
+						if (gNPC[n].bits & NPC_SHOW_DAMAGE)
 							gNPC[n].damage_view -= gBul[b].damage;
 
-						if ((gMC.cond & 0x80) && gNPC[n].bits & npc_eventDie)
+						if ((gMC.cond & 0x80) && gNPC[n].bits & NPC_EVENT_WHEN_KILLED)
 							StartTextScript(gNPC[n].code_event);
 						else
 							gNPC[n].cond |= 8;
@@ -598,7 +598,7 @@
 							gNPC[n].shock = 16;
 						}
 
-						if (gNPC[n].bits & npc_showDamage)
+						if (gNPC[n].bits & NPC_SHOW_DAMAGE)
 							gNPC[n].damage_view -= gBul[b].damage;
 					}
 				}