made 'modern' custom monster health an engine feature.

This commit is contained in:
Christoph Oelckers 2023-10-09 19:07:14 +02:00
parent 7a7d579b8e
commit 7b3203c607
2 changed files with 5 additions and 8 deletions

View file

@ -1506,14 +1506,10 @@ static void actInitDudes()
act->vel.Zero(); act->vel.Zero();
#ifdef NOONE_EXTENSIONS if ((currentLevel->featureflags & kFeatureEnemyAttacks) && act->xspr.sysData2 > 0)
// add a way to set custom hp for every enemy - should work only if map just started and not loaded. act->xspr.health = clamp(act->xspr.sysData2 << 4, 1, 65535);
if (!gModernMap || act->xspr.sysData2 <= 0) act->xspr.health = pDudeInfo->startHealth << 4; else
else act->xspr.health = ClipRange(act->xspr.sysData2 << 4, 1, 65535); act->xspr.health = pDudeInfo->startHealth << 4;
#else
act->xspr.health = pDudeInfo->startHealth << 4;
#endif
} }
if (getSequence(seqStartId)) seqSpawn(seqStartId, act); if (getSequence(seqStartId)) seqSpawn(seqStartId, act);

View file

@ -282,6 +282,7 @@ enum EFeatureFlags
kFeatureEnemyAttacks = 2, kFeatureEnemyAttacks = 2,
kFeatureCustomClipdist = 4, kFeatureCustomClipdist = 4,
kFeatureCustomTrapExploder = 8, kFeatureCustomTrapExploder = 8,
kFeatureCustomEnemyHealth = 16,
}; };
constexpr int BMAX_PATH = 260; constexpr int BMAX_PATH = 260;