deathMorphType property

This commit is contained in:
Christoph Oelckers 2023-10-10 23:20:53 +02:00
parent 16bde524ff
commit 4f7ed35655
4 changed files with 9 additions and 4 deletions

View file

@ -54,7 +54,6 @@ struct FActorInfo
FActorInfo(const FActorInfo& other)
{
// only copy the fields that get inherited
TypeNum = other.TypeNum;
DefaultFlags = other.DefaultFlags;
DefaultCstat = other.DefaultCstat;
SpriteSetNames = other.SpriteSetNames;

View file

@ -3956,11 +3956,13 @@ static void actCheckDudes()
if (seqGetStatus(actor) < 0) genDudeTransform(actor);
}
#endif
if (actor->GetType() == kDudeCerberusTwoHead)
{
if (actor->xspr.health <= 0 && seqGetStatus(actor) < 0)
{
actor->ChangeType(kDudeCerberusOneHead);
// generalize the morph effect of the dying two headed cerberus.
auto dmt = actor->PointerVar<PClassActor>("deathMorphType");
if (dmt)
{
actor->ChangeType(dmt);
actor->xspr.health = actor->startHealth() << 4;
if (actor->GetTarget() != nullptr) aiSetTarget(actor, actor->GetTarget());
aiActivateDude(actor);

View file

@ -187,6 +187,7 @@ public:
{
memcpy(dmgControl, startdamage, sizeof(dmgControl));
}
spr.lotag = static_cast<PClassActor*>(newtype)->ActorInfo()->TypeNum;
}
}

View file

@ -20,6 +20,7 @@ class BloodDudeBase : Bloodactor
meta double backSpeed;
meta double turnRange;
meta int gibType[3]; // which gib used when explode dude
meta class<BloodDudeBase> deathMorphType;
meta Sound explodeSound;
@ -46,6 +47,7 @@ class BloodDudeBase : Bloodactor
property turnRange: turnRange;
property explodeSound: explodeSound;
property deathMorphType: deathMorphType;
default
@ -1143,6 +1145,7 @@ class BloodDudeCerberusTwoHead : BloodDudeBase
turnrange 67.5;
gibtype 7, -1, -1;
dmgcontrol 16, 0, 16, 16, 0, 96, 48;
deathMorphType "BloodDudeCerberusOneHead";
}
}