mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-27 13:50:49 +00:00
use a flag for checking if a dude is burning.
This commit is contained in:
parent
4f7ed35655
commit
ecf15a35cb
4 changed files with 20 additions and 18 deletions
|
@ -3907,21 +3907,7 @@ static void actCheckTraps()
|
||||||
bool IsBurningDude(DBloodActor* actor)
|
bool IsBurningDude(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
if (actor == NULL) return false;
|
if (actor == NULL) return false;
|
||||||
switch (actor->GetType())
|
return actor->classflags() & 1;
|
||||||
{
|
|
||||||
case kDudeBurningInnocent:
|
|
||||||
case kDudeBurningCultist:
|
|
||||||
case kDudeBurningZombieAxe:
|
|
||||||
case kDudeBurningZombieButcher:
|
|
||||||
case kDudeBurningTinyCaleb:
|
|
||||||
case kDudeBurningBeast:
|
|
||||||
#ifdef NOONE_EXTENSIONS
|
|
||||||
case kDudeModernCustomBurning:
|
|
||||||
#endif
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@ -3940,10 +3926,11 @@ static void actCheckDudes()
|
||||||
|
|
||||||
if (actor->hasX())
|
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 ((actor->xspr.burnTime > 0) || fixBurnGlitch)
|
||||||
{
|
{
|
||||||
if (!IsBurningDude(actor))
|
if (!burn)
|
||||||
actor->xspr.burnTime = ClipLow(actor->xspr.burnTime - 4, 0);
|
actor->xspr.burnTime = ClipLow(actor->xspr.burnTime - 4, 0);
|
||||||
actDamageSprite(actor->GetBurnSource(), actor, kDamageBurn, 8);
|
actDamageSprite(actor->GetBurnSource(), actor, kDamageBurn, 8);
|
||||||
}
|
}
|
||||||
|
|
|
@ -748,6 +748,7 @@ void GameInterface::FinalizeSetup()
|
||||||
o_fleeHealth = getvar(dudedef, "fleeHealth");
|
o_fleeHealth = getvar(dudedef, "fleeHealth");
|
||||||
o_alertChance = getvar(dudedef, "alertchance");
|
o_alertChance = getvar(dudedef, "alertchance");
|
||||||
o_lockout = getvar(dudedef, "lockout");
|
o_lockout = getvar(dudedef, "lockout");
|
||||||
|
o_classflags = getvar(dudedef, "classflags");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ inline size_t o_aimHeight;
|
||||||
inline size_t o_fleeHealth;
|
inline size_t o_fleeHealth;
|
||||||
inline size_t o_alertChance;
|
inline size_t o_alertChance;
|
||||||
inline size_t o_lockout;
|
inline size_t o_lockout;
|
||||||
|
inline size_t o_classflags;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -251,6 +252,11 @@ public:
|
||||||
return *(int*)(GetClass()->Meta + o_lockout);
|
return *(int*)(GetClass()->Meta + o_lockout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline int classflags() const
|
||||||
|
{
|
||||||
|
return *(int*)(GetClass()->Meta + o_classflags);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
int hinderDamage; // recoil damage
|
int hinderDamage; // recoil damage
|
||||||
int changeTarget; // chance to change target when attacked someone else
|
int changeTarget; // chance to change target when attacked someone else
|
||||||
|
|
|
@ -20,9 +20,10 @@ class BloodDudeBase : Bloodactor
|
||||||
meta double backSpeed;
|
meta double backSpeed;
|
||||||
meta double turnRange;
|
meta double turnRange;
|
||||||
meta int gibType[3]; // which gib used when explode dude
|
meta int gibType[3]; // which gib used when explode dude
|
||||||
meta class<BloodDudeBase> deathMorphType;
|
|
||||||
|
|
||||||
|
meta int classflags;
|
||||||
meta Sound explodeSound;
|
meta Sound explodeSound;
|
||||||
|
meta class<BloodDudeBase> deathMorphType;
|
||||||
|
|
||||||
property prefix: none;
|
property prefix: none;
|
||||||
property seqStartName: seqStartName;
|
property seqStartName: seqStartName;
|
||||||
|
@ -48,6 +49,7 @@ class BloodDudeBase : Bloodactor
|
||||||
|
|
||||||
property explodeSound: explodeSound;
|
property explodeSound: explodeSound;
|
||||||
property deathMorphType: deathMorphType;
|
property deathMorphType: deathMorphType;
|
||||||
|
flagdef burning: classflags, 0;
|
||||||
|
|
||||||
|
|
||||||
default
|
default
|
||||||
|
@ -1289,6 +1291,7 @@ class BloodDudeBurningInnocent : BloodDudeBase
|
||||||
dmgcontrol 256, 256, 256, 256, 256, 256, 256;
|
dmgcontrol 256, 256, 256, 256, 256, 256, 256;
|
||||||
|
|
||||||
explodesound 717;
|
explodesound 717;
|
||||||
|
+BloodDudeBase.burning;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1317,6 +1320,7 @@ class BloodDudeBurningCultist : BloodDudeBase
|
||||||
dmgcontrol 256, 256, 256, 256, 256, 256, 256;
|
dmgcontrol 256, 256, 256, 256, 256, 256, 256;
|
||||||
|
|
||||||
explodesound 717;
|
explodesound 717;
|
||||||
|
+BloodDudeBase.burning;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1345,6 +1349,7 @@ class BloodDudeBurningZombieAxe : BloodDudeBase
|
||||||
turnrange 28.125;
|
turnrange 28.125;
|
||||||
gibtype 7, 5, -1;
|
gibtype 7, 5, -1;
|
||||||
dmgcontrol 256, 256, 256, 256, 256, 256, 256;
|
dmgcontrol 256, 256, 256, 256, 256, 256, 256;
|
||||||
|
+BloodDudeBase.burning;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1373,6 +1378,7 @@ class BloodDudeBurningZombieButcher : BloodDudeBase
|
||||||
turnrange 17.578125;
|
turnrange 17.578125;
|
||||||
gibtype 7, 5, -1;
|
gibtype 7, 5, -1;
|
||||||
dmgcontrol 256, 256, 256, 256, 256, 256, 256;
|
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;
|
dmgcontrol 256, 256, 256, 256, 256, 256, 256;
|
||||||
|
|
||||||
explodesound 717;
|
explodesound 717;
|
||||||
|
+BloodDudeBase.burning;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1699,6 +1706,7 @@ class BloodDudeBurningBeast : BloodDudeBase
|
||||||
turnrange 67.5;
|
turnrange 67.5;
|
||||||
gibtype 7, -1, -1;
|
gibtype 7, -1, -1;
|
||||||
dmgcontrol 256, 256, 256, 256, 256, 256, 256;
|
dmgcontrol 256, 256, 256, 256, 256, 256, 256;
|
||||||
|
+BloodDudeBase.burning;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue