From 25543b521be341b158835fe802b9f66cdbd589ad Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Wed, 27 May 2015 08:45:59 +0000 Subject: [PATCH] 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 --- polymer/eduke32/source/actors.h | 1 + polymer/eduke32/source/lunatic/con_lang.lua | 1 + polymer/eduke32/source/sector.c | 15 ++++++++------- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/polymer/eduke32/source/actors.h b/polymer/eduke32/source/actors.h index 974e26289..3a8245d29 100644 --- a/polymer/eduke32/source/actors.h +++ b/polymer/eduke32/source/actors.h @@ -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. diff --git a/polymer/eduke32/source/lunatic/con_lang.lua b/polymer/eduke32/source/lunatic/con_lang.lua index 7e336819d..29199b68a 100644 --- a/polymer/eduke32/source/lunatic/con_lang.lua +++ b/polymer/eduke32/source/lunatic/con_lang.lua @@ -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 } diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index d80ea82f7..27d4f6743 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -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)) {