- Fixes for refactor (wrong kills count)

- Fixes for refactor (proximity flag for dudes)
- Fixes for refactor (wrong kills count)

# Conflicts:
#	source/blood/src/actor.cpp
This commit is contained in:
Grind Core 2019-10-14 01:29:19 +03:00 committed by Christoph Oelckers
parent 16d4aebbb4
commit 9dd46c1c7c
5 changed files with 54 additions and 40 deletions

View file

@ -6690,7 +6690,7 @@ void actBuildMissile(spritetype* pMissile, int nXSprite, int nSprite) {
evPost(nMissile, 3, 0, kCallbackFXFlareSpark); evPost(nMissile, 3, 0, kCallbackFXFlareSpark);
sfxPlay3DSound(pMissile, 422, 0, 0); sfxPlay3DSound(pMissile, 422, 0, 0);
break; break;
case 317: case kMissileLifeLeechAltSmall:
evPost(nMissile, 3, 0, kCallbackFXArcSpark); evPost(nMissile, 3, 0, kCallbackFXArcSpark);
break; break;
case kMissileArcGargoyle: case kMissileArcGargoyle:
@ -6699,45 +6699,37 @@ void actBuildMissile(spritetype* pMissile, int nXSprite, int nSprite) {
} }
} }
int actGetRespawnTime(spritetype *pSprite) int actGetRespawnTime(spritetype *pSprite) {
{ if (pSprite->extra <= 0) return -1;
int nXSprite = pSprite->extra; XSPRITE *pXSprite = &xsprite[pSprite->extra];
if (nXSprite <= 0) if (IsDudeSprite(pSprite) && !IsPlayerSprite(pSprite)) {
return -1; if (pXSprite->respawn == 2 || (pXSprite->respawn != 1 && gGameOptions.nMonsterSettings == 2))
XSPRITE *pXSprite = &xsprite[nXSprite];
if (IsDudeSprite(pSprite) && !IsPlayerSprite(pSprite))
{
if (pXSprite->respawn == 2 || (pXSprite->respawn != 1 && gGameOptions.nMonsterSettings == 2))
return gGameOptions.nMonsterRespawnTime; return gGameOptions.nMonsterRespawnTime;
return -1; return -1;
} }
if (IsWeaponSprite(pSprite))
{ if (IsWeaponSprite(pSprite)) {
if (pXSprite->respawn == 3 || gGameOptions.nWeaponSettings == 1) if (pXSprite->respawn == 3 || gGameOptions.nWeaponSettings == 1) return 0;
return 0; else if (pXSprite->respawn != 1 && gGameOptions.nWeaponSettings != 0)
if (pXSprite->respawn != 1 && gGameOptions.nWeaponSettings != 0)
return gGameOptions.nWeaponRespawnTime; return gGameOptions.nWeaponRespawnTime;
return -1; return -1;
} }
if (IsAmmoSprite(pSprite))
{ if (IsAmmoSprite(pSprite)) {
if (pXSprite->respawn == 2 || (pXSprite->respawn != 1 && gGameOptions.nWeaponSettings != 0)) if (pXSprite->respawn == 2 || (pXSprite->respawn != 1 && gGameOptions.nWeaponSettings != 0))
return gGameOptions.nWeaponRespawnTime; return gGameOptions.nWeaponRespawnTime;
return -1; return -1;
} }
if (IsItemSprite(pSprite))
{ if (IsItemSprite(pSprite)) {
if (pXSprite->respawn == 3 && gGameOptions.nGameType == 1) if (pXSprite->respawn == 3 && gGameOptions.nGameType == 1) return 0;
return 0; else if (pXSprite->respawn == 2 || (pXSprite->respawn != 1 && gGameOptions.nItemSettings != 0)) {
if (pXSprite->respawn == 2 || (pXSprite->respawn != 1 && gGameOptions.nItemSettings != 0)) switch (pSprite->type) {
{ case kItemShadowCloak:
switch (pSprite->type) case kItemTwoGuns:
{ case kItemReflectShots:
case 113:
case 117:
case 124:
return gGameOptions.nSpecialRespawnTime; return gGameOptions.nSpecialRespawnTime;
case 114: case kItemDeathMask:
return gGameOptions.nSpecialRespawnTime<<1; return gGameOptions.nSpecialRespawnTime<<1;
default: default:
return gGameOptions.nItemRespawnTime; return gGameOptions.nItemRespawnTime;

View file

@ -288,7 +288,8 @@ enum {
kDudeBeast = 251, kDudeBeast = 251,
kDudeBurningTinyCaleb = 252, kDudeBurningTinyCaleb = 252,
kDudeBurningBeast = 253, kDudeBurningBeast = 253,
kDudeModernCustom = 254, // gModern map only kDudeVanillaMax = 254,
kDudeModernCustom = kDudeVanillaMax, // gModern map only
kDudeModernCustomBurning = 255, // gModern map only kDudeModernCustomBurning = 255, // gModern map only
kDudeMax = 256, kDudeMax = 256,

View file

@ -138,6 +138,26 @@ void CKillMgr::sub_263E0(int nCount)
at0 += 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) { void CKillMgr::AddKill(spritetype *pSprite) {
if (pSprite->statnum == kStatDude) { if (pSprite->statnum == kStatDude) {
switch (pSprite->type) { switch (pSprite->type) {
@ -174,6 +194,7 @@ void CKillMgr::sub_2641C(void)
} }
} }
*/
void CKillMgr::Draw(void) void CKillMgr::Draw(void)
{ {

View file

@ -1078,7 +1078,8 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) {
switch (pItem->type) { switch (pItem->type) {
case kItemShadowCloak: case kItemShadowCloak:
if (isGrown(pPlayer->pSprite)) return false; if (isGrown(pPlayer->pSprite) || !powerupActivate(pPlayer, nType)) return false;
break;
case kItemShroomShrink: case kItemShroomShrink:
case kItemShroomGrow: case kItemShroomGrow:
if (gModernMap) { if (gModernMap) {
@ -1090,6 +1091,7 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) {
if (isGrown(pSprite)) return false; if (isGrown(pSprite)) return false;
break; break;
} }
powerupActivate(pPlayer, nType); powerupActivate(pPlayer, nType);
} }
break; break;

View file

@ -851,6 +851,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event)
} }
if (pSprite->statnum == kStatDude && pSprite->type >= kDudeBase && pSprite->type < kDudeMax) { if (pSprite->statnum == kStatDude && pSprite->type >= kDudeBase && pSprite->type < kDudeMax) {
switch (event.cmd) { switch (event.cmd) {
case kCmdOff: case kCmdOff:
SetSpriteState(nSprite, pXSprite, 0); SetSpriteState(nSprite, pXSprite, 0);
@ -864,9 +865,9 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event)
if (!pXSprite->state) SetSpriteState(nSprite, pXSprite, 1); if (!pXSprite->state) SetSpriteState(nSprite, pXSprite, 1);
aiActivateDude(pSprite, pXSprite); aiActivateDude(pSprite, pXSprite);
break; break;
default:
return;
} }
return;
} }
@ -1006,8 +1007,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event)
break; break;
case kMarkerDudeSpawn: case kMarkerDudeSpawn:
if (gGameOptions.nMonsterSettings && pXSprite->data1 >= kDudeBase && pXSprite->data1 < kDudeMax) if (gGameOptions.nMonsterSettings && pXSprite->data1 >= kDudeBase && pXSprite->data1 < kDudeMax) {
{
spritetype* pSpawn = NULL; spritetype* pSpawn = NULL;
// By NoOne: add spawn random dude feature - works only if at least 2 data fields are not empty. // 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); pSpawn = actSpawnDude(pSprite, pXSprite->data1, -1, 0);
} }
if (pSpawn) if (pSpawn) {
{
XSPRITE *pXSpawn = &xsprite[pSpawn->extra]; XSPRITE *pXSpawn = &xsprite[pSpawn->extra];
gKillMgr.sub_263E0(1); gKillMgr.sub_263E0(1);
switch (pXSprite->data1) { switch (pXSprite->data1) {
@ -1027,8 +1026,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event)
case kDudeBurningCultist: case kDudeBurningCultist:
case kDudeBurningZombieButcher: case kDudeBurningZombieButcher:
case kDudeBurningTinyCaleb: case kDudeBurningTinyCaleb:
case kDudeBurningBeast: case kDudeBurningBeast: {
{
pXSpawn->health = dudeInfo[pXSprite->data1 - kDudeBase].startHealth << 4; pXSpawn->health = dudeInfo[pXSprite->data1 - kDudeBase].startHealth << 4;
pXSpawn->burnTime = 10; pXSpawn->burnTime = 10;
pXSpawn->target = -1; pXSpawn->target = -1;