Add SFLAG_HURTSPAWNBLOOD, which allows actors (particularly useractor enemies) to spawn blood when hurt as hardcoded enemies do.

git-svn-id: https://svn.eduke32.com/eduke32@5250 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2015-05-27 08:45:59 +00:00
parent d04d31bd31
commit 25543b521b
3 changed files with 10 additions and 7 deletions

View file

@ -255,6 +255,7 @@ enum sflags_t {
SFLAG_DIDNOSE7WATER = 0x00080000, // used temporarily
SFLAG_NODAMAGEPUSH = 0x00100000,
SFLAG_NOWATERDIP = 0x00200000,
SFLAG_HURTSPAWNBLOOD = 0x00400000,
};
// Custom projectiles "workslike" flags.

View file

@ -223,6 +223,7 @@ SFLAG = {
SFLAG_DIDNOSE7WATER = -0x00080000,
SFLAG_NODAMAGEPUSH = 0x00100000,
SFLAG_NOWATERDIP = 0x00200000,
SFLAG_HURTSPAWNBLOOD = 0x00400000,
-- RESERVED for actor.FLAGS.chain_*/replace_*:
-- 0x08000000, 0x10000000, 0x20000000, 0x40000000
}

View file

@ -2283,7 +2283,7 @@ void A_DamageObject(int32_t i,int32_t sn)
if ((PN != DRONE) && (PN != ROTATEGUN) && (PN != COMMANDER) && (PN < GREENSLIME || PN > GREENSLIME+7))
if (sprite[sn].picnum != FREEZEBLAST)
if (!A_CheckSpriteTileFlags(PN, SFLAG_BADGUY))
if (!A_CheckSpriteTileFlags(PN, SFLAG_BADGUY) || A_CheckSpriteTileFlags(PN, SFLAG_HURTSPAWNBLOOD))
{
j = A_Spawn(sn,JIBS6);
if (sprite[sn].pal == 6)
@ -2298,12 +2298,13 @@ void A_DamageObject(int32_t i,int32_t sn)
if (j >= 0 && sprite[j].picnum == APLAYER && PN != ROTATEGUN && PN != DRONE)
if (g_player[P_Get(j)].ps->curr_weapon == SHOTGUN_WEAPON)
{
A_Shoot(i,BLOODSPLAT3);
A_Shoot(i,BLOODSPLAT1);
A_Shoot(i,BLOODSPLAT2);
A_Shoot(i,BLOODSPLAT4);
}
if (!A_CheckSpriteTileFlags(PN, SFLAG_BADGUY) || A_CheckSpriteTileFlags(PN, SFLAG_HURTSPAWNBLOOD))
{
A_Shoot(i,BLOODSPLAT3);
A_Shoot(i,BLOODSPLAT1);
A_Shoot(i,BLOODSPLAT2);
A_Shoot(i,BLOODSPLAT4);
}
if (!A_CheckSpriteFlags(i, SFLAG_NODAMAGEPUSH))
{