Adapt some parameter linedef types to UDMF

This commit is contained in:
MascaraSnake 2021-12-29 23:03:37 +01:00
parent 208f852c4b
commit 69797377c4
5 changed files with 180 additions and 33 deletions

View file

@ -1652,12 +1652,110 @@ udmf
{
title = "Parameters";
2
{
title = "Custom Exit";
prefix = "(2)";
arg0
{
title = "Next map";
}
arg1
{
title = "Flags";
type = 12;
enum
{
1 = "Skip score tally";
2 = "Check emeralds";
}
}
arg2
{
title = "Next map (all emeralds)";
}
}
3
{
title = "Zoom Tube Parameters";
prefix = "(3)";
arg0
{
title = "Speed";
}
arg1
{
title = "Sequence";
}
arg2
{
title = "Check player direction?";
type = 11;
enum = "yesno";
}
}
4
{
title = "Speed Pad Parameters";
prefix = "(4)";
arg0
{
title = "Speed";
}
arg1
{
title = "Flags";
type = 12;
enum
{
1 = "No teleport to center";
2 = "Force spinning frames";
}
}
stringarg0
{
title = "Sound";
}
}
11
{
title = "Rope Hang Parameters";
prefix = "(11)";
arg0
{
title = "Speed";
}
arg1
{
title = "Sequence";
}
arg2
{
title = "Loop?";
type = 11;
enum = "yesno";
}
}
15
{
title = "Fan Particle Generator Heights";
prefix = "(15)";
}
16
{
title = "Minecart Parameters";
prefix = "(16)";
arg0
{
title = "Order";
}
}
64
{
title = "Continuously Appearing/Disappearing FOF";

View file

@ -3179,6 +3179,25 @@ static void P_ConvertBinaryMap(void)
switch (lines[i].special)
{
case 2: //Custom exit
if (lines[i].flags & ML_NOCLIMB)
lines[i].args[1] |= TMEF_SKIPTALLY;
if (lines[i].flags & ML_BLOCKMONSTERS)
lines[i].args[1] |= TMEF_EMERALDCHECK;
break;
case 3: //Zoom tube parameters
lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
lines[i].args[1] = sides[lines[i].sidenum[0]].rowoffset >> FRACBITS;
lines[i].args[2] = !!(lines[i].flags & ML_EFFECT4);
break;
case 4: //Speed pad parameters
lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
if (lines[i].flags & ML_EFFECT4)
lines[i].args[1] |= TMSP_NOTELEPORT;
if (lines[i].flags & ML_EFFECT5)
lines[i].args[1] |= TMSP_FORCESPIN;
P_WriteConstant(sides[lines[i].sidenum[0]].toptexture ? sides[lines[i].sidenum[0]].toptexture : sfx_spdpad, &lines[i].stringargs[0]);
break;
case 7: //Sector flat alignment
lines[i].args[0] = tag;
if ((lines[i].flags & (ML_NETONLY|ML_NONET)) == (ML_NETONLY|ML_NONET))
@ -3216,6 +3235,14 @@ static void P_ConvertBinaryMap(void)
lines[i].args[0] = tag;
lines[i].args[1] = !!(lines[i].flags & ML_NOCLIMB);
break;
case 11: //Rope hang parameters
lines[i].args[0] = (lines[i].flags & ML_NOCLIMB) ? 0 : sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
lines[i].args[1] = sides[lines[i].sidenum[0]].rowoffset >> FRACBITS;
lines[i].args[2] = !!(lines[i].flags & ML_EFFECT1);
break;
case 16: //Minecart parameters
lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
break;
case 20: //PolyObject first line
{
INT32 check = -1;

View file

@ -4311,15 +4311,36 @@ static void P_ProcessEggCapsule(player_t *player, sector_t *sector)
static void P_ProcessSpeedPad(player_t *player, sector_t *sector, sector_t *roversector, mtag_t sectag)
{
INT32 lineindex;
INT32 lineindex = -1;
angle_t lineangle;
fixed_t linespeed;
fixed_t sfxnum;
size_t i;
if (player->powers[pw_flashing] != 0 && player->powers[pw_flashing] < TICRATE/2)
return;
lineindex = Tag_FindLineSpecial(4, sectag);
// Try for lines facing the sector itself, with tag 0.
for (i = 0; i < sector->linecount; i++)
{
line_t *li = sector->lines[i];
if (li->frontsector != sector)
continue;
if (li->special != 4)
continue;
if (!Tag_Find(&li->tags, 0))
continue;
lineindex = li - lines;
break;
}
// Nothing found? Look via tag.
if (lineindex == -1)
lineindex = Tag_FindLineSpecial(4, sectag);
if (lineindex == -1)
{
@ -4328,7 +4349,7 @@ static void P_ProcessSpeedPad(player_t *player, sector_t *sector, sector_t *rove
}
lineangle = R_PointToAngle2(lines[lineindex].v1->x, lines[lineindex].v1->y, lines[lineindex].v2->x, lines[lineindex].v2->y);
linespeed = sides[lines[lineindex].sidenum[0]].textureoffset;
linespeed = lines[lineindex].args[0] << FRACBITS;
if (linespeed == 0)
{
@ -4341,7 +4362,7 @@ static void P_ProcessSpeedPad(player_t *player, sector_t *sector, sector_t *rove
if (!demoplayback || P_ControlStyle(player) == CS_LMAOGALOG)
P_SetPlayerAngle(player, player->mo->angle);
if (!(lines[lineindex].flags & ML_EFFECT4))
if (!(lines[lineindex].args[1] & TMSP_NOTELEPORT))
{
P_UnsetThingPosition(player->mo);
if (roversector) // make FOF speed pads work
@ -4359,7 +4380,7 @@ static void P_ProcessSpeedPad(player_t *player, sector_t *sector, sector_t *rove
P_InstaThrust(player->mo, player->mo->angle, linespeed);
if (lines[lineindex].flags & ML_EFFECT5) // Roll!
if (lines[lineindex].args[1] & TMSP_FORCESPIN) // Roll!
{
if (!(player->pflags & PF_SPINNING))
player->pflags |= PF_SPINNING;
@ -4369,7 +4390,7 @@ static void P_ProcessSpeedPad(player_t *player, sector_t *sector, sector_t *rove
player->powers[pw_flashing] = TICRATE/3;
sfxnum = sides[lines[lineindex].sidenum[0]].toptexture;
sfxnum = lines[lineindex].stringargs[0] ? get_number(lines[lineindex].stringargs[0]) : sfx_spdpad;
if (!sfxnum)
sfxnum = sfx_spdpad;
@ -4414,13 +4435,13 @@ static void P_ProcessExitSector(player_t *player, boolean isTouching, mtag_t sec
return;
}
// Special goodies with the block monsters flag depending on emeralds collected
if ((lines[lineindex].flags & ML_BLOCKMONSTERS) && ALL7EMERALDS(emeralds))
nextmapoverride = (INT16)(lines[lineindex].frontsector->ceilingheight>>FRACBITS);
// Special goodies depending on emeralds collected
if ((lines[lineindex].args[1] & TMEF_EMERALDCHECK) && ALL7EMERALDS(emeralds))
nextmapoverride = (INT16)(udmf ? lines[lineindex].args[2] : lines[lineindex].frontsector->ceilingheight>>FRACBITS);
else
nextmapoverride = (INT16)(lines[lineindex].frontsector->floorheight>>FRACBITS);
nextmapoverride = (INT16)(udmf ? lines[lineindex].args[0] : lines[lineindex].frontsector->floorheight>>FRACBITS);
if (lines[lineindex].flags & ML_NOCLIMB)
if (lines[lineindex].args[1] & TMEF_SKIPTALLY)
skipstats = 1;
}
@ -4491,10 +4512,10 @@ static void P_ProcessZoomTube(player_t *player, sector_t *sector, mtag_t sectag,
}
// Grab speed and sequence values
speed = abs(sides[lines[lineindex].sidenum[0]].textureoffset)/8;
speed = abs(lines[lineindex].args[0])<<(FRACBITS-3);
if (end)
speed *= -1;
sequence = abs(sides[lines[lineindex].sidenum[0]].rowoffset)>>FRACBITS;
sequence = abs(lines[lineindex].args[1]);
if (speed == 0)
{
@ -4514,7 +4535,7 @@ static void P_ProcessZoomTube(player_t *player, sector_t *sector, mtag_t sectag,
an = R_PointToAngle2(player->mo->x, player->mo->y, waypoint->x, waypoint->y) - player->mo->angle;
if (an > ANGLE_90 && an < ANGLE_270 && !(lines[lineindex].flags & ML_EFFECT4))
if (an > ANGLE_90 && an < ANGLE_270 && !(lines[lineindex].args[2]))
return; // behind back
P_SetTarget(&player->mo->tracer, waypoint);
@ -4625,14 +4646,8 @@ static void P_ProcessRopeHang(player_t *player, sector_t *sector, mtag_t sectag)
}
// Grab speed and sequence values
speed = abs(sides[lines[lineindex].sidenum[0]].textureoffset)/8;
sequence = abs(sides[lines[lineindex].sidenum[0]].rowoffset)>>FRACBITS;
if (speed == 0)
{
CONS_Debug(DBG_GAMELOGIC, "ERROR: Waypoint sequence %d at zero speed.\n", sequence);
return;
}
speed = abs(lines[lineindex].args[0]) << (FRACBITS - 3);
sequence = abs(lines[lineindex].args[1]);
// Find the closest waypoint
// Find the preceding waypoint
@ -4694,21 +4709,21 @@ static void P_ProcessRopeHang(player_t *player, sector_t *sector, mtag_t sectag)
P_ResetPlayer(player);
player->mo->momx = player->mo->momy = player->mo->momz = 0;
if (lines[lineindex].flags & ML_EFFECT1) // Don't wrap
if (lines[lineindex].args[2]) // Don't wrap
{
mobj_t *highest = P_GetLastWaypoint(sequence);
highest->flags |= MF_SLIDEME;
}
// Changing the conditions on these ifs to fix issues with snapping to the wrong spot -Red
if ((lines[lineindex].flags & ML_EFFECT1) && waypointmid->health == 0)
if ((lines[lineindex].args[2]) && waypointmid->health == 0)
{
closest = waypointhigh;
player->mo->x = resulthigh.x;
player->mo->y = resulthigh.y;
player->mo->z = resulthigh.z - P_GetPlayerHeight(player);
}
else if ((lines[lineindex].flags & ML_EFFECT1) && waypointmid->health == numwaypoints[sequence] - 1)
else if ((lines[lineindex].args[2]) && waypointmid->health == numwaypoints[sequence] - 1)
{
closest = waypointmid;
player->mo->x = resultlow.x;
@ -4739,12 +4754,7 @@ static void P_ProcessRopeHang(player_t *player, sector_t *sector, mtag_t sectag)
P_SetTarget(&player->mo->tracer, closest);
player->powers[pw_carry] = CR_ROPEHANG;
// Option for static ropes.
if (lines[lineindex].flags & ML_NOCLIMB)
player->speed = 0;
else
player->speed = speed;
player->speed = speed;
S_StartSound(player->mo, sfx_s3k4a);

View file

@ -122,6 +122,18 @@ typedef enum
TMB_BARRIER = 1<<1,
} textmapbrakflags_t;
typedef enum
{
TMEF_SKIPTALLY = 1,
TMEF_EMERALDCHECK = 1<<1,
} textmapexitflags_t;
typedef enum
{
TMSP_NOTELEPORT = 1,
TMSP_FORCESPIN = 1<<1,
} textmapspeedpadflags_t;
//FOF flags
typedef enum
{

View file

@ -10768,7 +10768,7 @@ static mobj_t *P_LookForRails(mobj_t* mobj, fixed_t c, fixed_t s, angle_t target
fixed_t nx, ny;
angle_t nang, dummy, angdiff;
mobj_t *mark;
mobj_t *snax = P_GetAxis(sides[lines[lline].sidenum[0]].textureoffset >> FRACBITS);
mobj_t *snax = P_GetAxis(lines[lline].args[0]);
if (!snax)
return NULL;
P_GetAxisPosition(x, y, snax, &nx, &ny, &nang, &dummy);
@ -10870,7 +10870,7 @@ static void P_MinecartThink(player_t *player)
// Update axis if the cart is standing on a rail.
if (sec && lnum != -1)
{
mobj_t *axis = P_GetAxis(sides[lines[lnum].sidenum[0]].textureoffset >> FRACBITS);
mobj_t *axis = P_GetAxis(lines[lnum].args[0]);
fixed_t newx, newy;
angle_t targetangle, grind;
angle_t prevangle, angdiff;