- 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);
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;

View file

@ -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,

View file

@ -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)
{

View file

@ -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;

View file

@ -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;