- Added names for callbacks

- Added names for sprite, wall and sector types
- Added gModernMap protection for using new features only on different version of map

# Conflicts:
#	source/blood/src/actor.cpp
#	source/blood/src/callback.cpp
#	source/blood/src/callback.h
#	source/blood/src/triggers.h
This commit is contained in:
Grind Core 2019-10-12 00:59:39 +03:00 committed by Christoph Oelckers
parent 9a4c07db27
commit 08dfee073c
37 changed files with 4056 additions and 4116 deletions

File diff suppressed because it is too large Load diff

View file

@ -82,7 +82,7 @@ struct THINGINFO
unsigned char at15; // xrepeat
unsigned char at16; // yrepeat
int at17[7]; // damage
bool allowThrow; // By NoOne: indicates if kCustomDude can throw it
bool allowThrow; // By NoOne: indicates if kDudeModernCustom can throw it
};
struct AMMOITEMDATA
@ -131,7 +131,7 @@ struct MissileType
unsigned char atb; // yrepeat
char atc; // shade
unsigned char atd; // clipdist
int fireSound[2]; // By NoOne: predefined fire sounds. used by kCustomDude, but can be used for something else.
int fireSound[2]; // By NoOne: predefined fire sounds. used by kDudeModernCustom, but can be used for something else.
};
struct EXPLOSION
@ -164,7 +164,7 @@ struct VECTORDATA {
int at15; // blood splats
int at19; // blood splat chance
VECTORDATA_at1d at1d[15];
int fireSound[2]; // By NoOne: predefined fire sounds. used by kCustomDude, but can be used for something else.
int fireSound[2]; // By NoOne: predefined fire sounds. used by kDudeModernCustom, but can be used for something else.
};
// by NoOne: sprite mass info for getSpriteMassBySize();
@ -239,7 +239,7 @@ bool actHealDude(XSPRITE *pXDude, int a2, int a3);
void actKillDude(int a1, spritetype *pSprite, DAMAGE_TYPE a3, int a4);
int actDamageSprite(int nSource, spritetype *pSprite, DAMAGE_TYPE a3, int a4);
void actHitcodeToData(int a1, HITINFO *pHitInfo, int *a3, spritetype **a4, XSPRITE **a5, int *a6, walltype **a7, XWALL **a8, int *a9, sectortype **a10, XSECTOR **a11);
void actImpactMissile(spritetype *pMissile, int a2);
void actImpactMissile(spritetype *pMissile, int hitCode);
void actKickObject(spritetype *pSprite1, spritetype *pSprite2);
void actTouchFloor(spritetype *pSprite, int nSector);
void ProcessTouchObjects(spritetype *pSprite, int nXSprite);

File diff suppressed because it is too large Load diff

View file

@ -31,7 +31,7 @@ BEGIN_BLD_NS
struct AISTATE {
int stateType; // By NoOne: current type of state. Basically required for kGDXDudeTargetChanger, but can be used for something else.
int stateType; // By NoOne: current type of state. Basically required for kModernDudeTargetChanger, but can be used for something else.
int at0; // seq
int at4; // seq callback
int at8;
@ -104,7 +104,7 @@ void aiProcessDudes(void);
void aiInit(void);
void aiInitSprite(spritetype *pSprite);
// By NoOne: this function required for kGDXDudeTargetChanger
// By NoOne: this function required for kModernDudeTargetChanger
void aiSetGenIdleState(spritetype* pSprite, XSPRITE* pXSprite);
END_BLD_NS

View file

@ -134,7 +134,7 @@ static void StompSeqCallback(int, int nXSprite)
spritetype *pSprite2 = &sprite[nSprite2];
if (pSprite2->extra > 0 && pSprite2->extra < kMaxXSprites)
{
if (pSprite2->type == 251)
if (pSprite2->type == kDudeBeast)
continue;
if (pSprite2->flags&32)
continue;
@ -195,7 +195,7 @@ static void StompSeqCallback(int, int nXSprite)
static void MorphToBeast(spritetype *pSprite, XSPRITE *pXSprite)
{
actHealDude(pXSprite, dudeInfo[51].startHealth, dudeInfo[51].startHealth);
pSprite->type = 251;
pSprite->type = kDudeBeast;
}
static void thinkSearch(spritetype *pSprite, XSPRITE *pXSprite)

View file

@ -110,25 +110,25 @@ static void thinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
{
switch (pSprite->type)
{
case 240:
case kDudeBurningCultist:
aiNewState(pSprite, pXSprite, &cultistBurnSearch);
break;
case 241:
case kDudeBurningZombieAxe:
aiNewState(pSprite, pXSprite, &zombieABurnSearch);
break;
case 242:
case kDudeBurningZombieButcher:
aiNewState(pSprite, pXSprite, &zombieFBurnSearch);
break;
case 239:
case kDudeBurningInnocent:
aiNewState(pSprite, pXSprite, &innocentBurnSearch);
break;
case 253:
case kDudeBurningBeast:
aiNewState(pSprite, pXSprite, &beastBurnSearch);
break;
case 252:
case kDudeBurningTinyCaleb:
aiNewState(pSprite, pXSprite, &tinycalebBurnSearch);
break;
case kCustomDudeBurning:
case kDudeModernCustomBurning:
aiNewState(pSprite, pXSprite, &GDXGenDudeBurnSearch);
break;
}
@ -142,25 +142,25 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
{
switch (pSprite->type)
{
case 240:
case kDudeBurningCultist:
aiNewState(pSprite, pXSprite, &cultistBurnGoto);
break;
case 241:
case kDudeBurningZombieAxe:
aiNewState(pSprite, pXSprite, &zombieABurnGoto);
break;
case 242:
case kDudeBurningZombieButcher:
aiNewState(pSprite, pXSprite, &zombieFBurnGoto);
break;
case 239:
case kDudeBurningInnocent:
aiNewState(pSprite, pXSprite, &innocentBurnGoto);
break;
case 253:
case kDudeBurningBeast:
aiNewState(pSprite, pXSprite, &beastBurnGoto);
break;
case 252:
case kDudeBurningTinyCaleb:
aiNewState(pSprite, pXSprite, &tinycalebBurnGoto);
break;
case kCustomDudeBurning:
case kDudeModernCustomBurning:
aiNewState(pSprite, pXSprite, &GDXGenDudeBurnGoto);
break;
}
@ -178,25 +178,25 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
{
switch (pSprite->type)
{
case 240:
case kDudeBurningCultist:
aiNewState(pSprite, pXSprite, &cultistBurnSearch);
break;
case 241:
case kDudeBurningZombieAxe:
aiNewState(pSprite, pXSprite, &zombieABurnSearch);
break;
case 242:
case kDudeBurningZombieButcher:
aiNewState(pSprite, pXSprite, &zombieFBurnSearch);
break;
case 239:
case kDudeBurningInnocent:
aiNewState(pSprite, pXSprite, &innocentBurnSearch);
break;
case 253:
case kDudeBurningBeast:
aiNewState(pSprite, pXSprite, &beastBurnSearch);
break;
case 252:
case kDudeBurningTinyCaleb:
aiNewState(pSprite, pXSprite, &tinycalebBurnSearch);
break;
case kCustomDudeBurning:
case kDudeModernCustomBurning:
aiNewState(pSprite, pXSprite, &GDXGenDudeBurnSearch);
break;
}
@ -216,25 +216,25 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
{
switch (pSprite->type)
{
case 240:
case kDudeBurningCultist:
aiNewState(pSprite, pXSprite, &cultistBurnAttack);
break;
case 241:
case kDudeBurningZombieAxe:
aiNewState(pSprite, pXSprite, &zombieABurnAttack);
break;
case 242:
case kDudeBurningZombieButcher:
aiNewState(pSprite, pXSprite, &zombieFBurnAttack);
break;
case 239:
case kDudeBurningInnocent:
aiNewState(pSprite, pXSprite, &innocentBurnAttack);
break;
case 253:
case kDudeBurningBeast:
aiNewState(pSprite, pXSprite, &beastBurnAttack);
break;
case 252:
case kDudeBurningTinyCaleb:
aiNewState(pSprite, pXSprite, &tinycalebBurnAttack);
break;
case kCustomDudeBurning:
case kDudeModernCustomBurning:
aiNewState(pSprite, pXSprite, &GDXGenDudeBurnSearch);
break;
}
@ -246,25 +246,25 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
switch (pSprite->type)
{
case 240:
case kDudeBurningCultist:
aiNewState(pSprite, pXSprite, &cultistBurnGoto);
break;
case 241:
case kDudeBurningZombieAxe:
aiNewState(pSprite, pXSprite, &zombieABurnGoto);
break;
case 242:
aiNewState(pSprite, pXSprite, &zombieFBurnGoto);
break;
case 239:
case kDudeBurningInnocent:
aiNewState(pSprite, pXSprite, &innocentBurnGoto);
break;
case 253:
case kDudeBurningBeast:
aiNewState(pSprite, pXSprite, &beastBurnGoto);
break;
case 252:
case kDudeBurningTinyCaleb:
aiNewState(pSprite, pXSprite, &tinycalebBurnGoto);
break;
case kCustomDudeBurning:
case kDudeModernCustomBurning:
aiNewState(pSprite, pXSprite, &GDXGenDudeBurnSearch);
break;
}

View file

@ -163,15 +163,14 @@ static void BurnSeqCallback(int, int nXSprite)
}
}
}
switch (pSprite->type)
{
case 227:
actFireMissile(pSprite, -350, 0, aim.dx, aim.dy, aim.dz, 313);
actFireMissile(pSprite, 350, -100, aim.dx, aim.dy, aim.dz, 313);
break;
case 228:
actFireMissile(pSprite, 350, -100, aim.dx, aim.dy, aim.dz, 313);
break;
switch (pSprite->type) {
case kDudeCerberusTwoHead:
actFireMissile(pSprite, -350, 0, aim.dx, aim.dy, aim.dz, kMissileFireballCerberus);
actFireMissile(pSprite, 350, -100, aim.dx, aim.dy, aim.dz, kMissileFireballCerberus);
break;
case kDudeCerberusOneHead:
actFireMissile(pSprite, 350, -100, aim.dx, aim.dy, aim.dz, kMissileFireballCerberus);
break;
}
}
@ -248,15 +247,14 @@ static void BurnSeqCallback2(int, int nXSprite)
}
}
}
switch (pSprite->type)
{
case 227:
actFireMissile(pSprite, 350, -100, aim.dx, aim.dy, -aim.dz, 308);
actFireMissile(pSprite, -350, 0, ax, ay, az, 308);
break;
case 228:
actFireMissile(pSprite, 350, -100, aim.dx, aim.dy, -aim.dz, 308);
break;
switch (pSprite->type) {
case kDudeCerberusTwoHead:
actFireMissile(pSprite, 350, -100, aim.dx, aim.dy, -aim.dz, kMissileFlameHound);
actFireMissile(pSprite, -350, 0, ax, ay, az, kMissileFlameHound);
break;
case kDudeCerberusOneHead:
actFireMissile(pSprite, 350, -100, aim.dx, aim.dy, -aim.dz, kMissileFlameHound);
break;
}
}
@ -278,7 +276,7 @@ static void thinkTarget(spritetype *pSprite, XSPRITE *pXSprite)
pXSprite->goalAng += 256;
POINT3D *pTarget = &baseSprite[pSprite->index];
aiSetTarget(pXSprite, pTarget->x, pTarget->y, pTarget->z);
if (pSprite->type == 227)
if (pSprite->type == kDudeCerberusTwoHead)
aiNewState(pSprite, pXSprite, &cerberus139890);
else
aiNewState(pSprite, pXSprite, &cerberus1398AC);
@ -333,14 +331,13 @@ static void thinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
aiChooseDirection(pSprite, pXSprite, nAngle);
if (nDist < 512 && klabs(pSprite->ang - nAngle) < pDudeInfo->periphery)
{
switch (pSprite->type)
{
case 227:
aiNewState(pSprite, pXSprite, &cerberusSearch);
break;
case 228:
aiNewState(pSprite, pXSprite, &cerberus2Search);
break;
switch (pSprite->type) {
case kDudeCerberusTwoHead:
aiNewState(pSprite, pXSprite, &cerberusSearch);
break;
case kDudeCerberusOneHead:
aiNewState(pSprite, pXSprite, &cerberus2Search);
break;
}
}
aiThinkTarget(pSprite, pXSprite);
@ -348,21 +345,19 @@ static void thinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
{
if (pXSprite->target == -1)
{
switch (pSprite->type)
{
case 227:
aiNewState(pSprite, pXSprite, &cerberusGoto);
break;
case 228:
aiNewState(pSprite, pXSprite, &cerberus2Goto);
break;
if (pXSprite->target == -1) {
switch (pSprite->type) {
case kDudeCerberusTwoHead:
aiNewState(pSprite, pXSprite, &cerberusGoto);
break;
case kDudeCerberusOneHead:
aiNewState(pSprite, pXSprite, &cerberus2Goto);
break;
}
return;
}
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax))
return;
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) return;
//dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
DUDEINFO *pDudeInfo = &dudeInfo[pSprite->type - kDudeBase];
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites))
@ -373,32 +368,31 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
int dx = pTarget->x-pSprite->x;
int dy = pTarget->y-pSprite->y;
aiChooseDirection(pSprite, pXSprite, getangle(dx, dy));
if (pXTarget->health == 0)
{
switch (pSprite->type)
{
case 227:
aiNewState(pSprite, pXSprite, &cerberusSearch);
break;
case 228:
aiNewState(pSprite, pXSprite, &cerberus2Search);
break;
if (pXTarget->health == 0) {
switch (pSprite->type) {
case kDudeCerberusTwoHead:
aiNewState(pSprite, pXSprite, &cerberusSearch);
break;
case kDudeCerberusOneHead:
aiNewState(pSprite, pXSprite, &cerberus2Search);
break;
}
return;
}
if (IsPlayerSprite(pTarget) && powerupCheck(&gPlayer[pTarget->type-kDudePlayer1], 13) > 0)
{
switch (pSprite->type)
{
case 227:
aiNewState(pSprite, pXSprite, &cerberusSearch);
break;
case 228:
aiNewState(pSprite, pXSprite, &cerberus2Search);
break;
if (IsPlayerSprite(pTarget) && powerupCheck(&gPlayer[pTarget->type-kDudePlayer1], 13) > 0) {
switch (pSprite->type) {
case kDudeCerberusTwoHead:
aiNewState(pSprite, pXSprite, &cerberusSearch);
break;
case kDudeCerberusOneHead:
aiNewState(pSprite, pXSprite, &cerberus2Search);
break;
}
return;
}
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
@ -406,72 +400,66 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
int height = (pDudeInfo->eyeHeight*pSprite->yrepeat)<<2;
if (cansee(pTarget->x, pTarget->y, pTarget->z, pTarget->sectnum, pSprite->x, pSprite->y, pSprite->z - height, pSprite->sectnum))
{
if (nDist < pDudeInfo->seeDist && klabs(nDeltaAngle) <= pDudeInfo->periphery)
{
if (nDist < pDudeInfo->seeDist && klabs(nDeltaAngle) <= pDudeInfo->periphery) {
aiSetTarget(pXSprite, pXSprite->target);
if (nDist < 0x1b00 && nDist > 0xd00 && klabs(nDeltaAngle) < 85)
{
switch (pSprite->type)
{
case 227:
aiNewState(pSprite, pXSprite, &cerberusBurn);
break;
case 228:
aiNewState(pSprite, pXSprite, &cerberus2Burn);
break;
if (nDist < 0x1b00 && nDist > 0xd00 && klabs(nDeltaAngle) < 85) {
switch (pSprite->type) {
case kDudeCerberusTwoHead:
aiNewState(pSprite, pXSprite, &cerberusBurn);
break;
case kDudeCerberusOneHead:
aiNewState(pSprite, pXSprite, &cerberus2Burn);
break;
}
}
else if (nDist < 0xb00 && nDist > 0x500 && klabs(nDeltaAngle) < 85)
{
switch (pSprite->type)
{
case 227:
aiNewState(pSprite, pXSprite, &cerberus3Burn);
break;
case 228:
aiNewState(pSprite, pXSprite, &cerberus4Burn);
break;
else if (nDist < 0xb00 && nDist > 0x500 && klabs(nDeltaAngle) < 85) {
switch (pSprite->type) {
case kDudeCerberusTwoHead:
aiNewState(pSprite, pXSprite, &cerberus3Burn);
break;
case kDudeCerberusOneHead:
aiNewState(pSprite, pXSprite, &cerberus4Burn);
break;
}
}
else if (nDist < 0x200 && klabs(nDeltaAngle) < 85)
{
int hit = HitScan(pSprite, pSprite->z, dx, dy, 0, CLIPMASK1, 0);
switch (pSprite->type)
{
case 227:
switch (hit)
{
case -1:
aiNewState(pSprite, pXSprite, &cerberusBite);
break;
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != 211)
switch (pSprite->type) {
case kDudeCerberusTwoHead:
switch (hit) {
case -1:
aiNewState(pSprite, pXSprite, &cerberusBite);
break;
case 0:
case 4:
break;
default:
aiNewState(pSprite, pXSprite, &cerberusBite);
break;
break;
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeHellHound)
aiNewState(pSprite, pXSprite, &cerberusBite);
break;
case 0:
case 4:
break;
default:
aiNewState(pSprite, pXSprite, &cerberusBite);
break;
}
break;
case 228:
switch (hit)
{
case -1:
aiNewState(pSprite, pXSprite, &cerberus2Bite);
break;
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != 211)
case kDudeCerberusOneHead:
switch (hit) {
case -1:
aiNewState(pSprite, pXSprite, &cerberus2Bite);
break;
case 0:
case 4:
break;
default:
aiNewState(pSprite, pXSprite, &cerberus2Bite);
break;
break;
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeHellHound)
aiNewState(pSprite, pXSprite, &cerberus2Bite);
break;
case 0:
case 4:
break;
default:
aiNewState(pSprite, pXSprite, &cerberus2Bite);
break;
}
break;
}
@ -481,14 +469,13 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
}
}
switch (pSprite->type)
{
case 227:
aiNewState(pSprite, pXSprite, &cerberusGoto);
break;
case 228:
aiNewState(pSprite, pXSprite, &cerberus2Goto);
break;
switch (pSprite->type) {
case kDudeCerberusTwoHead:
aiNewState(pSprite, pXSprite, &cerberusGoto);
break;
case kDudeCerberusOneHead:
aiNewState(pSprite, pXSprite, &cerberus2Goto);
break;
}
pXSprite->target = -1;
}

View file

@ -128,7 +128,7 @@ static void TeslaSeqCallback(int, int nXSprite)
dx += Random3((5-gGameOptions.nDifficulty)*1000);
dy += Random3((5-gGameOptions.nDifficulty)*1000);
dz += Random3((5-gGameOptions.nDifficulty)*500);
actFireMissile(pSprite, 0, 0, dx, dy, dz, 306);
actFireMissile(pSprite, 0, 0, dx, dy, dz, kMissileTeslaRegular);
sfxPlay3DSound(pSprite, 470, -1, 0);
}
}
@ -162,9 +162,9 @@ static void ThrowSeqCallback(int, int nXSprite)
XSPRITE *pXSprite = &xsprite[nXSprite];
int nSprite = pXSprite->reference;
spritetype *pSprite = &sprite[nSprite];
int nMissile = 418;
int nMissile = kThingArmedTNTStick;
if (gGameOptions.nDifficulty > 2)
nMissile = 419;
nMissile = kThingArmedTNTBundle;
char v4 = Chance(0x6000);
sfxPlay3DSound(pSprite, 455, -1, 0);
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
@ -181,7 +181,7 @@ static void ThrowSeqCallback(int, int nXSprite)
if (v4)
xsprite[pMissile->extra].Impact = 1;
else
evPost(pMissile->index, 3, 120*(1+Random(2)), COMMAND_ID_1);
evPost(pMissile->index, 3, 120*(1+Random(2)), kCmdOn);
}
static void sub_68170(int, int nXSprite)
@ -189,12 +189,12 @@ static void sub_68170(int, int nXSprite)
XSPRITE *pXSprite = &xsprite[nXSprite];
int nSprite = pXSprite->reference;
spritetype *pSprite = &sprite[nSprite];
int nMissile = 418;
int nMissile = kThingArmedTNTStick;
if (gGameOptions.nDifficulty > 2)
nMissile = 419;
nMissile = kThingArmedTNTBundle;
sfxPlay3DSound(pSprite, 455, -1, 0);
spritetype *pMissile = actFireThing(pSprite, 0, 0, gDudeSlope[nXSprite]-9460, nMissile, 0x133333);
evPost(pMissile->index, 3, 120*(2+Random(2)), COMMAND_ID_1);
evPost(pMissile->index, 3, 120*(2+Random(2)), kCmdOn);
}
static void sub_68230(int, int nXSprite)
@ -202,9 +202,9 @@ static void sub_68230(int, int nXSprite)
XSPRITE *pXSprite = &xsprite[nXSprite];
int nSprite = pXSprite->reference;
spritetype *pSprite = &sprite[nSprite];
int nMissile = 418;
int nMissile = kThingArmedTNTStick;
if (gGameOptions.nDifficulty > 2)
nMissile = 419;
nMissile = kThingArmedTNTBundle;
sfxPlay3DSound(pSprite, 455, -1, 0);
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
spritetype *pTarget = &sprite[pXSprite->target];
@ -222,7 +222,7 @@ static char TargetNearExplosion(spritetype *pSprite)
{
for (short nSprite = headspritesect[pSprite->sectnum]; nSprite >= 0; nSprite = nextspritesect[nSprite])
{
if (sprite[nSprite].type == 418 || sprite[nSprite].statnum == kStatExplosion)
if (sprite[nSprite].type == kThingArmedTNTStick || sprite[nSprite].statnum == kStatExplosion)
return 1;
}
return 0;
@ -289,7 +289,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
{
case 0:
aiNewState(pSprite, pXSprite, &cultistSearch);
if (pSprite->type == 201)
if (pSprite->type == kDudeCultistTommy)
aiPlay3DSound(pSprite, 4021+Random(4), AI_SFX_PRIORITY_1, -1);
else
aiPlay3DSound(pSprite, 1021+Random(4), AI_SFX_PRIORITY_1, -1);
@ -327,9 +327,8 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
aiSetTarget(pXSprite, pXSprite->target);
int nXSprite = sprite[pXSprite->reference].extra;
gDudeSlope[nXSprite] = divscale(pTarget->z-pSprite->z, nDist, 10);
switch (pSprite->type)
{
case 201:
switch (pSprite->type) {
case kDudeCultistTommy:
if (nDist < 0x1e00 && nDist > 0xe00 && klabs(nDeltaAngle) < 85 && !TargetNearExplosion(pTarget)
&& (pTarget->flags&2) && gGameOptions.nDifficulty > 2 && IsPlayerSprite(pTarget) && gPlayer[pTarget->type-kDudePlayer1].at2e
&& Chance(0x8000))
@ -345,7 +344,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
case 4:
break;
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != 202 && pXSprite->medium != 1 && pXSprite->medium != 2)
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeCultistShotgun && pXSprite->medium != 1 && pXSprite->medium != 2)
aiNewState(pSprite, pXSprite, &cultistTThrow);
break;
default:
@ -367,7 +366,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
aiNewState(pSprite, pXSprite, &cultistTSwimFire);
break;
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != 202)
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeCultistShotgun)
{
if (!sub_5BDA8(pSprite, 14) && pXSprite->medium == 0)
aiNewState(pSprite, pXSprite, &cultistTFire);
@ -397,7 +396,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
}
}
break;
case 202:
case kDudeCultistShotgun:
if (nDist < 0x2c00 && nDist > 0x1400 && !TargetNearExplosion(pTarget)
&& (pTarget->flags&2) && gGameOptions.nDifficulty >= 2 && IsPlayerSprite(pTarget) && !gPlayer[pTarget->type-kDudePlayer1].at2e
&& Chance(0x8000))
@ -413,7 +412,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
case 4:
break;
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != 202 && pXSprite->medium != 1 && pXSprite->medium != 2)
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeCultistShotgun && pXSprite->medium != 1 && pXSprite->medium != 2)
aiNewState(pSprite, pXSprite, &cultistSThrow);
break;
default:
@ -435,7 +434,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
aiNewState(pSprite, pXSprite, &cultistSSwimFire);
break;
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != 201)
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeCultistTommy)
{
if (!sub_5BDA8(pSprite, 14) && pXSprite->medium == 0)
aiNewState(pSprite, pXSprite, &cultistSFire);
@ -465,7 +464,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
}
}
break;
case 247:
case kDudeCultistTesla:
if (nDist < 0x1e00 && nDist > 0xe00 && !TargetNearExplosion(pTarget)
&& (pTarget->flags&2) && gGameOptions.nDifficulty > 2 && IsPlayerSprite(pTarget) && gPlayer[pTarget->type-kDudePlayer1].at2e
&& Chance(0x8000))
@ -481,7 +480,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
case 4:
break;
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != 202 && pXSprite->medium != 1 && pXSprite->medium != 2)
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeCultistShotgun && pXSprite->medium != 1 && pXSprite->medium != 2)
aiNewState(pSprite, pXSprite, &cultistTsThrow);
break;
default:
@ -503,7 +502,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
aiNewState(pSprite, pXSprite, &cultistTsSwimFire);
break;
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != 201)
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeCultistTommy)
{
if (!sub_5BDA8(pSprite, 14) && pXSprite->medium == 0)
aiNewState(pSprite, pXSprite, &cultistTsFire);
@ -533,7 +532,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
}
}
break;
case 248:
case kDudeCultistTNT:
if (nDist < 0x2c00 && nDist > 0x1400 && klabs(nDeltaAngle) < 85
&& (pTarget->flags&2) && IsPlayerSprite(pTarget))
{
@ -547,7 +546,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
case 4:
break;
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != 202 && pXSprite->medium != 1 && pXSprite->medium != 2)
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeCultistShotgun && pXSprite->medium != 1 && pXSprite->medium != 2)
aiNewState(pSprite, pXSprite, &cultistDThrow);
break;
default:
@ -568,7 +567,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
case 4:
break;
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != 202 && pXSprite->medium != 1 && pXSprite->medium != 2)
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeCultistShotgun && pXSprite->medium != 1 && pXSprite->medium != 2)
aiNewState(pSprite, pXSprite, &cultist139A78);
break;
default:
@ -577,7 +576,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
}
}
break;
case 249:
case kDudeCultistBeast:
if (nDist < 0x1e00 && nDist > 0xe00 && !TargetNearExplosion(pTarget)
&& (pTarget->flags&2) && gGameOptions.nDifficulty > 2 && IsPlayerSprite(pTarget) && gPlayer[pTarget->type-kDudePlayer1].at2e
&& Chance(0x8000))
@ -593,7 +592,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
case 4:
break;
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != 202 && pXSprite->medium != 1 && pXSprite->medium != 2)
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeCultistShotgun && pXSprite->medium != 1 && pXSprite->medium != 2)
aiNewState(pSprite, pXSprite, &cultistSThrow);
break;
default:
@ -615,7 +614,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
aiNewState(pSprite, pXSprite, &cultistSSwimFire);
break;
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != 201)
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeCultistTommy)
{
if (!sub_5BDA8(pSprite, 14) && pXSprite->medium == 0)
aiNewState(pSprite, pXSprite, &cultistSFire);

View file

@ -125,7 +125,7 @@ static void ThrowFSeqCallback(int, int nXSprite)
{
XSPRITE *pXSprite = &xsprite[nXSprite];
int nSprite = pXSprite->reference;
actFireThing(&sprite[nSprite], 0, 0, gDudeSlope[nXSprite]-7500, 421, 0xeeeee);
actFireThing(&sprite[nSprite], 0, 0, gDudeSlope[nXSprite]-7500, kThingBone, 0xeeeee);
}
static void BlastSSeqCallback(int, int nXSprite)
@ -210,8 +210,8 @@ static void BlastSSeqCallback(int, int nXSprite)
}
if (IsPlayerSprite(pTarget) || !VanillaMode()) // By NoOne: allow to fire missile in non-player targets
{
actFireMissile(pSprite, -120, 0, aim.dx, aim.dy, aim.dz, 311);
actFireMissile(pSprite, 120, 0, aim.dx, aim.dy, aim.dz, 311);
actFireMissile(pSprite, -120, 0, aim.dx, aim.dy, aim.dz, kMissileArcGargoyle);
actFireMissile(pSprite, 120, 0, aim.dx, aim.dy, aim.dz, kMissileArcGargoyle);
}
}
@ -220,7 +220,7 @@ static void ThrowSSeqCallback(int, int nXSprite)
XSPRITE *pXSprite = &xsprite[nXSprite];
int nSprite = pXSprite->reference;
spritetype *pSprite = &sprite[nSprite];
actFireThing(pSprite, 0, 0, gDudeSlope[nXSprite]-7500, 421, Chance(0x6000) ? 0x133333 : 0x111111);
actFireThing(pSprite, 0, 0, gDudeSlope[nXSprite]-7500, kThingBone, Chance(0x6000) ? 0x133333 : 0x111111);
}
static void thinkTarget(spritetype *pSprite, XSPRITE *pXSprite)
@ -398,9 +398,8 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
{
aiSetTarget(pXSprite, pXSprite->target);
int floorZ = getflorzofslope(pSprite->sectnum, pSprite->x, pSprite->y);
switch (pSprite->type)
{
case 206:
switch (pSprite->type) {
case kDudeGargoyleFlesh:
if (nDist < 0x1800 && nDist > 0xc00 && klabs(nDeltaAngle) < 85)
{
int hit = HitScan(pSprite, pSprite->z, dx, dy, 0, CLIPMASK1, 0);
@ -414,7 +413,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
case 4:
break;
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != 207)
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeGargoyleStone)
{
sfxPlay3DSound(pSprite, 1408, 0, 0);
aiNewState(pSprite, pXSprite, &gargoyleFThrow);
@ -439,7 +438,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
case 4:
break;
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != 207)
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeGargoyleStone)
{
sfxPlay3DSound(pSprite, 1406, 0, 0);
aiNewState(pSprite, pXSprite, &gargoyleFSlash);
@ -459,7 +458,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
else if ((height2-height < 0x2000 || floorZ-bottom < 0x2000) && klabs(nDeltaAngle) < 85)
aiPlay3DSound(pSprite, 1400, AI_SFX_PRIORITY_1, -1);
break;
case 207:
case kDudeGargoyleStone:
if (nDist < 0x1800 && nDist > 0xc00 && klabs(nDeltaAngle) < 85)
{
int hit = HitScan(pSprite, pSprite->z, dx, dy, 0, CLIPMASK1, 0);
@ -473,7 +472,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
case 4:
break;
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != 206)
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeGargoyleFlesh)
{
sfxPlay3DSound(pSprite, 1457, 0, 0);
aiNewState(pSprite, pXSprite, &gargoyleSBlast);
@ -497,7 +496,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
case 4:
break;
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != 206)
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeGargoyleFlesh)
aiNewState(pSprite, pXSprite, &gargoyleFSlash);
break;
default:
@ -507,7 +506,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
}
else if ((height2-height > 0x2000 || floorZ-bottom > 0x2000) && nDist < 0x1400 && nDist > 0x800)
{
if (pSprite->type == 206)
if (pSprite->type == kDudeGargoyleFlesh)
aiPlay3DSound(pSprite, 1400, AI_SFX_PRIORITY_1, -1);
else
aiPlay3DSound(pSprite, 1450, AI_SFX_PRIORITY_1, -1);
@ -535,14 +534,14 @@ static void entryFStatue(spritetype *pSprite, XSPRITE *pXSprite)
{
DUDEINFO *pDudeInfo = &dudeInfo[6];
actHealDude(pXSprite, pDudeInfo->startHealth, pDudeInfo->startHealth);
pSprite->type = 206;
pSprite->type = kDudeGargoyleFlesh;
}
static void entrySStatue(spritetype *pSprite, XSPRITE *pXSprite)
{
DUDEINFO *pDudeInfo = &dudeInfo[7];
actHealDude(pXSprite, pDudeInfo->startHealth, pDudeInfo->startHealth);
pSprite->type = 207;
pSprite->type = kDudeGargoyleStone;
}
static void MoveForward(spritetype *pSprite, XSPRITE *pXSprite)
@ -612,14 +611,13 @@ static void MoveSlow(spritetype *pSprite, XSPRITE *pXSprite)
t2 >>= 1;
xvel[nSprite] = dmulscale30(t1, nCos, t2, nSin);
yvel[nSprite] = dmulscale30(t1, nSin, -t2, nCos);
switch (pSprite->type)
{
case 206:
zvel[nSprite] = 0x44444;
break;
case 207:
zvel[nSprite] = 0x35555;
break;
switch (pSprite->type) {
case kDudeGargoyleFlesh:
zvel[nSprite] = 0x44444;
break;
case kDudeGargoyleStone:
zvel[nSprite] = 0x35555;
break;
}
}
@ -654,14 +652,13 @@ static void MoveSwoop(spritetype *pSprite, XSPRITE *pXSprite)
t1 += nAccel>>1;
xvel[nSprite] = dmulscale30(t1, nCos, t2, nSin);
yvel[nSprite] = dmulscale30(t1, nSin, -t2, nCos);
switch (pSprite->type)
{
case 206:
zvel[nSprite] = t1;
break;
case 207:
zvel[nSprite] = t1;
break;
switch (pSprite->type) {
case kDudeGargoyleFlesh:
zvel[nSprite] = t1;
break;
case kDudeGargoyleStone:
zvel[nSprite] = t1;
break;
}
}
@ -696,14 +693,13 @@ static void MoveFly(spritetype *pSprite, XSPRITE *pXSprite)
t1 += nAccel>>1;
xvel[nSprite] = dmulscale30(t1, nCos, t2, nSin);
yvel[nSprite] = dmulscale30(t1, nSin, -t2, nCos);
switch (pSprite->type)
{
case 206:
zvel[nSprite] = -t1;
break;
case 207:
zvel[nSprite] = -t1;
break;
switch (pSprite->type) {
case kDudeGargoyleFlesh:
zvel[nSprite] = -t1;
break;
case kDudeGargoyleStone:
zvel[nSprite] = -t1;
break;
}
klabs(zvel[nSprite]);
}

View file

@ -108,7 +108,7 @@ static void ThrowSeqCallback(int, int nXSprite)
{
XSPRITE *pXSprite = &xsprite[nXSprite];
int nSprite = pXSprite->reference;
actFireThing(&sprite[nSprite], 0, 0, gDudeSlope[nXSprite]-7500, 421, 0xeeeee);
actFireThing(&sprite[nSprite], 0, 0, gDudeSlope[nXSprite]-7500, kThingBone, 0xeeeee);
}
static void BlastSeqCallback(int, int nXSprite)
@ -194,7 +194,7 @@ static void BlastSeqCallback(int, int nXSprite)
if (IsPlayerSprite(pTarget) || !VanillaMode()) // By NoOne: allow fire missile in non-player targets if not a demo
{
sfxPlay3DSound(pSprite, 489, 0, 0);
actFireMissile(pSprite, 0, 0, aim.dx, aim.dy, aim.dz, 307);
actFireMissile(pSprite, 0, 0, aim.dx, aim.dy, aim.dz, kMissileEctoSkull);
}
}
@ -372,11 +372,9 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
{
aiSetTarget(pXSprite, pXSprite->target);
int floorZ = getflorzofslope(pSprite->sectnum, pSprite->x, pSprite->y);
switch (pSprite->type)
{
case 210:
if (nDist < 0x2000 && nDist > 0x1000 && klabs(nDeltaAngle) < 85)
{
switch (pSprite->type) {
case kDudePhantasm:
if (nDist < 0x2000 && nDist > 0x1000 && klabs(nDeltaAngle) < 85) {
int hit = HitScan(pSprite, pSprite->z, dx, dy, 0, CLIPMASK1, 0);
switch (hit)
{
@ -387,7 +385,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
case 4:
break;
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != 210)
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudePhantasm)
aiNewState(pSprite, pXSprite, &ghostBlast);
break;
default:
@ -407,7 +405,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
case 4:
break;
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != 210)
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudePhantasm)
aiNewState(pSprite, pXSprite, &ghostSlash);
break;
default:
@ -505,11 +503,10 @@ static void MoveSlow(spritetype *pSprite, XSPRITE *pXSprite)
t2 >>= 1;
xvel[nSprite] = dmulscale30(t1, nCos, t2, nSin);
yvel[nSprite] = dmulscale30(t1, nSin, -t2, nCos);
switch (pSprite->type)
{
case 210:
zvel[nSprite] = 0x44444;
break;
switch (pSprite->type) {
case kDudePhantasm:
zvel[nSprite] = 0x44444;
break;
}
}
@ -544,11 +541,10 @@ static void MoveSwoop(spritetype *pSprite, XSPRITE *pXSprite)
t1 += nAccel>>1;
xvel[nSprite] = dmulscale30(t1, nCos, t2, nSin);
yvel[nSprite] = dmulscale30(t1, nSin, -t2, nCos);
switch (pSprite->type)
{
case 210:
zvel[nSprite] = t1;
break;
switch (pSprite->type) {
case kDudePhantasm:
zvel[nSprite] = t1;
break;
}
}
@ -583,11 +579,10 @@ static void MoveFly(spritetype *pSprite, XSPRITE *pXSprite)
t1 += nAccel>>1;
xvel[nSprite] = dmulscale30(t1, nCos, t2, nSin);
yvel[nSprite] = dmulscale30(t1, nSin, -t2, nCos);
switch (pSprite->type)
{
case 210:
zvel[nSprite] = -t1;
break;
switch (pSprite->type) {
case kDudePhantasm:
zvel[nSprite] = -t1;
break;
}
}

View file

@ -86,7 +86,7 @@ static void BurnSeqCallback(int, int nXSprite)
XSPRITE *pXSprite = &xsprite[nXSprite];
int nSprite = pXSprite->reference;
spritetype *pSprite = &sprite[nSprite];
actFireMissile(pSprite, 0, 0, Cos(pSprite->ang)>>16, Sin(pSprite->ang)>>16, 0, 308);
actFireMissile(pSprite, 0, 0, Cos(pSprite->ang)>>16, Sin(pSprite->ang)>>16, 0, kMissileFlameHound);
}
static void thinkSearch(spritetype *pSprite, XSPRITE *pXSprite)

View file

@ -111,7 +111,7 @@ static void sub_6FFA0(int, int nXSprite)
spritetype *pMissile = NULL;
switch (pSprite->type)
{
case 221:
case kDudePodGreen:
dz += 8000;
if (pDudeInfo->seeDist*0.1 < nDist)
{
@ -119,17 +119,17 @@ static void sub_6FFA0(int, int nXSprite)
sfxPlay3DSound(pSprite, 2474, -1, 0);
else
sfxPlay3DSound(pSprite, 2475, -1, 0);
pMissile = actFireThing(pSprite, 0, -8000, dz/128-14500, 430, (nDist2<<23)/120);
pMissile = actFireThing(pSprite, 0, -8000, dz/128-14500, kThingPodFireBall, (nDist2<<23)/120);
}
if (pMissile)
seqSpawn(68, 3, pMissile->extra, -1);
break;
case 223:
case kDudePodFire:
dz += 8000;
if (pDudeInfo->seeDist*0.1 < nDist)
{
sfxPlay3DSound(pSprite, 2454, -1, 0);
pMissile = actFireThing(pSprite, 0, -8000, dz/128-14500, 429, (nDist2<<23)/120);
pMissile = actFireThing(pSprite, 0, -8000, dz/128-14500, kThingPodGreenBall, (nDist2<<23)/120);
}
if (pMissile)
seqSpawn(22, 3, pMissile->extra, -1);
@ -147,19 +147,18 @@ static void sub_70284(int, int nXSprite)
sfxPlay3DSound(pSprite, 2502, -1, 0);
int nDist, nBurn;
DAMAGE_TYPE dmgType;
switch (pSprite->type)
{
case 222:
default:
nBurn = 0;
dmgType = DAMAGE_TYPE_2;
nDist = 50;
break;
case 224:
nBurn = (gGameOptions.nDifficulty*120)>>2;
dmgType = DAMAGE_TYPE_3;
nDist = 75;
break;
switch (pSprite->type) {
case kDudeTentacleGreen:
default: // ???
nBurn = 0;
dmgType = DAMAGE_TYPE_2;
nDist = 50;
break;
case kDudeTentacleFire: // ???
nBurn = (gGameOptions.nDifficulty*120)>>2;
dmgType = DAMAGE_TYPE_3;
nDist = 75;
break;
}
sub_2A620(nSprite, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, nDist, 1, 5*(1+gGameOptions.nDifficulty), dmgType, 2, nBurn, 0, 0);
}
@ -182,18 +181,16 @@ static void sub_70380(spritetype *pSprite, XSPRITE *pXSprite)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(pSprite, pXSprite, nAngle);
if (nDist < 512 && klabs(pSprite->ang - nAngle) < pDudeInfo->periphery)
{
switch (pSprite->type)
{
case 221:
case 223:
aiNewState(pSprite, pXSprite, &podSearch);
break;
case 222:
case 224:
aiNewState(pSprite, pXSprite, &tentacleSearch);
break;
if (nDist < 512 && klabs(pSprite->ang - nAngle) < pDudeInfo->periphery) {
switch (pSprite->type) {
case kDudePodGreen:
case kDudePodFire:
aiNewState(pSprite, pXSprite, &podSearch);
break;
case kDudeTentacleGreen:
case kDudeTentacleFire:
aiNewState(pSprite, pXSprite, &tentacleSearch);
break;
}
}
aiThinkTarget(pSprite, pXSprite);
@ -201,18 +198,16 @@ static void sub_70380(spritetype *pSprite, XSPRITE *pXSprite)
static void sub_704D8(spritetype *pSprite, XSPRITE *pXSprite)
{
if (pXSprite->target == -1)
{
switch (pSprite->type)
{
case 221:
case 223:
aiNewState(pSprite, pXSprite, &pod13A600);
break;
case 222:
case 224:
aiNewState(pSprite, pXSprite, &tentacle13A718);
break;
if (pXSprite->target == -1) {
switch (pSprite->type) {
case kDudePodGreen:
case kDudePodFire:
aiNewState(pSprite, pXSprite, &pod13A600);
break;
case kDudeTentacleGreen:
case kDudeTentacleFire:
aiNewState(pSprite, pXSprite, &tentacle13A718);
break;
}
return;
}
@ -228,18 +223,17 @@ static void sub_704D8(spritetype *pSprite, XSPRITE *pXSprite)
int dx = pTarget->x-pSprite->x;
int dy = pTarget->y-pSprite->y;
aiChooseDirection(pSprite, pXSprite, getangle(dx, dy));
if (pXTarget->health == 0)
{
switch (pSprite->type)
{
case 221:
case 223:
aiNewState(pSprite, pXSprite, &podSearch);
break;
case 222:
case 224:
aiNewState(pSprite, pXSprite, &tentacleSearch);
break;
if (pXTarget->health == 0) {
switch (pSprite->type) {
case kDudePodGreen:
case kDudePodFire:
aiNewState(pSprite, pXSprite, &podSearch);
break;
case kDudeTentacleGreen:
case kDudeTentacleFire:
aiNewState(pSprite, pXSprite, &tentacleSearch);
break;
}
return;
}
@ -253,18 +247,16 @@ static void sub_704D8(spritetype *pSprite, XSPRITE *pXSprite)
if (nDist < pDudeInfo->seeDist && klabs(nDeltaAngle) <= pDudeInfo->periphery)
{
aiSetTarget(pXSprite, pXSprite->target);
if (klabs(nDeltaAngle) < 85 && pTarget->type != 221 && pTarget->type != 223)
{
switch (pSprite->type)
{
case 221:
case 223:
aiNewState(pSprite, pXSprite, &pod13A638);
break;
case 222:
case 224:
aiNewState(pSprite, pXSprite, &tentacle13A750);
break;
if (klabs(nDeltaAngle) < 85 && pTarget->type != kDudePodGreen && pTarget->type != kDudePodFire) {
switch (pSprite->type) {
case kDudePodGreen:
case kDudePodFire:
aiNewState(pSprite, pXSprite, &pod13A638);
break;
case kDudeTentacleGreen:
case kDudeTentacleFire:
aiNewState(pSprite, pXSprite, &tentacle13A750);
break;
}
}
return;
@ -272,16 +264,15 @@ static void sub_704D8(spritetype *pSprite, XSPRITE *pXSprite)
}
}
switch (pSprite->type)
{
case 221:
case 223:
aiNewState(pSprite, pXSprite, &pod13A600);
break;
case 222:
case 224:
aiNewState(pSprite, pXSprite, &tentacle13A718);
break;
switch (pSprite->type) {
case kDudePodGreen:
case kDudePodFire:
aiNewState(pSprite, pXSprite, &pod13A600);
break;
case kDudeTentacleGreen:
case kDudeTentacleFire:
aiNewState(pSprite, pXSprite, &tentacle13A718);
break;
}
pXSprite->target = -1;
}

View file

@ -101,48 +101,34 @@ static void SpidBiteSeqCallback(int, int nXSprite)
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
spritetype *pTarget = &sprite[pXSprite->target];
XSPRITE *pXTarget = &xsprite[pTarget->extra];
if (IsPlayerSprite(pTarget))
{
if (IsPlayerSprite(pTarget)) {
int hit = HitScan(pSprite, pSprite->z, dx, dy, 0, CLIPMASK1, 0);
if (hit == 3)
{
if (sprite[gHitInfo.hitsprite].type <= kDudePlayer8 && sprite[gHitInfo.hitsprite].type >= kDudePlayer1)
{
dz += pTarget->z-pSprite->z;
if (pTarget->type >= kDudePlayer1 && pTarget->type <= kDudePlayer8)
{
PLAYER *pPlayer = &gPlayer[pTarget->type-kDudePlayer1];
switch (pSprite->type)
{
case 213:
actFireVector(pSprite, 0, 0, dx, dy, dz, VECTOR_TYPE_17);
if (IsPlayerSprite(pTarget) && !pPlayer->at31a && powerupCheck(pPlayer, 14) <= 0
&& Chance(0x4000))
powerupActivate(pPlayer, 28);
break;
case 214:
actFireVector(pSprite, 0, 0, dx, dy, dz, VECTOR_TYPE_17);
if (Chance(0x5000))
sub_70D30(pXTarget, 4, 16);
break;
case 215:
actFireVector(pSprite, 0, 0, dx, dy, dz, VECTOR_TYPE_17);
sub_70D30(pXTarget, 8, 16);
break;
case 216:
{
actFireVector(pSprite, 0, 0, dx, dy, dz, VECTOR_TYPE_17);
dx += Random2(2000);
dy += Random2(2000);
dz += Random2(2000);
actFireVector(pSprite, 0, 0, dx, dy, dz, VECTOR_TYPE_17);
sub_70D30(pXTarget, 8, 16);
break;
}
}
}
if (hit == 3 && IsPlayerSprite(&sprite[gHitInfo.hitsprite])) {
dz += pTarget->z - pSprite->z;
PLAYER *pPlayer = &gPlayer[pTarget->type - kDudePlayer1];
switch (pSprite->type) {
case kDudeSpiderBrown:
actFireVector(pSprite, 0, 0, dx, dy, dz, VECTOR_TYPE_17);
if (IsPlayerSprite(pTarget) && !pPlayer->at31a && powerupCheck(pPlayer, 14) <= 0 && Chance(0x4000))
powerupActivate(pPlayer, 28);
break;
case kDudeSpiderRed:
actFireVector(pSprite, 0, 0, dx, dy, dz, VECTOR_TYPE_17);
if (Chance(0x5000)) sub_70D30(pXTarget, 4, 16);
break;
case kDudeSpiderBlack:
actFireVector(pSprite, 0, 0, dx, dy, dz, VECTOR_TYPE_17);
sub_70D30(pXTarget, 8, 16);
break;
case kDudeSpiderMother:
actFireVector(pSprite, 0, 0, dx, dy, dz, VECTOR_TYPE_17);
actFireVector(pSprite, 0, 0, dx + Random2(2000), dy + Random2(2000), dz + Random2(2000), VECTOR_TYPE_17);
sub_70D30(pXTarget, 8, 16);
break;
}
}
}
}
@ -159,21 +145,16 @@ static void SpidJumpSeqCallback(int, int nXSprite)
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
spritetype *pTarget = &sprite[pXSprite->target];
if (IsPlayerSprite(pTarget))
{
if (IsPlayerSprite(pTarget)) {
dz += pTarget->z-pSprite->z;
if (pTarget->type >= kDudePlayer1 && pTarget->type <= kDudePlayer8)
{
switch (pSprite->type)
{
case 213:
case 214:
case 215:
switch (pSprite->type) {
case kDudeSpiderBrown:
case kDudeSpiderRed:
case kDudeSpiderBlack:
xvel[nSprite] = dx << 16;
yvel[nSprite] = dy << 16;
zvel[nSprite] = dz << 16;
break;
}
}
}
}
@ -192,22 +173,24 @@ static void sub_71370(int, int nXSprite)
int dy = pXSprite->targetY-pSprite->y;
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
spritetype *pSpawn = NULL;
if (IsPlayerSprite(pTarget) && pDudeExtraE->at4 < 10)
{
if (IsPlayerSprite(pTarget) && pDudeExtraE->at4 < 10) {
if (nDist < 0x1a00 && nDist > 0x1400 && klabs(pSprite->ang-nAngle) < pDudeInfo->periphery)
pSpawn = actSpawnDude(pSprite, 214, pSprite->clipdist, 0);
pSpawn = actSpawnDude(pSprite, kDudeSpiderRed, pSprite->clipdist, 0);
else if (nDist < 0x1400 && nDist > 0xc00 && klabs(pSprite->ang-nAngle) < pDudeInfo->periphery)
pSpawn = actSpawnDude(pSprite, 213, pSprite->clipdist, 0);
pSpawn = actSpawnDude(pSprite, kDudeSpiderBrown, pSprite->clipdist, 0);
else if (nDist < 0xc00 && klabs(pSprite->ang - nAngle) < pDudeInfo->periphery)
pSpawn = actSpawnDude(pSprite, 213, pSprite->clipdist, 0);
if (pSpawn)
{
pSpawn = actSpawnDude(pSprite, kDudeSpiderBrown, pSprite->clipdist, 0);
if (pSpawn) {
pDudeExtraE->at4++;
pSpawn->owner = nSprite;
gKillMgr.sub_263E0(1);
}
}
}
static void thinkSearch(spritetype *pSprite, XSPRITE *pXSprite)
@ -256,35 +239,33 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite)
return;
}
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
if (nDist <= pDudeInfo->seeDist) {
int nDeltaAngle = ((getangle(dx,dy)+1024-pSprite->ang)&2047)-1024;
int height = (pDudeInfo->eyeHeight*pSprite->yrepeat)<<2;
if (cansee(pTarget->x, pTarget->y, pTarget->z, pTarget->sectnum, pSprite->x, pSprite->y, pSprite->z - height, pSprite->sectnum))
{
if (nDist < pDudeInfo->seeDist && klabs(nDeltaAngle) <= pDudeInfo->periphery)
{
if (cansee(pTarget->x, pTarget->y, pTarget->z, pTarget->sectnum, pSprite->x, pSprite->y, pSprite->z - height, pSprite->sectnum)) {
if (nDist < pDudeInfo->seeDist && klabs(nDeltaAngle) <= pDudeInfo->periphery) {
aiSetTarget(pXSprite, pXSprite->target);
switch (pSprite->type)
{
case 214:
if (nDist < 0x399 && klabs(nDeltaAngle) < 85)
aiNewState(pSprite, pXSprite, &spidBite);
break;
case 213:
case 215:
if (nDist < 0x733 && nDist > 0x399 && klabs(nDeltaAngle) < 85)
aiNewState(pSprite, pXSprite, &spidJump);
else if (nDist < 0x399 && klabs(nDeltaAngle) < 85)
aiNewState(pSprite, pXSprite, &spidBite);
break;
case 216:
if (nDist < 0x733 && nDist > 0x399 && klabs(nDeltaAngle) < 85)
aiNewState(pSprite, pXSprite, &spidJump);
else if (Chance(0x8000))
aiNewState(pSprite, pXSprite, &spid13A92C);
break;
switch (pSprite->type) {
case kDudeSpiderRed:
if (nDist < 0x399 && klabs(nDeltaAngle) < 85)
aiNewState(pSprite, pXSprite, &spidBite);
break;
case kDudeSpiderBrown:
case kDudeSpiderBlack:
if (nDist < 0x733 && nDist > 0x399 && klabs(nDeltaAngle) < 85)
aiNewState(pSprite, pXSprite, &spidJump);
else if (nDist < 0x399 && klabs(nDeltaAngle) < 85)
aiNewState(pSprite, pXSprite, &spidBite);
break;
case kDudeSpiderMother:
if (nDist < 0x733 && nDist > 0x399 && klabs(nDeltaAngle) < 85)
aiNewState(pSprite, pXSprite, &spidJump);
else if (Chance(0x8000))
aiNewState(pSprite, pXSprite, &spid13A92C);
break;
}
return;
}
}

View file

@ -76,7 +76,7 @@ static void sub_71A90(int, int nXSprite)
int nTarget = pTarget->index;
int nOwner = actSpriteIdToOwnerId(nSprite);
if (pXTarget->burnTime == 0)
evPost(nTarget, 3, 0, CALLBACK_ID_0);
evPost(nTarget, 3, 0, kCallbackFXFlameLick);
actBurnSprite(nOwner, pXTarget, 40);
if (Chance(0x6000))
aiNewState(pSprite, pXSprite, &tcherno13A9D4);
@ -150,8 +150,8 @@ static void sub_71BD4(int, int nXSprite)
}
}
}
actFireMissile(pSprite, -350, 0, aim.dx, aim.dy, aim.dz, 314);
actFireMissile(pSprite, 350, 0, aim.dx, aim.dy, aim.dz, 314);
actFireMissile(pSprite, -350, 0, aim.dx, aim.dy, aim.dz, kMissileFireballTchernobog);
actFireMissile(pSprite, 350, 0, aim.dx, aim.dy, aim.dz, kMissileFireballTchernobog);
}
static void sub_720AC(int, int nXSprite)
@ -226,8 +226,8 @@ static void sub_720AC(int, int nXSprite)
}
}
}
actFireMissile(pSprite, 350, 0, aim.dx, aim.dy, -aim.dz, 314);
actFireMissile(pSprite, -350, 0, ax, ay, az, 314);
actFireMissile(pSprite, 350, 0, aim.dx, aim.dy, -aim.dz, kMissileFireballTchernobog);
actFireMissile(pSprite, -350, 0, ax, ay, az, kMissileFireballTchernobog);
}
static void sub_72580(spritetype *pSprite, XSPRITE *pXSprite)

View file

@ -261,7 +261,7 @@ static void ThrowThing(int nXIndex, bool impact) {
int dist = approxDist(dx, dy); int zThrow = 14500;
spritetype* pThing = NULL; spritetype* pLeech = NULL; XSPRITE* pXLeech = NULL;
if (thingType == kGDXThingCustomDudeLifeLeech) {
if (thingType == kModernThingEnemyLifeLeech) {
if ((pLeech = leechIsDropped(pSprite)) != NULL) {
// pickup life leech before throw it again
pXLeech = &xsprite[pLeech->extra];
@ -274,17 +274,17 @@ static void ThrowThing(int nXIndex, bool impact) {
pThing = actFireThing(pSprite, 0, 0, (dz / 128) - zThrow, thingType, divscale(dist / 540, 120, 23));
if (pThing == NULL) return;
if (pThinkInfo->at11 < 0 && pThing->type != kGDXThingThrowableRock) pThing->picnum = 0;
if (pThinkInfo->at11 < 0 && pThing->type != kModernThingThrowableRock) pThing->picnum = 0;
pThing->owner = pSprite->xvel;
switch (thingType) {
case 428:
case kThingNapalmBall:
impact = true;
pThing->xrepeat = 24;
pThing->yrepeat = 24;
xsprite[pThing->extra].data4 = 3 + gGameOptions.nDifficulty;
break;
case kGDXThingThrowableRock:
case kModernThingThrowableRock:
int sPics[6];
sPics[0] = 2406; sPics[1] = 2280;
sPics[2] = 2185; sPics[3] = 2155;
@ -306,17 +306,17 @@ static void ThrowThing(int nXIndex, bool impact) {
impact = false;
return;
case 400:
case 401:
case 420:
case kThingTNTBarrel:
case kThingArmedProxBomb:
case kThingArmedSpray:
impact = false;
break;
case kGDXThingTNTProx:
case kModernThingTNTProx:
xsprite[pThing->extra].state = 0;
xsprite[pThing->extra].Proximity = true;
return;
case 431:
case kGDXThingCustomDudeLifeLeech:
case kThingDroppedLifeLeech:
case kModernThingEnemyLifeLeech:
XSPRITE* pXThing = &xsprite[pThing->extra];
if (pLeech != NULL) pXThing->health = pXLeech->health;
else pXThing->health = 300 * gGameOptions.nDifficulty;
@ -329,14 +329,14 @@ static void ThrowThing(int nXIndex, bool impact) {
pXThing->target = pTarget->xvel;
pXThing->Proximity = true;
pXThing->stateTimer = 1;
evPost(pThing->xvel, 3, 80, CALLBACK_ID_20);
evPost(pThing->xvel, 3, 80, kCallbackLeechStateTimer);
return;
}
if (impact == true && dist <= 7680) xsprite[pThing->extra].Impact = true;
else {
xsprite[pThing->extra].Impact = false;
evPost(pThing->xvel, 3, 120 * Random(2) + 120, COMMAND_ID_1);
evPost(pThing->xvel, 3, 120 * Random(2) + 120, kCmdOn);
}
return;
}
@ -442,12 +442,12 @@ static void thinkChase( spritetype* pSprite, XSPRITE* pXSprite )
spritetype* pLeech = NULL; VECTORDATA* meleeVector = &gVectorData[22];
if (pXSprite->data1 >= kThingBase && pXSprite->data1 < kThingMax) {
if (pXSprite->data1 == 431) pXSprite->data1 = kGDXThingCustomDudeLifeLeech;
if (pXSprite->data1 == kThingDroppedLifeLeech) pXSprite->data1 = kModernThingEnemyLifeLeech;
if ((pLeech = leechIsDropped(pSprite)) != NULL && xsprite[pLeech->extra].target != pXSprite->target)
xsprite[pLeech->extra].target = pXSprite->target;
if (klabs(losAngle) < kAng15) {
if (dist < 12264 && dist > 7680 && !spriteIsUnderwater(pSprite, false) && pXSprite->data1 != kGDXThingCustomDudeLifeLeech) {
if (dist < 12264 && dist > 7680 && !spriteIsUnderwater(pSprite, false) && pXSprite->data1 != kModernThingEnemyLifeLeech) {
int pHit = HitScan(pSprite, pSprite->z, dx, dy, 0, 16777280, 0);
switch (pHit) {
case 0:
@ -461,7 +461,7 @@ static void thinkChase( spritetype* pSprite, XSPRITE* pXSprite )
}
else if (dist > 4072 && dist <= 9072 && !spriteIsUnderwater(pSprite, false) && pSprite->owner != (kMaxSprites - 1)) {
switch (pXSprite->data1) {
case kGDXThingCustomDudeLifeLeech:
case kModernThingEnemyLifeLeech:
{
if (pLeech == NULL) {
aiNewState(pSprite, pXSprite, &GDXGenDudeThrow2);
@ -492,7 +492,7 @@ static void thinkChase( spritetype* pSprite, XSPRITE* pXSprite )
}
}
return;
case kGDXThingThrowableRock:
case kModernThingThrowableRock:
if (Chance(0x4000)) aiNewState(pSprite, pXSprite, &GDXGenDudeThrow2);
else sfxPlayGDXGenDudeSound(pSprite, 0);
return;
@ -577,17 +577,17 @@ static void thinkChase( spritetype* pSprite, XSPRITE* pXSprite )
else if (pXSprite->data1 >= kMissileBase && pXSprite->data1 < kMissileMax) {
// special handling for flame, explosive and life leech missiles
int state = checkAttackState(pSprite, pXSprite);
int mdist = (pXSprite->data1 != 303) ? 3000 : 2500;
int mdist = (pXSprite->data1 != kMissileFlareAlt) ? 3000 : 2500;
switch (pXSprite->data1) {
case 315:
// pickup life leech if it was thrown previously
if ((pLeech = leechIsDropped(pSprite)) != NULL) removeLeech(pLeech);
break;
case 303:
case 305:
case 312:
case 313:
case 314:
case kMissileFlareAlt:
case kMissileFireball:
case kMissileFireballNapam:
case kMissileFireballCerberus:
case kMissileFireballTchernobog:
if (dist > mdist || pXSprite->locked == 1) break;
else if (dist <= meleeVector->maxDist && Chance(0x9000))
aiNewState(pSprite, pXSprite, &GDXGenDudePunch);
@ -597,8 +597,8 @@ static void thinkChase( spritetype* pSprite, XSPRITE* pXSprite )
return;
case 304:
case 308:
case kMissileFlameSpray:
case kMissileFlameHound:
if (spriteIsUnderwater(pSprite, false)) {
if (dist > meleeVector->maxDist) aiNewState(pSprite, pXSprite, &GDXGenDudeChaseW);
else if (Chance(0x8000)) aiNewState(pSprite, pXSprite, &GDXGenDudePunch);
@ -611,9 +611,9 @@ static void thinkChase( spritetype* pSprite, XSPRITE* pXSprite )
}
}
else if (pXSprite->data1 >= 459 && pXSprite->data1 < (459 + kExplodeMax) - 1) {
else if (pXSprite->data1 >= kTrapExploder && pXSprite->data1 < (kTrapExploder + kExplodeMax) - 1) {
int nType = pXSprite->data1 - 459; EXPLOSION* pExpl = &explodeInfo[nType];
int nType = pXSprite->data1 - kTrapExploder; EXPLOSION* pExpl = &explodeInfo[nType];
if (pExpl != NULL && CheckProximity(pSprite, pTarget->x, pTarget->y, pTarget->z, pTarget->sectnum, pExpl->radius / 2)
&& doExplosion(pSprite, nType)) {
@ -843,7 +843,7 @@ bool spriteIsUnderwater(spritetype* pSprite,bool oldWay) {
spritetype* leechIsDropped(spritetype* pSprite) {
for (int nSprite = headspritestat[kStatThing]; nSprite >= 0; nSprite = nextspritestat[nSprite]) {
if (sprite[nSprite].type == kGDXThingCustomDudeLifeLeech && sprite[nSprite].owner == pSprite->xvel)
if (sprite[nSprite].type == kModernThingEnemyLifeLeech && sprite[nSprite].owner == pSprite->xvel)
return &sprite[nSprite];
}
@ -855,15 +855,15 @@ void removeDudeStuff(spritetype* pSprite) {
for (short nSprite = headspritestat[kStatThing]; nSprite >= 0; nSprite = nextspritestat[nSprite]) {
if (sprite[nSprite].owner != pSprite->xvel) continue;
switch (sprite[nSprite].type) {
case 401:
case 402:
case 433:
sprite[nSprite].type = 0;
actPostSprite(sprite[nSprite].xvel, kStatFree);
break;
case kGDXThingCustomDudeLifeLeech:
killDudeLeech(&sprite[nSprite]);
break;
case kThingArmedProxBomb:
case kThingArmedRemoteBomb:
case kModernThingTNTProx:
sprite[nSprite].type = 0;
actPostSprite(sprite[nSprite].xvel, kStatFree);
break;
case kModernThingEnemyLifeLeech:
killDudeLeech(&sprite[nSprite]);
break;
}
}
@ -926,12 +926,12 @@ bool dudeIsMelee(XSPRITE* pXSprite) {
} else {
if (pXSprite->data1 >= 459 && pXSprite->data1 < (459 + kExplodeMax) - 1)
if (pXSprite->data1 >= kTrapExploder && pXSprite->data1 < (kTrapExploder + kExplodeMax) - 1)
return true;
/*switch (pXSprite->data1) {
case 304:
case 308:
case kMissileFlameSpray:
case kMissileFlameHound:
return true;
default:
return false;
@ -975,9 +975,9 @@ int getDodgeChance(spritetype* pSprite) {
return chance;
}
void dudeLeechOperate(spritetype* pSprite, XSPRITE* pXSprite, EVENT a3)
void dudeLeechOperate(spritetype* pSprite, XSPRITE* pXSprite, EVENT event)
{
if (a3.cmd == COMMAND_ID_0) {
if (event.cmd == kCmdOff) {
actPostSprite(pSprite->xvel, kStatFree);
return;
}
@ -1006,7 +1006,7 @@ void dudeLeechOperate(spritetype* pSprite, XSPRITE* pXSprite, EVENT a3)
int dy = Sin(pSprite->ang) >> 16;
int tz = pTarget->z - (pTarget->yrepeat * pDudeInfo->aimHeight) * 4;
int dz = divscale(tz - top - 256, nDist, 10);
int nMissileType = 316 + (pXSprite->data3 ? 1 : 0);
int nMissileType = kMissileLifeLeechAltNormal + (pXSprite->data3 ? 1 : 0);
int t2;
if (!pXSprite->data3) t2 = 120 / 10.0;
@ -1017,7 +1017,7 @@ void dudeLeechOperate(spritetype* pSprite, XSPRITE* pXSprite, EVENT a3)
{
pMissile->owner = pSprite->owner;
pXSprite->stateTimer = 1;
evPost(pSprite->index, 3, t2, CALLBACK_ID_20);
evPost(pSprite->index, 3, t2, kCallbackLeechStateTimer);
pXSprite->data3 = ClipLow(pXSprite->data3 - 1, 0);
}
pSprite->ang = angBak;

View file

@ -269,7 +269,7 @@ static void myThinkSearch(spritetype *pSprite, XSPRITE *pXSprite)
static void entryEZombie(spritetype *pSprite, XSPRITE *pXSprite)
{
UNREFERENCED_PARAMETER(pXSprite);
pSprite->type = 203;
pSprite->type = kDudeZombieAxeNormal;
pSprite->flags |= 1;
}

View file

@ -75,7 +75,7 @@ static void HackSeqCallback(int, int nXSprite)
if (nXSprite < 0 || nXSprite >= kMaxSprites)
return;
spritetype *pSprite = &sprite[nSprite];
if (pSprite->type != 204)
if (pSprite->type != kDudeZombieButcher)
return;
spritetype *pTarget = &sprite[pXSprite->target];
DUDEINFO *pDudeInfo = &dudeInfo[pSprite->type-kDudeBase];
@ -102,7 +102,7 @@ static void PukeSeqCallback(int, int nXSprite)
int dx = Cos(nAngle)>>16;
int dy = Sin(nAngle)>>16;
sfxPlay3DSound(pSprite, 1203, 1, 0);
actFireMissile(pSprite, 0, -(height-height2), dx, dy, 0, 309);
actFireMissile(pSprite, 0, -(height-height2), dx, dy, 0, kMissilePukeGreen);
}
static void ThrowSeqCallback(int, int nXSprite)
@ -110,7 +110,7 @@ static void ThrowSeqCallback(int, int nXSprite)
XSPRITE *pXSprite = &xsprite[nXSprite];
int nSprite = pXSprite->reference;
spritetype *pSprite = &sprite[nSprite];
actFireMissile(pSprite, 0, -dudeInfo[pSprite->type-kDudeBase].eyeHeight, Cos(pSprite->ang)>>16, Sin(pSprite->ang)>>16, 0, 300);
actFireMissile(pSprite, 0, -dudeInfo[pSprite->type-kDudeBase].eyeHeight, Cos(pSprite->ang)>>16, Sin(pSprite->ang)>>16, 0, kMissileButcherKnife);
}
static void thinkSearch(spritetype *pSprite, XSPRITE *pXSprite)

View file

@ -222,10 +222,10 @@ void PrecacheDude(spritetype *pSprite)
seqPrecacheId(pDudeInfo->seqStartID+2);
switch (pSprite->type)
{
case 201:
case 202:
case 247:
case 248:
case kDudeCultistTommy:
case kDudeCultistShotgun:
case kDudeCultistTesla:
case kDudeCultistTNT:
seqPrecacheId(pDudeInfo->seqStartID+6);
seqPrecacheId(pDudeInfo->seqStartID+7);
seqPrecacheId(pDudeInfo->seqStartID+8);
@ -234,8 +234,8 @@ void PrecacheDude(spritetype *pSprite)
seqPrecacheId(pDudeInfo->seqStartID+14);
seqPrecacheId(pDudeInfo->seqStartID+15);
break;
case 204:
case 217:
case kDudeZombieButcher:
case kDudeGillBeast:
seqPrecacheId(pDudeInfo->seqStartID+6);
seqPrecacheId(pDudeInfo->seqStartID+7);
seqPrecacheId(pDudeInfo->seqStartID+8);
@ -243,51 +243,51 @@ void PrecacheDude(spritetype *pSprite)
seqPrecacheId(pDudeInfo->seqStartID+10);
seqPrecacheId(pDudeInfo->seqStartID+11);
break;
case 208:
case 209:
case kDudeGargoyleStatueFlesh:
case kDudeGargoyleStatueStone:
seqPrecacheId(pDudeInfo->seqStartID+6);
seqPrecacheId(pDudeInfo->seqStartID+6);
fallthrough__;
case 206:
case 207:
case kDudeGargoyleFlesh:
case kDudeGargoyleStone:
seqPrecacheId(pDudeInfo->seqStartID+6);
seqPrecacheId(pDudeInfo->seqStartID+7);
seqPrecacheId(pDudeInfo->seqStartID+8);
seqPrecacheId(pDudeInfo->seqStartID+9);
break;
case 210:
case 211:
case 213:
case 214:
case 215:
case 216:
case 229:
case kDudePhantasm:
case kDudeHellHound:
case kDudeSpiderBrown:
case kDudeSpiderRed:
case kDudeSpiderBlack:
case kDudeSpiderMother:
case kDudeTchernobog:
seqPrecacheId(pDudeInfo->seqStartID+6);
seqPrecacheId(pDudeInfo->seqStartID+7);
seqPrecacheId(pDudeInfo->seqStartID+8);
break;
case 227:
case kDudeCerberusTwoHead:
seqPrecacheId(pDudeInfo->seqStartID+6);
seqPrecacheId(pDudeInfo->seqStartID+7);
fallthrough__;
case 212:
case 218:
case 219:
case 220:
case kDudeHand:
case kDudeBoneEel:
case kDudeBat:
case kDudeRat:
seqPrecacheId(pDudeInfo->seqStartID+6);
seqPrecacheId(pDudeInfo->seqStartID+7);
break;
case 249:
case kDudeCultistBeast:
seqPrecacheId(pDudeInfo->seqStartID+6);
break;
case 205:
case kDudeZombieAxeBuried:
seqPrecacheId(pDudeInfo->seqStartID+12);
seqPrecacheId(pDudeInfo->seqStartID+9);
fallthrough__;
case 244:
case kDudeZombieAxeLaying:
seqPrecacheId(pDudeInfo->seqStartID+10);
fallthrough__;
case 203:
case kDudeZombieAxeNormal:
seqPrecacheId(pDudeInfo->seqStartID+6);
seqPrecacheId(pDudeInfo->seqStartID+7);
seqPrecacheId(pDudeInfo->seqStartID+8);
@ -298,34 +298,33 @@ void PrecacheDude(spritetype *pSprite)
}
}
void PrecacheThing(spritetype *pSprite)
{
switch (pSprite->type)
{
case 406:
case 407:
seqPrecacheId(12);
break;
case 410:
seqPrecacheId(15);
break;
case 411:
seqPrecacheId(21);
break;
case 412:
seqPrecacheId(25);
seqPrecacheId(26);
break;
case 413:
seqPrecacheId(38);
seqPrecacheId(40);
seqPrecacheId(28);
break;
case 416:
break;
default:
tilePreloadTile(pSprite->picnum);
break;
void PrecacheThing(spritetype *pSprite) {
switch (pSprite->type) {
case kThingGlassWindow: // worthless...
case kThingFluorescent:
seqPrecacheId(12);
break;
case kThingSpiderWeb:
seqPrecacheId(15);
break;
case kThingMetalGrate:
seqPrecacheId(21);
break;
case kThingFlammableTree:
seqPrecacheId(25);
seqPrecacheId(26);
break;
case kTrapMachinegun:
seqPrecacheId(38);
seqPrecacheId(40);
seqPrecacheId(28);
break;
case kThingObjectGib:
//case kThingObjectExplode: weird that only gib object is precached and this one is not
break;
default:
tilePreloadTile(pSprite->picnum);
break;
}
seqPrecacheId(3);
seqPrecacheId(4);
@ -611,8 +610,8 @@ void StartLevel(GAMEOPTIONS *gameOptions)
for (int i = 0; i < kMaxSprites; i++)
{
spritetype *pSprite = &sprite[i];
if (pSprite->statnum < kMaxStatus && pSprite->extra > 0)
{
if (pSprite->statnum < kMaxStatus && pSprite->extra > 0) {
XSPRITE *pXSprite = &xsprite[pSprite->extra];
if ((pXSprite->lSkill & (1 << gameOptions->nDifficulty)) || (pXSprite->lS && gameOptions->nGameType == 0)
|| (pXSprite->lB && gameOptions->nGameType == 2) || (pXSprite->lT && gameOptions->nGameType == 3)
@ -621,12 +620,81 @@ void StartLevel(GAMEOPTIONS *gameOptions)
DeleteSprite(i);
continue;
}
if (gModernMap) {
switch (pSprite->type) {
// add statnum for faster dude searching
case kModernDudeTargetChanger:
changespritestat(i, kStatModernDudeTargetChanger);
break;
// remove kStatItem status from random item generators
case kModernRandom:
case kModernRandom2:
changespritestat(i, kStatDecoration);
break;
}
} else {
switch (pSprite->type) {
// erase all modern types if the map is not extended
case kModernCustomDudeSpawn:
case kModernRandomTX:
case kModernSequentialTX:
case kModernSeqSpawner:
case kModernObjPropertiesChanger:
case kModernObjPicnumChanger:
case kModernObjSizeChanger:
case kModernDudeTargetChanger:
case kModernSectorFXChanger:
case kModernObjDataChanger:
case kModernSpriteDamager:
case kModernObjDataAccumulator:
case kModernEffectSpawner:
case kModernWindGenerator:
pSprite->type = kSpriteDecoration;
break;
case kItemModernMapLevel:
case kDudeModernCustom:
case kDudeModernCustomBurning:
case kModernThingTNTProx:
case kModernThingEnemyLifeLeech:
pSprite->type = kSpriteDecoration;
changespritestat(pSprite->index, kStatDecoration);
break;
case kModernConcussSprite:
pSprite->type = kSpriteDecoration;
changespritestat(pSprite->index, kStatDecoration);
break;
// also erase some modernized vanilla types which was not active
case kMarkerWarpDest:
if (pSprite->statnum != kStatMarker) pSprite->type = kSpriteDecoration;
break;
}
if (pXSprite->Sight)
pXSprite->Sight = false; // it does not work in vanilla at all
if (pXSprite->Proximity) {
// proximity works only for things and dudes in vanilla
switch (pSprite->statnum) {
case kStatThing:
case kStatDude:
break;
default:
pXSprite->Proximity = false;
break;
}
}
}
}
}
scrLoadPLUs();
startpos.z = getflorzofslope(startsectnum,startpos.x,startpos.y);
for (int i = 0; i < kMaxPlayers; i++)
{
for (int i = 0; i < kMaxPlayers; i++) {
gStartZone[i].x = startpos.x;
gStartZone[i].y = startpos.y;
gStartZone[i].z = startpos.z;
@ -634,7 +702,7 @@ void StartLevel(GAMEOPTIONS *gameOptions)
gStartZone[i].ang = startang;
// By NoOne: Create spawn zones for players in teams mode.
if (i <= kMaxPlayers / 2) {
if (gModernMap && i <= kMaxPlayers / 2) {
gStartZoneTeam1[i].x = startpos.x;
gStartZoneTeam1[i].y = startpos.y;
gStartZoneTeam1[i].z = startpos.z;

View file

@ -48,99 +48,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_BLD_NS
void makeMissileBlocking(int nSprite) // 23
{
dassert(nSprite >= 0 && nSprite < kMaxSprites);
if (sprite[nSprite].statnum != kStatProjectile) return;
sprite[nSprite].cstat |= CSTAT_SPRITE_BLOCK;
}
void UniMissileBurst(int nSprite) // 22
{
dassert(nSprite >= 0 && nSprite < kMaxSprites);
if (sprite[nSprite].statnum != kStatProjectile) return;
spritetype * pSprite = &sprite[nSprite];
int nAngle = getangle(xvel[nSprite], yvel[nSprite]);
int nRadius = 0x55555;
for (int i = 0; i < 8; i++)
{
spritetype* pBurst = actSpawnSprite(pSprite, 5);
pBurst->type = pSprite->type;
pBurst->shade = pSprite->shade;
pBurst->picnum = pSprite->picnum;
pBurst->cstat = pSprite->cstat;
if ((pBurst->cstat & CSTAT_SPRITE_BLOCK)) {
pBurst->cstat &= ~CSTAT_SPRITE_BLOCK; // we don't want missiles impact each other
evPost(pBurst->xvel, 3, 100, CALLBACK_ID_23); // so set blocking flag a bit later
}
pBurst->pal = pSprite->pal;
pBurst->clipdist = pSprite->clipdist / 4;
pBurst->flags = pSprite->flags;
pBurst->xrepeat = pSprite->xrepeat / 2;
pBurst->yrepeat = pSprite->yrepeat / 2;
pBurst->ang = ((pSprite->ang + missileInfo[pSprite->type - kMissileBase].at6) & 2047);
pBurst->owner = pSprite->owner;
actBuildMissile(pBurst, pBurst->extra, pSprite->xvel);
int nAngle2 = (i << 11) / 8;
int dx = 0;
int dy = mulscale30r(nRadius, Sin(nAngle2));
int dz = mulscale30r(nRadius, -Cos(nAngle2));
if (i & 1)
{
dy >>= 1;
dz >>= 1;
}
RotateVector(&dx, &dy, nAngle);
xvel[pBurst->index] += dx;
yvel[pBurst->index] += dy;
zvel[pBurst->index] += dz;
evPost(pBurst->index, 3, 960, CALLBACK_ID_1);
}
evPost(nSprite, 3, 0, CALLBACK_ID_1);
}
void sub_74C20(int nSprite) // 7
{
spritetype *pSprite = &sprite[nSprite];
spritetype *pFX = gFX.fxSpawn(FX_15, pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 0);
if (pFX)
{
xvel[pFX->index] = xvel[nSprite] + Random2(0x10000);
yvel[pFX->index] = yvel[nSprite] + Random2(0x10000);
zvel[pFX->index] = zvel[nSprite] - Random(0x1aaaa);
}
evPost(nSprite, 3, 3, CALLBACK_ID_7);
}
void sub_74D04(int nSprite) // 15
{
spritetype *pSprite = &sprite[nSprite];
spritetype *pFX = gFX.fxSpawn(FX_49, pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 0);
if (pFX)
{
xvel[pFX->index] = xvel[nSprite] + Random2(0x1aaaa);
yvel[pFX->index] = yvel[nSprite] + Random2(0x1aaaa);
zvel[pFX->index] = zvel[nSprite] - Random(0x1aaaa);
}
evPost(nSprite, 3, 3, CALLBACK_ID_15);
}
void FinishHim(int nSprite) // 13
{
spritetype *pSprite = &sprite[nSprite];
int nXSprite = pSprite->extra;
XSPRITE *pXSprite = &xsprite[nXSprite];
if (playerSeqPlaying(&gPlayer[pSprite->type-kDudePlayer1], 16) && pXSprite->target == gMe->at5b)
sndStartSample(3313, -1, 1, 0);
}
void FlameLick(int nSprite) // 0
void fxFlameLick(int nSprite) // 0
{
spritetype *pSprite = &sprite[nSprite];
int nXSprite = pSprite->extra;
@ -165,7 +74,7 @@ void FlameLick(int nSprite) // 0
}
}
if (pXSprite->burnTime > 0)
evPost(nSprite, 3, 5, CALLBACK_ID_0);
evPost(nSprite, 3, 5, kCallbackFXFlameLick);
}
void Remove(int nSprite) // 1
@ -190,7 +99,7 @@ void FlareBurst(int nSprite) // 2
pSpawn->picnum = 2424;
pSpawn->shade = -128;
pSpawn->xrepeat = pSpawn->yrepeat = 32;
pSpawn->type = 303;
pSpawn->type = kMissileFlareAlt;
pSpawn->clipdist = 2;
pSpawn->owner = pSprite->owner;
int nAngle2 = (i<<11)/8;
@ -206,12 +115,12 @@ void FlareBurst(int nSprite) // 2
xvel[pSpawn->index] += dx;
yvel[pSpawn->index] += dy;
zvel[pSpawn->index] += dz;
evPost(pSpawn->index, 3, 960, CALLBACK_ID_1);
evPost(pSpawn->index, 3, 960, kCallbackRemove);
}
evPost(nSprite, 3, 0, CALLBACK_ID_1);
evPost(nSprite, 3, 0, kCallbackRemove);
}
void FlareSpark(int nSprite) // 3
void fxFlareSpark(int nSprite) // 3
{
spritetype *pSprite = &sprite[nSprite];
spritetype *pFX = gFX.fxSpawn(FX_28, pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 0);
@ -221,10 +130,10 @@ void FlareSpark(int nSprite) // 3
yvel[pFX->index] = yvel[nSprite] + Random2(0x1aaaa);
zvel[pFX->index] = zvel[nSprite] - Random(0x1aaaa);
}
evPost(nSprite, 3, 4, CALLBACK_ID_3);
evPost(nSprite, 3, 4, kCallbackFXFlareSpark);
}
void FlareSparkLite(int nSprite) // 4
void fxFlareSparkLite(int nSprite) // 4
{
spritetype *pSprite = &sprite[nSprite];
spritetype *pFX = gFX.fxSpawn(FX_28, pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 0);
@ -234,10 +143,10 @@ void FlareSparkLite(int nSprite) // 4
yvel[pFX->index] = yvel[nSprite] + Random2(0x1aaaa);
zvel[pFX->index] = zvel[nSprite] - Random(0x1aaaa);
}
evPost(nSprite, 3, 12, CALLBACK_ID_4);
evPost(nSprite, 3, 12, kCallbackFXFlareSparkLite);
}
void ZombieSpurt(int nSprite) // 5
void fxZombieBloodSpurt(int nSprite) // 5
{
dassert(nSprite >= 0 && nSprite < kMaxSprites);
spritetype *pSprite = &sprite[nSprite];
@ -255,18 +164,18 @@ void ZombieSpurt(int nSprite) // 5
}
if (pXSprite->data1 > 0)
{
evPost(nSprite, 3, 4, CALLBACK_ID_5);
evPost(nSprite, 3, 4, kCallbackFXZombieSpurt);
pXSprite->data1 -= 4;
}
else if (pXSprite->data2 > 0)
{
evPost(nSprite, 3, 60, CALLBACK_ID_5);
evPost(nSprite, 3, 60, kCallbackFXZombieSpurt);
pXSprite->data1 = 40;
pXSprite->data2--;
}
}
void BloodSpurt(int nSprite) // 6
void fxBloodSpurt(int nSprite) // 6
{
spritetype *pSprite = &sprite[nSprite];
spritetype *pFX = gFX.fxSpawn(FX_27, pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 0);
@ -277,10 +186,25 @@ void BloodSpurt(int nSprite) // 6
yvel[pFX->index] = yvel[nSprite]>>8;
zvel[pFX->index] = zvel[nSprite]>>8;
}
evPost(nSprite, 3, 6, CALLBACK_ID_6);
evPost(nSprite, 3, 6, kCallbackFXBloodSpurt);
}
void DynPuff(int nSprite) // 8
void fxArcSpark(int nSprite) // 7
{
spritetype* pSprite = &sprite[nSprite];
spritetype* pFX = gFX.fxSpawn(FX_15, pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 0);
if (pFX)
{
xvel[pFX->index] = xvel[nSprite] + Random2(0x10000);
yvel[pFX->index] = yvel[nSprite] + Random2(0x10000);
zvel[pFX->index] = zvel[nSprite] - Random(0x1aaaa);
}
evPost(nSprite, 3, 3, kCallbackFXArcSpark);
}
void fxDynPuff(int nSprite) // 8
{
spritetype *pSprite = &sprite[nSprite];
if (zvel[nSprite])
@ -297,7 +221,7 @@ void DynPuff(int nSprite) // 8
zvel[pFX->index] = zvel[nSprite];
}
}
evPost(nSprite, 3, 12, CALLBACK_ID_8);
evPost(nSprite, 3, 12, kCallbackFXDynPuff);
}
void Respawn(int nSprite) // 9
@ -316,14 +240,14 @@ void Respawn(int nSprite) // 9
{
int nTime = mulscale16(actGetRespawnTime(pSprite), 0x4000);
pXSprite->respawnPending = 2;
evPost(nSprite, 3, nTime, CALLBACK_ID_9);
evPost(nSprite, 3, nTime, kCallbackRespawn);
break;
}
case 2:
{
int nTime = mulscale16(actGetRespawnTime(pSprite), 0x2000);
pXSprite->respawnPending = 3;
evPost(nSprite, 3, nTime, CALLBACK_ID_9);
evPost(nSprite, 3, nTime, kCallbackRespawn);
break;
}
case 3:
@ -352,10 +276,10 @@ void Respawn(int nSprite) // 9
aiInitSprite(pSprite);
pXSprite->key = 0;
}
if (pSprite->type == 400)
if (pSprite->type == kThingTNTBarrel)
{
pSprite->cstat |= 257;
pSprite->cstat &= (unsigned short)~32768;
pSprite->cstat |= CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN;
pSprite->cstat &= (unsigned short)~CSTAT_SPRITE_INVISIBLE;
}
gFX.fxSpawn(FX_29, pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 0);
sfxPlay3DSound(pSprite, 350, -1, 0);
@ -393,7 +317,7 @@ void PlayerBubble(int nSprite) // 10
zvel[pFX->index] = zvel[nSprite] + Random2(0x1aaaa);
}
}
evPost(nSprite, 3, 4, CALLBACK_ID_10);
evPost(nSprite, 3, 4, kCallbackPlayerBubble);
}
}
@ -417,44 +341,44 @@ void EnemyBubble(int nSprite) // 11
zvel[pFX->index] = zvel[nSprite] + Random2(0x1aaaa);
}
}
evPost(nSprite, 3, 4, CALLBACK_ID_11);
evPost(nSprite, 3, 4, kCallbackEnemeyBubble);
}
void CounterCheck(int nSector) // 12
{
dassert(nSector >= 0 && nSector < kMaxSectors);
sectortype *pSector = &sector[nSector];
// By NoOne: edits for counter sector new features.
// remove check below, so every sector can be counter if command 12 (this callback) received.
//if (pSector->type != 619) return;
int nXSprite = pSector->extra;
if (nXSprite > 0)
{
XSECTOR *pXSector = &xsector[nXSprite];
int nReq = pXSector->waitTimeA;
int nType = pXSector->data;
if (nType && nReq)
{
int nCount = 0;
for (int nSprite = headspritesect[nSector]; nSprite >= 0; nSprite = nextspritesect[nSprite])
{
if (sprite[nSprite].type == nType)
nCount++;
}
if (nCount >= nReq)
{
// By NoOne: remove check below, so every sector can be counter if command 12 (this callback) received.
//if (pSector->type != kSectorCounter) return;
if (sector[nSector].extra <= 0) return; XSECTOR *pXSector = &xsector[sector[nSector].extra];
int nReq = pXSector->waitTimeA; int nType = pXSector->data; int nCount = 0;
if (!nType || !nReq) return;
for (int nSprite = headspritesect[nSector]; nSprite >= 0; nSprite = nextspritesect[nSprite]) {
if (sprite[nSprite].type == nType) nCount++;
}
if (nCount < nReq) {
evPost(nSector, 6, 5, kCallbackCounterCheck);
return;
} else {
//pXSector->waitTimeA = 0; //do not reset necessary objects counter to zero
trTriggerSector(nSector, pXSector, 1);
trTriggerSector(nSector, pXSector, kCmdOn);
pXSector->locked = 1; //lock sector, so it can be opened again later
}
else
evPost(nSector, 6, 5, CALLBACK_ID_12);
}
}
}
void sub_76140(int nSprite) // 14
void FinishHim(int nSprite) // 13
{
spritetype* pSprite = &sprite[nSprite];
int nXSprite = pSprite->extra;
XSPRITE* pXSprite = &xsprite[nXSprite];
if (playerSeqPlaying(&gPlayer[pSprite->type - kDudePlayer1], 16) && pXSprite->target == gMe->at5b)
sndStartSample(3313, -1, 1, 0);
}
void fxBloodBits(int nSprite) // 14
{
spritetype *pSprite = &sprite[nSprite];
int ceilZ, ceilHit, floorZ, floorHit;
@ -482,14 +406,65 @@ void sub_76140(int nSprite) // 14
gFX.sub_73FFC(nSprite);
}
void sub_7632C(spritetype *pSprite)
void fxTeslaAlt(int nSprite) // 15
{
xvel[pSprite->index] = yvel[pSprite->index] = zvel[pSprite->index] = 0;
if (pSprite->extra > 0)
seqKill(3, pSprite->extra);
sfxKill3DSound(pSprite, -1, -1);
switch (pSprite->type)
spritetype* pSprite = &sprite[nSprite];
spritetype* pFX = gFX.fxSpawn(FX_49, pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 0);
if (pFX)
{
xvel[pFX->index] = xvel[nSprite] + Random2(0x1aaaa);
yvel[pFX->index] = yvel[nSprite] + Random2(0x1aaaa);
zvel[pFX->index] = zvel[nSprite] - Random(0x1aaaa);
}
evPost(nSprite, 3, 3, kCallbackFXTeslaAlt);
}
int tommySleeveSnd[] = { 608, 609, 611 }; // unused?
int sawedOffSleeveSnd[] = { 610, 612 };
void fxBouncingSleeve(int nSprite) // 16
{
spritetype* pSprite = &sprite[nSprite]; int ceilZ, ceilHit, floorZ, floorHit;
GetZRange(pSprite, &ceilZ, &ceilHit, &floorZ, &floorHit, pSprite->clipdist, CLIPMASK0);
int top, bottom; GetSpriteExtents(pSprite, &top, &bottom);
pSprite->z += floorZ - bottom;
int zv = zvel[nSprite] - velFloor[pSprite->sectnum];
if (zvel[nSprite] == 0) sleeveStopBouncing(pSprite);
else if (zv > 0) {
actFloorBounceVector((int*)& xvel[nSprite], (int*)& yvel[nSprite], &zv, pSprite->sectnum, 0x9000);
zvel[nSprite] = zv;
if (velFloor[pSprite->sectnum] == 0 && klabs(zvel[nSprite]) < 0x20000) {
sleeveStopBouncing(pSprite);
return;
}
int nChannel = 28 + (pSprite->index & 2);
dassert(nChannel < 32);
// tommy sleeve
if (pSprite->type >= 37 && pSprite->type <= 39) {
Random(3);
sfxPlay3DSound(pSprite, 608 + Random(2), nChannel, 1);
// sawed-off sleeve
} else {
sfxPlay3DSound(pSprite, sawedOffSleeveSnd[Random(2)], nChannel, 1);
}
}
}
void sleeveStopBouncing(spritetype* pSprite) {
xvel[pSprite->index] = yvel[pSprite->index] = zvel[pSprite->index] = 0;
if (pSprite->extra > 0) seqKill(3, pSprite->extra);
sfxKill3DSound(pSprite, -1, -1);
switch (pSprite->type) {
case 37:
case 38:
case 39:
@ -501,72 +476,56 @@ void sub_7632C(spritetype *pSprite)
pSprite->picnum = 2464;
break;
}
pSprite->type = 51;
pSprite->xrepeat = pSprite->yrepeat = 10;
}
int dword_13B32C[] = { 608, 609, 611 };
int dword_13B338[] = { 610, 612 };
void sub_763BC(int nSprite) // 16
void returnFlagToBase(int nSprite) // 17
{
spritetype *pSprite = &sprite[nSprite];
int ceilZ, ceilHit, floorZ, floorHit;
GetZRange(pSprite, &ceilZ, &ceilHit, &floorZ, &floorHit, pSprite->clipdist, CLIPMASK0);
int top, bottom;
GetSpriteExtents(pSprite, &top, &bottom);
pSprite->z += floorZ-bottom;
int zv = zvel[nSprite]-velFloor[pSprite->sectnum];
if (zv > 0)
{
actFloorBounceVector((int*)&xvel[nSprite], (int*)&yvel[nSprite], &zv, pSprite->sectnum, 0x9000);
zvel[nSprite] = zv;
if (velFloor[pSprite->sectnum] == 0 && klabs(zvel[nSprite]) < 0x20000)
{
sub_7632C(pSprite);
return;
}
int nChannel = 28+(pSprite->index&2);
dassert(nChannel < 32);
if (pSprite->type >= 37 && pSprite->type <= 39)
{
Random(3);
sfxPlay3DSound(pSprite, 608+Random(2), nChannel, 1);
}
else
sfxPlay3DSound(pSprite, dword_13B338[Random(2)], nChannel, 1);
}
else if (zvel[nSprite] == 0)
sub_7632C(pSprite);
}
void sub_765B8(int nSprite) // 17
{
spritetype *pSprite = &sprite[nSprite];
spritetype* pSprite = &sprite[nSprite];
if (pSprite->owner >= 0 && pSprite->owner < kMaxSprites)
{
spritetype *pOwner = &sprite[pSprite->owner];
XSPRITE *pXOwner = &xsprite[pOwner->extra];
switch (pSprite->type)
{
case 147:
trTriggerSprite(pOwner->index, pXOwner, 1);
spritetype* pOwner = &sprite[pSprite->owner];
XSPRITE* pXOwner = &xsprite[pOwner->extra];
switch (pSprite->type) {
case kItemFlagA:
trTriggerSprite(pOwner->index, pXOwner, kCmdOn);
sndStartSample(8003, 255, 2, 0);
gBlueFlagDropped = false;
viewSetMessage("Blue Flag returned to base.");
break;
case 148:
trTriggerSprite(pOwner->index, pXOwner, 1);
case kItemFlagB:
trTriggerSprite(pOwner->index, pXOwner, kCmdOn);
sndStartSample(8002, 255, 2, 0);
gRedFlagDropped = false;
viewSetMessage("Red Flag returned to base.");
break;
}
}
evPost(pSprite->index, 3, 0, CALLBACK_ID_1);
evPost(pSprite->index, 3, 0, kCallbackRemove);
}
void sub_766B8(int nSprite) // 19
void fxPodBloodSpray(int nSprite) // 18
{
spritetype* pSprite = &sprite[nSprite];
spritetype* pFX;
if (pSprite->type == 53)
pFX = gFX.fxSpawn(FX_53, pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 0);
else
pFX = gFX.fxSpawn(FX_54, pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 0);
if (pFX)
{
pFX->ang = 0;
xvel[pFX->index] = xvel[nSprite] >> 8;
yvel[pFX->index] = yvel[nSprite] >> 8;
zvel[pFX->index] = zvel[nSprite] >> 8;
}
evPost(nSprite, 3, 6, kCallbackFXPodBloodSpray);
}
void fxPodBloodSplat(int nSprite) // 19
{
spritetype *pSprite = &sprite[nSprite];
int ceilZ, ceilHit, floorZ, floorHit;
@ -585,9 +544,9 @@ void sub_766B8(int nSprite) // 19
sfxPlay3DSound(pSprite, 385, nChannel, 1);
}
spritetype *pFX = NULL;
if (pSprite->type == 53 || pSprite->type == 430)
if (pSprite->type == 53 || pSprite->type == kThingPodFireBall)
{
if (Chance(0x500) || pSprite->type == 430)
if (Chance(0x500) || pSprite->type == kThingPodFireBall)
pFX = gFX.fxSpawn(FX_55, pSprite->sectnum, x, y, floorZ-64, 0);
if (pFX)
pFX->ang = nAngle;
@ -601,38 +560,22 @@ void sub_766B8(int nSprite) // 19
gFX.sub_73FFC(nSprite);
}
void sub_768E8(int nSprite) // 18
{
spritetype *pSprite = &sprite[nSprite];
spritetype *pFX;
if (pSprite->type == 53)
pFX = gFX.fxSpawn(FX_53, pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 0);
else
pFX = gFX.fxSpawn(FX_54, pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 0);
if (pFX)
{
pFX->ang = 0;
xvel[pFX->index] = xvel[nSprite]>>8;
yvel[pFX->index] = yvel[nSprite]>>8;
zvel[pFX->index] = zvel[nSprite]>>8;
}
evPost(nSprite, 3, 6, CALLBACK_ID_18);
}
void sub_769B4(int nSprite) // 19
void LeechStateTimer(int nSprite) // 20
{
spritetype *pSprite = &sprite[nSprite];
if (pSprite->statnum == kStatThing && !(pSprite->flags & 32)) {
switch (pSprite->type) {
case 431:
case kGDXThingCustomDudeLifeLeech:
case kThingDroppedLifeLeech:
case kModernThingEnemyLifeLeech:
xsprite[pSprite->extra].stateTimer = 0;
break;
}
}
}
void sub_76A08(spritetype *pSprite, spritetype *pSprite2, PLAYER *pPlayer)
void sub_76A08(spritetype *pSprite, spritetype *pSprite2, PLAYER *pPlayer) // ???
{
int top, bottom;
int nSprite = pSprite->index;
@ -652,13 +595,13 @@ void sub_76A08(spritetype *pSprite, spritetype *pSprite2, PLAYER *pPlayer)
}
}
void sub_76B78(int nSprite)
void DropVoodoo(int nSprite) // unused
{
spritetype *pSprite = &sprite[nSprite];
int nOwner = actSpriteOwnerToSpriteId(pSprite);
if (nOwner < 0 || nOwner >= kMaxSprites)
{
evPost(nSprite, 3, 0, CALLBACK_ID_1);
evPost(nSprite, 3, 0, kCallbackRemove);
return;
}
spritetype *pOwner = &sprite[nOwner];
@ -669,7 +612,7 @@ void sub_76B78(int nSprite)
pPlayer = NULL;
if (!pPlayer)
{
evPost(nSprite, 3, 0, CALLBACK_ID_1);
evPost(nSprite, 3, 0, kCallbackRemove);
return;
}
pSprite->ang = getangle(pOwner->x-pSprite->x, pOwner->y-pSprite->y);
@ -679,7 +622,7 @@ void sub_76B78(int nSprite)
XSPRITE *pXSprite = &xsprite[nXSprite];
if (pXSprite->data1 == 0)
{
evPost(nSprite, 3, 0, CALLBACK_ID_1);
evPost(nSprite, 3, 0, kCallbackRemove);
return;
}
int nSprite2, nNextSprite;
@ -714,7 +657,7 @@ void sub_76B78(int nSprite)
int nDmg = actDamageSprite(nOwner, pSprite2, DAMAGE_TYPE_5, pXSprite->data1<<4);
pXSprite->data1 = ClipLow(pXSprite->data1-nDmg, 0);
sub_76A08(pSprite2, pSprite, pPlayer2);
evPost(nSprite, 3, 0, CALLBACK_ID_1);
evPost(nSprite, 3, 0, kCallbackRemove);
return;
}
}
@ -723,39 +666,39 @@ void sub_76B78(int nSprite)
int vd = 0x2666;
switch (pSprite2->type)
{
case 218:
case 219:
case 220:
case 250:
case 251:
case kDudeBoneEel:
case kDudeBat:
case kDudeRat:
case kDudeTinyCaleb:
case kDudeBeast:
vd = 0x147;
break;
case 205:
case 221:
case 222:
case 223:
case 224:
case 225:
case 226:
case 227:
case 228:
case 229:
case 239:
case 240:
case 241:
case 242:
case 243:
case 244:
case 245:
case 252:
case 253:
case kDudeZombieAxeBuried:
case kDudePodGreen:
case kDudeTentacleGreen:
case kDudePodFire:
case kDudeTentacleFire:
case kDudePodMother:
case kDudeTentacleMother:
case kDudeCerberusTwoHead:
case kDudeCerberusOneHead:
case kDudeTchernobog:
case kDudeBurningInnocent:
case kDudeBurningCultist:
case kDudeBurningZombieAxe:
case kDudeBurningZombieButcher:
case kDudeCultistReserved:
case kDudeZombieAxeLaying:
case kDudeInnocent:
case kDudeBurningTinyCaleb:
case kDudeBurningBeast:
vd = 0;
break;
}
if (vd && (Chance(vd) || nNextSprite < 0))
{
sub_76A08(pSprite2, pSprite, NULL);
evPost(nSprite, 3, 0, CALLBACK_ID_1);
evPost(nSprite, 3, 0, kCallbackRemove);
return;
}
}
@ -763,34 +706,92 @@ void sub_76B78(int nSprite)
}
}
pXSprite->data1 = ClipLow(pXSprite->data1-1, 0);
evPost(nSprite, 3, 0, CALLBACK_ID_1);
evPost(nSprite, 3, 0, kCallbackRemove);
}
}
void UniMissileBurst(int nSprite) // 22
{
dassert(nSprite >= 0 && nSprite < kMaxSprites);
if (sprite[nSprite].statnum != kStatProjectile) return;
spritetype * pSprite = &sprite[nSprite];
int nAngle = getangle(xvel[nSprite], yvel[nSprite]);
int nRadius = 0x55555;
for (int i = 0; i < 8; i++)
{
spritetype* pBurst = actSpawnSprite(pSprite, 5);
pBurst->type = pSprite->type;
pBurst->shade = pSprite->shade;
pBurst->picnum = pSprite->picnum;
pBurst->cstat = pSprite->cstat;
if ((pBurst->cstat & CSTAT_SPRITE_BLOCK)) {
pBurst->cstat &= ~CSTAT_SPRITE_BLOCK; // we don't want missiles impact each other
evPost(pBurst->xvel, 3, 100, kCallbackMissileSpriteBlock); // so set blocking flag a bit later
}
pBurst->pal = pSprite->pal;
pBurst->clipdist = pSprite->clipdist / 4;
pBurst->flags = pSprite->flags;
pBurst->xrepeat = pSprite->xrepeat / 2;
pBurst->yrepeat = pSprite->yrepeat / 2;
pBurst->ang = ((pSprite->ang + missileInfo[pSprite->type - kMissileBase].at6) & 2047);
pBurst->owner = pSprite->owner;
actBuildMissile(pBurst, pBurst->extra, pSprite->xvel);
int nAngle2 = (i << 11) / 8;
int dx = 0;
int dy = mulscale30r(nRadius, Sin(nAngle2));
int dz = mulscale30r(nRadius, -Cos(nAngle2));
if (i & 1)
{
dy >>= 1;
dz >>= 1;
}
RotateVector(&dx, &dy, nAngle);
xvel[pBurst->index] += dx;
yvel[pBurst->index] += dy;
zvel[pBurst->index] += dz;
evPost(pBurst->index, 3, 960, kCallbackRemove);
}
evPost(nSprite, 3, 0, kCallbackRemove);
}
void makeMissileBlocking(int nSprite) // 23
{
dassert(nSprite >= 0 && nSprite < kMaxSprites);
if (sprite[nSprite].statnum != kStatProjectile) return;
sprite[nSprite].cstat |= CSTAT_SPRITE_BLOCK;
}
void(*gCallback[kCallbackMax])(int) =
{
FlameLick,
fxFlameLick,
Remove,
FlareBurst,
FlareSpark,
FlareSparkLite,
ZombieSpurt,
BloodSpurt,
sub_74C20,
DynPuff,
fxFlareSpark,
fxFlareSparkLite,
fxZombieBloodSpurt,
fxBloodSpurt,
fxArcSpark,
fxDynPuff,
Respawn,
PlayerBubble,
EnemyBubble,
CounterCheck,
FinishHim,
sub_76140,
sub_74D04,
sub_763BC,
sub_765B8,
sub_768E8,
sub_766B8,
sub_769B4,
sub_76B78,
fxBloodBits,
fxTeslaAlt,
fxBouncingSleeve,
returnFlagToBase,
fxPodBloodSpray,
fxPodBloodSplat,
LeechStateTimer,
DropVoodoo, // unused
UniMissileBurst,
makeMissileBlocking,
};

View file

@ -23,34 +23,35 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#pragma once
BEGIN_BLD_NS
void sleeveStopBouncing(spritetype* pSprite);
enum CALLBACK_ID {
CALLBACK_ID_NONE = -1,
CALLBACK_ID_0 = 0,
CALLBACK_ID_1,
CALLBACK_ID_2,
CALLBACK_ID_3,
CALLBACK_ID_4,
CALLBACK_ID_5,
CALLBACK_ID_6,
CALLBACK_ID_7,
CALLBACK_ID_8,
CALLBACK_ID_9,
CALLBACK_ID_10,
CALLBACK_ID_11,
CALLBACK_ID_12,
CALLBACK_ID_13,
CALLBACK_ID_14,
CALLBACK_ID_15,
CALLBACK_ID_16,
CALLBACK_ID_17,
CALLBACK_ID_18,
CALLBACK_ID_19,
CALLBACK_ID_20,
CALLBACK_ID_21,
CALLBACK_ID_22, // by NoOne: UniMissileBurst();
CALLBACK_ID_23, // by NoOne: makeMissileBlocking();
kCallbackMax
kCallbackNone = -1,
kCallbackFXFlameLick = 0,
kCallbackRemove = 1,
kCallbackFXFlareBurst = 2,
kCallbackFXFlareSpark = 3,
kCallbackFXFlareSparkLite = 4,
kCallbackFXZombieSpurt = 5,
kCallbackFXBloodSpurt = 6,
kCallbackFXArcSpark = 7,
kCallbackFXDynPuff = 8,
kCallbackRespawn = 9,
kCallbackPlayerBubble = 10,
kCallbackEnemeyBubble = 11,
kCallbackCounterCheck = 12,
kCallbackFinishHim = 13,
kCallbackFXBloodBits = 14,
kCallbackFXTeslaAlt = 15,
kCallbackFXBouncingSleeve = 16,
kCallbackReturnFlag = 17,
kCallbackFXPodBloodSpray = 18,
kCallbackFXPodBloodSplat = 19,
kCallbackLeechStateTimer = 20,
kCallbackDropVoodoo = 21, // unused
kCallbackMissileBurst = 22, // by NoOne
kCallbackMissileSpriteBlock = 23, // by NoOne
kCallbackMax = 24
};
extern void (*gCallback[kCallbackMax])(int);

View file

@ -77,14 +77,7 @@ void QuitGame(void);
#define kExplodeMax 8
#define kDudeBase 200
#define kDudePlayer1 231
#define kDudePlayer8 238
#define kDudeMax 260
#define kMissileBase 300
#define kMissileMax 318
#define kThingBase 400
#define kThingMax 436
#define kMaxPowerUps 51
@ -119,26 +112,290 @@ void QuitGame(void);
// -------------------------------
#define kMaxPAL 5
#define kItemBase 100
#define kWeaponItemBase 40
#define kItemMax 151
// marker sprite types
#define kMarkerSPStart 1
#define kMarkerMPStart 2
#define kMarkerOff 3
#define kMarkerOn 4
#define kMarkerAxis 5
#define kMarkerLowLink 6
#define kMarkerUpLink 7
#define kMarkerWarpDest 8
#define kMarkerUpWater 9
#define kMarkerLowWater 10
#define kMarkerUpStack 11
#define kMarkerLowStack 12
#define kMarkerUpGoo 13
#define kMarkerLowGoo 14
#define kMarkerPath 15
// SPRITE TYPES /////////////////////////////////////////////////
enum {
kSpriteDecoration = 0,
// markers
kMarkerSPStart = 1,
kMarkerMPStart = 2,
kMarkerOff = 3,
kMarkerOn = 4,
kMarkerAxis = 5,
kMarkerLowLink = 6,
kMarkerUpLink = 7,
kMarkerWarpDest = 8,
kMarkerUpWater = 9,
kMarkerLowWater = 10,
kMarkerUpStack = 11,
kMarkerLowStack = 12,
kMarkerUpGoo = 13,
kMarkerLowGoo = 14,
kMarkerPath = 15,
kMarkerDudeSpawn = 18,
kMarkerEarthQuake = 19,
// switches
kSwitchBase = 20,
kSwitchToggle = 20,
kSwitchOneWay = 21,
kSwitchCombo = 22,
kSwitchPadlock = 23,
kSwitchMax = 24,
// modern types (gModernMap only)
kModernCustomDudeSpawn = 24,
kModernRandomTX = 25,
kModernSequentialTX = 26,
kModernSeqSpawner = 27,
kModernObjPropertiesChanger = 28,
kModernObjPicnumChanger = 29,
kModernObjSizeChanger = 31,
kModernDudeTargetChanger = 33,
kModernSectorFXChanger = 34,
kModernObjDataChanger = 35,
kModernSpriteDamager = 36,
kModernObjDataAccumulator = 37,
kModernEffectSpawner = 38,
kModernWindGenerator = 39,
kModernConcussSprite = 712,
// decorations
kDecorationTorch = 30,
kDecorationCandle = 32,
// (weapons)
kItemWeaponBase = 40,
kModernRandom = 40, // gModernMap only
kItemWeaponSawedoff = 41,
kItemWeaponTommygun = 42,
kItemWeaponVoodooDoll = 44,
kItemWeaponLifeLeech = 50,
kItemWeaponMax = 51,
// items (ammos)
kItemAmmoBase = 60,
kItemAmmoSawedoffFew = 67,
kItemAmmoTommygunFew = 69,
kAmmoItemVoodooDoll = 70,
kModernRandom2 = 80, // gModernMap Only
kItemAmmoMax = 81,
kItemBase = 100,
// items (keys)
kItemKeyBase = kItemBase,
kItemKeySkull = kItemKeyBase,
kItemKeyEye = 101,
kItemKeyFire = 102,
kItemKeyDagger = 103,
kItemKeySpider = 104,
kItemKeyMoon = 105,
kItemKeyKey7 = 106,
kItemKeyMax = 107,
// items (health)
kItemHealthDoctorBag = 107,
kItemHealthMedPouch = 108,
kItemHealthLifeEssense = 109,
kItemHealthLifeSeed = 110,
kItemHealthRedPotion = 111,
// items (misc)
kItemFeatherFall = 112,
kItemShadowCloak = 113, // ltdInvisibility
kItemDeathMask = 114, // invulnerability
kItemJumpBoots = 115,
kItemTwoGuns = 117,
kItemDivingSuit = 118,
kItemGasMask = 119,
kItemCrystalBall = 121,
kItemReflectShots = 124,
kItemBeastVision = 125,
kItemShroomDelirium = 128,
kItemShroomGrow = 129, // gModernMap = only
kItemShroomShrink = 130, // gModernMap = only
kItemArmorAsbest = 139,
kItemArmorBasic = 140,
kItemArmorBody = 141,
kItemArmorFire = 142,
kItemArmorSpirit = 143,
kItemArmorSuper = 144,
kItemFlagABase = 145,
kItemFlagBBase = 146,
kItemFlagA = 147,
kItemFlagB = 148,
kItemModernMapLevel = 150, // once picked up, draws whole minimap
kItemMax = 151,
// dudes
kDudeBase = 200,
kDudeCultistTommy = 201,
kDudeCultistShotgun = 202,
kDudeZombieAxeNormal = 203,
kDudeZombieButcher = 204,
kDudeZombieAxeBuried = 205,
kDudeGargoyleFlesh = 206,
kDudeGargoyleStone = 207,
kDudeGargoyleStatueFlesh = 208,
kDudeGargoyleStatueStone = 209,
kDudePhantasm = 210,
kDudeHellHound = 211,
kDudeHand = 212,
kDudeSpiderBrown = 213,
kDudeSpiderRed = 214,
kDudeSpiderBlack = 215,
kDudeSpiderMother = 216,
kDudeGillBeast = 217,
kDudeBoneEel = 218,
kDudeBat = 219,
kDudeRat = 220,
kDudePodGreen = 221,
kDudeTentacleGreen = 222,
kDudePodFire = 223,
kDudeTentacleFire = 224,
kDudePodMother = 225,
kDudeTentacleMother = 226,
kDudeCerberusTwoHead = 227,
kDudeCerberusOneHead = 228,
kDudeTchernobog = 229,
kDudeCultistTommyProne = 230,
kDudePlayer1 = 231,
kDudePlayer2 = 232,
kDudePlayer3 = 233,
kDudePlayer4 = 234,
kDudePlayer5 = 235,
kDudePlayer6 = 236,
kDudePlayer7 = 237,
kDudePlayer8 = 238,
kDudeBurningInnocent = 239,
kDudeBurningCultist = 240,
kDudeBurningZombieAxe = 241,
kDudeBurningZombieButcher = 242,
kDudeCultistReserved = 243, // unused
kDudeZombieAxeLaying = 244,
kDudeInnocent = 245,
kDudeCultistShotgunProne = 246,
kDudeCultistTesla = 247,
kDudeCultistTNT = 248,
kDudeCultistBeast = 249,
kDudeTinyCaleb = 250,
kDudeBeast = 251,
kDudeBurningTinyCaleb = 252,
kDudeBurningBeast = 253,
kDudeModernCustom = 254, // gModern map only
kDudeModernCustomBurning = 255, // gModern map only
kDudeMax = 256,
kMissileBase = 300,
kMissileButcherKnife = kMissileBase,
kMissileFlareRegular = 301,
kMissileTeslaAlt = 302,
kMissileFlareAlt = 303,
kMissileFlameSpray = 304,
kMissileFireball = 305,
kMissileTeslaRegular = 306,
kMissileEctoSkull = 307,
kMissileFlameHound = 308,
kMissilePukeGreen = 309,
kMissileArcGargoyle = 311,
kMissileFireballNapam = 312,
kMissileFireballCerberus = 313,
kMissileFireballTchernobog = 314,
kMissileLifeLeechRegular = 315,
kMissileLifeLeechAltNormal = 316,
kMissileLifeLeechAltSmall = 317,
kMissileMax = 318,
// things
kThingBase = 400,
kThingTNTBarrel = 400,
kThingArmedProxBomb = 401,
kThingArmedRemoteBomb = 402,
kThingCrateFace = 405,
kThingGlassWindow = 406,
kThingFluorescent = 407,
kThingWallCrack = 408,
kThingSpiderWeb = 410,
kThingMetalGrate = 411,
kThingFlammableTree = 412,
kTrapMachinegun = 413, // not really a thing, should be in traps instead
kThingFallingRock = 414,
kThingKickablePail = 415,
kThingObjectGib = 416,
kThingObjectExplode = 417,
kThingArmedTNTStick = 418,
kThingArmedTNTBundle = 419,
kThingArmedSpray = 420,
kThingBone = 421,
kThingDripWater = 423,
kThingDripBlood = 424,
kThingBloodBits = 425,
kThingBloodChunks = 426,
kThingZombieHead = 427,
kThingNapalmBall = 428,
kThingPodGreenBall = 429,
kThingPodFireBall = 430,
kThingDroppedLifeLeech = 431,
kThingVoodooHead = 432, // unused
kModernThingTNTProx = 433, // gModernMap only - detects only players
kModernThingThrowableRock = 434, // gModernMap only - does small damage if hits target
kModernThingEnemyLifeLeech = 435, // gModernMap only - the same as normal, except it aims in specified target only
kThingMax = 436,
// traps
kTrapFlame = 452,
kTrapSawCircular = 454,
kTrapZapSwitchable = 456,
kTrapExploder = 459,
// generators
kGenTrigger = 700,
kGenDripWater = 701,
kGenDripBlood = 702,
kGenMissileFireball = 703,
kGenMissileEctoSkull = 704, // does not work in vanilla
kGenModernMissileUniversal = 704, // gModernMap only
kGenDart = 705,
kGenBubble = 706,
kGenBubbleMulti = 707,
// sound sprites
kGenSound = 708,
kSoundSector = 709,
kSoundPlayer = 711,
};
// WALL TYPES /////////////////////////////////////////////////
enum {
kWallBase = 500,
kWallStack = 501,
kWallGib = 511,
kWallMax = 512,
};
// SECTOR TYPES /////////////////////////////////////////////////
enum {
kSectorBase = 600,
kSectorZMotion = 600,
kSectorZMotionSprite = 602,
kSectorTeleport = 604,
kSectorPath = 612,
kSectorRotateStep = 613,
kSectorSlideMarked = 614,
kSectorRotateMarked = 615,
kSectorSlide = 616,
kSectorRotate = 617,
kSectorDamage = 618,
kSectorCounter = 619,
kSectorMax = 620,
};
// sprite attributes
#define kHitagAutoAim 0x0008
@ -162,21 +419,6 @@ void QuitGame(void);
#define kModernTypeFlag2 0x2
#define kModernTypeFlag3 0x3
// sector types
#define kSecBase 600
#define kSecZMotion kSectorBase
#define kSecZSprite 602
#define kSecWarp 603
#define kSecTeleport 604
#define kSecPath 612
#define kSecRotateStep 613
#define kSecSlideMarked 614
#define kSecRotateMarked 615
#define kSecSlide 616
#define kSecRotate 617
#define kSecDamage 618
#define kSecCounter 619
#define kSecMax 620
// sector cstat
#define kSecCParallax 0x01
@ -189,42 +431,6 @@ void QuitGame(void);
#define kSecCRelAlign 0x40
#define kSecCFloorShade 0x8000
// switch types
#define kSwitchBase 20
#define kSwitchToggle 20
#define kSwitchOneWay 21
#define kSwitchCombo 22
#define kSwitchPadlock 23
#define kSwitchMax 24
// projectile types
#define kProjectileEctoSkull 307
// GDX types
#define kGDXTypeBase 24
#define kGDXCustomDudeSpawn 24
#define kGDXRandomTX 25
#define kGDXSequentialTX 26
#define kGDXSeqSpawner 27
#define kGDXObjPropertiesChanger 28
#define kGDXObjPicnumChanger 29
#define kGDXObjSizeChanger 31
#define kGDXDudeTargetChanger 33
#define kGDXSectorFXChanger 34
#define kGDXObjDataChanger 35
#define kGDXSpriteDamager 36
#define kGDXObjDataAccumulator 37
#define kGDXEffectSpawner 38
#define kGDXWindGenerator 39
#define kModernConcussSprite 712
#define kGDXThingTNTProx 433 // detects only players
#define kGDXThingThrowableRock 434 // does small damage if hits target
#define kGDXThingCustomDudeLifeLeech 435 // the same as normal, except it aims in specified target
#define kCustomDude 254
#define kCustomDudeBurning 255
#define kGDXItemMapLevel 150 // once picked up, draws whole minimap
// ai state types
#define kAiStateOther -1

View file

@ -600,68 +600,37 @@ void dbInit(void)
void PropagateMarkerReferences(void)
{
int nSprite, nNextSprite;
for (nSprite = headspritestat[kStatMarker]; nSprite != -1; nSprite = nNextSprite)
{
for (nSprite = headspritestat[kStatMarker]; nSprite != -1; nSprite = nNextSprite) {
nNextSprite = nextspritestat[nSprite];
switch (sprite[nSprite].type)
{
case 8:
{
int nOwner = sprite[nSprite].owner;
if (nOwner >= 0 && nOwner < numsectors)
{
int nXSector = sector[nOwner].extra;
if (nXSector > 0 && nXSector < kMaxXSectors)
{
xsector[nXSector].at2c_0 = nSprite;
continue;
switch (sprite[nSprite].type) {
case kMarkerOff:
case kMarkerAxis:
case kMarkerWarpDest: {
int nOwner = sprite[nSprite].owner;
if (nOwner >= 0 && nOwner < numsectors) {
int nXSector = sector[nOwner].extra;
if (nXSector > 0 && nXSector < kMaxXSectors) {
xsector[nXSector].marker0 = nSprite;
continue;
}
}
}
break;
case kMarkerOn: {
int nOwner = sprite[nSprite].owner;
if (nOwner >= 0 && nOwner < numsectors) {
int nXSector = sector[nOwner].extra;
if (nXSector > 0 && nXSector < kMaxXSectors) {
xsector[nXSector].marker1 = nSprite;
continue;
}
}
}
break;
}
case 3:
{
int nOwner = sprite[nSprite].owner;
if (nOwner >= 0 && nOwner < numsectors)
{
int nXSector = sector[nOwner].extra;
if (nXSector > 0 && nXSector < kMaxXSectors)
{
xsector[nXSector].at2c_0 = nSprite;
continue;
}
}
break;
}
case 4:
{
int nOwner = sprite[nSprite].owner;
if (nOwner >= 0 && nOwner < numsectors)
{
int nXSector = sector[nOwner].extra;
if (nXSector > 0 && nXSector < kMaxXSectors)
{
xsector[nXSector].at2e_0 = nSprite;
continue;
}
}
break;
}
case 5:
{
int nOwner = sprite[nSprite].owner;
if (nOwner >= 0 && nOwner < numsectors)
{
int nXSector = sector[nOwner].extra;
if (nXSector > 0 && nXSector < kMaxXSectors)
{
xsector[nXSector].at2c_0 = nSprite;
continue;
}
}
break;
}
}
DeleteSprite(nSprite);
}
}
@ -789,26 +758,28 @@ int dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, short
return -1;
}
byte_1A76C8 = 0;
if ((header.version & 0xff00) == 0x600)
{
}
else if ((header.version & 0xff00) == 0x700)
{
if ((header.version & 0xff00) == 0x700) {
byte_1A76C8 = 1;
}
else
{
// by NoOne: indicate if the map requires modern features to work properly
// for maps wich created in PMAPEDIT BETA13 or higher versions. Since only minor version changed,
// the map is still can be loaded with vanilla BLOOD / MAPEDIT and should work in other ports too.
if ((header.version & 0x00ff) == 0x001) gModernMap = true;
else gModernMap = false;
} else {
initprintf("Map file is wrong version");
gSysRes.Unlock(pNode);
return -1;
}
MAPHEADER mapHeader;
IOBuffer1.Read(&mapHeader,37/* sizeof(mapHeader)*/);
if (mapHeader.at16 != 0 && mapHeader.at16 != 0x7474614d && mapHeader.at16 != 0x4d617474)
{
if (mapHeader.at16 != 0 && mapHeader.at16 != 0x7474614d && mapHeader.at16 != 0x4d617474) {
dbCrypt((char*)&mapHeader, sizeof(mapHeader), 0x7474614d);
byte_1A76C7 = 1;
}
#if B_BIG_ENDIAN == 1
mapHeader.at0 = B_LITTLE32(mapHeader.at0);
mapHeader.at4 = B_LITTLE32(mapHeader.at4);
@ -967,7 +938,7 @@ int dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, short
pXSector->at16_3 = bitReader.readUnsigned(1);
pXSector->decoupled = bitReader.readUnsigned(1);
pXSector->triggerOnce = bitReader.readUnsigned(1);
pXSector->at16_6 = bitReader.readUnsigned(1);
pXSector->isTriggered = bitReader.readUnsigned(1);
pXSector->Key = bitReader.readUnsigned(3);
pXSector->Push = bitReader.readUnsigned(1);
pXSector->Vector = bitReader.readUnsigned(1);
@ -979,15 +950,15 @@ int dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, short
pXSector->at18_1 = bitReader.readUnsigned(1);
pXSector->busyTimeB = bitReader.readUnsigned(12);
pXSector->waitTimeB = bitReader.readUnsigned(12);
pXSector->at1b_2 = bitReader.readUnsigned(1);
pXSector->at1b_3 = bitReader.readUnsigned(1);
pXSector->stopOn = bitReader.readUnsigned(1);
pXSector->stopOff = bitReader.readUnsigned(1);
pXSector->ceilpal = bitReader.readUnsigned(4);
pXSector->at1c_0 = bitReader.readSigned(32);
pXSector->at20_0 = bitReader.readSigned(32);
pXSector->at24_0 = bitReader.readSigned(32);
pXSector->at28_0 = bitReader.readSigned(32);
pXSector->at2c_0 = bitReader.readUnsigned(16);
pXSector->at2e_0 = bitReader.readUnsigned(16);
pXSector->marker0 = bitReader.readUnsigned(16);
pXSector->marker1 = bitReader.readUnsigned(16);
pXSector->Crush = bitReader.readUnsigned(1);
pXSector->at30_1 = bitReader.readUnsigned(8);
pXSector->at31_1 = bitReader.readUnsigned(8);
@ -1012,7 +983,7 @@ int dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, short
// by NoOne: indicate if the map requires modern features to work properly
// for maps wich created in different editors (include vanilla MAPEDIT) or in PMAPEDIT version below than BETA13
if (pXSector->rxID == kChannelMapExtended && pXSector->rxID == pXSector->txID && pXSector->command == kCommandMapExtend)
if (pXSector->rxID == kChannelMapExtended && pXSector->rxID == pXSector->txID && pXSector->command == kCmdModernFeaturesEnable)
gModernMap = true;
}
}
@ -1091,7 +1062,7 @@ int dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, short
// by NoOne: indicate if the map requires modern features to work properly
// for maps wich created in different editors (include vanilla MAPEDIT) or in PMAPEDIT version below than BETA13
if (pXWall->rxID == kChannelMapExtended && pXWall->rxID == pXWall->txID && pXWall->command == kCommandMapExtend)
if (pXWall->rxID == kChannelMapExtended && pXWall->rxID == pXWall->txID && pXWall->command == kCmdModernFeaturesEnable)
gModernMap = true;
}
}
@ -1215,7 +1186,7 @@ int dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, short
// by NoOne: indicate if the map requires modern features to work properly
// for maps wich created in different editors (include vanilla MAPEDIT) or in PMAPEDIT version below than BETA13
if (pXSprite->rxID == kChannelMapExtended && pXSprite->rxID == pXSprite->txID && pXSprite->command == kCommandMapExtend)
if (pXSprite->rxID == kChannelMapExtended && pXSprite->rxID == pXSprite->txID && pXSprite->command == kCmdModernFeaturesEnable)
gModernMap = true;
}
if ((sprite[i].cstat & 0x30) == 0x30)
@ -1486,7 +1457,7 @@ int dbSaveMap(const char *pPath, int nX, int nY, int nZ, short nAngle, short nSe
bitWriter.write(pXSector->at16_3, 1);
bitWriter.write(pXSector->decoupled, 1);
bitWriter.write(pXSector->triggerOnce, 1);
bitWriter.write(pXSector->at16_6, 1);
bitWriter.write(pXSector->isTriggered, 1);
bitWriter.write(pXSector->Key, 3);
bitWriter.write(pXSector->Push, 1);
bitWriter.write(pXSector->Vector, 1);
@ -1498,15 +1469,15 @@ int dbSaveMap(const char *pPath, int nX, int nY, int nZ, short nAngle, short nSe
bitWriter.write(pXSector->at18_1, 1);
bitWriter.write(pXSector->busyTimeB, 12);
bitWriter.write(pXSector->waitTimeB, 12);
bitWriter.write(pXSector->at1b_2, 1);
bitWriter.write(pXSector->at1b_3, 1);
bitWriter.write(pXSector->stopOn, 1);
bitWriter.write(pXSector->stopOff, 1);
bitWriter.write(pXSector->ceilpal, 4);
bitWriter.write(pXSector->at1c_0, 32);
bitWriter.write(pXSector->at20_0, 32);
bitWriter.write(pXSector->at24_0, 32);
bitWriter.write(pXSector->at28_0, 32);
bitWriter.write(pXSector->at2c_0, 16);
bitWriter.write(pXSector->at2e_0, 16);
bitWriter.write(pXSector->marker0, 16);
bitWriter.write(pXSector->marker1, 16);
bitWriter.write(pXSector->Crush, 1);
bitWriter.write(pXSector->at30_1, 8);
bitWriter.write(pXSector->at31_1, 8);

View file

@ -110,7 +110,7 @@ struct XSPRITE {
struct XSECTOR {
signed int reference : 14;
unsigned int state : 1; // State 0
unsigned int state : 1; // State
unsigned int busy : 17;
unsigned int data : 16; // Data
unsigned int txID : 10; // TX ID
@ -118,7 +118,7 @@ struct XSECTOR {
unsigned int at7_2 : 3; // OFF->ON wave
unsigned int at7_5 : 3; // ON->OFF wave
unsigned int command : 8; // Cmd 0
unsigned int command : 8; // Cmd
unsigned int triggerOn : 1; // Send at ON
unsigned int triggerOff : 1; // Send at OFF
unsigned int busyTimeA : 12; // OFF->ON busyTime
@ -148,7 +148,7 @@ struct XSECTOR {
unsigned int at16_3 : 1;
unsigned int decoupled : 1; // Decoupled
unsigned int triggerOnce : 1; // 1-shot
unsigned int at16_6 : 1;
unsigned int isTriggered : 1;
unsigned int Key : 3; // Key
unsigned int Push : 1; // Push
unsigned int Vector : 1; // Vector
@ -160,15 +160,15 @@ struct XSECTOR {
unsigned int at18_1 : 1;
unsigned int busyTimeB : 12; // ON->OFF busyTime
unsigned int waitTimeB : 12; // ON->OFF waitTime
unsigned int at1b_2 : 1;
unsigned int at1b_3 : 1;
unsigned int stopOn : 1;
unsigned int stopOff : 1;
unsigned int ceilpal : 4; // Ceil pal2
signed int at1c_0 : 32;
signed int at20_0 : 32;
signed int at24_0 : 32;
signed int at28_0 : 32;
unsigned int at2c_0 : 16;
unsigned int at2e_0 : 16;
unsigned int marker0 : 16;
unsigned int marker1 : 16;
unsigned int Crush : 1; // Crush
unsigned int at30_1 : 8; // Ceiling x panning frac
unsigned int at31_1 : 8; // Ceiling y panning frac

View file

@ -138,22 +138,41 @@ void CKillMgr::sub_263E0(int nCount)
at0 += nCount;
}
void CKillMgr::AddKill(spritetype *pSprite)
{
if (pSprite->statnum == kStatDude && pSprite->type != 219 && pSprite->type != 220 && pSprite->type != 245 && pSprite->type != 239)
void CKillMgr::AddKill(spritetype *pSprite) {
if (pSprite->statnum == kStatDude) {
switch (pSprite->type) {
case kDudeBat:
case kDudeRat:
case kDudeBurningInnocent:
case kDudeInnocent:
return;
}
at4++;
}
}
void CKillMgr::sub_2641C(void)
{
at0 = 0;
for (int nSprite = headspritestat[kStatDude]; nSprite >= 0; nSprite = nextspritestat[nSprite])
{
for (int nSprite = headspritestat[kStatDude]; nSprite >= 0; nSprite = nextspritestat[nSprite]) {
spritetype *pSprite = &sprite[nSprite];
if (pSprite->type < kDudeBase || pSprite->type >= kDudeMax)
ThrowError("Non-enemy sprite (%d) in the enemy sprite list.", nSprite);
if (pSprite->statnum == kStatDude && pSprite->type != 219 && pSprite->type != 220 && pSprite->type != 245 && pSprite->type != 239)
if (pSprite->statnum == kStatDude) {
switch (pSprite->type) {
case kDudeBat:
case kDudeRat:
case kDudeBurningInnocent:
case kDudeInnocent:
return;
}
at0++;
}
}
}

View file

@ -68,7 +68,7 @@ void EventQueue::Kill(int a1, int a2)
void EventQueue::Kill(int a1, int a2, CALLBACK_ID a3)
{
EVENT evn = { (unsigned int)a1, (unsigned int)a2, kCommandCallback, (unsigned int)a3 };
EVENT evn = { (unsigned int)a1, (unsigned int)a2, kCmdCallback, (unsigned int)a3 };
PQueue->Kill([=](EVENT nItem)->bool {return !memcmp(&nItem, &evn, sizeof(EVENT)); });
}
@ -364,17 +364,17 @@ void evSend(int nIndex, int nType, int rxId, COMMAND_ID command)
EVENT event; event.index = nIndex; event.type = nType; event.cmd = command;
switch (command) {
case COMMAND_ID_2:
command = evGetSourceState(nType, nIndex) ? COMMAND_ID_1 : COMMAND_ID_0;
case kCmdState:
command = evGetSourceState(nType, nIndex) ? kCmdOn : kCmdOff;
break;
case COMMAND_ID_4:
command = evGetSourceState(nType, nIndex) ? COMMAND_ID_0 : COMMAND_ID_1;
case kCmdNotState:
command = evGetSourceState(nType, nIndex) ? kCmdOff : kCmdOn;
break;
}
switch (rxId) {
case kChannelTextOver:
if (command >= COMMAND_ID_64) trTextOver(command - COMMAND_ID_64);
if (command >= kCmdNumberic) trTextOver(command - kCmdNumberic);
else viewSetSystemMessage("Invalid TextOver command by xobject #%d (object type %d)", nIndex, nType);
return;
case kChannelLevelExitNormal:
@ -385,15 +385,15 @@ void evSend(int nIndex, int nType, int rxId, COMMAND_ID command)
return;
// By NoOne: finished level and load custom level ¹ via numbered command.
case kChannelModernEndLevelCustom:
if (command >= COMMAND_ID_64) levelEndLevelCustom(command - COMMAND_ID_64);
if (command >= kCmdNumberic) levelEndLevelCustom(command - kCmdNumberic);
else viewSetSystemMessage("Invalid Level-Exit# command by xobject #%d (object type %d)", nIndex, nType);
return;
case kChannelSetTotalSecrets:
if (command >= COMMAND_ID_64) levelSetupSecret(command - COMMAND_ID_64);
if (command >= kCmdNumberic) levelSetupSecret(command - kCmdNumberic);
else viewSetSystemMessage("Invalid Total-Secrets command by xobject #%d (object type %d)", nIndex, nType);
break;
case kChannelSecretFound:
if (command >= COMMAND_ID_64) levelTriggerSecret(command - COMMAND_ID_64);
if (command >= kCmdNumberic) levelTriggerSecret(command - kCmdNumberic);
else viewSetSystemMessage("Invalid Trigger-Secret command by xobject #%d (object type %d)", nIndex, nType);
break;
case kChannelRemoteBomb0:
@ -469,11 +469,11 @@ void evSend(int nIndex, int nType, int rxId, COMMAND_ID command)
void evPost(int nIndex, int nType, unsigned int nDelta, COMMAND_ID command)
{
dassert(command != kCommandCallback);
if (command == COMMAND_ID_2)
command = evGetSourceState(nType, nIndex) ? COMMAND_ID_1 : COMMAND_ID_0;
else if (command == COMMAND_ID_4)
command = evGetSourceState(nType, nIndex) ? COMMAND_ID_0 : COMMAND_ID_1;
dassert(command != kCmdCallback);
if (command == kCmdState)
command = evGetSourceState(nType, nIndex) ? kCmdOn : kCmdOff;
else if (command == kCmdNotState)
command = evGetSourceState(nType, nIndex) ? kCmdOff : kCmdOn;
EVENT evn = {};
evn.index = nIndex;
evn.type = nType;
@ -487,7 +487,7 @@ void evPost(int nIndex, int nType, unsigned int nDelta, CALLBACK_ID a4)
EVENT evn = {};
evn.index = nIndex;
evn.type = nType;
evn.cmd = kCommandCallback;
evn.cmd = kCmdCallback;
evn.funcID = a4;
eventQ.PQueue->Insert((int)gFrameClock+nDelta, evn);
}
@ -509,7 +509,7 @@ void evProcess(unsigned int nTime)
while(eventQ.IsNotEmpty(nTime))
{
EVENT event = eventQ.ERemove();
if (event.cmd == kCommandCallback)
if (event.cmd == kCmdCallback)
{
dassert(event.funcID < kCallbackMax);
dassert(gCallback[event.funcID] != NULL);

View file

@ -64,22 +64,43 @@ extern RXBUCKET rxBucket[];
extern unsigned short bucketHead[];
enum COMMAND_ID {
COMMAND_ID_0 = 0,
COMMAND_ID_1,
COMMAND_ID_2,
COMMAND_ID_3,
COMMAND_ID_4,
COMMAND_ID_5,
COMMAND_ID_6,
COMMAND_ID_7,
COMMAND_ID_8,
COMMAND_ID_9,
kCmdOff = 0,
kCmdOn = 1,
kCmdState = 2,
kCmdToggle = 3,
kCmdNotState = 4,
kCmdLink = 5,
kCmdLock = 6,
kCmdUnlock = 7,
kCmdToggleLock = 8,
kCmdStopOff = 9,
kCmdStopOn = 10,
kCmdStopNext = 11,
kCmdCounterSector = 12,
kCmdCallback = 20,
kCmdRepeat = 21,
kCmdSpritePush = 30,
kCmdSpriteImpact = 31,
kCmdSpritePickup = 32,
kCmdSpriteTouch = 33,
kCmdSpriteSight = 34,
kCmdSpriteProximity = 35,
kCmdSpriteExplode = 36,
kCmdSectorPush = 40,
kCmdSectorImpact = 41,
kCmdSectorEnter = 42,
kCmdSectorExit = 43,
kCommandCallback = 20,
COMMAND_ID_21,
kGDXCommandPaste = 53, // used by some new GDX types
COMMAND_ID_64 = 64,
kCommandMapExtend = 100
kCmdWallPush = 50,
kCmdWallImpact = 51,
kCmdWallTouch = 52,
kCmdModernUse = 53, // used by most of modern types
kCmdNumberic = 64, // 64: 0, 65: 1 and so on up to 255
kCmdModernFeaturesEnable = 100, // must be in object with kChannelMapExtended RX / TX
kCmdModernFeaturesDisable = 200 // must be in object with kChannelMapExtended RX / TX
};
struct EVENT {

View file

@ -60,63 +60,63 @@ struct FXDATA {
};
FXDATA gFXData[] = {
{ CALLBACK_ID_NONE, 0, 49, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 0, 50, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 0, 51, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 0, 52, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 0, 44, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 0, 45, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 0, 46, 1, -128, 8192, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 2, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 2, 42, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 2, 43, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 1, 48, 3, -256, 8192, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 1, 60, 3, -256, 8192, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_14, 2, 0, 1, 46603, 2048, 480, 2154, 40, 40, 0, -12, 0 },
{ CALLBACK_ID_NONE, 2, 0, 3, 46603, 5120, 480, 2269, 24, 24, 0, -128, 0 },
{ CALLBACK_ID_NONE, 2, 0, 3, 46603, 5120, 480, 1720, 24, 24, 0, -128, 0 },
{ CALLBACK_ID_NONE, 1, 0, 1, 58254, 3072, 480, 2280, 48, 48, 0, -128, 0 },
{ CALLBACK_ID_NONE, 1, 0, 1, 58254, 3072, 480, 3135, 48, 48, 0, -128, 0 },
{ CALLBACK_ID_NONE, 0, 0, 3, 58254, 1024, 480, 3261, 32, 32, 0, 0, 0 },
{ CALLBACK_ID_NONE, 1, 0, 3, 58254, 1024, 480, 3265, 32, 32, 0, 0, 0 },
{ CALLBACK_ID_NONE, 1, 0, 3, 58254, 1024, 480, 3269, 32, 32, 0, 0, 0 },
{ CALLBACK_ID_NONE, 1, 0, 3, 58254, 1024, 480, 3273, 32, 32, 0, 0, 0 },
{ CALLBACK_ID_NONE, 1, 0, 3, 58254, 1024, 480, 3277, 32, 32, 0, 0, 0 },
{ CALLBACK_ID_NONE, 2, 0, 1, -27962, 8192, 600, 1128, 16, 16, 514, -16, 0 }, // bubble 1
{ CALLBACK_ID_NONE, 2, 0, 1, -18641, 8192, 600, 1128, 12, 12, 514, -16, 0 }, // bubble 2
{ CALLBACK_ID_NONE, 2, 0, 1, -9320, 8192, 600, 1128, 8, 8, 514, -16, 0 }, // bubble 3
{ CALLBACK_ID_NONE, 2, 0, 1, -18641, 8192, 600, 1131, 32, 32, 514, -16, 0 },
{ CALLBACK_ID_14, 2, 0, 3, 27962, 4096, 480, 733, 32, 32, 0, -16, 0 },
{ CALLBACK_ID_NONE, 1, 0, 3, 18641, 4096, 120, 2261, 12, 12, 0, -128, 0 },
{ CALLBACK_ID_NONE, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 1, 0, 3, 58254, 3328, 480, 2185, 48, 48, 0, 0, 0 },
{ CALLBACK_ID_NONE, 0, 0, 3, 58254, 1024, 480, 2620, 48, 48, 0, 0, 0 },
{ CALLBACK_ID_NONE, 1, 55, 1, -13981, 5120, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 1, 56, 1, -13981, 5120, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 1, 57, 1, 0, 2048, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 1, 58, 1, 0, 2048, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 2, 0, 0, 0, 0, 960, 956, 32, 32, 610, 0, 0 },
{ CALLBACK_ID_16, 2, 62, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_16, 2, 63, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_16, 2, 64, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_16, 2, 65, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_16, 2, 66, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_16, 2, 67, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 1, 0, 3, 0, 0, 0, 838, 16, 16, 80, -8, 0 },
{ CALLBACK_ID_NONE, 0, 0, 3, 34952, 8192, 0, 2078, 64, 64, 0, -8, 0 },
{ CALLBACK_ID_NONE, 0, 0, 3, 34952, 8192, 0, 1106, 64, 64, 0, -8, 0 },
{ CALLBACK_ID_NONE, 0, 0, 3, 58254, 3328, 480, 2406, 48, 48, 0, 0, 0 },
{ CALLBACK_ID_NONE, 1, 0, 3, 46603, 4096, 480, 3511, 64, 64, 0, -128, 0 },
{ CALLBACK_ID_NONE, 0, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 2, 11, 3, -256, 8192, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 2, 11, 3, 0, 8192, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ CALLBACK_ID_NONE, 1, 30, 3, 0, 0, 0, 0, 40, 40, 80, -8, 0 },
{ CALLBACK_ID_19, 2, 0, 3, 27962, 4096, 480, 4023, 32, 32, 0, -16, 0 },
{ CALLBACK_ID_19, 2, 0, 3, 27962, 4096, 480, 4028, 32, 32, 0, -16, 0 },
{ CALLBACK_ID_NONE, 2, 0, 0, 0, 0, 480, 926, 32, 32, 610, -12, 0 },
{ CALLBACK_ID_NONE, 1, 70, 1, -13981, 5120, 0, 0, 0, 0, 0, 0, 0 }
{ kCallbackNone, 0, 49, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 0, 50, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 0, 51, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 0, 52, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 0, 44, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 0, 45, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 0, 46, 1, -128, 8192, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 2, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 2, 42, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 2, 43, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 1, 48, 3, -256, 8192, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 1, 60, 3, -256, 8192, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackFXBloodBits, 2, 0, 1, 46603, 2048, 480, 2154, 40, 40, 0, -12, 0 },
{ kCallbackNone, 2, 0, 3, 46603, 5120, 480, 2269, 24, 24, 0, -128, 0 },
{ kCallbackNone, 2, 0, 3, 46603, 5120, 480, 1720, 24, 24, 0, -128, 0 },
{ kCallbackNone, 1, 0, 1, 58254, 3072, 480, 2280, 48, 48, 0, -128, 0 },
{ kCallbackNone, 1, 0, 1, 58254, 3072, 480, 3135, 48, 48, 0, -128, 0 },
{ kCallbackNone, 0, 0, 3, 58254, 1024, 480, 3261, 32, 32, 0, 0, 0 },
{ kCallbackNone, 1, 0, 3, 58254, 1024, 480, 3265, 32, 32, 0, 0, 0 },
{ kCallbackNone, 1, 0, 3, 58254, 1024, 480, 3269, 32, 32, 0, 0, 0 },
{ kCallbackNone, 1, 0, 3, 58254, 1024, 480, 3273, 32, 32, 0, 0, 0 },
{ kCallbackNone, 1, 0, 3, 58254, 1024, 480, 3277, 32, 32, 0, 0, 0 },
{ kCallbackNone, 2, 0, 1, -27962, 8192, 600, 1128, 16, 16, 514, -16, 0 }, // bubble 1
{ kCallbackNone, 2, 0, 1, -18641, 8192, 600, 1128, 12, 12, 514, -16, 0 }, // bubble 2
{ kCallbackNone, 2, 0, 1, -9320, 8192, 600, 1128, 8, 8, 514, -16, 0 }, // bubble 3
{ kCallbackNone, 2, 0, 1, -18641, 8192, 600, 1131, 32, 32, 514, -16, 0 },
{ kCallbackFXBloodBits, 2, 0, 3, 27962, 4096, 480, 733, 32, 32, 0, -16, 0 },
{ kCallbackNone, 1, 0, 3, 18641, 4096, 120, 2261, 12, 12, 0, -128, 0 },
{ kCallbackNone, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 1, 0, 3, 58254, 3328, 480, 2185, 48, 48, 0, 0, 0 },
{ kCallbackNone, 0, 0, 3, 58254, 1024, 480, 2620, 48, 48, 0, 0, 0 },
{ kCallbackNone, 1, 55, 1, -13981, 5120, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 1, 56, 1, -13981, 5120, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 1, 57, 1, 0, 2048, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 1, 58, 1, 0, 2048, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 2, 0, 0, 0, 0, 960, 956, 32, 32, 610, 0, 0 },
{ kCallbackFXBouncingSleeve, 2, 62, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackFXBouncingSleeve, 2, 63, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackFXBouncingSleeve, 2, 64, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackFXBouncingSleeve, 2, 65, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackFXBouncingSleeve, 2, 66, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackFXBouncingSleeve, 2, 67, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 1, 0, 3, 0, 0, 0, 838, 16, 16, 80, -8, 0 },
{ kCallbackNone, 0, 0, 3, 34952, 8192, 0, 2078, 64, 64, 0, -8, 0 },
{ kCallbackNone, 0, 0, 3, 34952, 8192, 0, 1106, 64, 64, 0, -8, 0 },
{ kCallbackNone, 0, 0, 3, 58254, 3328, 480, 2406, 48, 48, 0, 0, 0 },
{ kCallbackNone, 1, 0, 3, 46603, 4096, 480, 3511, 64, 64, 0, -128, 0 },
{ kCallbackNone, 0, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 2, 11, 3, -256, 8192, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 2, 11, 3, 0, 8192, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ kCallbackNone, 1, 30, 3, 0, 0, 0, 0, 40, 40, 80, -8, 0 },
{ kCallbackFXPodBloodSplat, 2, 0, 3, 27962, 4096, 480, 4023, 32, 32, 0, -16, 0 },
{ kCallbackFXPodBloodSplat, 2, 0, 3, 27962, 4096, 480, 4028, 32, 32, 0, -16, 0 },
{ kCallbackNone, 2, 0, 0, 0, 0, 480, 926, 32, 32, 610, -12, 0 },
{ kCallbackNone, 1, 70, 1, -13981, 5120, 0, 0, 0, 0, 0, 0, 0 }
};
void CFX::sub_73FB0(int nSprite)
@ -199,7 +199,7 @@ spritetype * CFX::fxSpawn(FX_ID nFx, int nSector, int x, int y, int z, unsigned
if (a6 == 0)
a6 = pFX->ate;
if (a6)
evPost((int)pSprite->index, 3, a6+Random2(a6>>1), CALLBACK_ID_1);
evPost((int)pSprite->index, 3, a6+Random2(a6>>1), kCallbackRemove);
return pSprite;
}
@ -288,7 +288,7 @@ void fxSpawnBlood(spritetype *pSprite, int a2)
xvel[pBlood->index] = Random2(0x6aaaa);
yvel[pBlood->index] = Random2(0x6aaaa);
zvel[pBlood->index] = -Random(0x10aaaa)-100;
evPost(pBlood->index, 3, 8, CALLBACK_ID_6);
evPost(pBlood->index, 3, 8, kCallbackFXBloodSpurt);
}
}
@ -303,7 +303,7 @@ void sub_746D4(spritetype *pSprite, int a2)
if (gbAdultContent && gGameOptions.nGameType <= 0)
return;
spritetype *pSpawn;
if (pSprite->type == 221)
if (pSprite->type == kDudePodGreen)
pSpawn = gFX.fxSpawn(FX_53, pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 0);
else
pSpawn = gFX.fxSpawn(FX_54, pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 0);
@ -313,7 +313,7 @@ void sub_746D4(spritetype *pSprite, int a2)
xvel[pSpawn->index] = Random2(0x6aaaa);
yvel[pSpawn->index] = Random2(0x6aaaa);
zvel[pSpawn->index] = -Random(0x10aaaa)-100;
evPost(pSpawn->index, 3, 8, CALLBACK_ID_18);
evPost(pSpawn->index, 3, 8, kCallbackFXPodBloodSpray);
}
}

View file

@ -363,11 +363,10 @@ void GibFX(spritetype *pSprite, GIBFX *pGFX, CGibPosition *pPos, CGibVelocity *p
void GibThing(spritetype *pSprite, GIBTHING *pGThing, CGibPosition *pPos, CGibVelocity *pVel)
{
if (gbAdultContent && gGameOptions.nGameType <= 0)
switch (pGThing->at0)
{
case 425:
case 427:
return;
switch (pGThing->at0) {
case kThingBloodBits:
case kThingZombieHead:
return;
}
if (pGThing->chance == 65536 || Chance(pGThing->chance))

View file

@ -787,7 +787,7 @@ void CCheatMgr::Process(CCheatMgr::CHEATCODE nCheatCode, char* pzArgs)
case kCheatMcGee:
{
if (!gMe->pXSprite->burnTime)
evPost(gMe->at5b, 3, 0, CALLBACK_ID_0);
evPost(gMe->at5b, 3, 0, kCallbackFXFlameLick);
actBurnSprite(actSpriteIdToOwnerId(gMe->at5b), gMe->pXSprite, 2400);
viewSetMessage("You're fired!");
break;
@ -801,7 +801,7 @@ void CCheatMgr::Process(CCheatMgr::CHEATCODE nCheatCode, char* pzArgs)
actHealDude(gMe->pXSprite, 200, 200);
gMe->at33e[1] = VanillaMode() ? 200 : 3200;
if (!gMe->pXSprite->burnTime)
evPost(gMe->at5b, 3, 0, CALLBACK_ID_0);
evPost(gMe->at5b, 3, 0, kCallbackFXFlameLick);
actBurnSprite(actSpriteIdToOwnerId(gMe->at5b), gMe->pXSprite, 2400);
viewSetMessage("Flame retardant!");
break;

View file

@ -100,7 +100,7 @@ void InitMirrors(void)
int nTile = 4080+mirrorcnt;
if (wall[i].overpicnum == 504)
{
if (wall[i].extra > 0 && GetWallType(i) == 501)
if (wall[i].extra > 0 && GetWallType(i) == kWallStack)
{
wall[i].overpicnum = nTile;
mirror[mirrorcnt].at14 = i;
@ -112,7 +112,7 @@ void InitMirrors(void)
{
if (j == i)
continue;
if (wall[j].extra > 0 && GetWallType(i) == 501)
if (wall[j].extra > 0 && GetWallType(i) == kWallStack)
{
if (tmp != xwall[wall[j].extra].data)
continue;
@ -374,7 +374,7 @@ void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz, int smooth, int
sector[mirrorsector].floorz = sector[nSector].floorz;
sector[mirrorsector].ceilingz = sector[nSector].ceilingz;
int cx, cy, ca;
if (GetWallType(nWall) == 501)
if (GetWallType(nWall) == kWallStack)
{
cx = x - (wall[pWall->hitag].x-wall[pWall->point2].x);
cy = y - (wall[pWall->hitag].y-wall[pWall->point2].y);
@ -393,7 +393,7 @@ void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz, int smooth, int
yax_drawrooms(viewProcessSprites, mirrorsector, didmirror, smooth);
viewProcessSprites(cx,cy,z,fix16_to_int(ca),smooth);
renderDrawMasks();
if (GetWallType(nWall) != 501)
if (GetWallType(nWall) != kWallStack)
renderCompleteMirror();
if (wall[nWall].pal != 0 || wall[nWall].shade != 0)
TranslateMirrorColors(wall[nWall].shade, wall[nWall].pal);

View file

@ -473,55 +473,57 @@ char powerupActivate(PLAYER *pPlayer, int nPowerUp)
int nPack = powerupToPackItem(nPowerUp);
if (nPack >= 0)
pPlayer->packInfo[nPack].at0 = 1;
switch (nPowerUp+100)
{
case kGDXItemMapLevel:
gFullMap = true;
break;
case 130:
if (isGrown(pPlayer->pSprite)) deactivateSizeShrooms(pPlayer);
else shrinkPlayerSize(pPlayer, 2);
break;
case 129:
if (isShrinked(pPlayer->pSprite)) deactivateSizeShrooms(pPlayer);
else {
growPlayerSize(pPlayer, 2);
if (powerupCheck(&gPlayer[pPlayer->pSprite->type - kDudePlayer1], 13) > 0) {
powerupDeactivate(pPlayer, 13);
pPlayer->at202[13] = 0;
}
switch (nPowerUp + kItemBase) {
case kItemModernMapLevel:
if (gModernMap) gFullMap = true;
break;
case kItemShroomShrink:
if (!gModernMap) break;
else if (isGrown(pPlayer->pSprite)) deactivateSizeShrooms(pPlayer);
else shrinkPlayerSize(pPlayer, 2);
break;
case kItemShroomGrow:
if (!gModernMap) break;
else if (isShrinked(pPlayer->pSprite)) deactivateSizeShrooms(pPlayer);
else {
growPlayerSize(pPlayer, 2);
if (powerupCheck(&gPlayer[pPlayer->pSprite->type - kDudePlayer1], 13) > 0) {
powerupDeactivate(pPlayer, 13);
pPlayer->at202[13] = 0;
}
if (ceilIsTooLow(pPlayer->pSprite))
actDamageSprite(pPlayer->pSprite->xvel, pPlayer->pSprite, DAMAGE_TYPE_3, 65535);
}
break;
case 112:
case 115: // jump boots
pPlayer->ata1[0]++;
break;
case 124: // reflective shots
if (pPlayer == gMe && gGameOptions.nGameType == 0)
sfxSetReverb2(1);
break;
case 114: // death mask
for (int i = 0; i < 7; i++)
pPlayer->ata1[i]++;
break;
case 118: // diving suit
pPlayer->ata1[4]++;
if (pPlayer == gMe && gGameOptions.nGameType == 0)
sfxSetReverb(1);
break;
case 119:
pPlayer->ata1[4]++;
break;
case 139:
pPlayer->ata1[1]++;
break;
case 117: // guns akimbo
pPlayer->atc.newWeapon = pPlayer->atbd;
WeaponRaise(pPlayer);
break;
if (ceilIsTooLow(pPlayer->pSprite))
actDamageSprite(pPlayer->pSprite->xvel, pPlayer->pSprite, DAMAGE_TYPE_3, 65535);
}
break;
case kItemFeatherFall:
case kItemJumpBoots:
pPlayer->ata1[0]++;
break;
case kItemReflectShots: // reflective shots
if (pPlayer == gMe && gGameOptions.nGameType == 0)
sfxSetReverb2(1);
break;
case kItemDeathMask:
for (int i = 0; i < 7; i++)
pPlayer->ata1[i]++;
break;
case kItemDivingSuit: // diving suit
pPlayer->ata1[4]++;
if (pPlayer == gMe && gGameOptions.nGameType == 0)
sfxSetReverb(1);
break;
case kItemGasMask:
pPlayer->ata1[4]++;
break;
case kItemArmorAsbest:
pPlayer->ata1[1]++;
break;
case kItemTwoGuns:
pPlayer->atc.newWeapon = pPlayer->atbd;
WeaponRaise(pPlayer);
break;
}
sfxPlay3DSound(pPlayer->pSprite, 776, -1, 0);
return 1;
@ -532,43 +534,45 @@ void powerupDeactivate(PLAYER *pPlayer, int nPowerUp)
int nPack = powerupToPackItem(nPowerUp);
if (nPack >= 0)
pPlayer->packInfo[nPack].at0 = 0;
switch (nPowerUp+100)
{
case 130:
resetPlayerSize(pPlayer);
if (ceilIsTooLow(pPlayer->pSprite))
actDamageSprite(pPlayer->pSprite->xvel, pPlayer->pSprite, DAMAGE_TYPE_3, 65535);
break;
case 129:
resetPlayerSize(pPlayer);
break;
case 112:
case 115: // jump boots
pPlayer->ata1[0]--;
break;
case 114: // death mask
for (int i = 0; i < 7; i++)
pPlayer->ata1[i]--;
break;
case 118: // diving suit
pPlayer->ata1[4]--;
if (pPlayer == gMe && VanillaMode() ? true : pPlayer->at202[24] == 0)
sfxSetReverb(0);
break;
case 124: // reflective shots
if (pPlayer == gMe && VanillaMode() ? true : pPlayer->packInfo[1].at0 == 0)
sfxSetReverb(0);
break;
case 119:
pPlayer->ata1[4]--;
break;
case 139:
pPlayer->ata1[1]--;
break;
case 117: // guns akimbo
pPlayer->atc.newWeapon = pPlayer->atbd;
WeaponRaise(pPlayer);
break;
switch (nPowerUp + kItemBase) {
case kItemShroomShrink:
if (gModernMap) {
resetPlayerSize(pPlayer);
if (ceilIsTooLow(pPlayer->pSprite))
actDamageSprite(pPlayer->pSprite->xvel, pPlayer->pSprite, DAMAGE_TYPE_3, 65535);
}
break;
case kItemShroomGrow:
if (gModernMap) resetPlayerSize(pPlayer);
break;
case kItemFeatherFall:
case kItemJumpBoots:
pPlayer->ata1[0]--;
break;
case kItemDeathMask:
for (int i = 0; i < 7; i++)
pPlayer->ata1[i]--;
break;
case kItemDivingSuit:
pPlayer->ata1[4]--;
if (pPlayer == gMe && VanillaMode() ? true : pPlayer->at202[24] == 0)
sfxSetReverb(0);
break;
case kItemReflectShots:
if (pPlayer == gMe && VanillaMode() ? true : pPlayer->packInfo[1].at0 == 0)
sfxSetReverb(0);
break;
case kItemGasMask:
pPlayer->ata1[4]--;
break;
case kItemArmorAsbest:
pPlayer->ata1[1]--;
break;
case kItemTwoGuns:
pPlayer->atc.newWeapon = pPlayer->atbd;
WeaponRaise(pPlayer);
break;
}
}
@ -1061,79 +1065,67 @@ char sub_3A158(PLAYER *a1, spritetype *a2)
if (a2 && a2->index == nSprite)
continue;
spritetype *pSprite = &sprite[nSprite];
if (pSprite->type == 431 && actOwnerIdToSpriteId(pSprite->owner) == a1->at5b)
if (pSprite->type == kThingDroppedLifeLeech && actOwnerIdToSpriteId(pSprite->owner) == a1->at5b)
return 1;
}
return 0;
}
char PickupItem(PLAYER *pPlayer, spritetype *pItem)
{
char buffer[80];
int pickupSnd = 775;
spritetype *pSprite = pPlayer->pSprite;
XSPRITE *pXSprite = pPlayer->pXSprite;
int nType = pItem->type - 100;
switch (pItem->type)
{
//case 129:
//dudeInfo[31].seqStartID = 13568;
//if (!powerupActivate(pPlayer, nType))
//return 0;
//return 1;
case 113:
if (isGrown(pPlayer->pSprite)) return false;
case 130:
case 129:
switch (pItem->type) {
case 130:
if (isShrinked(pSprite)) return false;
char PickupItem(PLAYER *pPlayer, spritetype *pItem) {
spritetype *pSprite = pPlayer->pSprite; XSPRITE *pXSprite = pPlayer->pXSprite;
char buffer[80]; int pickupSnd = 775; int nType = pItem->type - kItemBase;
switch (pItem->type) {
case kItemShadowCloak:
if (isGrown(pPlayer->pSprite)) return false;
case kItemShroomShrink:
case kItemShroomGrow:
if (gModernMap) {
switch (pItem->type) {
case kItemShroomShrink:
if (isShrinked(pSprite)) return false;
break;
case kItemShroomGrow:
if (isGrown(pSprite)) return false;
break;
}
powerupActivate(pPlayer, nType);
}
break;
case 129:
if (isGrown(pSprite)) return false;
break;
}
powerupActivate(pPlayer, nType);
break;
case 145:
case 146:
if (gGameOptions.nGameType != 3)
return 0;
if (pItem->extra > 0)
{
XSPRITE *pXItem = &xsprite[pItem->extra];
if (pItem->type == 145)
{
if (pPlayer->at2ea == 1)
{
if ((pPlayer->at90&1) == 0 && pXItem->state)
{
case kItemFlagABase:
case kItemFlagBBase: {
if (gGameOptions.nGameType != 3 || pItem->extra <= 0) return 0;
XSPRITE * pXItem = &xsprite[pItem->extra];
if (pItem->type == kItemFlagABase) {
if (pPlayer->at2ea == 1) {
if ((pPlayer->at90 & 1) == 0 && pXItem->state) {
pPlayer->at90 |= 1;
pPlayer->at91[0] = pItem->index;
trTriggerSprite(pItem->index, pXItem, 0);
trTriggerSprite(pItem->index, pXItem, kCmdOff);
sprintf(buffer, "%s stole Blue Flag", gProfile[pPlayer->at57].name);
sndStartSample(8007, 255, 2, 0);
viewSetMessage(buffer);
}
}
if (pPlayer->at2ea == 0)
{
if ((pPlayer->at90&1) != 0 && !pXItem->state)
{
if (pPlayer->at2ea == 0) {
if ((pPlayer->at90 & 1) != 0 && !pXItem->state) {
pPlayer->at90 &= ~1;
pPlayer->at91[0] = -1;
trTriggerSprite(pItem->index, pXItem, 1);
trTriggerSprite(pItem->index, pXItem, kCmdOn);
sprintf(buffer, "%s returned Blue Flag", gProfile[pPlayer->at57].name);
sndStartSample(8003, 255, 2, 0);
viewSetMessage(buffer);
}
if ((pPlayer->at90&2) != 0 && pXItem->state)
{
if ((pPlayer->at90 & 2) != 0 && pXItem->state) {
pPlayer->at90 &= ~2;
pPlayer->at91[1] = -1;
dword_21EFB0[pPlayer->at2ea] += 10;
dword_21EFD0[pPlayer->at2ea] += 240;
evSend(0, 0, 81, COMMAND_ID_1);
evSend(0, 0, 81, kCmdOn);
sprintf(buffer, "%s captured Red Flag!", gProfile[pPlayer->at57].name);
sndStartSample(8001, 255, 2, 0);
viewSetMessage(buffer);
@ -1146,39 +1138,38 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem)
#endif
}
}
}
else if (pItem->type == 146)
{
if (pPlayer->at2ea == 0)
{
if((pPlayer->at90&2) == 0 && pXItem->state)
{
else if (pItem->type == kItemFlagBBase) {
if (pPlayer->at2ea == 0) {
if ((pPlayer->at90 & 2) == 0 && pXItem->state) {
pPlayer->at90 |= 2;
pPlayer->at91[1] = pItem->index;
trTriggerSprite(pItem->index, pXItem, 0);
trTriggerSprite(pItem->index, pXItem, kCmdOff);
sprintf(buffer, "%s stole Red Flag", gProfile[pPlayer->at57].name);
sndStartSample(8006, 255, 2, 0);
viewSetMessage(buffer);
}
}
if (pPlayer->at2ea == 1)
{
if ((pPlayer->at90&2) != 0 && !pXItem->state)
if (pPlayer->at2ea == 1) {
if ((pPlayer->at90 & 2) != 0 && !pXItem->state)
{
pPlayer->at90 &= ~2;
pPlayer->at91[1] = -1;
trTriggerSprite(pItem->index, pXItem, 1);
trTriggerSprite(pItem->index, pXItem, kCmdOn);
sprintf(buffer, "%s returned Red Flag", gProfile[pPlayer->at57].name);
sndStartSample(8002, 255, 2, 0);
viewSetMessage(buffer);
}
if ((pPlayer->at90&1) != 0 && pXItem->state)
if ((pPlayer->at90 & 1) != 0 && pXItem->state)
{
pPlayer->at90 &= ~1;
pPlayer->at91[0] = -1;
dword_21EFB0[pPlayer->at2ea] += 10;
dword_21EFD0[pPlayer->at2ea] += 240;
evSend(0, 0, 80, COMMAND_ID_1);
evSend(0, 0, 80, kCmdOn);
sprintf(buffer, "%s captured Blue Flag!", gProfile[pPlayer->at57].name);
sndStartSample(8000, 255, 2, 0);
viewSetMessage(buffer);
@ -1194,135 +1185,119 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem)
}
}
return 0;
case 147:
if (gGameOptions.nGameType != 3)
return 0;
evKill(pItem->index, 3, CALLBACK_ID_17);
pPlayer->at90 |= 1;
pPlayer->at91[0] = pItem->index;
gBlueFlagDropped = false;
break;
case 148:
if (gGameOptions.nGameType != 3)
return 0;
evKill(pItem->index, 3, CALLBACK_ID_17);
pPlayer->at90 |= 2;
pPlayer->at91[1] = pItem->index;
gRedFlagDropped = false;
break;
case 140:
case 141:
case 142:
case 143:
case 144:
{
ARMORDATA *pArmorData = &armorData[pItem->type-140];
char va = 0;
if (pPlayer->at33e[1] < pArmorData->atc)
{
pPlayer->at33e[1] = ClipHigh(pPlayer->at33e[1]+pArmorData->at8, pArmorData->atc);
va = 1;
case kItemFlagA:
if (gGameOptions.nGameType != 3) return 0;
evKill(pItem->index, 3, kCallbackReturnFlag);
pPlayer->at90 |= 1;
pPlayer->at91[0] = pItem->index;
gBlueFlagDropped = false;
break;
case kItemFlagB:
if (gGameOptions.nGameType != 3) return 0;
evKill(pItem->index, 3, kCallbackReturnFlag);
pPlayer->at90 |= 2;
pPlayer->at91[1] = pItem->index;
gRedFlagDropped = false;
break;
case kItemArmorBasic:
case kItemArmorBody:
case kItemArmorFire:
case kItemArmorSpirit:
case kItemArmorSuper: {
ARMORDATA *pArmorData = &armorData[pItem->type - kItemArmorBasic]; bool pickedUp = false;
if (pPlayer->at33e[1] < pArmorData->atc) {
pPlayer->at33e[1] = ClipHigh(pPlayer->at33e[1]+pArmorData->at8, pArmorData->atc);
pickedUp = true;
}
if (pPlayer->at33e[0] < pArmorData->at4) {
pPlayer->at33e[0] = ClipHigh(pPlayer->at33e[0]+pArmorData->at0, pArmorData->at4);
pickedUp = true;
}
if (pPlayer->at33e[2] < pArmorData->at14) {
pPlayer->at33e[2] = ClipHigh(pPlayer->at33e[2]+pArmorData->at10, pArmorData->at14);
pickedUp = true;
}
if (!pickedUp) return 0;
pickupSnd = 779;
break;
}
if (pPlayer->at33e[0] < pArmorData->at4)
{
pPlayer->at33e[0] = ClipHigh(pPlayer->at33e[0]+pArmorData->at0, pArmorData->at4);
va = 1;
case kItemCrystalBall:
if (gGameOptions.nGameType == 0 || !packAddItem(pPlayer, gItemData[nType].at8)) return 0;
break;
case kItemKeySkull:
case kItemKeyEye:
case kItemKeyFire:
case kItemKeyDagger:
case kItemKeySpider:
case kItemKeyMoon:
case kItemKeyKey7:
if (pPlayer->at88[pItem->type-99]) return 0;
pPlayer->at88[pItem->type-99] = 1;
pickupSnd = 781;
break;
case kItemHealthMedPouch:
case kItemHealthLifeEssense:
case kItemHealthLifeSeed:
case kItemHealthRedPotion: {
int addPower = gPowerUpInfo[nType].at3;
// by NoOne: allow custom amount for item
if (gModernMap && sprite[pItem->xvel].extra >= 0 && xsprite[sprite[pItem->xvel].extra].data1 > 0)
addPower = xsprite[sprite[pItem->xvel].extra].data1;
if (!actHealDude(pXSprite, addPower, gPowerUpInfo[nType].at7)) return 0;
return 1;
}
if (pPlayer->at33e[2] < pArmorData->at14)
{
pPlayer->at33e[2] = ClipHigh(pPlayer->at33e[2]+pArmorData->at10, pArmorData->at14);
va = 1;
}
if (!va)
return 0;
pickupSnd = 779;
break;
}
case 121:
if (gGameOptions.nGameType == 0)
return 0;
if (!packAddItem(pPlayer, gItemData[nType].at8))
return 0;
break;
case 100:
case 101:
case 102:
case 103:
case 104:
case 105:
case 106:
if (pPlayer->at88[pItem->type-99])
return 0;
pPlayer->at88[pItem->type-99] = 1;
pickupSnd = 781;
break;
case 108:
case 109:
case 110:
case 111:
{
int addPower = gPowerUpInfo[nType].at3;
// by NoOne: allow custom amount for item
if (sprite[pItem->xvel].extra >= 0 && xsprite[sprite[pItem->xvel].extra].data1 > 0 && !VanillaMode() && !DemoRecordStatus())
addPower = xsprite[sprite[pItem->xvel].extra].data1;
if (!actHealDude(pXSprite, addPower, gPowerUpInfo[nType].at7))
return 0;
return 1;
}
case 107:
case 115:
case 118:
case 125:
if (!packAddItem(pPlayer, gItemData[nType].at8))
return 0;
break;
default:
if (!powerupActivate(pPlayer, nType))
return 0;
return 1;
case kItemHealthDoctorBag:
case kItemJumpBoots:
case kItemDivingSuit:
case kItemBeastVision:
if (!packAddItem(pPlayer, gItemData[nType].at8)) return 0;
break;
default:
if (!powerupActivate(pPlayer, nType)) return 0;
return 1;
}
sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, pickupSnd, pSprite->sectnum);
return 1;
}
char PickupAmmo(PLAYER* pPlayer, spritetype* pAmmo)
{
AMMOITEMDATA* pAmmoItemData = &gAmmoItemData[pAmmo->type - 60];
char PickupAmmo(PLAYER* pPlayer, spritetype* pAmmo) {
AMMOITEMDATA* pAmmoItemData = &gAmmoItemData[pAmmo->type - kItemAmmoBase];
int nAmmoType = pAmmoItemData->ata;
if (pPlayer->at181[nAmmoType] >= gAmmoInfo[nAmmoType].at0) return 0;
else if (pAmmo->extra < 0 || xsprite[pAmmo->extra].data1 <= 0 || VanillaMode() || DemoRecordStatus())
else if (!gModernMap || pAmmo->extra < 0 || xsprite[pAmmo->extra].data1 <= 0)
pPlayer->at181[nAmmoType] = ClipHigh(pPlayer->at181[nAmmoType]+pAmmoItemData->at8, gAmmoInfo[nAmmoType].at0);
// by NoOne: allow custom amount for item
else
pPlayer->at181[nAmmoType] = ClipHigh(pPlayer->at181[nAmmoType] + xsprite[pAmmo->extra].data1, gAmmoInfo[nAmmoType].at0);
if (pAmmoItemData->atb)
pPlayer->atcb[pAmmoItemData->atb] = 1;
if (pAmmoItemData->atb) pPlayer->atcb[pAmmoItemData->atb] = 1;
sfxPlay3DSound(pPlayer->pSprite, 782, -1, 0);
return 1;
}
char PickupWeapon(PLAYER *pPlayer, spritetype *pWeapon)
{
WEAPONITEMDATA *pWeaponItemData = &gWeaponItemData[pWeapon->type-40];
char PickupWeapon(PLAYER *pPlayer, spritetype *pWeapon) {
WEAPONITEMDATA *pWeaponItemData = &gWeaponItemData[pWeapon->type - kItemWeaponBase];
int nWeaponType = pWeaponItemData->at8;
int nAmmoType = pWeaponItemData->ata;
if (!pPlayer->atcb[nWeaponType] || gGameOptions.nWeaponSettings == 2 || gGameOptions.nWeaponSettings == 3)
{
if (pWeapon->type == 50 && gGameOptions.nGameType > 1 && sub_3A158(pPlayer, NULL))
if (!pPlayer->atcb[nWeaponType] || gGameOptions.nWeaponSettings == 2 || gGameOptions.nWeaponSettings == 3) {
if (pWeapon->type == kItemWeaponLifeLeech && gGameOptions.nGameType > 1 && sub_3A158(pPlayer, NULL))
return 0;
pPlayer->atcb[nWeaponType] = 1;
if (nAmmoType == -1) return 0;
// By NoOne: allow to set custom ammo count for weapon pickups
if (pWeapon->extra < 0 || xsprite[pWeapon->extra].data1 <= 0 || VanillaMode() || DemoRecordStatus())
if (!gModernMap || pWeapon->extra < 0 || xsprite[pWeapon->extra].data1 <= 0)
pPlayer->at181[nAmmoType] = ClipHigh(pPlayer->at181[nAmmoType] + pWeaponItemData->atc, gAmmoInfo[nAmmoType].at0);
else
pPlayer->at181[nAmmoType] = ClipHigh(pPlayer->at181[nAmmoType] + xsprite[pWeapon->extra].data1, gAmmoInfo[nAmmoType].at0);
int nNewWeapon = WeaponUpgrade(pPlayer, nWeaponType);
if (nNewWeapon != pPlayer->atbd)
{
if (nNewWeapon != pPlayer->atbd) {
pPlayer->atc3 = 0;
pPlayer->atbe = nNewWeapon;
}
@ -1331,7 +1306,7 @@ char PickupWeapon(PLAYER *pPlayer, spritetype *pWeapon)
}
if (!actGetRespawnTime(pWeapon) || nAmmoType == -1 || pPlayer->at181[nAmmoType] >= gAmmoInfo[nAmmoType].at0) return 0;
else if (pWeapon->extra < 0 || xsprite[pWeapon->extra].data1 <= 0 || VanillaMode() || DemoRecordStatus())
else if (!gModernMap || pWeapon->extra < 0 || xsprite[pWeapon->extra].data1 <= 0)
pPlayer->at181[nAmmoType] = ClipHigh(pPlayer->at181[nAmmoType]+pWeaponItemData->atc, gAmmoInfo[nAmmoType].at0);
else
pPlayer->at181[nAmmoType] = ClipHigh(pPlayer->at181[nAmmoType] + xsprite[pWeapon->extra].data1, gAmmoInfo[nAmmoType].at0);
@ -1346,41 +1321,40 @@ void PickUp(PLAYER *pPlayer, spritetype *pSprite)
int nType = pSprite->type;
char pickedUp = 0;
int customMsg = -1;
XSPRITE* pXSprite = (pSprite->extra >= 0) ? &xsprite[pSprite->extra] : NULL;
if (pXSprite != NULL && pXSprite->txID != 3 && pXSprite->lockMsg > 0) // by NoOne: allow custom INI message instead "Picked up"
customMsg = pXSprite->lockMsg;
if (nType >= 100 && nType <= 149)
{
if (gModernMap) { // by NoOne: allow custom INI message instead "Picked up"
XSPRITE* pXSprite = (pSprite->extra >= 0) ? &xsprite[pSprite->extra] : NULL;
if (pXSprite != NULL && pXSprite->txID != 3 && pXSprite->lockMsg > 0)
customMsg = pXSprite->lockMsg;
}
if (nType >= kItemBase && nType <= kItemMax) {
pickedUp = PickupItem(pPlayer, pSprite);
if (pickedUp && customMsg == -1) sprintf(buffer, "Picked up %s", gItemText[nType - 100]);
}
else if (nType >= 60 && nType < 81)
{
} else if (nType >= kItemAmmoBase && nType < kItemAmmoMax) {
pickedUp = PickupAmmo(pPlayer, pSprite);
if (pickedUp && customMsg == -1) sprintf(buffer, "Picked up %s", gAmmoText[nType - 60]);
}
else if (nType >= 40 && nType < 51)
{
if (pickedUp && customMsg == -1) sprintf(buffer, "Picked up %s", gAmmoText[nType - kItemAmmoBase]);
} else if (nType >= kItemWeaponBase && nType < kItemWeaponMax) {
pickedUp = PickupWeapon(pPlayer, pSprite);
if (pickedUp && customMsg == -1) sprintf(buffer, "Picked up %s", gWeaponText[nType - 40]);
if (pickedUp && customMsg == -1) sprintf(buffer, "Picked up %s", gWeaponText[nType - kItemWeaponBase]);
}
if (pickedUp)
{
if (pSprite->extra > 0)
{
XSPRITE *pXSprite = &xsprite[pSprite->extra];
if (pXSprite->Pickup)
trTriggerSprite(pSprite->index, pXSprite, 32);
}
if (!actCheckRespawn(pSprite))
actPostSprite(pSprite->index, kStatFree);
pPlayer->at377 = 30;
if (pPlayer == gMe)
if (customMsg > 0) trTextOver(customMsg - 1);
else viewSetMessage(buffer, 0, MESSAGE_PRIORITY_PICKUP);
if (!pickedUp) return;
else if (pSprite->extra > 0) {
XSPRITE *pXSprite = &xsprite[pSprite->extra];
if (pXSprite->Pickup)
trTriggerSprite(pSprite->index, pXSprite, kCmdSpritePickup);
}
if (!actCheckRespawn(pSprite))
actPostSprite(pSprite->index, kStatFree);
pPlayer->at377 = 30;
if (pPlayer == gMe) {
if (customMsg > 0) trTextOver(customMsg - 1);
else viewSetMessage(buffer, 0, MESSAGE_PRIORITY_PICKUP);
}
}
@ -1392,8 +1366,7 @@ void CheckPickUp(PLAYER *pPlayer)
int z = pSprite->z;
int nSector = pSprite->sectnum;
int nNextSprite;
for (int nSprite = headspritestat[kStatItem]; nSprite >= 0; nSprite = nNextSprite)
{
for (int nSprite = headspritestat[kStatItem]; nSprite >= 0; nSprite = nNextSprite) {
spritetype *pItem = &sprite[nSprite];
nNextSprite = nextspritestat[nSprite];
if (pItem->flags&32)
@ -1444,7 +1417,7 @@ int ActionScan(PLAYER *pPlayer, int *a2, int *a3)
{
spritetype *pSprite = &sprite[*a2];
XSPRITE *pXSprite = &xsprite[*a3];
if (pSprite->type == 431)
if (pSprite->type == kThingDroppedLifeLeech)
{
if (gGameOptions.nGameType > 1 && sub_3A158(pPlayer, pSprite))
return -1;
@ -1467,7 +1440,7 @@ int ActionScan(PLAYER *pPlayer, int *a2, int *a3)
zvel[*a2] += mulscale16(z, t2);
}
if (pXSprite->Push && !pXSprite->state && !pXSprite->isTriggered)
trTriggerSprite(*a2, pXSprite, 30);
trTriggerSprite(*a2, pXSprite, kCmdSpritePush);
}
break;
case 0:
@ -1541,7 +1514,7 @@ void ProcessInput(PLAYER *pPlayer)
else if (seqGetStatus(3, pPlayer->pSprite->extra) < 0)
{
if (pPlayer->pSprite)
pPlayer->pSprite->type = 426;
pPlayer->pSprite->type = kThingBloodChunks;
actPostSprite(pPlayer->at5b, kStatThing);
seqSpawn(pPlayer->pDudeInfo->seqStartID+15, 3, pPlayer->pSprite->extra, -1);
playerReset(pPlayer);
@ -1682,7 +1655,7 @@ void ProcessInput(PLAYER *pPlayer)
sndStartSample(3062, 255, 2, 0);
}
if (!key || pPlayer->at88[key])
trTriggerSector(a2, pXSector, 30);
trTriggerSector(a2, pXSector, kCmdSpritePush);
else if (pPlayer == gMe)
{
viewSetMessage("That requires a key.");
@ -1700,7 +1673,7 @@ void ProcessInput(PLAYER *pPlayer)
sndStartSample(3062, 255, 2, 0);
}
if (!key || pPlayer->at88[key])
trTriggerWall(a2, pXWall, 50);
trTriggerWall(a2, pXWall, kCmdWallPush);
else if (pPlayer == gMe)
{
viewSetMessage("That requires a key.");
@ -1715,7 +1688,7 @@ void ProcessInput(PLAYER *pPlayer)
if (pXSprite->locked && pPlayer == gMe && pXSprite->lockMsg)
trTextOver(pXSprite->lockMsg);
if (!key || pPlayer->at88[key])
trTriggerSprite(a2, pXSprite, 30);
trTriggerSprite(a2, pXSprite, kCmdSpritePush);
else if (pPlayer == gMe)
{
viewSetMessage("That requires a key.");
@ -1728,7 +1701,7 @@ void ProcessInput(PLAYER *pPlayer)
pPlayer->at372 = ClipLow(pPlayer->at372-4*(6-gGameOptions.nDifficulty), 0);
if (pPlayer->at372 <= 0 && pPlayer->at376)
{
spritetype *pSprite2 = actSpawnDude(pPlayer->pSprite, 212, pPlayer->pSprite->clipdist<<1, 0);
spritetype *pSprite2 = actSpawnDude(pPlayer->pSprite, kDudeHand, pPlayer->pSprite->clipdist<<1, 0);
pSprite2->ang = (pPlayer->pSprite->ang+1024)&2047;
int nSprite = pPlayer->pSprite->index;
int x = Cos(pPlayer->pSprite->ang)>>16;
@ -2087,16 +2060,16 @@ void FragPlayer(PLAYER *pPlayer, int nSprite)
if (nTeam1 == 0)
{
if (nTeam1 != nTeam2)
evSend(0, 0, 15, COMMAND_ID_3);
evSend(0, 0, 15, kCmdToggle);
else
evSend(0, 0, 16, COMMAND_ID_3);
evSend(0, 0, 16, kCmdToggle);
}
else
{
if (nTeam1 == nTeam2)
evSend(0, 0, 16, COMMAND_ID_3);
evSend(0, 0, 16, kCmdToggle);
else
evSend(0, 0, 15, COMMAND_ID_3);
evSend(0, 0, 15, kCmdToggle);
}
}
}
@ -2128,9 +2101,9 @@ spritetype *sub_40A94(PLAYER *pPlayer, int a2)
spritetype *pSprite = NULL;
switch (a2)
{
case 147:
case kItemFlagA:
pPlayer->at90 &= ~1;
pSprite = actDropObject(pPlayer->pSprite, 147);
pSprite = actDropObject(pPlayer->pSprite, kItemFlagA);
if (pSprite)
pSprite->owner = pPlayer->at91[0];
gBlueFlagDropped = true;
@ -2138,9 +2111,9 @@ spritetype *sub_40A94(PLAYER *pPlayer, int a2)
sndStartSample(8005, 255, 2, 0);
viewSetMessage(buffer);
break;
case 148:
case kItemFlagB:
pPlayer->at90 &= ~2;
pSprite = actDropObject(pPlayer->pSprite, 148);
pSprite = actDropObject(pPlayer->pSprite, kItemFlagB);
if (pSprite)
pSprite->owner = pPlayer->at91[1];
gRedFlagDropped = true;
@ -2226,12 +2199,9 @@ int playerDamageSprite(int nSource, PLAYER *pPlayer, DAMAGE_TYPE nDamageType, in
return nDamage;
}
sfxKill3DSound(pPlayer->pSprite, -1, 441);
if (gGameOptions.nGameType == 3 && pPlayer->at90)
{
if (pPlayer->at90&1)
sub_40A94(pPlayer, 147);
if (pPlayer->at90&2)
sub_40A94(pPlayer, 148);
if (gGameOptions.nGameType == 3 && pPlayer->at90) {
if (pPlayer->at90&1) sub_40A94(pPlayer, kItemFlagA);
if (pPlayer->at90&2) sub_40A94(pPlayer, kItemFlagB);
}
pPlayer->at1fe = 0;
pPlayer->at1b1 = 0;
@ -2265,7 +2235,7 @@ int playerDamageSprite(int nSource, PLAYER *pPlayer, DAMAGE_TYPE nDamageType, in
nKneelingPlayer = nPlayerKneelClient;
powerupActivate(pPlayer, 28);
pXSprite->target = nSource;
evPost(pSprite->index, 3, 15, CALLBACK_ID_13);
evPost(pSprite->index, 3, 15, kCallbackFinishHim);
}
else
{
@ -2281,7 +2251,7 @@ int playerDamageSprite(int nSource, PLAYER *pPlayer, DAMAGE_TYPE nDamageType, in
{
powerupClear(pPlayer);
if (nXSector > 0 && xsector[nXSector].Exit)
trTriggerSector(pSprite->sectnum, &xsector[nXSector], 43);
trTriggerSector(pSprite->sectnum, &xsector[nXSector], kCmdSectorExit);
pSprite->flags |= 7;
for (int p = connecthead; p >= 0; p = connectpoint2[p])
{
@ -2289,7 +2259,7 @@ int playerDamageSprite(int nSource, PLAYER *pPlayer, DAMAGE_TYPE nDamageType, in
gPlayer[p].at2ee = -1;
}
FragPlayer(pPlayer, nSource);
trTriggerSprite(nSprite, pXSprite, 0);
trTriggerSprite(nSprite, pXSprite, kCmdOff);
}
dassert(gSysRes.Lookup(pDudeInfo->seqStartID + nDeathSeqID, "SEQ") != NULL);
seqSpawn(pDudeInfo->seqStartID+nDeathSeqID, 3, nXSprite, nKneelingPlayer);

View file

@ -510,8 +510,8 @@ void seqProcess(int a1)
int nSprite = xsprite[nXSprite].reference;
dassert(nSprite >= 0 && nSprite < kMaxSprites);
evKill(nSprite, 3);
if ((sprite[nSprite].flags & 16) && sprite[nSprite].inittype >= 200 && sprite[nSprite].inittype < 254)
evPost(nSprite, 3, gGameOptions.nMonsterSettings, (COMMAND_ID)9);
if ((sprite[nSprite].flags & 16) && sprite[nSprite].inittype >= kDudeBase && sprite[nSprite].inittype < kDudeMax)
evPost(nSprite, 3, gGameOptions.nMonsterSettings, kCallbackRespawn);
else
DeleteSprite(nSprite);
break;

File diff suppressed because it is too large Load diff

View file

@ -31,13 +31,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "dude.h"
BEGIN_BLD_NS
void trTriggerSector(unsigned int nSector, XSECTOR *pXSector, int a3);
void trMessageSector(unsigned int nSector, EVENT a2);
void trTriggerWall(unsigned int nWall, XWALL *pXWall, int a3);
void trMessageWall(unsigned int nWall, EVENT a2);
void trTriggerSprite(unsigned int nSprite, XSPRITE *pXSprite, int a3);
void trMessageSprite(unsigned int nSprite, EVENT a2);
void trTriggerSector(unsigned int nSector, XSECTOR *pXSector, int command);
void trMessageSector(unsigned int nSector, EVENT event);
void trTriggerWall(unsigned int nWall, XWALL *pXWall, int command);
void trMessageWall(unsigned int nWall, EVENT event);
void trTriggerSprite(unsigned int nSprite, XSPRITE *pXSprite, int command);
void trMessageSprite(unsigned int nSprite, EVENT event);
void trProcessBusy(void);
void trInit(void);
void trTextOver(int nId);

View file

@ -608,7 +608,7 @@ void fakeMoveDude(spritetype *pSprite)
if (nSector == -1)
nSector = predict.at68;
if (sector[nSector].type >= 612 && sector[nSector].type <= 617)
if (sector[nSector].type >= kSectorPath && sector[nSector].type <= kSectorRotate)
{
short nSector2 = nSector;
pushmove_old((int32_t*)&predict.at50, (int32_t*)&predict.at54, (int32_t*)&predict.at58, &nSector2, wd, tz, bz, CLIPMASK0);
@ -2185,25 +2185,18 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t
pTSprite->ang = pPrevLoc->ang+mulscale16(((pTSprite->ang-pPrevLoc->ang+1024)&2047)-1024, gInterpolate);
}
int nAnim = 0;
switch (picanm[nTile].extra&7)
{
switch (picanm[nTile].extra & 7) {
case 0:
if (nXSprite > 0)
{
dassert(nXSprite < kMaxXSprites);
switch (pTSprite->type)
{
case 20:
case 21:
if (xsprite[nXSprite].state)
{
nAnim = 1;
}
//dassert(nXSprite > 0 && nXSprite < kMaxXSprites);
if (nXSprite <= 0 || nXSprite >= kMaxXSprites) break;
switch (pTSprite->type) {
case kSwitchToggle:
case kSwitchOneWay:
if (xsprite[nXSprite].state) nAnim = 1;
break;
case 22:
case kSwitchCombo:
nAnim = xsprite[nXSprite].data1;
break;
}
}
break;
case 1:
@ -2362,145 +2355,106 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t
{
pTSprite->cstat |= 8;
}
switch (pTSprite->statnum)
{
case kStatDecoration:
{
switch (pTSprite->type)
{
case 32:
if (pTXSprite)
{
if (pTXSprite->state > 0)
{
switch (pTSprite->statnum) {
case kStatDecoration: {
switch (pTSprite->type) {
case kDecorationCandle:
if (!pTXSprite || pTXSprite->state == 1) {
pTSprite->shade = -128;
viewAddEffect(nTSprite, VIEW_EFFECT_11);
}
else
{
} else {
pTSprite->shade = -8;
}
}
else
{
pTSprite->shade = -128;
viewAddEffect(nTSprite, VIEW_EFFECT_11);
}
break;
case 30:
if (pTXSprite)
{
if (pTXSprite->state > 0)
{
break;
case kDecorationTorch:
if (!pTXSprite || pTXSprite->state == 1) {
pTSprite->picnum++;
viewAddEffect(nTSprite, VIEW_EFFECT_4);
}
else
{
} else {
viewAddEffect(nTSprite, VIEW_EFFECT_6);
}
}
else
{
pTSprite->picnum++;
viewAddEffect(nTSprite, VIEW_EFFECT_4);
}
break;
default:
if (pXSector && pXSector->color)
{
pTSprite->pal = pSector->floorpal;
}
break;
break;
default:
if (pXSector && pXSector->color) pTSprite->pal = pSector->floorpal;
break;
}
break;
}
case kStatItem:
{
switch (pTSprite->type)
{
case 145:
if (pTXSprite && pTXSprite->state > 0 && gGameOptions.nGameType == 3)
{
uspritetype *pNTSprite = viewAddEffect(nTSprite, VIEW_EFFECT_17);
if (pNTSprite)
pNTSprite->pal = 10;
}
break;
case 146:
if (pTXSprite && pTXSprite->state > 0 && gGameOptions.nGameType == 3)
{
uspritetype *pNTSprite = viewAddEffect(nTSprite, VIEW_EFFECT_17);
if (pNTSprite)
pNTSprite->pal = 7;
}
break;
case 147:
pTSprite->pal = 10;
pTSprite->cstat |= 1024;
break;
case 148:
pTSprite->pal = 7;
pTSprite->cstat |= 1024;
break;
default:
if (pTSprite->type >= 100 && pTSprite->type <= 106)
pTSprite->shade = -128;
if (pXSector && pXSector->color)
{
pTSprite->pal = pSector->floorpal;
}
break;
}
break;
}
case kStatProjectile:
{
switch (pTSprite->type)
{
case 302:
pTSprite->yrepeat = 128;
pTSprite->cstat |= 32;
break;
case 306:
viewAddEffect(nTSprite, VIEW_EFFECT_15);
break;
case 300:
viewAddEffect(nTSprite, VIEW_EFFECT_10);
break;
case 301:
case 303:
if (pTSprite->statnum == kStatFlare)
{
dassert(pTXSprite != NULL);
if (pTXSprite->target == gView->at5b)
{
pTSprite->xrepeat = 0;
break;
break;
case kStatItem: {
switch (pTSprite->type) {
case kItemFlagABase:
if (pTXSprite && pTXSprite->state > 0 && gGameOptions.nGameType == 3) {
uspritetype *pNTSprite = viewAddEffect(nTSprite, VIEW_EFFECT_17);
if (pNTSprite) pNTSprite->pal = 10;
}
}
viewAddEffect(nTSprite, VIEW_EFFECT_1);
if (pTSprite->type == 301)
{
break;
case kItemFlagBBase:
if (pTXSprite && pTXSprite->state > 0 && gGameOptions.nGameType == 3) {
uspritetype *pNTSprite = viewAddEffect(nTSprite, VIEW_EFFECT_17);
if (pNTSprite) pNTSprite->pal = 7;
}
break;
case kItemFlagA:
pTSprite->pal = 10;
pTSprite->cstat |= 1024;
break;
case kItemFlagB:
pTSprite->pal = 7;
pTSprite->cstat |= 1024;
break;
default:
if (pTSprite->type >= kItemKeySkull && pTSprite->type < kItemKeyMax)
pTSprite->shade = -128;
if (pXSector && pXSector->color) {
pTSprite->pal = pSector->floorpal;
}
break;
}
}
break;
case kStatProjectile: {
switch (pTSprite->type) {
case kMissileTeslaAlt:
pTSprite->yrepeat = 128;
pTSprite->cstat |= 32;
break;
case kMissileTeslaRegular:
viewAddEffect(nTSprite, VIEW_EFFECT_15);
break;
case kMissileButcherKnife:
viewAddEffect(nTSprite, VIEW_EFFECT_10);
break;
case kMissileFlareRegular:
case kMissileFlareAlt:
if (pTSprite->statnum == kStatFlare) {
dassert(pTXSprite != NULL);
if (pTXSprite->target == gView->at5b) {
pTSprite->xrepeat = 0;
break;
}
}
viewAddEffect(nTSprite, VIEW_EFFECT_1);
if (pTSprite->type != kMissileFlareRegular) break;
sectortype *pSector = &sector[pTSprite->sectnum];
int zDiff = (pTSprite->z-pSector->ceilingz)>>8;
if ((pSector->ceilingstat&1) == 0 && zDiff < 64)
{
int zDiff = (pTSprite->z - pSector->ceilingz) >> 8;
if ((pSector->ceilingstat&1) == 0 && zDiff < 64) {
viewAddEffect(nTSprite, VIEW_EFFECT_2);
}
zDiff = (pSector->floorz-pTSprite->z)>>8;
if ((pSector->floorstat&1) == 0 && zDiff < 64)
{
zDiff = (pSector->floorz - pTSprite->z) >> 8;
if ((pSector->floorstat&1) == 0 && zDiff < 64) {
viewAddEffect(nTSprite, VIEW_EFFECT_3);
}
break;
}
break;
}
break;
}
case kStatDude:
{
if (pTSprite->type == 212 && pTXSprite->aiState == &hand13A3B4)
if (pTSprite->type == kDudeHand && pTXSprite->aiState == &hand13A3B4)
{
spritetype *pTTarget = &sprite[pTXSprite->target];
dassert(pTXSprite != NULL && pTTarget != NULL);
@ -2585,53 +2539,31 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t
}
break;
}
case kStatTraps:
{
if (pTSprite->type == 454)
{
if (pTXSprite->state)
{
if (pTXSprite->data1)
{
case kStatTraps: {
if (pTSprite->type == kTrapSawCircular) {
if (pTXSprite->state) {
if (pTXSprite->data1) {
pTSprite->picnum = 772;
if (pTXSprite->data2)
{
viewAddEffect(nTSprite, VIEW_EFFECT_9);
}
}
}
else
{
if (pTXSprite->data1)
{
pTSprite->picnum = 773;
}
else
{
pTSprite->picnum = 656;
}
}
}
else if (pTXSprite->data1) pTSprite->picnum = 773;
else pTSprite->picnum = 656;
}
break;
}
case kStatThing:
{
case kStatThing: {
if (pXSector && pXSector->color)
{
pTSprite->pal = pSector->floorpal;
if (pTSprite->type < kThingBase || pTSprite->type >= kThingMax || !gSpriteHit[nXSprite].florhit) {
if ((pTSprite->flags & kPhysMove) && getflorzofslope(pTSprite->sectnum, pTSprite->x, pTSprite->y) >= cZ)
viewAddEffect(nTSprite, VIEW_EFFECT_0);
}
if (pTSprite->flags&1)
{
if (getflorzofslope(pTSprite->sectnum, pTSprite->x, pTSprite->y) >= cZ)
{
if (pTSprite->type < 400 || pTSprite->type >= 433 || !gSpriteHit[nXSprite].florhit)
{
viewAddEffect(nTSprite, VIEW_EFFECT_0);
}
}
}
break;
}
break;
}
}
@ -3364,20 +3296,15 @@ RORHACKOTHER:
nSprite = nextspritestat[nSprite];
}
nSprite = headspritestat[kStatProjectile];
while (nSprite >= 0)
{
while (nSprite >= 0) {
spritetype *pSprite = &sprite[nSprite];
switch (pSprite->type)
{
case 301:
case 302:
case 303:
case 306:
if (TestBitString(gotsector, pSprite->sectnum))
{
unk += 256;
}
break;
switch (pSprite->type) {
case kMissileFlareRegular:
case kMissileTeslaAlt:
case kMissileFlareAlt:
case kMissileTeslaRegular:
if (TestBitString(gotsector, pSprite->sectnum)) unk += 256;
break;
}
nSprite = nextspritestat[nSprite];
}

View file

@ -51,90 +51,85 @@ void warpInit(void)
int team1 = 0; int team2 = 0; // increment if team start positions specified.
for (int nSprite = 0; nSprite < kMaxSprites; nSprite++)
{
if (sprite[nSprite].statnum < kMaxStatus)
{
if (sprite[nSprite].statnum < kMaxStatus) {
spritetype *pSprite = &sprite[nSprite];
int nXSprite = pSprite->extra;
if (nXSprite > 0)
{
if (nXSprite > 0) {
XSPRITE *pXSprite = &xsprite[nXSprite];
switch (pSprite->type)
{
case 1:
if (gGameOptions.nGameType < 2 && pXSprite->data1 >= 0 && pXSprite->data1 < 8)
{
ZONE *pZone = &gStartZone[pXSprite->data1];
pZone->x = pSprite->x;
pZone->y = pSprite->y;
pZone->z = pSprite->z;
pZone->sectnum = pSprite->sectnum;
pZone->ang = pSprite->ang;
}
DeleteSprite(nSprite);
break;
case 2:
if (pXSprite->data1 >= 0 && pXSprite->data2 < 8) {
if (gGameOptions.nGameType >= 2)
{
// default if BB or teams without data2 specified
ZONE* pZone = &gStartZone[pXSprite->data1];
switch (pSprite->type) {
case kMarkerSPStart:
if (gGameOptions.nGameType < 2 && pXSprite->data1 >= 0 && pXSprite->data1 < kMaxPlayers) {
ZONE *pZone = &gStartZone[pXSprite->data1];
pZone->x = pSprite->x;
pZone->y = pSprite->y;
pZone->z = pSprite->z;
pZone->sectnum = pSprite->sectnum;
pZone->ang = pSprite->ang;
// By NoOne: fill player spawn position according team of player in TEAMS mode.
if (gGameOptions.nGameType == 3) {
if (pXSprite->data2 == 1) {
pZone = &gStartZoneTeam1[team1];
pZone->x = pSprite->x;
pZone->y = pSprite->y;
pZone->z = pSprite->z;
pZone->sectnum = pSprite->sectnum;
pZone->ang = pSprite->ang;
team1++;
} else if (pXSprite->data2 == 2) {
pZone = &gStartZoneTeam2[team2];
pZone->x = pSprite->x;
pZone->y = pSprite->y;
pZone->z = pSprite->z;
pZone->sectnum = pSprite->sectnum;
pZone->ang = pSprite->ang;
team2++;
}
}
}
DeleteSprite(nSprite);
}
break;
case 7:
gUpperLink[pSprite->sectnum] = nSprite;
pSprite->cstat |= 32768;
pSprite->cstat &= ~257;
break;
case 6:
gLowerLink[pSprite->sectnum] = nSprite;
pSprite->cstat |= 32768;
pSprite->cstat &= ~257;
break;
case 9:
case 11:
case 13:
gUpperLink[pSprite->sectnum] = nSprite;
pSprite->cstat |= 32768;
pSprite->cstat &= ~257;
pSprite->z = getflorzofslope(pSprite->sectnum, pSprite->x, pSprite->y);
break;
case 10:
case 12:
case 14:
gLowerLink[pSprite->sectnum] = nSprite;
pSprite->cstat |= 32768;
pSprite->cstat &= ~257;
pSprite->z = getceilzofslope(pSprite->sectnum, pSprite->x, pSprite->y);
break;
break;
case kMarkerMPStart:
if (pXSprite->data1 >= 0 && pXSprite->data2 < kMaxPlayers) {
if (gGameOptions.nGameType >= 2) {
// default if BB or teams without data2 specified
ZONE* pZone = &gStartZone[pXSprite->data1];
pZone->x = pSprite->x;
pZone->y = pSprite->y;
pZone->z = pSprite->z;
pZone->sectnum = pSprite->sectnum;
pZone->ang = pSprite->ang;
// By NoOne: fill player spawn position according team of player in TEAMS mode.
if (gModernMap && gGameOptions.nGameType == 3) {
if (pXSprite->data2 == 1) {
pZone = &gStartZoneTeam1[team1];
pZone->x = pSprite->x;
pZone->y = pSprite->y;
pZone->z = pSprite->z;
pZone->sectnum = pSprite->sectnum;
pZone->ang = pSprite->ang;
team1++;
} else if (pXSprite->data2 == 2) {
pZone = &gStartZoneTeam2[team2];
pZone->x = pSprite->x;
pZone->y = pSprite->y;
pZone->z = pSprite->z;
pZone->sectnum = pSprite->sectnum;
pZone->ang = pSprite->ang;
team2++;
}
}
}
DeleteSprite(nSprite);
}
break;
case kMarkerUpLink:
gUpperLink[pSprite->sectnum] = nSprite;
pSprite->cstat |= 32768;
pSprite->cstat &= ~257;
break;
case kMarkerLowLink:
gLowerLink[pSprite->sectnum] = nSprite;
pSprite->cstat |= 32768;
pSprite->cstat &= ~257;
break;
case kMarkerUpWater:
case kMarkerUpStack:
case kMarkerUpGoo:
gUpperLink[pSprite->sectnum] = nSprite;
pSprite->cstat |= 32768;
pSprite->cstat &= ~257;
pSprite->z = getflorzofslope(pSprite->sectnum, pSprite->x, pSprite->y);
break;
case kMarkerLowWater:
case kMarkerLowStack:
case kMarkerLowGoo:
gLowerLink[pSprite->sectnum] = nSprite;
pSprite->cstat |= 32768;
pSprite->cstat &= ~257;
pSprite->z = getceilzofslope(pSprite->sectnum, pSprite->x, pSprite->y);
break;
}
}
}

View file

@ -979,7 +979,7 @@ void FirePitchfork(int, PLAYER *pPlayer)
void FireSpray(int, PLAYER *pPlayer)
{
playerFireMissile(pPlayer, 0, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.dz, 304);
playerFireMissile(pPlayer, 0, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.dz, kMissileFlameSpray);
UseAmmo(pPlayer, 6, 4);
if (CheckAmmo(pPlayer, 6, 1))
sfxPlay3DSound(pPlayer->pSprite, 441, 1, 2);
@ -992,11 +992,11 @@ void ThrowCan(int, PLAYER *pPlayer)
sfxKill3DSound(pPlayer->pSprite, -1, 441);
int nSpeed = mulscale16(pPlayer->at1ba, 0x177777)+0x66666;
sfxPlay3DSound(pPlayer->pSprite, 455, 1, 0);
spritetype *pSprite = playerFireThing(pPlayer, 0, -9460, 420, nSpeed);
spritetype *pSprite = playerFireThing(pPlayer, 0, -9460, kThingArmedSpray, nSpeed);
if (pSprite)
{
sfxPlay3DSound(pSprite, 441, 0, 0);
evPost(pSprite->index, 3, pPlayer->at1b2, COMMAND_ID_1);
evPost(pSprite->index, 3, pPlayer->at1b2, kCmdOn);
int nXSprite = pSprite->extra;
XSPRITE *pXSprite = &xsprite[nXSprite];
pXSprite->Impact = 1;
@ -1008,10 +1008,10 @@ void ThrowCan(int, PLAYER *pPlayer)
void DropCan(int, PLAYER *pPlayer)
{
sfxKill3DSound(pPlayer->pSprite, -1, 441);
spritetype *pSprite = playerFireThing(pPlayer, 0, 0, 420, 0);
spritetype *pSprite = playerFireThing(pPlayer, 0, 0, kThingArmedSpray, 0);
if (pSprite)
{
evPost(pSprite->index, 3, pPlayer->at1b2, COMMAND_ID_1);
evPost(pSprite->index, 3, pPlayer->at1b2, kCmdOn);
UseAmmo(pPlayer, 6, gAmmoItemData[0].at8);
}
}
@ -1019,8 +1019,8 @@ void DropCan(int, PLAYER *pPlayer)
void ExplodeCan(int, PLAYER *pPlayer)
{
sfxKill3DSound(pPlayer->pSprite, -1, 441);
spritetype *pSprite = playerFireThing(pPlayer, 0, 0, 420, 0);
evPost(pSprite->index, 3, 0, COMMAND_ID_1);
spritetype *pSprite = playerFireThing(pPlayer, 0, 0, kThingArmedSpray, 0);
evPost(pSprite->index, 3, 0, kCmdOn);
UseAmmo(pPlayer, 6, gAmmoItemData[0].at8);
StartQAV(pPlayer, 15, -1);
pPlayer->atbd = 0;
@ -1032,13 +1032,13 @@ void ThrowBundle(int, PLAYER *pPlayer)
sfxKill3DSound(pPlayer->pSprite, 16, -1);
int nSpeed = mulscale16(pPlayer->at1ba, 0x177777)+0x66666;
sfxPlay3DSound(pPlayer->pSprite, 455, 1, 0);
spritetype *pSprite = playerFireThing(pPlayer, 0, -9460, 419, nSpeed);
spritetype *pSprite = playerFireThing(pPlayer, 0, -9460, kThingArmedTNTBundle, nSpeed);
int nXSprite = pSprite->extra;
XSPRITE *pXSprite = &xsprite[nXSprite];
if (pPlayer->at1b2 < 0)
pXSprite->Impact = 1;
else
evPost(pSprite->index, 3, pPlayer->at1b2, COMMAND_ID_1);
evPost(pSprite->index, 3, pPlayer->at1b2, kCmdOn);
UseAmmo(pPlayer, 5, 1);
pPlayer->at1ba = 0;
}
@ -1046,16 +1046,16 @@ void ThrowBundle(int, PLAYER *pPlayer)
void DropBundle(int, PLAYER *pPlayer)
{
sfxKill3DSound(pPlayer->pSprite, 16, -1);
spritetype *pSprite = playerFireThing(pPlayer, 0, 0, 419, 0);
evPost(pSprite->index, 3, pPlayer->at1b2, COMMAND_ID_1);
spritetype *pSprite = playerFireThing(pPlayer, 0, 0, kThingArmedTNTBundle, 0);
evPost(pSprite->index, 3, pPlayer->at1b2, kCmdOn);
UseAmmo(pPlayer, 5, 1);
}
void ExplodeBundle(int, PLAYER *pPlayer)
{
sfxKill3DSound(pPlayer->pSprite, 16, -1);
spritetype *pSprite = playerFireThing(pPlayer, 0, 0, 419, 0);
evPost(pSprite->index, 3, 0, COMMAND_ID_1);
spritetype *pSprite = playerFireThing(pPlayer, 0, 0, kThingArmedTNTBundle, 0);
evPost(pSprite->index, 3, 0, kCmdOn);
UseAmmo(pPlayer, 5, 1);
StartQAV(pPlayer, 24, -1, 0);
pPlayer->atbd = 0;
@ -1066,16 +1066,16 @@ void ThrowProx(int, PLAYER *pPlayer)
{
int nSpeed = mulscale16(pPlayer->at1ba, 0x177777)+0x66666;
sfxPlay3DSound(pPlayer->pSprite, 455, 1, 0);
spritetype *pSprite = playerFireThing(pPlayer, 0, -9460, 401, nSpeed);
evPost(pSprite->index, 3, 240, COMMAND_ID_1);
spritetype *pSprite = playerFireThing(pPlayer, 0, -9460, kThingArmedProxBomb, nSpeed);
evPost(pSprite->index, 3, 240, kCmdOn);
UseAmmo(pPlayer, 10, 1);
pPlayer->at1ba = 0;
}
void DropProx(int, PLAYER *pPlayer)
{
spritetype *pSprite = playerFireThing(pPlayer, 0, 0, 401, 0);
evPost(pSprite->index, 3, 240, COMMAND_ID_1);
spritetype *pSprite = playerFireThing(pPlayer, 0, 0, kThingArmedProxBomb, 0);
evPost(pSprite->index, 3, 240, kCmdOn);
UseAmmo(pPlayer, 10, 1);
}
@ -1083,7 +1083,7 @@ void ThrowRemote(int, PLAYER *pPlayer)
{
int nSpeed = mulscale16(pPlayer->at1ba, 0x177777)+0x66666;
sfxPlay3DSound(pPlayer->pSprite, 455, 1, 0);
spritetype *pSprite = playerFireThing(pPlayer, 0, -9460, 402, nSpeed);
spritetype *pSprite = playerFireThing(pPlayer, 0, -9460, kThingArmedRemoteBomb, nSpeed);
int nXSprite = pSprite->extra;
XSPRITE *pXSprite = &xsprite[nXSprite];
pXSprite->rxID = 90+(pPlayer->pSprite->type-kDudePlayer1);
@ -1093,7 +1093,7 @@ void ThrowRemote(int, PLAYER *pPlayer)
void DropRemote(int, PLAYER *pPlayer)
{
spritetype *pSprite = playerFireThing(pPlayer, 0, 0, 402, 0);
spritetype *pSprite = playerFireThing(pPlayer, 0, 0, kThingArmedRemoteBomb, 0);
int nXSprite = pSprite->extra;
XSPRITE *pXSprite = &xsprite[nXSprite];
pXSprite->rxID = 90+(pPlayer->pSprite->type-kDudePlayer1);
@ -1102,7 +1102,7 @@ void DropRemote(int, PLAYER *pPlayer)
void FireRemote(int, PLAYER *pPlayer)
{
evSend(0, 0, 90+(pPlayer->pSprite->type-kDudePlayer1), COMMAND_ID_1);
evSend(0, 0, 90+(pPlayer->pSprite->type-kDudePlayer1), kCmdOn);
}
#define kMaxShotgunBarrels 4
@ -1305,7 +1305,7 @@ void FireFlare(int nTrigger, PLAYER *pPlayer)
offset = 120;
break;
}
playerFireMissile(pPlayer, offset, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.dz, 301);
playerFireMissile(pPlayer, offset, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.dz, kMissileFlareRegular);
UseAmmo(pPlayer, 1, 1);
sfxPlay3DSound(pSprite, 420, 2, 0);
pPlayer->at362 = 30;
@ -1325,7 +1325,7 @@ void AltFireFlare(int nTrigger, PLAYER *pPlayer)
offset = 120;
break;
}
playerFireMissile(pPlayer, offset, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.dz, 303);
playerFireMissile(pPlayer, offset, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.dz, kMissileFlareAlt);
UseAmmo(pPlayer, 1, 8);
sfxPlay3DSound(pSprite, 420, 2, 0);
pPlayer->at362 = 45;
@ -1361,7 +1361,7 @@ void FireVoodoo(int nTrigger, PLAYER *pPlayer)
sfxPlay3DSound(pSprite, 460, 2, 0);
fxSpawnBlood(pTarget, 17<<4);
int nDamage = actDamageSprite(nSprite, pTarget, DAMAGE_TYPE_5, 9<<4);
if (pTarget->type >= kDudePlayer1 && pTarget->type <= kDudePlayer8)
if (IsPlayerSprite(pTarget))
WeaponLower(&gPlayer[pTarget->type-kDudePlayer1]);
UseAmmo(pPlayer, 9, nDamage/4);
break;
@ -1379,9 +1379,9 @@ void FireVoodoo(int nTrigger, PLAYER *pPlayer)
sfxPlay3DSound(pSprite, 460, 2, 0);
fxSpawnBlood(pTarget, 17<<4);
int nDamage = actDamageSprite(nSprite, pTarget, DAMAGE_TYPE_5, 11<<4);
if (pTarget->type >= kDudePlayer1 && pTarget->type <= kDudePlayer8)
if (IsPlayerSprite(pTarget))
{
PLAYER *pOtherPlayer = &gPlayer[pTarget->type-kDudePlayer1];
PLAYER *pOtherPlayer = &gPlayer[pTarget->type - kDudePlayer1];
pOtherPlayer->at36a = 128;
}
UseAmmo(pPlayer, 9, nDamage/4);
@ -1415,7 +1415,7 @@ void AltFireVoodoo(int nTrigger, PLAYER *pPlayer)
nDamage = (nDamage * ((51200 - nDist) + 1)) / 51200;
nDamage = actDamageSprite(pPlayer->at5b, pTarget, DAMAGE_TYPE_5, nDamage);
if (pTarget->type >= kDudePlayer1 && pTarget->type <= kDudePlayer8)
if (IsPlayerSprite(pTarget))
{
PLAYER* pOtherPlayer = &gPlayer[pTarget->type - kDudePlayer1];
if (!pOtherPlayer->at31a || !powerupCheck(pOtherPlayer, 14))
@ -1453,7 +1453,7 @@ void AltFireVoodoo(int nTrigger, PLAYER *pPlayer)
nDamage = (nDamage * ((51200 - nDist) + 1)) / 51200;
nDamage = actDamageSprite(pPlayer->at5b, pTarget, DAMAGE_TYPE_5, nDamage);
UseAmmo(pPlayer, 9, nDamage);
if (pTarget->type >= kDudePlayer1 && pTarget->type <= kDudePlayer8)
if (IsPlayerSprite(pTarget))
{
PLAYER* pOtherPlayer = &gPlayer[pTarget->type - kDudePlayer1];
if (!pOtherPlayer->at31a || !powerupCheck(pOtherPlayer, 14))
@ -1473,13 +1473,13 @@ void DropVoodoo(int nTrigger, PLAYER *pPlayer)
{
UNREFERENCED_PARAMETER(nTrigger);
sfxPlay3DSound(pPlayer->pSprite, 455, 2, 0);
spritetype *pSprite = playerFireThing(pPlayer, 0, -4730, 432, 0xccccc);
spritetype *pSprite = playerFireThing(pPlayer, 0, -4730, kThingVoodooHead, 0xccccc);
if (pSprite)
{
int nXSprite = pSprite->extra;
XSPRITE *pXSprite = &xsprite[nXSprite];
pXSprite->data1 = pPlayer->at181[9];
evPost(pSprite->index, 3, 90, CALLBACK_ID_21);
evPost(pSprite->index, 3, 90, kCallbackDropVoodoo);
UseAmmo(pPlayer, 6, gAmmoItemData[0].at8);
UseAmmo(pPlayer, 9, pPlayer->at181[9]);
pPlayer->atcb[10] = 0;
@ -1535,7 +1535,7 @@ void AltFireTesla(int nTrigger, PLAYER *pPlayer)
{
UNREFERENCED_PARAMETER(nTrigger);
spritetype *pSprite = pPlayer->pSprite;
playerFireMissile(pPlayer, 0, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.dz, 302);
playerFireMissile(pPlayer, 0, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.dz, kMissileTeslaAlt);
UseAmmo(pPlayer, pPlayer->atc7, 35);
sfxPlay3DSound(pSprite, 471, 2, 0);
pPlayer->at362 = 40;
@ -1555,7 +1555,7 @@ void FireNapalm(int nTrigger, PLAYER *pPlayer)
offset = 50;
break;
}
playerFireMissile(pPlayer, offset, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.dz, 312);
playerFireMissile(pPlayer, offset, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.dz, kMissileFireballNapam);
sfxPlay3DSound(pSprite, 480, 2, 0);
UseAmmo(pPlayer, 4, 1);
pPlayer->at37b = 1;
@ -1565,8 +1565,8 @@ void FireNapalm2(int nTrigger, PLAYER *pPlayer)
{
UNREFERENCED_PARAMETER(nTrigger);
spritetype *pSprite = pPlayer->pSprite;
playerFireMissile(pPlayer, -120, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.dz, 312);
playerFireMissile(pPlayer, 120, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.dz, 312);
playerFireMissile(pPlayer, -120, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.dz, kMissileFireballNapam);
playerFireMissile(pPlayer, 120, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.dz, kMissileFireballNapam);
sfxPlay3DSound(pSprite, 480, 2, 0);
UseAmmo(pPlayer, 4, 2);
pPlayer->at37b = 1;
@ -1577,7 +1577,7 @@ void AltFireNapalm(int nTrigger, PLAYER *pPlayer)
UNREFERENCED_PARAMETER(nTrigger);
char UNUSED(bAkimbo) = powerupCheck(pPlayer, 17);
int nSpeed = mulscale16(0x8000, 0x177777)+0x66666;
spritetype *pMissile = playerFireThing(pPlayer, 0, -4730, 428, nSpeed);
spritetype *pMissile = playerFireThing(pPlayer, 0, -4730, kThingNapalmBall, nSpeed);
if (pMissile)
{
XSPRITE *pXSprite = &xsprite[pMissile->extra];
@ -1585,7 +1585,7 @@ void AltFireNapalm(int nTrigger, PLAYER *pPlayer)
UseAmmo(pPlayer, 4, pXSprite->data4);
seqSpawn(22, 3, pMissile->extra, -1);
actBurnSprite(actSpriteIdToOwnerId(pPlayer->pSprite->index), pXSprite, 600);
evPost(pMissile->index, 3, 0, CALLBACK_ID_0);
evPost(pMissile->index, 3, 0, kCallbackFXFlameLick);
sfxPlay3DSound(pMissile, 480, 2, 0);
pPlayer->at362 = 30;
pPlayer->at37b = 1;
@ -1617,7 +1617,7 @@ void AltFireLifeLeech(int nTrigger, PLAYER *pPlayer)
{
UNREFERENCED_PARAMETER(nTrigger);
sfxPlay3DSound(pPlayer->pSprite, 455, 2, 0);
spritetype *pMissile = playerFireThing(pPlayer, 0, -4730, 431, 0x19999);
spritetype *pMissile = playerFireThing(pPlayer, 0, -4730, kThingDroppedLifeLeech, 0x19999);
if (pMissile)
{
pMissile->cstat |= 4096;
@ -1627,7 +1627,7 @@ void AltFireLifeLeech(int nTrigger, PLAYER *pPlayer)
pXSprite->DudeLockout = 1;
pXSprite->data4 = ClipHigh(pPlayer->at181[4], 12);
pXSprite->stateTimer = 1;
evPost(pMissile->index, 3, 120, CALLBACK_ID_20);
evPost(pMissile->index, 3, 120, kCallbackLeechStateTimer);
if (gGameOptions.nGameType <= 1)
{
int nAmmo = pPlayer->at181[8];