Block Monsters is a flag again

This commit is contained in:
Sally Coolatta 2022-10-10 01:51:42 -04:00
parent babd0d5981
commit df3c077bf1
8 changed files with 96 additions and 65 deletions

View file

@ -25,7 +25,7 @@ linedefflags
linedefflagstranslation linedefflagstranslation
{ {
1 = "blocking"; 1 = "blocking";
2 = "blockmonsters"; 2 = "blockplayers";
4 = "twosided"; 4 = "twosided";
8 = "dontpegtop"; 8 = "dontpegtop";
16 = "dontpegbottom"; 16 = "dontpegbottom";
@ -37,8 +37,8 @@ linedefflagstranslation
1024 = "wrapmidtex"; 1024 = "wrapmidtex";
2048 = "netonly"; 2048 = "netonly";
4096 = "nonet"; 4096 = "nonet";
8192 = "effect6"; 8192 = "blockmonsters";
16384 = "bouncy"; 16384 = "notbouncy";
32768 = "transfer"; 32768 = "transfer";
} }
@ -46,7 +46,7 @@ linedefflagstranslation
linedefflags_udmf linedefflags_udmf
{ {
blocking = "Impassable"; blocking = "Impassable";
blockmonsters = "Block Enemies"; blockplayers = "Block Players";
twosided = "Double-Sided"; twosided = "Double-Sided";
dontpegtop = "Upper Unpegged"; dontpegtop = "Upper Unpegged";
dontpegbottom = "Lower Unpegged"; dontpegbottom = "Lower Unpegged";
@ -58,7 +58,8 @@ linedefflags_udmf
wrapmidtex = "Repeat Midtexture"; wrapmidtex = "Repeat Midtexture";
netonly = "Netgame Only"; netonly = "Netgame Only";
nonet = "No Netgame"; nonet = "No Netgame";
bouncy = "Bouncy Wall"; blockmonsters = "Block Enemies";
bouncy = "Not Bouncy";
transfer = "Transfer Line"; transfer = "Transfer Line";
} }

View file

@ -5812,7 +5812,7 @@ const char *const ML_LIST[] = {
"WRAPMIDTEX", "WRAPMIDTEX",
"NETONLY", "NETONLY",
"NONET", "NONET",
"EFFECT6", "BLOCKMONSTERS",
"NOTBOUNCY", "NOTBOUNCY",
"TFERLINE", "TFERLINE",
NULL NULL

View file

@ -99,48 +99,57 @@ typedef struct
// LineDef attributes. // LineDef attributes.
// //
// Solid, is an obstacle. enum
#define ML_IMPASSABLE 1 {
// Solid, is an obstacle.
ML_IMPASSABLE = 0x00000001,
// SRB2Kart: Blocks players only; items can be thrown through these. // SRB2Kart: Blocks players only; items can be thrown through these.
#define ML_BLOCKPLAYERS 2 ML_BLOCKPLAYERS = 0x00000002,
// Backside will not be present at all if not two sided. // Backside will not be present at all if not two sided.
#define ML_TWOSIDED 4 ML_TWOSIDED = 0x00000004,
// If a texture is pegged, the texture will have // If a texture is pegged, the texture will have
// the end exposed to air held constant at the // the end exposed to air held constant at the
// top or bottom of the texture (stairs or pulled // top or bottom of the texture (stairs or pulled
// down things) and will move with a height change // down things) and will move with a height change
// of one of the neighbor sectors. // of one of the neighbor sectors.
// Unpegged textures allways have the first row of // Unpegged textures allways have the first row of
// the texture at the top pixel of the line for both // the texture at the top pixel of the line for both
// top and bottom textures (use next to windows). // top and bottom textures (use next to windows).
// upper texture unpegged // upper texture unpegged
#define ML_DONTPEGTOP 8 ML_DONTPEGTOP = 0x00000008,
// lower texture unpegged // lower texture unpegged
#define ML_DONTPEGBOTTOM 16 ML_DONTPEGBOTTOM = 0x00000010,
#define ML_SKEWTD 32 ML_SKEWTD = 0x00000020,
// Don't let Knuckles climb on this line // Don't let Knuckles climb on this line
#define ML_NOCLIMB 64 ML_NOCLIMB = 0x00000040,
#define ML_NOSKEW 128 ML_NOSKEW = 0x00000080,
#define ML_MIDPEG 256 ML_MIDPEG = 0x00000100,
#define ML_MIDSOLID 512 ML_MIDSOLID = 0x00000200,
#define ML_WRAPMIDTEX 1024 ML_WRAPMIDTEX = 0x00000400,
#define ML_NETONLY 2048 // Apply effect only in netgames // Apply effect only in netgames
#define ML_NONET 4096 // Apply effect only in single player games ML_NETONLY = 0x00000800,
#define ML_EFFECT6 8192
// Don't bounce off this wall! // Apply effect only in single player games
#define ML_NOTBOUNCY 16384 ML_NONET = 0x00001000,
#define ML_TFERLINE 32768 // Blocks enemies only
ML_BLOCKMONSTERS = 0x00002000,
// Don't bounce off this wall!
ML_NOTBOUNCY = 0x00004000,
// Transfers FOF properties.
ML_TFERLINE = 0x00008000,
};
// Sector definition, from editing. // Sector definition, from editing.
typedef struct typedef struct

View file

@ -1620,17 +1620,34 @@ boolean P_IsLineBlocking(const line_t *ld, const mobj_t *thing)
{ {
// missiles can cross uncrossable lines // missiles can cross uncrossable lines
if ((thing->flags & MF_MISSILE)) if ((thing->flags & MF_MISSILE))
{
return false; return false;
}
else else
{ {
return if (thing->player && thing->player->spectator)
( {
(ld->flags & ML_IMPASSABLE) || // block objects from moving through this linedef. // Allow spectators thru blocking lines.
(thing->player && !thing->player->spectator && return false;
ld->flags & ML_BLOCKPLAYERS) || // SRB2Kart: Only block players, not items }
((thing->flags & (MF_ENEMY|MF_BOSS)) && ld->special == 81) // case 81: block monsters only
); if (ld->flags & ML_IMPASSABLE)
{
// block objects from moving through this linedef.
return true;
}
if (thing->player)
{
return (ld->flags & ML_BLOCKPLAYERS);
}
else if (thing->flags & (MF_ENEMY|MF_BOSS))
{
return (ld->flags & ML_BLOCKMONSTERS);
}
} }
return false;
} }
boolean P_IsLineTripWire(const line_t *ld) boolean P_IsLineTripWire(const line_t *ld)

View file

@ -1480,7 +1480,7 @@ static void ArchiveLines(void)
if (diff & LD_DIFF2) if (diff & LD_DIFF2)
WRITEUINT8(save_p, diff2); WRITEUINT8(save_p, diff2);
if (diff & LD_FLAG) if (diff & LD_FLAG)
WRITEINT16(save_p, li->flags); WRITEUINT32(save_p, li->flags);
if (diff & LD_SPECIAL) if (diff & LD_SPECIAL)
WRITEINT16(save_p, li->special); WRITEINT16(save_p, li->special);
if (diff & LD_CLLCOUNT) if (diff & LD_CLLCOUNT)
@ -1562,7 +1562,7 @@ static void UnArchiveLines(void)
diff2 = 0; diff2 = 0;
if (diff & LD_FLAG) if (diff & LD_FLAG)
li->flags = READINT16(save_p); li->flags = READUINT32(save_p);
if (diff & LD_SPECIAL) if (diff & LD_SPECIAL)
li->special = READINT16(save_p); li->special = READINT16(save_p);
if (diff & LD_CLLCOUNT) if (diff & LD_CLLCOUNT)

View file

@ -1631,8 +1631,8 @@ static void ParseTextmapLinedefParameter(UINT32 i, const char *param, const char
lines[i].flags |= ML_MIDSOLID; lines[i].flags |= ML_MIDSOLID;
else if (fastcmp(param, "wrapmidtex") && fastcmp("true", val)) else if (fastcmp(param, "wrapmidtex") && fastcmp("true", val))
lines[i].flags |= ML_WRAPMIDTEX; lines[i].flags |= ML_WRAPMIDTEX;
/*else if (fastcmp(param, "effect6") && fastcmp("true", val)) else if (fastcmp(param, "blockmonsters") && fastcmp("true", val))
lines[i].flags |= ML_EFFECT6;*/ lines[i].flags |= ML_BLOCKMONSTERS;
else if (fastcmp(param, "nonet") && fastcmp("true", val)) else if (fastcmp(param, "nonet") && fastcmp("true", val))
lines[i].flags |= ML_NONET; lines[i].flags |= ML_NONET;
else if (fastcmp(param, "netonly") && fastcmp("true", val)) else if (fastcmp(param, "netonly") && fastcmp("true", val))
@ -3714,7 +3714,7 @@ static void P_LinkMapData(void)
static void P_AddBinaryMapTagsFromLine(sector_t *sector, line_t *line) static void P_AddBinaryMapTagsFromLine(sector_t *sector, line_t *line)
{ {
Tag_Add(&sector->tags, Tag_FGet(&line->tags)); Tag_Add(&sector->tags, Tag_FGet(&line->tags));
if (line->flags & ML_EFFECT6) { if (line->flags & ML_BLOCKMONSTERS) {
if (sides[line->sidenum[0]].textureoffset) if (sides[line->sidenum[0]].textureoffset)
Tag_Add(&sector->tags, (INT32)sides[line->sidenum[0]].textureoffset / FRACUNIT); Tag_Add(&sector->tags, (INT32)sides[line->sidenum[0]].textureoffset / FRACUNIT);
if (sides[line->sidenum[0]].rowoffset) if (sides[line->sidenum[0]].rowoffset)
@ -3756,7 +3756,7 @@ static void P_AddBinaryMapTags(void)
tag = Tag_FGet(&lines[i].frontsector->tags); tag = Tag_FGet(&lines[i].frontsector->tags);
target_tag = Tag_FGet(&lines[i].tags); target_tag = Tag_FGet(&lines[i].tags);
memset(offset_tags, 0, sizeof(mtag_t)*4); memset(offset_tags, 0, sizeof(mtag_t)*4);
if (lines[i].flags & ML_EFFECT6) { if (lines[i].flags & ML_BLOCKMONSTERS) {
offset_tags[0] = (INT32)sides[lines[i].sidenum[0]].textureoffset / FRACUNIT; offset_tags[0] = (INT32)sides[lines[i].sidenum[0]].textureoffset / FRACUNIT;
offset_tags[1] = (INT32)sides[lines[i].sidenum[0]].rowoffset / FRACUNIT; offset_tags[1] = (INT32)sides[lines[i].sidenum[0]].rowoffset / FRACUNIT;
} }
@ -3975,7 +3975,7 @@ static void P_ConvertBinaryLinedefTypes(void)
lines[i].args[1] = TMP_BOTH; lines[i].args[1] = TMP_BOTH;
lines[i].flags &= ~(ML_NETONLY|ML_NONET); lines[i].flags &= ~(ML_NETONLY|ML_NONET);
if (lines[i].flags & ML_EFFECT6) // Set offset through x and y texture offsets if (lines[i].flags & ML_BLOCKMONSTERS) // Set offset through x and y texture offsets
{ {
angle_t flatangle = InvAngle(R_PointToAngle2(lines[i].v1->x, lines[i].v1->y, lines[i].v2->x, lines[i].v2->y)); angle_t flatangle = InvAngle(R_PointToAngle2(lines[i].v1->x, lines[i].v1->y, lines[i].v2->x, lines[i].v2->y));
fixed_t xoffs = sides[lines[i].sidenum[0]].textureoffset; fixed_t xoffs = sides[lines[i].sidenum[0]].textureoffset;
@ -4093,7 +4093,7 @@ static void P_ConvertBinaryLinedefTypes(void)
lines[i].args[3] &= ~TMPF_INVISIBLEPLANES; lines[i].args[3] &= ~TMPF_INVISIBLEPLANES;
/*if (lines[paramline].flags & ML_WRAPMIDTEX) /*if (lines[paramline].flags & ML_WRAPMIDTEX)
lines[i].args[3] |= TMPF_DONTCLIPPLANES;*/ lines[i].args[3] |= TMPF_DONTCLIPPLANES;*/
if (lines[paramline].flags & ML_EFFECT6) if (lines[paramline].flags & ML_BLOCKMONSTERS)
lines[i].args[3] |= TMPF_SPLAT; lines[i].args[3] |= TMPF_SPLAT;
if (lines[paramline].flags & ML_NOCLIMB) if (lines[paramline].flags & ML_NOCLIMB)
lines[i].args[3] |= TMPF_EXECUTOR; lines[i].args[3] |= TMPF_EXECUTOR;
@ -4198,6 +4198,10 @@ static void P_ConvertBinaryLinedefTypes(void)
lines[i].args[0] = tag; lines[i].args[0] = tag;
lines[i].args[1] = P_AproxDistance(lines[i].dx, lines[i].dy) >> FRACBITS; lines[i].args[1] = P_AproxDistance(lines[i].dx, lines[i].dy) >> FRACBITS;
break; break;
case 81: //Block enemies
lines[i].flags |= ML_BLOCKMONSTERS;
lines[i].special = 0;
break;
case 100: //FOF: solid, opaque, shadowcasting case 100: //FOF: solid, opaque, shadowcasting
case 101: //FOF: solid, opaque, non-shadowcasting case 101: //FOF: solid, opaque, non-shadowcasting
case 102: //FOF: solid, translucent case 102: //FOF: solid, translucent
@ -4229,7 +4233,7 @@ static void P_ConvertBinaryLinedefTypes(void)
lines[i].args[3] |= TMFA_NOPLANES; lines[i].args[3] |= TMFA_NOPLANES;
if (lines[i].special != 100 && (lines[i].special != 104 || !(lines[i].flags & ML_NOCLIMB))) if (lines[i].special != 100 && (lines[i].special != 104 || !(lines[i].flags & ML_NOCLIMB)))
lines[i].args[3] |= TMFA_NOSHADE; lines[i].args[3] |= TMFA_NOSHADE;
if (lines[i].flags & ML_EFFECT6) if (lines[i].flags & ML_BLOCKMONSTERS)
lines[i].args[3] |= TMFA_SPLAT; lines[i].args[3] |= TMFA_SPLAT;
//Tangibility //Tangibility
@ -4277,7 +4281,7 @@ static void P_ConvertBinaryLinedefTypes(void)
lines[i].args[3] |= TMFW_GOOWATER; lines[i].args[3] |= TMFW_GOOWATER;
//Splat rendering? //Splat rendering?
if (lines[i].flags & ML_EFFECT6) if (lines[i].flags & ML_BLOCKMONSTERS)
lines[i].args[3] |= TMFW_SPLAT; lines[i].args[3] |= TMFW_SPLAT;
lines[i].special = 120; lines[i].special = 120;
@ -4312,7 +4316,7 @@ static void P_ConvertBinaryLinedefTypes(void)
lines[i].args[3] |= TMFA_NOPLANES; lines[i].args[3] |= TMFA_NOPLANES;
if (lines[i].special != 146 && (lines[i].flags & ML_NOCLIMB)) if (lines[i].special != 146 && (lines[i].flags & ML_NOCLIMB))
lines[i].args[3] |= TMFA_NOSHADE; lines[i].args[3] |= TMFA_NOSHADE;
if (lines[i].flags & ML_EFFECT6) if (lines[i].flags & ML_BLOCKMONSTERS)
lines[i].args[3] |= TMFA_SPLAT; lines[i].args[3] |= TMFA_SPLAT;
//Tangibility //Tangibility
@ -4388,7 +4392,7 @@ static void P_ConvertBinaryLinedefTypes(void)
lines[i].args[4] |= TMFC_AIRBOB; lines[i].args[4] |= TMFC_AIRBOB;
if (lines[i].special >= 176 && lines[i].special <= 179) if (lines[i].special >= 176 && lines[i].special <= 179)
lines[i].args[4] |= TMFC_FLOATBOB; lines[i].args[4] |= TMFC_FLOATBOB;
if (lines[i].flags & ML_EFFECT6) if (lines[i].flags & ML_BLOCKMONSTERS)
lines[i].args[4] |= TMFC_SPLAT; lines[i].args[4] |= TMFC_SPLAT;
if (lines[i].flags & ML_SKEWTD) if (lines[i].flags & ML_SKEWTD)
@ -4425,7 +4429,7 @@ static void P_ConvertBinaryLinedefTypes(void)
lines[i].args[3] |= TMFA_INSIDES; lines[i].args[3] |= TMFA_INSIDES;
if (lines[i].special != 190 && (lines[i].special <= 193 || lines[i].flags & ML_NOCLIMB)) if (lines[i].special != 190 && (lines[i].special <= 193 || lines[i].flags & ML_NOCLIMB))
lines[i].args[3] |= TMFA_NOSHADE; lines[i].args[3] |= TMFA_NOSHADE;
if (lines[i].flags & ML_EFFECT6) if (lines[i].flags & ML_BLOCKMONSTERS)
lines[i].args[3] |= TMFA_SPLAT; lines[i].args[3] |= TMFA_SPLAT;
//Tangibility //Tangibility
@ -4482,7 +4486,7 @@ static void P_ConvertBinaryLinedefTypes(void)
lines[i].args[3] |= TMFA_INSIDES; lines[i].args[3] |= TMFA_INSIDES;
if (lines[i].special != 220 && !(lines[i].flags & ML_NOCLIMB)) if (lines[i].special != 220 && !(lines[i].flags & ML_NOCLIMB))
lines[i].args[3] |= TMFA_NOSHADE; lines[i].args[3] |= TMFA_NOSHADE;
if (lines[i].flags & ML_EFFECT6) if (lines[i].flags & ML_BLOCKMONSTERS)
lines[i].args[3] |= TMFA_SPLAT; lines[i].args[3] |= TMFA_SPLAT;
lines[i].special = 220; lines[i].special = 220;
@ -4548,7 +4552,7 @@ static void P_ConvertBinaryLinedefTypes(void)
} }
if (lines[i].special == 252 && lines[i].flags & ML_NOCLIMB) if (lines[i].special == 252 && lines[i].flags & ML_NOCLIMB)
lines[i].args[4] |= TMFB_ONLYBOTTOM; lines[i].args[4] |= TMFB_ONLYBOTTOM;
if (lines[i].flags & ML_EFFECT6) if (lines[i].flags & ML_BLOCKMONSTERS)
lines[i].args[4] |= TMFB_SPLAT; lines[i].args[4] |= TMFB_SPLAT;
lines[i].special = 254; lines[i].special = 254;
@ -4570,7 +4574,7 @@ static void P_ConvertBinaryLinedefTypes(void)
if (lines[i].flags & ML_SKEWTD) if (lines[i].flags & ML_SKEWTD)
lines[i].args[3] |= TMFL_NOBOSSES; lines[i].args[3] |= TMFL_NOBOSSES;
//Replicate old hack: Translucent FOFs set to full opacity cut cyan pixels //Replicate old hack: Translucent FOFs set to full opacity cut cyan pixels
if (lines[i].flags & ML_EFFECT6 || lines[i].args[1] == 256) if (lines[i].flags & ML_BLOCKMONSTERS || lines[i].args[1] == 256)
lines[i].args[3] |= TMFL_SPLAT; lines[i].args[3] |= TMFL_SPLAT;
break; break;
@ -4580,7 +4584,7 @@ static void P_ConvertBinaryLinedefTypes(void)
lines[i].args[0] = tag; lines[i].args[0] = tag;
lines[i].args[3] = P_GetFOFFlags(sides[lines[i].sidenum[1]].toptexture); lines[i].args[3] = P_GetFOFFlags(sides[lines[i].sidenum[1]].toptexture);
if (lines[i].flags & ML_EFFECT6) if (lines[i].flags & ML_BLOCKMONSTERS)
lines[i].args[3] |= FOF_SPLAT; lines[i].args[3] |= FOF_SPLAT;
lines[i].args[4] = P_GetFOFBusttype(sides[lines[i].sidenum[1]].toptexture); lines[i].args[4] = P_GetFOFBusttype(sides[lines[i].sidenum[1]].toptexture);
if (sides[lines[i].sidenum[1]].toptexture & FF_OLD_SHATTERBOTTOM) if (sides[lines[i].sidenum[1]].toptexture & FF_OLD_SHATTERBOTTOM)
@ -5656,7 +5660,7 @@ static void P_ConvertBinaryLinedefTypes(void)
lines[i].args[1] = tag; lines[i].args[1] = tag;
if (lines[i].flags & ML_EFFECT6) if (lines[i].flags & ML_BLOCKMONSTERS)
{ {
UINT8 side = lines[i].special >= 714; UINT8 side = lines[i].special >= 714;

View file

@ -525,7 +525,7 @@ typedef struct line_s
angle_t angle; // Precalculated angle between dx and dy angle_t angle; // Precalculated angle between dx and dy
// Animation related. // Animation related.
INT16 flags; UINT32 flags;
INT16 special; INT16 special;
taglist_t tags; taglist_t tags;
INT32 args[NUMLINEARGS]; INT32 args[NUMLINEARGS];

View file

@ -411,7 +411,7 @@ slope_sector
(*slope) = new_vertex_slope(anchors, flags); (*slope) = new_vertex_slope(anchors, flags);
/* Effect 6 - invert slope to opposite side */ /* Effect 6 - invert slope to opposite side */
if (flags & ML_EFFECT6) if (flags & ML_BLOCKMONSTERS)
{ {
(*alt) = new_vertex_slope(flip_slope(anchors, sector), flags); (*alt) = new_vertex_slope(flip_slope(anchors, sector), flags);
} }
@ -446,7 +446,7 @@ make_anchored_slope
if (plane == (FLOOR|CEILING)) if (plane == (FLOOR|CEILING))
{ {
flags &= ~ML_EFFECT6; flags &= ~ML_BLOCKMONSTERS;
} }
if (plane & FLOOR) if (plane & FLOOR)