- two new flags and one renamed one for hitradius.

slowly getting closer to sorting this one out. The new flags already make operation a lot clearer.
This commit is contained in:
Christoph Oelckers 2022-12-29 15:57:03 +01:00
parent 19f4e4ff63
commit 9ddb5987cd
7 changed files with 21 additions and 21 deletions

View file

@ -125,7 +125,7 @@ static FFlagDef DukeActorFlagDefs[] =
DEFINE_FLAG(SFLAG, FLAMMABLEPOOLEFFECT, DDukeActor, flags1),
DEFINE_FLAG(SFLAG, INFLAME, DDukeActor, flags1),
DEFINE_FLAG(SFLAG, NOFLOORFIRE, DDukeActor, flags1),
DEFINE_FLAG(SFLAG, HITRADIUS_FLAG1, DDukeActor, flags1),
DEFINE_FLAG(SFLAG, HITRADIUS_CHECKHITONLY, DDukeActor, flags1),
DEFINE_FLAG(SFLAG, HITRADIUS_FLAG2, DDukeActor, flags1),
DEFINE_FLAG(SFLAG, CHECKSLEEP, DDukeActor, flags1),
DEFINE_FLAG(SFLAG, NOTELEPORT, DDukeActor, flags1),
@ -179,6 +179,8 @@ static FFlagDef DukeActorFlagDefs[] =
DEFINE_FLAG(SFLAG3, DONTLIGHTSHOOTER, DDukeActor, flags3),
DEFINE_FLAG(SFLAG3, SHOOTCENTERED, DDukeActor, flags3),
DEFINE_FLAG(SFLAG3, NOCEILINGBLAST, DDukeActor, flags3),
DEFINE_FLAG(SFLAG3, HITRADIUS_DONTHURTSHOOTER, DDukeActor, flags3),
DEFINE_FLAG(SFLAG3, HITRADIUS_NODAMAGE, DDukeActor, flags3),
};

View file

@ -178,7 +178,7 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
}
}
if (x == 0 || x >= 5 || (act2->flags1 & SFLAG_HITRADIUS_FLAG1))
if (x == 0 || x >= 5 || (act2->flags1 & SFLAG_HITRADIUS_CHECKHITONLY))
{
if (actor->spr.picnum != DTILE_SHRINKSPARK || (act2->spr.cstat & CSTAT_SPRITE_BLOCK_ALL))
if ((actor->spr.pos - act2->spr.pos).Length() < radius)
@ -190,11 +190,11 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
}
else if (act2->spr.extra >= 0 && act2 != actor && ((act2->flags1 & SFLAG_HITRADIUS_FLAG2) || badguy(act2) || (act2->spr.cstat & CSTAT_SPRITE_BLOCK_ALL)))
{
if (actor->spr.picnum == DTILE_SHRINKSPARK && act2->spr.picnum != DTILE_SHARK && (act2 == Owner || act2->spr.scale.X < 0.375))
if (actor->spr.picnum == DTILE_SHRINKSPARK && act2->spr.picnum != DTILE_SHARK && (act2->spr.scale.X < 0.375))
{
continue;
}
if (actor->spr.picnum == DTILE_MORTER && act2 == Owner)
if (actor->flags3 & SFLAG3_HITRADIUS_DONTHURTSHOOTER && act2 == Owner)
{
continue;
}
@ -206,8 +206,7 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
act2->hitang = (act2->spr.pos - actor->spr.pos).Angle();
act2->attackertype = CallGetRadiusDamageType(actor, act2->spr.extra);
if (actor->spr.picnum != DTILE_SHRINKSPARK && (!isWorldTour() || actor->spr.picnum != DTILE_LAVAPOOL))
if (!(actor->flags3 & SFLAG3_HITRADIUS_NODAMAGE))
{
if (dist < radius / 3)
{

View file

@ -164,24 +164,23 @@ void hitradius_r(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
DukeStatIterator it1(statlist[x]);
while (auto act2 = it1.Next())
{
if (x == 0 || x >= 5 || (act2->flags1 & SFLAG_HITRADIUS_FLAG1))
if (x == 0 || x >= 5 || (act2->flags1 & SFLAG_HITRADIUS_CHECKHITONLY))
{
if (act2->spr.cstat & CSTAT_SPRITE_BLOCK_ALL)
if ((actor->spr.pos - act2->spr.pos).Length() < radius)
{
if (badguy(act2) && !cansee(act2->spr.pos.plusZ(q), act2->sector(), actor->spr.pos.plusZ(q), actor->sector()))
continue;
if ((actor->spr.pos - act2->spr.pos).Length() < radius)
{
if (badguy(act2) && !cansee(act2->spr.pos.plusZ(q), act2->sector(), actor->spr.pos.plusZ(q), actor->sector()))
continue;
checkhitsprite(act2, actor);
}
checkhitsprite(act2, actor);
}
}
else if (act2->spr.extra >= 0 && act2 != actor && ((act2->flags1 & SFLAG_HITRADIUS_FLAG2) || badguy(act2) || (act2->spr.cstat & CSTAT_SPRITE_BLOCK_ALL)))
{
if (actor->spr.picnum == RTILE_MORTER && act2 == Owner)
if (actor->flags3 & SFLAG3_HITRADIUS_DONTHURTSHOOTER && act2 == Owner)
{
continue;
}
if ((isRRRA()) && actor->spr.picnum == RTILE_CHEERBOMB && act2 == Owner)
if ((isRRRA()) && act2->spr.picnum == RTILE_MINION && act2->spr.pal == 19)
{
continue;
}
@ -190,10 +189,6 @@ void hitradius_r(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
if (dist < radius && cansee(act2->spr.pos.plusZ(-8), act2->sector(), actor->spr.pos.plusZ(-12), actor->sector()))
{
if ((isRRRA()) && act2->spr.picnum == RTILE_MINION && act2->spr.pal == 19)
{
continue;
}
act2->hitang = (act2->spr.pos - actor->spr.pos).Angle();
act2->attackertype = CallGetRadiusDamageType(actor, act2->spr.extra);

View file

@ -68,6 +68,8 @@ class DukeShrinkSpark : DukeProjectile
+MIRRORREFLECT;
+NOFLOORPAL;
+NOCEILINGBLAST;
+HITRADIUS_DONTHURTSHOOTER;
+HITRADIUS_NODAMAGE;
}
override void posthiteffect(CollisionData coll)

View file

@ -3,7 +3,7 @@ class DukeFlammable : DukeActor
default
{
statnum STAT_STANDABLE;
+HITRADIUS_FLAG1;
+HITRADIUS_CHECKHITONLY;
}
override void Initialize()

View file

@ -4,6 +4,7 @@ class DukeLavaPool : DukeActor
{
pic "LAVAPOOL";
+FORCERUNCON;
+HITRADIUS_NODAMAGE;
}
override void Initialize()

View file

@ -5,6 +5,7 @@ class DukeMortar : DukeActor
pic "MORTER";
DukeMortar.ceilingdist 3;
DukeMortar.spawnscale 0.5;
+HITRADIUS_DONTHURTSHOOTER;
}
meta int ceilingdist;