diff --git a/source/blood/src/actor.cpp b/source/blood/src/actor.cpp index 9ddba578c..7e00a8008 100644 --- a/source/blood/src/actor.cpp +++ b/source/blood/src/actor.cpp @@ -6690,7 +6690,7 @@ void actBuildMissile(spritetype* pMissile, int nXSprite, int nSprite) { evPost(nMissile, 3, 0, kCallbackFXFlareSpark); sfxPlay3DSound(pMissile, 422, 0, 0); break; - case 317: + case kMissileLifeLeechAltSmall: evPost(nMissile, 3, 0, kCallbackFXArcSpark); break; case kMissileArcGargoyle: @@ -6699,45 +6699,37 @@ void actBuildMissile(spritetype* pMissile, int nXSprite, int nSprite) { } } -int actGetRespawnTime(spritetype *pSprite) -{ - int nXSprite = pSprite->extra; - if (nXSprite <= 0) - return -1; - XSPRITE *pXSprite = &xsprite[nXSprite]; - if (IsDudeSprite(pSprite) && !IsPlayerSprite(pSprite)) - { - if (pXSprite->respawn == 2 || (pXSprite->respawn != 1 && gGameOptions.nMonsterSettings == 2)) +int actGetRespawnTime(spritetype *pSprite) { + if (pSprite->extra <= 0) return -1; + XSPRITE *pXSprite = &xsprite[pSprite->extra]; + if (IsDudeSprite(pSprite) && !IsPlayerSprite(pSprite)) { + if (pXSprite->respawn == 2 || (pXSprite->respawn != 1 && gGameOptions.nMonsterSettings == 2)) return gGameOptions.nMonsterRespawnTime; return -1; } - if (IsWeaponSprite(pSprite)) - { - if (pXSprite->respawn == 3 || gGameOptions.nWeaponSettings == 1) - return 0; - if (pXSprite->respawn != 1 && gGameOptions.nWeaponSettings != 0) + + if (IsWeaponSprite(pSprite)) { + if (pXSprite->respawn == 3 || gGameOptions.nWeaponSettings == 1) return 0; + else if (pXSprite->respawn != 1 && gGameOptions.nWeaponSettings != 0) return gGameOptions.nWeaponRespawnTime; return -1; } - if (IsAmmoSprite(pSprite)) - { - if (pXSprite->respawn == 2 || (pXSprite->respawn != 1 && gGameOptions.nWeaponSettings != 0)) + + if (IsAmmoSprite(pSprite)) { + if (pXSprite->respawn == 2 || (pXSprite->respawn != 1 && gGameOptions.nWeaponSettings != 0)) return gGameOptions.nWeaponRespawnTime; return -1; } - if (IsItemSprite(pSprite)) - { - if (pXSprite->respawn == 3 && gGameOptions.nGameType == 1) - return 0; - if (pXSprite->respawn == 2 || (pXSprite->respawn != 1 && gGameOptions.nItemSettings != 0)) - { - switch (pSprite->type) - { - case 113: - case 117: - case 124: + + if (IsItemSprite(pSprite)) { + if (pXSprite->respawn == 3 && gGameOptions.nGameType == 1) return 0; + else if (pXSprite->respawn == 2 || (pXSprite->respawn != 1 && gGameOptions.nItemSettings != 0)) { + switch (pSprite->type) { + case kItemShadowCloak: + case kItemTwoGuns: + case kItemReflectShots: return gGameOptions.nSpecialRespawnTime; - case 114: + case kItemDeathMask: return gGameOptions.nSpecialRespawnTime<<1; default: return gGameOptions.nItemRespawnTime; diff --git a/source/blood/src/common_game.h b/source/blood/src/common_game.h index 3da20a66b..55cc0a6e0 100644 --- a/source/blood/src/common_game.h +++ b/source/blood/src/common_game.h @@ -288,7 +288,8 @@ enum { kDudeBeast = 251, kDudeBurningTinyCaleb = 252, kDudeBurningBeast = 253, - kDudeModernCustom = 254, // gModern map only + kDudeVanillaMax = 254, + kDudeModernCustom = kDudeVanillaMax, // gModern map only kDudeModernCustomBurning = 255, // gModern map only kDudeMax = 256, diff --git a/source/blood/src/endgame.cpp b/source/blood/src/endgame.cpp index f9d624f4a..b3fc6c01d 100644 --- a/source/blood/src/endgame.cpp +++ b/source/blood/src/endgame.cpp @@ -138,6 +138,26 @@ void CKillMgr::sub_263E0(int nCount) at0 += nCount; } +void CKillMgr::AddKill(spritetype* pSprite) +{ + if (pSprite->statnum == kStatDude && pSprite->type != kDudeBat && pSprite->type != kDudeRat && pSprite->type != kDudeInnocent && pSprite->type != kDudeBurningInnocent) + at4++; +} + +void CKillMgr::sub_2641C(void) +{ + at0 = 0; + 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 != kDudeBat && pSprite->type != kDudeRat && pSprite->type != kDudeInnocent && pSprite->type != kDudeBurningInnocent) + at0++; + } +} + +/* void CKillMgr::AddKill(spritetype *pSprite) { if (pSprite->statnum == kStatDude) { switch (pSprite->type) { @@ -174,6 +194,7 @@ void CKillMgr::sub_2641C(void) } } +*/ void CKillMgr::Draw(void) { diff --git a/source/blood/src/player.cpp b/source/blood/src/player.cpp index ee50c6bc0..df1c2ad54 100644 --- a/source/blood/src/player.cpp +++ b/source/blood/src/player.cpp @@ -1078,7 +1078,8 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) { switch (pItem->type) { case kItemShadowCloak: - if (isGrown(pPlayer->pSprite)) return false; + if (isGrown(pPlayer->pSprite) || !powerupActivate(pPlayer, nType)) return false; + break; case kItemShroomShrink: case kItemShroomGrow: if (gModernMap) { @@ -1090,6 +1091,7 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) { if (isGrown(pSprite)) return false; break; } + powerupActivate(pPlayer, nType); } break; diff --git a/source/blood/src/triggers.cpp b/source/blood/src/triggers.cpp index e972ab84f..4c1743948 100644 --- a/source/blood/src/triggers.cpp +++ b/source/blood/src/triggers.cpp @@ -851,6 +851,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) } if (pSprite->statnum == kStatDude && pSprite->type >= kDudeBase && pSprite->type < kDudeMax) { + switch (event.cmd) { case kCmdOff: SetSpriteState(nSprite, pXSprite, 0); @@ -864,9 +865,9 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) if (!pXSprite->state) SetSpriteState(nSprite, pXSprite, 1); aiActivateDude(pSprite, pXSprite); break; - default: - return; } + + return; } @@ -1006,8 +1007,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) break; case kMarkerDudeSpawn: - if (gGameOptions.nMonsterSettings && pXSprite->data1 >= kDudeBase && pXSprite->data1 < kDudeMax) - { + if (gGameOptions.nMonsterSettings && pXSprite->data1 >= kDudeBase && pXSprite->data1 < kDudeMax) { spritetype* pSpawn = NULL; // By NoOne: add spawn random dude feature - works only if at least 2 data fields are not empty. @@ -1018,8 +1018,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) pSpawn = actSpawnDude(pSprite, pXSprite->data1, -1, 0); } - if (pSpawn) - { + if (pSpawn) { XSPRITE *pXSpawn = &xsprite[pSpawn->extra]; gKillMgr.sub_263E0(1); switch (pXSprite->data1) { @@ -1027,8 +1026,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) case kDudeBurningCultist: case kDudeBurningZombieButcher: case kDudeBurningTinyCaleb: - case kDudeBurningBeast: - { + case kDudeBurningBeast: { pXSpawn->health = dudeInfo[pXSprite->data1 - kDudeBase].startHealth << 4; pXSpawn->burnTime = 10; pXSpawn->target = -1;