More editing flags

PSX-inspired flags to change the render styles of monsters (and other
things).
This commit is contained in:
Gaerzi 2014-04-10 12:32:23 +02:00
parent bbb41e869c
commit 580094a792
7 changed files with 79 additions and 2 deletions

View file

@ -192,9 +192,10 @@ enum EMapLineFlags // These are flags that use different values internally
ML_RESERVED_ETERNITY = 0x0800,
// [RH] Extra flags for Strife
ML_TRANSLUCENT_STRIFE = 0x1000,
ML_RAILING_STRIFE = 0x0200,
ML_BLOCK_FLOATERS_STRIFE = 0x0400,
ML_TRANSPARENT_STRIFE = 0x0800,
ML_TRANSLUCENT_STRIFE = 0x1000,
};
@ -385,6 +386,15 @@ enum EMapThingFlags
MTF_SECRET = 0x080000, // Secret pickup
MTF_NOINFIGHTING = 0x100000,
// PSX Doom and Doom 64 effects
MTF_TRANS = 0x200000, // 50% alpha
MTF_ADD = 0x400000, // 100% additive
MTF_SUBTRACT = 0x800000, // 100% subtractive
MTF_SPECTRE = 0x1000000, // 25% additive
MTF_DOUBLEHEALTH = 0x2000000, // Double hit points
// BOOM and DOOM compatible versions of some of the above
BTF_NOTSINGLE = 0x0010, // (TF_COOPERATIVE|TF_DEATHMATCH)

View file

@ -373,6 +373,11 @@ xx(Friend)
xx(Strifeally)
xx(Standing)
xx(Countsecret)
//xx(Transparent) defined below for linedefs
//xx(Additive) already defined for invisibility types
xx(Subtractive)
xx(Spectre)
xx(Doublehealth)
xx(Blocking)
xx(Blockmonsters)

View file

@ -4022,6 +4022,24 @@ void AActor::HandleSpawnFlags ()
RenderStyle = STYLE_Translucent;
alpha = TRANSLUC25;
}
else if (SpawnFlags & MTF_TRANS)
{
RenderStyle = STYLE_Translucent;
alpha = TRANSLUC50;
}
else if (SpawnFlags & MTF_ADD)
{
RenderStyle = STYLE_Add;
}
else if (SpawnFlags & MTF_SUBTRACT)
{
RenderStyle = STYLE_Subtract;
}
else if (SpawnFlags & MTF_SPECTRE)
{
RenderStyle = STYLE_Add;
alpha = TRANSLUC25;
}
else if (SpawnFlags & MTF_ALTSHADOW)
{
RenderStyle = STYLE_None;
@ -4035,6 +4053,10 @@ void AActor::HandleSpawnFlags ()
level.total_secrets++;
}
}
if (SpawnFlags & MTF_DOUBLEHEALTH)
{
health *= 2;
}
}
void AActor::BeginPlay ()

View file

@ -632,6 +632,31 @@ public:
Flag(th->flags, MTF_SECRET, key);
break;
case NAME_Transparent:
CHECK_N(Zd | Zdt)
Flag(th->flags, MTF_TRANS, key);
break;
case NAME_Additive:
CHECK_N(Zd | Zdt)
Flag(th->flags, MTF_ADD, key);
break;
case NAME_Subtractive:
CHECK_N(Zd | Zdt)
Flag(th->flags, MTF_SUBTRACT, key);
break;
case NAME_Spectre:
CHECK_N(Zd | Zdt)
Flag(th->flags, MTF_SPECTRE, key);
break;
case NAME_Doublehealth:
CHECK_N(Zd | Zdt)
Flag(th->flags, MTF_DOUBLEHEALTH, key);
break;
default:
if (0 == strnicmp("user_", key.GetChars(), 5))
{ // Custom user key - Sets an actor's user variable directly
@ -686,6 +711,7 @@ public:
{
bool passuse = false;
bool strifetrans = false;
bool strifetrans2 = false;
FString arg0str, arg1str;
memset(ld, 0, sizeof(*ld));
@ -803,6 +829,11 @@ public:
strifetrans = CheckBool(key);
continue;
case NAME_Transparent:
CHECK_N(St | Zd | Zdt | Va)
strifetrans2 = CheckBool(key);
continue;
case NAME_Passuse:
CHECK_N(Dm | Zd | Zdt | Va)
passuse = CheckBool(key);
@ -965,6 +996,10 @@ public:
{
ld->Alpha = FRACUNIT * 3/4;
}
if (strifetrans2 && ld->Alpha == FRACUNIT)
{
ld->Alpha = FRACUNIT * 1/4;
}
if (ld->sidedef[0] == NULL)
{
ld->sidedef[0] = (side_t*)(intptr_t)(1);

View file

@ -89,6 +89,9 @@ void P_TranslateLineDef (line_t *ld, maplinedef_t *mld)
case -2:
ld->Alpha = FRACUNIT*3/4;
break;
case -3:
ld->Alpha = FRACUNIT / 4;
break;
default:
newflags |= LineFlagTranslations[i].newvalue;
break;

View file

@ -239,5 +239,6 @@ enum
//
ML_PASSTHROUGH = -1,
ML_TRANSLUCENT = -2
ML_TRANSLUCENT = -2,
ML_TRANSPARENT = -3,
}

View file

@ -363,5 +363,6 @@ lineflag 7 = ML_DONTDRAW;
lineflag 8 = ML_MAPPED;
lineflag 9 = ML_RAILING;
lineflag 10 = ML_BLOCK_FLOATERS;
lineflag 11 = ML_TRANSPARENT;
lineflag 12 = ML_TRANSLUCENT;