- Duke: restrict skill filter to those actors which originally handled it.

For flexibility there now is a flag that can be set on any actor class, but due to precedent it needs to be off by default.
This commit is contained in:
Christoph Oelckers 2023-04-11 20:14:02 +02:00
parent f7122e7f73
commit 660227e175
4 changed files with 15 additions and 4 deletions

View file

@ -107,7 +107,7 @@ static FFlagDef DukeActorFlagDefs[] =
DEFINE_FLAG(SFLAG, BOSS, DDukeActor, flags1),
DEFINE_FLAG(SFLAG, BADGUYSTAYPUT, DDukeActor, flags1),
DEFINE_FLAG(SFLAG, GREENSLIMEFOOD, DDukeActor, flags1),
//DEFINE_FLAG(SFLAG, NODAMAGEPUSH, DDukeActor, flags1),
DEFINE_FLAG(SFLAG, SKILLFILTER, DDukeActor, flags1),
DEFINE_FLAG(SFLAG, NOWATERDIP, DDukeActor, flags1),
DEFINE_FLAG(SFLAG, INTERNAL_BADGUY, DDukeActor, flags1),
DEFINE_FLAG(SFLAG, KILLCOUNT, DDukeActor, flags1),

View file

@ -327,7 +327,7 @@ enum sflags_t
SFLAG_BOSS = 0x00000010,
SFLAG_BADGUYSTAYPUT = 0x00000020,
SFLAG_GREENSLIMEFOOD = 0x00000040,
//SFLAG_NODAMAGEPUSH = 0x00000080,
SFLAG_SKILLFILTER = 0x00000080,
SFLAG_NOWATERDIP = 0x00000100,
SFLAG_INTERNAL_BADGUY = 0x00000200, // a separate flag is needed for the internal ones because SFLAG_BADGUY has additional semantics.
SFLAG_KILLCOUNT = 0x00000400,

View file

@ -314,7 +314,7 @@ bool commonEnemySetup(DDukeActor* self, DDukeActor* owner)
}
}
if ((self->spr.lotag > ud.player_skill) || ud.monsters_off == 1)
if (ud.monsters_off == 1)
{
self->spr.scale.Zero();
ChangeActorStat(self, STAT_MISC);
@ -842,6 +842,16 @@ DDukeActor* spawninit(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>* ac
}
else if (!act->isPlayer())
{
if (act->flags1 & (SFLAG_INTERNAL_BADGUY | SFLAG_SKILLFILTER))
{
if (act->spr.lotag > ud.player_skill)
{
act->spr.scale.Zero();
ChangeActorStat(act, STAT_MISC);
return nullptr;
}
}
if (!badguy(act) || commonEnemySetup(act, actj))
CallInitialize(act);
}

View file

@ -422,7 +422,7 @@ class DukeEgg : DukeActor
default
{
pic "EGG";
+INTERNAL_BADGUY;
+BADGUY;
}
override void Initialize()
@ -434,6 +434,7 @@ class DukeEgg : DukeActor
}
else
{
self.scale = (0.625, 0.625);
self.clipdist = 6;
self.cstat = CSTAT_SPRITE_BLOCK_ALL | randomXFlip();
self.ChangeStat(STAT_ZOMBIEACTOR);