- MBF21: splash group.

This commit is contained in:
Christoph Oelckers 2021-06-29 17:47:52 +02:00
parent cc801a7efa
commit 0bb5ec0d22
3 changed files with 29 additions and 0 deletions

View file

@ -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)
{

View file

@ -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.

View file

@ -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]
//==========================================================================