fix cultist respawn time (#220)

# Conflicts:
#	source/blood/src/actor.cpp
This commit is contained in:
CommonLoon102 2019-10-15 12:36:50 +00:00 committed by Christoph Oelckers
parent 64e116a4b1
commit 70b5e67e6f
5 changed files with 12 additions and 12 deletions

View file

@ -3665,7 +3665,7 @@ int actDamageSprite(int nSource, spritetype *pSprite, DAMAGE_TYPE damageType, in
switch (pSprite->statnum) { switch (pSprite->statnum) {
case kStatDude: { case kStatDude: {
if (!IsDudeSprite(pSprite)) if (!IsDudeSprite(pSprite))
ThrowError("Bad Dude Failed: initial=%d type=%d %s\n", (int)pSprite->inittype, (int)pSprite->type, (int)(pSprite->flags & 16) ? "RESPAWN" : "NORMAL"); ThrowError("Bad Dude Failed: initial=%d type=%d %s\n", (int)pSprite->inittype, (int)pSprite->type, (int)(pSprite->flags & kHitagRespawn) ? "RESPAWN" : "NORMAL");
int nType = pSprite->type - kDudeBase; int nDamageFactor = dudeInfo[nType].at70[damageType]; int nType = pSprite->type - kDudeBase; int nDamageFactor = dudeInfo[nType].at70[damageType];
if (!nDamageFactor) return 0; if (!nDamageFactor) return 0;
@ -3709,7 +3709,7 @@ int actDamageSprite(int nSource, spritetype *pSprite, DAMAGE_TYPE damageType, in
sprite[pSprite->owner].owner = kMaxSprites - 1; // By NoOne: indicates if custom dude had life leech. sprite[pSprite->owner].owner = kMaxSprites - 1; // By NoOne: indicates if custom dude had life leech.
break; break;
default: default:
if (!(pSprite->flags & 16)) if (!(pSprite->flags & kHitagRespawn))
actPropagateSpriteOwner(pSprite, &sprite[nSource]); actPropagateSpriteOwner(pSprite, &sprite[nSource]);
break; break;
} }
@ -5523,7 +5523,7 @@ void actActivateGibObject(spritetype *pSprite, XSPRITE *pXSprite)
sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, vbp, pSprite->sectnum); sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, vbp, pSprite->sectnum);
if (v8 > 0) if (v8 > 0)
actDropObject(pSprite, v8); actDropObject(pSprite, v8);
if (!(pSprite->cstat&32768) && !(pSprite->flags&16)) if (!(pSprite->cstat&32768) && !(pSprite->flags&kHitagRespawn))
actPostSprite(pSprite->index, kStatFree); actPostSprite(pSprite->index, kStatFree);
} }
@ -6763,7 +6763,7 @@ bool actCheckRespawn(spritetype *pSprite)
nRespawnTime = mulscale16(nRespawnTime, 0xa000); nRespawnTime = mulscale16(nRespawnTime, 0xa000);
pSprite->owner = pSprite->statnum; pSprite->owner = pSprite->statnum;
actPostSprite(pSprite->index, kStatRespawn); actPostSprite(pSprite->index, kStatRespawn);
pSprite->flags |= 16; pSprite->flags |= kHitagRespawn;
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax))
{ {
pSprite->cstat &= ~257; pSprite->cstat &= ~257;

View file

@ -257,7 +257,7 @@ void Respawn(int nSprite) // 9
ChangeSpriteStat(nSprite, pSprite->owner); ChangeSpriteStat(nSprite, pSprite->owner);
pSprite->type = pSprite->inittype; pSprite->type = pSprite->inittype;
pSprite->owner = -1; pSprite->owner = -1;
pSprite->flags &= ~16; pSprite->flags &= ~kHitagRespawn;
xvel[nSprite] = yvel[nSprite] = zvel[nSprite] = 0; xvel[nSprite] = yvel[nSprite] = zvel[nSprite] = 0;
pXSprite->respawnPending = 0; pXSprite->respawnPending = 0;
pXSprite->burnTime = 0; pXSprite->burnTime = 0;

View file

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

View file

@ -91,7 +91,7 @@ char SetSpriteState(int nSprite, XSPRITE* pXSprite, int nState)
pXSprite->busy = nState << 16; pXSprite->busy = nState << 16;
pXSprite->state = nState; pXSprite->state = nState;
evKill(nSprite, 3); evKill(nSprite, 3);
if ((sprite[nSprite].flags & 16) != 0 && sprite[nSprite].inittype >= kDudeBase && sprite[nSprite].inittype < kDudeMax) if ((sprite[nSprite].flags & kHitagRespawn) != 0 && sprite[nSprite].inittype >= kDudeBase && sprite[nSprite].inittype < kDudeMax)
{ {
pXSprite->respawnPending = 3; pXSprite->respawnPending = 3;
evPost(nSprite, 3, gGameOptions.nMonsterRespawnTime, kCallbackRespawn); evPost(nSprite, 3, gGameOptions.nMonsterRespawnTime, kCallbackRespawn);
@ -116,7 +116,7 @@ char modernTypeSetSpriteState(int nSprite, XSPRITE *pXSprite, int nState)
pXSprite->busy = nState<<16; pXSprite->busy = nState<<16;
pXSprite->state = nState; pXSprite->state = nState;
evKill(nSprite, 3); evKill(nSprite, 3);
if ((sprite[nSprite].flags & 16) != 0 && sprite[nSprite].inittype >= kDudeBase && sprite[nSprite].inittype < kDudeMax) if ((sprite[nSprite].flags & kHitagRespawn) != 0 && sprite[nSprite].inittype >= kDudeBase && sprite[nSprite].inittype < kDudeMax)
{ {
pXSprite->respawnPending = 3; pXSprite->respawnPending = 3;
evPost(nSprite, 3, gGameOptions.nMonsterRespawnTime, kCallbackRespawn); evPost(nSprite, 3, gGameOptions.nMonsterRespawnTime, kCallbackRespawn);
@ -1051,7 +1051,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event)
} }
break; break;
case kThingTNTBarrel: case kThingTNTBarrel:
if (pSprite->flags&16) return; if (pSprite->flags&kHitagRespawn) return;
fallthrough__; fallthrough__;
case kThingArmedTNTStick: case kThingArmedTNTStick:
case kThingArmedTNTBundle: case kThingArmedTNTBundle:

View file

@ -2260,7 +2260,7 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t
// Can be overridden by def script // Can be overridden by def script
if (usevoxels && gDetail >= 4 && videoGetRenderMode() != REND_POLYMER && tiletovox[pTSprite->picnum] == -1 && voxelIndex[pTSprite->picnum] != -1) if (usevoxels && gDetail >= 4 && videoGetRenderMode() != REND_POLYMER && tiletovox[pTSprite->picnum] == -1 && voxelIndex[pTSprite->picnum] != -1)
{ {
if ((pTSprite->flags&16) == 0) if ((pTSprite->flags&kHitagRespawn) == 0)
{ {
pTSprite->cstat |= 48; pTSprite->cstat |= 48;
pTSprite->cstat &= ~(4|8); pTSprite->cstat &= ~(4|8);
@ -2320,7 +2320,7 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t
} }
nShade += tileShade[pTSprite->picnum]; nShade += tileShade[pTSprite->picnum];
pTSprite->shade = ClipRange(nShade, -128, 127); pTSprite->shade = ClipRange(nShade, -128, 127);
if ((pTSprite->flags&16) && sprite[pTSprite->owner].owner == 3) if ((pTSprite->flags&kHitagRespawn) && sprite[pTSprite->owner].owner == 3)
{ {
dassert(pTXSprite != NULL); dassert(pTXSprite != NULL);
pTSprite->xrepeat = 48; pTSprite->xrepeat = 48;