diff --git a/source/blood/src/ai.cpp b/source/blood/src/ai.cpp index 6d1fb79cb..517e90ec5 100644 --- a/source/blood/src/ai.cpp +++ b/source/blood/src/ai.cpp @@ -103,13 +103,16 @@ void aiNewState(DBloodActor* actor, AISTATE *pAIState) pAIState->enterFunc(&bloodActors[pXSprite->reference]); } -bool isImmune(spritetype* pSprite, int dmgType, int minScale) { +bool isImmune(spritetype* pSprite, int dmgType, int minScale) +{ - if (dmgType >= kDmgFall && dmgType < kDmgMax && pSprite->extra >= 0 && xsprite[pSprite->extra].locked != 1) { + if (dmgType >= kDmgFall && dmgType < kDmgMax && pSprite->extra >= 0 && xsprite[pSprite->extra].locked != 1) + { if (pSprite->type >= kThingBase && pSprite->type < kThingMax) return (thingInfo[pSprite->type - kThingBase].dmgControl[dmgType] <= minScale); - else if (IsDudeSprite(pSprite)) { - if (IsPlayerSprite(pSprite)) return (gPlayer[pSprite->type - kDudePlayer1].damageControl[dmgType] <= minScale); + else if (IsDudeSprite(pSprite)) + { + if (IsPlayerSprite(pSprite)) return (gPlayer[pSprite->type - kDudePlayer1].godMode || gPlayer[pSprite->type - kDudePlayer1].damageControl[dmgType] <= minScale); else return (dudeInfo[pSprite->type - kDudeBase].at70[dmgType] <= minScale); } } diff --git a/source/blood/src/nnexts.cpp b/source/blood/src/nnexts.cpp index ee4b75ffd..d3ff6d91e 100644 --- a/source/blood/src/nnexts.cpp +++ b/source/blood/src/nnexts.cpp @@ -2317,8 +2317,7 @@ void useSpriteDamager(XSPRITE* pXSource, spritetype* pSprite) { int dmgType = (pXSource->data2 >= kDmgFall) ? ClipHigh(pXSource->data2, kDmgElectric) : -1; int dmg = pXSprite->health << 4; int armor[3]; - bool godMode = (pPlayer && ((dmgType >= 0 && pPlayer->damageControl[dmgType]) || powerupCheck(pPlayer, kPwUpDeathMask) || pPlayer->godMode - /*|| seqGetID(3, pSprite->extra) == getDudeInfo(pSprite->type)->seqStartID + 16*/)); // kneeling + bool godMode = (pPlayer && ((dmgType >= 0 && pPlayer->damageControl[dmgType]) || powerupCheck(pPlayer, kPwUpDeathMask) || pPlayer->godMode)); // kneeling if (godMode || pXSprite->locked) return; else if (pXSource->data3) { diff --git a/source/blood/src/player.cpp b/source/blood/src/player.cpp index 484dca4fb..c5b3c5c8c 100644 --- a/source/blood/src/player.cpp +++ b/source/blood/src/player.cpp @@ -606,17 +606,6 @@ void playerSetRace(PLAYER *pPlayer, int nLifeMode) void playerSetGodMode(PLAYER *pPlayer, bool bGodMode) { - if (pPlayer->godMode == bGodMode) return; - if (bGodMode) - { - for (int i = 0; i < 7; i++) - pPlayer->damageControl[i]++; - } - else - { - for (int i = 0; i < 7; i++) - pPlayer->damageControl[i]--; - } pPlayer->godMode = bGodMode; } @@ -1929,7 +1918,7 @@ int playerDamageSprite(int nSource, PLAYER *pPlayer, DAMAGE_TYPE nDamageType, in { assert(nSource < kMaxSprites); assert(pPlayer != NULL); - if (pPlayer->damageControl[nDamageType]) + if (pPlayer->damageControl[nDamageType] || pPlayer->godMode) return 0; nDamage = playerDamageArmor(pPlayer, nDamageType, nDamage); pPlayer->painEffect = ClipHigh(pPlayer->painEffect+(nDamage>>3), 600);