- added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors.

SVN r3234 (trunk)
This commit is contained in:
Christoph Oelckers 2011-06-13 10:34:46 +00:00
parent 6ba0689b8d
commit a587ffed57
3 changed files with 9 additions and 1 deletions

View file

@ -100,7 +100,8 @@ enum EPuffFlags
{ {
PF_HITTHING = 1, PF_HITTHING = 1,
PF_MELEERANGE = 2, PF_MELEERANGE = 2,
PF_TEMPORARY = 4 PF_TEMPORARY = 4,
PF_HITTHINGBLEED = 8
}; };
AActor *P_SpawnPuff (AActor *source, const PClass *pufftype, fixed_t x, fixed_t y, fixed_t z, angle_t dir, int updown, int flags = 0); AActor *P_SpawnPuff (AActor *source, const PClass *pufftype, fixed_t x, fixed_t y, fixed_t z, angle_t dir, int updown, int flags = 0);

View file

@ -3485,6 +3485,9 @@ AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance,
(trace.Actor->flags & MF_NOBLOOD) || (trace.Actor->flags & MF_NOBLOOD) ||
(trace.Actor->flags2 & (MF2_INVULNERABLE|MF2_DORMANT))) (trace.Actor->flags2 & (MF2_INVULNERABLE|MF2_DORMANT)))
{ {
if (!(trace.Actor->flags & MF_NOBLOOD))
flags |= PF_HITTHINGBLEED;
// We must pass the unreplaced puff type here // We must pass the unreplaced puff type here
puff = P_SpawnPuff (t1, pufftype, hitx, hity, hitz, angle - ANG180, 2, flags|PF_HITTHING); puff = P_SpawnPuff (t1, pufftype, hitx, hity, hitz, angle - ANG180, 2, flags|PF_HITTHING);
} }

View file

@ -4421,6 +4421,10 @@ AActor *P_SpawnPuff (AActor *source, const PClass *pufftype, fixed_t x, fixed_t
{ {
puff->SetState (crashstate); puff->SetState (crashstate);
} }
else if ((flags & PF_HITTHINGBLEED) && (crashstate = puff->FindState(NAME_Death, NAME_Extreme, true)) != NULL)
{
puff->SetState (crashstate);
}
else if ((flags & PF_MELEERANGE) && puff->MeleeState != NULL) else if ((flags & PF_MELEERANGE) && puff->MeleeState != NULL)
{ {
// handle the hard coded state jump of Doom's bullet puff // handle the hard coded state jump of Doom's bullet puff