- Added new flags8 actor field. Isn't it frightening how quickly how we got to our 8th flag field?

- Speaking of frightening, added +FRIGHTENING flag.
This commit is contained in:
Rachael Alexanderson 2017-05-14 12:26:31 -04:00 committed by Christoph Oelckers
parent 3b20c26275
commit a96ef5276d
6 changed files with 18 additions and 2 deletions

View file

@ -398,6 +398,10 @@ enum ActorFlag7
MF7_FORCEINFIGHTING = 0x40000000, // overrides a map setting of 'no infighting'.
MF7_SPRITEFLIP = 0x80000000, // sprite flipped on x-axis
};
enum ActorFlag8
{
MF8_FRIGHTENING = 0x00000001, // for those moments when halloween just won't do
};
// --- mobj.renderflags ---
enum ActorRenderFlag
@ -517,6 +521,7 @@ typedef TFlags<ActorFlag4> ActorFlags4;
typedef TFlags<ActorFlag5> ActorFlags5;
typedef TFlags<ActorFlag6> ActorFlags6;
typedef TFlags<ActorFlag7> ActorFlags7;
typedef TFlags<ActorFlag8> ActorFlags8;
typedef TFlags<ActorRenderFlag> ActorRenderFlags;
typedef TFlags<ActorBounceFlag, uint16_t> ActorBounceFlags;
DEFINE_TFLAGS_OPERATORS (ActorFlags)
@ -526,6 +531,7 @@ DEFINE_TFLAGS_OPERATORS (ActorFlags4)
DEFINE_TFLAGS_OPERATORS (ActorFlags5)
DEFINE_TFLAGS_OPERATORS (ActorFlags6)
DEFINE_TFLAGS_OPERATORS (ActorFlags7)
DEFINE_TFLAGS_OPERATORS (ActorFlags8)
DEFINE_TFLAGS_OPERATORS (ActorRenderFlags)
DEFINE_TFLAGS_OPERATORS (ActorBounceFlags)
@ -1022,6 +1028,7 @@ public:
ActorFlags5 flags5; // OMG! We need another one.
ActorFlags6 flags6; // Shit! Where did all the flags go?
ActorFlags7 flags7; // WHO WANTS TO BET ON 8!?
ActorFlags8 flags8; // I see your 8, and raise you a bet for 9.
double Floorclip; // value to use for floor clipping
double radius, Height; // for movement checking

View file

@ -3765,6 +3765,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Respawn)
self->flags5 = defs->flags5;
self->flags6 = defs->flags6;
self->flags7 = defs->flags7;
self->flags8 = defs->flags8;
self->SetState (self->SpawnState);
self->renderflags &= ~RF_INVISIBLE;

View file

@ -996,7 +996,8 @@ void P_NewChaseDir(AActor * actor)
if (!(actor->flags6 & MF6_NOFEAR))
{
if ((actor->target->player != NULL && (actor->target->player->cheats & CF_FRIGHTENING)) ||
(actor->flags4 & MF4_FRIGHTENED))
(actor->flags4 & MF4_FRIGHTENED) ||
(actor->target->flags8 & MF8_FRIGHTENING))
{
delta = -delta;
}
@ -2655,7 +2656,7 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi
// [RH] Scared monsters attack less frequently
if (((actor->target->player == NULL ||
!(actor->target->player->cheats & CF_FRIGHTENING)) &&
!((actor->target->player->cheats & CF_FRIGHTENING) || (actor->target->flags8 & MF8_FRIGHTENING))) &&
!(actor->flags4 & MF4_FRIGHTENED)) ||
pr_scaredycat() < 43)
{

View file

@ -407,6 +407,7 @@ void AActor::Serialize(FSerializer &arc)
A("flags5", flags5)
A("flags6", flags6)
A("flags7", flags7)
A("flags8", flags8)
A("weaponspecial", weaponspecial)
A("special1", special1)
A("special2", special2)
@ -8394,6 +8395,9 @@ void PrintMiscActorInfo(AActor *query)
Printf("\n flags7: %x", query->flags7.GetValue());
for (flagi = 0; flagi <= 31; flagi++)
if (query->flags7 & ActorFlags7::FromInt(1<<flagi)) Printf(" %s", FLAG_NAME(1<<flagi, flags7));
Printf("\n flags8: %x", query->flags8.GetValue());
for (flagi = 0; flagi <= 31; flagi++)
if (query->flags8 & ActorFlags8::FromInt(1<<flagi)) Printf(" %s", FLAG_NAME(1<<flagi, flags8));
Printf("\nBounce flags: %x\nBounce factors: f:%f, w:%f",
query->BounceFlags.GetValue(), query->bouncefactor,
query->wallbouncefactor);

View file

@ -324,6 +324,8 @@ static FFlagDef ActorFlagDefs[]=
DEFINE_FLAG(MF7, FORCEINFIGHTING, AActor, flags7),
DEFINE_FLAG(MF7, SPRITEFLIP, AActor, flags7),
DEFINE_FLAG(MF8, FRIGHTENING, AActor, flags8),
// Effect flags
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),
DEFINE_FLAG2(FX_ROCKET, ROCKETTRAIL, AActor, effects),

View file

@ -989,6 +989,7 @@ DEFINE_PROPERTY(clearflags, 0, Actor)
defaults->flags5 = 0;
defaults->flags6 = 0;
defaults->flags7 = 0;
defaults->flags8 = 0;
}
//==========================================================================