use a flag for checking if a dude is burning.

This commit is contained in:
Christoph Oelckers 2023-10-10 23:29:27 +02:00
parent 4f7ed35655
commit ecf15a35cb
4 changed files with 20 additions and 18 deletions

View file

@ -3907,21 +3907,7 @@ static void actCheckTraps()
bool IsBurningDude(DBloodActor* actor)
{
if (actor == NULL) return false;
switch (actor->GetType())
{
case kDudeBurningInnocent:
case kDudeBurningCultist:
case kDudeBurningZombieAxe:
case kDudeBurningZombieButcher:
case kDudeBurningTinyCaleb:
case kDudeBurningBeast:
#ifdef NOONE_EXTENSIONS
case kDudeModernCustomBurning:
#endif
return true;
}
return false;
return actor->classflags() & 1;
}
//---------------------------------------------------------------------------
@ -3940,10 +3926,11 @@ static void actCheckDudes()
if (actor->hasX())
{
const bool fixBurnGlitch = !cl_bloodvanillaenemies && IsBurningDude(actor) && !VanillaMode(); // if enemies are burning, always apply burning damage per tick
bool burn = IsBurningDude(actor);
const bool fixBurnGlitch = !cl_bloodvanillaenemies && burn && !VanillaMode(); // if enemies are burning, always apply burning damage per tick
if ((actor->xspr.burnTime > 0) || fixBurnGlitch)
{
if (!IsBurningDude(actor))
if (!burn)
actor->xspr.burnTime = ClipLow(actor->xspr.burnTime - 4, 0);
actDamageSprite(actor->GetBurnSource(), actor, kDamageBurn, 8);
}

View file

@ -748,6 +748,7 @@ void GameInterface::FinalizeSetup()
o_fleeHealth = getvar(dudedef, "fleeHealth");
o_alertChance = getvar(dudedef, "alertchance");
o_lockout = getvar(dudedef, "lockout");
o_classflags = getvar(dudedef, "classflags");
}

View file

@ -22,6 +22,7 @@ inline size_t o_aimHeight;
inline size_t o_fleeHealth;
inline size_t o_alertChance;
inline size_t o_lockout;
inline size_t o_classflags;
@ -251,6 +252,11 @@ public:
return *(int*)(GetClass()->Meta + o_lockout);
}
inline int classflags() const
{
return *(int*)(GetClass()->Meta + o_classflags);
}
/*
int hinderDamage; // recoil damage
int changeTarget; // chance to change target when attacked someone else

View file

@ -20,9 +20,10 @@ class BloodDudeBase : Bloodactor
meta double backSpeed;
meta double turnRange;
meta int gibType[3]; // which gib used when explode dude
meta class<BloodDudeBase> deathMorphType;
meta int classflags;
meta Sound explodeSound;
meta class<BloodDudeBase> deathMorphType;
property prefix: none;
property seqStartName: seqStartName;
@ -48,6 +49,7 @@ class BloodDudeBase : Bloodactor
property explodeSound: explodeSound;
property deathMorphType: deathMorphType;
flagdef burning: classflags, 0;
default
@ -1289,6 +1291,7 @@ class BloodDudeBurningInnocent : BloodDudeBase
dmgcontrol 256, 256, 256, 256, 256, 256, 256;
explodesound 717;
+BloodDudeBase.burning;
}
}
@ -1317,6 +1320,7 @@ class BloodDudeBurningCultist : BloodDudeBase
dmgcontrol 256, 256, 256, 256, 256, 256, 256;
explodesound 717;
+BloodDudeBase.burning;
}
}
@ -1345,6 +1349,7 @@ class BloodDudeBurningZombieAxe : BloodDudeBase
turnrange 28.125;
gibtype 7, 5, -1;
dmgcontrol 256, 256, 256, 256, 256, 256, 256;
+BloodDudeBase.burning;
}
}
@ -1373,6 +1378,7 @@ class BloodDudeBurningZombieButcher : BloodDudeBase
turnrange 17.578125;
gibtype 7, 5, -1;
dmgcontrol 256, 256, 256, 256, 256, 256, 256;
+BloodDudeBase.burning;
}
}
@ -1670,6 +1676,7 @@ class BloodDudeBurningTinyCaleb : BloodDudeBase
dmgcontrol 256, 256, 256, 256, 256, 256, 256;
explodesound 717;
+BloodDudeBase.burning;
}
}
@ -1699,6 +1706,7 @@ class BloodDudeBurningBeast : BloodDudeBase
turnrange 67.5;
gibtype 7, -1, -1;
dmgcontrol 256, 256, 256, 256, 256, 256, 256;
+BloodDudeBase.burning;
}
}