From 0bb5ec0d220ab9f14a2d527f5cb751b05f6f6804 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 29 Jun 2021 17:47:52 +0200 Subject: [PATCH] - MBF21: splash group. --- src/gamedata/d_dehacked.cpp | 11 +++++++++++ src/playsim/p_map.cpp | 5 +++++ src/scripting/thingdef_properties.cpp | 13 +++++++++++++ 3 files changed, 29 insertions(+) diff --git a/src/gamedata/d_dehacked.cpp b/src/gamedata/d_dehacked.cpp index ad62d1b61..f69ae6714 100644 --- a/src/gamedata/d_dehacked.cpp +++ b/src/gamedata/d_dehacked.cpp @@ -978,6 +978,17 @@ static int PatchThing (int thingy) if (grp < 0) grp = -1; type->ActorInfo()->projectile_group = grp; } + else if (linelen == 12 && stricmp(Line1, "splash group") == 0) + { + stripwhite(Line2); + int grp = atoi(Line2); + if (grp < 0) + { + Printf("Splash groups must be >= 0 (check your dehacked)\n"); + grp = 0; + } + type->ActorInfo()->splash_group = grp; + } else if (linelen > 6) { diff --git a/src/playsim/p_map.cpp b/src/playsim/p_map.cpp index 0e6e42ffe..757e8f9b1 100644 --- a/src/playsim/p_map.cpp +++ b/src/playsim/p_map.cpp @@ -5956,6 +5956,11 @@ int P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bom continue; } + // MBF21 + auto targetgroup = thing->GetClass()->ActorInfo()->splash_group; + auto sourcegroup = bombspot->GetClass()->ActorInfo()->splash_group; + if (targetgroup != 0 && targetgroup == sourcegroup) continue; + // a much needed option: monsters that fire explosive projectiles cannot // be hurt by projectiles fired by a monster of the same type. // Controlled by the DONTHARMCLASS and DONTHARMSPECIES flags. diff --git a/src/scripting/thingdef_properties.cpp b/src/scripting/thingdef_properties.cpp index 0367b8caf..64d44e669 100644 --- a/src/scripting/thingdef_properties.cpp +++ b/src/scripting/thingdef_properties.cpp @@ -1051,6 +1051,19 @@ DEFINE_PROPERTY(projectilegroup, I, Actor) info->ActorInfo()->projectile_group = i; } +//========================================================================== +// MBF21 +//========================================================================== +DEFINE_PROPERTY(splashgroup, I, Actor) +{ + PROP_INT_PARM(i, 0); + if (i < 0) + { + I_Error("Splash groups must be >= 0."); + } + info->ActorInfo()->splash_group = i; +} + //========================================================================== // [BB] //==========================================================================