diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 3456fbe05..69a9e13a7 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -896,43 +896,14 @@ static void actInitDudes() int seqStartId = act->seqStartID(); if (!act->IsPlayerActor()) { -#ifdef NOONE_EXTENSIONS - switch (act->GetType()) - { - case kDudeModernCustom: - case kDudeModernCustomBurning: - act->spr.cstat |= CSTAT_SPRITE_BLOOD_BIT1 | CSTAT_SPRITE_BLOCK_ALL; - if (act->xspr.data2 > 0 && getSequence(act->xspr.data2)) - seqStartId = act->xspr.data2; // Custom Dude stores it's SEQ in data2 - - seqStartId = genDudeSeqStartId(act); // Custom Dude stores its SEQ in data2 - act->xspr.sysData1 = act->xspr.data3; // move sndStartId to sysData1, because data3 used by the game; - act->xspr.data3 = 0; - break; - - case kDudePodMother: // FakeDude type (no seq, custom flags, clipdist and cstat) - if (gModernMap) break; - [[fallthrough]]; - default: - act->clipdist = act->fClipDist(); - act->spr.cstat |= CSTAT_SPRITE_BLOOD_BIT1 | CSTAT_SPRITE_BLOCK_ALL; - break; - } -#else act->clipdist = act->fClipDist(); act->spr.cstat |= CSTAT_SPRITE_BLOOD_BIT1 | CSTAT_SPRITE_BLOCK_ALL; -#endif - act->vel.Zero(); -#ifdef NOONE_EXTENSIONS - // add a way to set custom hp for every enemy - should work only if map just started and not loaded. - if (!gModernMap || act->xspr.sysData2 <= 0) act->xspr.health = act->startHealth() << 4; - else act->xspr.health = ClipRange(act->xspr.sysData2 << 4, 1, 65535); -#else - act->xspr.health = act->startHealth() << 4; -#endif - + if ((currentLevel->featureflags & kFeatureEnemyAttacks) && act->xspr.sysData2 > 0) + act->xspr.health = clamp(act->xspr.sysData2 << 4, 1, 65535); + else + act->xspr.health = act->startHealth() << 4; } if (getSequence(seqStartId)) seqSpawn(seqStartId, act); diff --git a/source/games/blood/src/aiunicult.cpp b/source/games/blood/src/aiunicult.cpp index 1984bfe8c..3b7b493d8 100644 --- a/source/games/blood/src/aiunicult.cpp +++ b/source/games/blood/src/aiunicult.cpp @@ -2651,5 +2651,21 @@ void modernCustomDudeBurningDeath(DBloodActor* actor, int nSeq) } +void onGenDudeInit() // should be called virtually from actInitDude +{ + if (act->xspr.data2 > 0 && getSequence(act->xspr.data2)) + seqStartId = act->xspr.data2; // Custom Dude stores it's SEQ in data2 + + seqStartId = genDudeSeqStartId(act); // Custom Dude stores its SEQ in data2 + act->xspr.sysData1 = act->xspr.data3; // move sndStartId to sysData1, because data3 used by the game; + act->xspr.data3 = 0; +} + +/* onInit +case kDudePodMother: // FakeDude type (no seq, custom flags, clipdist and cstat) + if (gModernMap) break; + [[fallthrough]]; +*/ + END_BLD_NS #endif diff --git a/source/games/blood/src/blood.h b/source/games/blood/src/blood.h index 97d1fbf9c..af55c6339 100644 --- a/source/games/blood/src/blood.h +++ b/source/games/blood/src/blood.h @@ -281,6 +281,7 @@ enum EFeatureFlags kFeatureEnemyAttacks = 2, kFeatureCustomClipdist = 4, kFeatureCustomTrapExploder = 8, + kFeatureCustomEnemyHealth = 16, }; constexpr int BMAX_PATH = 260;