Add surface type enum

This commit is contained in:
nukeykt 2019-08-16 13:32:17 +09:00 committed by Christoph Oelckers
parent 316ddb1fb5
commit 99775a8fe0
2 changed files with 23 additions and 23 deletions

View file

@ -3922,7 +3922,7 @@ void actImpactMissile(spritetype *pMissile, int a2)
int nDamage = (20+Random(10))<<4; int nDamage = (20+Random(10))<<4;
actDamageSprite(nOwner, pSpriteHit, DAMAGE_TYPE_2, nDamage); actDamageSprite(nOwner, pSpriteHit, DAMAGE_TYPE_2, nDamage);
} }
if (surfType[pSpriteHit->picnum] == 4) if (surfType[pSpriteHit->picnum] == kSurfFlesh)
{ {
pMissile->picnum = 2123; pMissile->picnum = 2123;
pXMissile->target = nSpriteHit; pXMissile->target = nSpriteHit;
@ -4108,7 +4108,7 @@ void actTouchFloor(spritetype *pSprite, int nSector)
nDamage = 1000; nDamage = 1000;
actDamageSprite(pSprite->index, pSprite, nDamageType, scale(4, nDamage, 120) << 4); actDamageSprite(pSprite->index, pSprite, nDamageType, scale(4, nDamage, 120) << 4);
} }
if (tileGetSurfType(nSector + 0x4000) == 14) if (tileGetSurfType(nSector + 0x4000) == kSurfLava)
{ {
actDamageSprite(pSprite->index, pSprite, DAMAGE_TYPE_1, 16); actDamageSprite(pSprite->index, pSprite, DAMAGE_TYPE_1, 16);
sfxPlay3DSound(pSprite, 352, 5, 2); sfxPlay3DSound(pSprite, 352, 5, 2);
@ -5062,10 +5062,10 @@ void MoveDude(spritetype *pSprite)
pSprite->hitag |= 4; pSprite->hitag |= 4;
switch (tileGetSurfType(floorHit)) switch (tileGetSurfType(floorHit))
{ {
case 5: case kSurfWater:
gFX.fxSpawn(FX_9, pSprite->sectnum, pSprite->x, pSprite->y, floorZ, 0); gFX.fxSpawn(FX_9, pSprite->sectnum, pSprite->x, pSprite->y, floorZ, 0);
break; break;
case 14: case kSurfLava:
{ {
spritetype *pFX = gFX.fxSpawn(FX_10, pSprite->sectnum, pSprite->x, pSprite->y, floorZ, 0); spritetype *pFX = gFX.fxSpawn(FX_10, pSprite->sectnum, pSprite->x, pSprite->y, floorZ, 0);
if (pFX) if (pFX)
@ -6565,7 +6565,7 @@ void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6,
int y = gHitInfo.hity-mulscale(a5, 16, 14); int y = gHitInfo.hity-mulscale(a5, 16, 14);
int z = gHitInfo.hitz-mulscale(a6, 256, 14); int z = gHitInfo.hitz-mulscale(a6, 256, 14);
short nSector = gHitInfo.hitsect; short nSector = gHitInfo.hitsect;
char nSurf = 0; char nSurf = kSurfNone;
if (nRange == 0 || approxDist(gHitInfo.hitx-pShooter->x, gHitInfo.hity-pShooter->y) < nRange) if (nRange == 0 || approxDist(gHitInfo.hitx-pShooter->x, gHitInfo.hity-pShooter->y) < nRange)
{ {
switch (hit) switch (hit)
@ -6574,7 +6574,7 @@ void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6,
{ {
int nSector = gHitInfo.hitsect; int nSector = gHitInfo.hitsect;
if (sector[nSector].ceilingstat&1) if (sector[nSector].ceilingstat&1)
nSurf = 0; nSurf = kSurfNone;
else else
nSurf = surfType[sector[nSector].ceilingpicnum]; nSurf = surfType[sector[nSector].ceilingpicnum];
break; break;
@ -6583,7 +6583,7 @@ void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6,
{ {
int nSector = gHitInfo.hitsect; int nSector = gHitInfo.hitsect;
if (sector[nSector].floorstat&1) if (sector[nSector].floorstat&1)
nSurf = 0; nSurf = kSurfNone;
else else
nSurf = surfType[sector[nSector].floorpicnum]; nSurf = surfType[sector[nSector].floorpicnum];
break; break;
@ -6910,7 +6910,7 @@ void MakeSplash(spritetype *pSprite, XSPRITE *pXSprite)
switch (pSprite->type) switch (pSprite->type)
{ {
case 423: case 423:
if (nSurface == 5) if (nSurface == kSurfWater)
{ {
seqSpawn(6, 3, nXSprite, -1); seqSpawn(6, 3, nXSprite, -1);
sfxPlay3DSound(pSprite, 356, -1, 0); sfxPlay3DSound(pSprite, 356, -1, 0);

View file

@ -26,21 +26,21 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "blood.h" #include "blood.h"
enum SurfaceType { enum SurfaceType {
kSurf0 = 0, kSurfNone = 0,
kSurf1, kSurfStone,
kSurf2, kSurfMetal,
kSurf3, kSurfWood,
kSurf4, kSurfFlesh,
kSurf5, kSurfWater,
kSurf6, kSurfDirt,
kSurf7, kSurfClay,
kSurf8, kSurfSnow,
kSurf9, kSurfIce,
kSurf10, kSurfLeaves,
kSurf11, kSurfCloth,
kSurf12, kSurfPlant,
kSurf13, kSurfGoo,
kSurf14, kSurfLava,
kSurfMax kSurfMax
}; };