Adapt some player-related linedef executors to UDMF

This commit is contained in:
MascaraSnake 2021-09-20 13:31:32 +02:00
parent 4028d392b0
commit 00b04f6d9e
3 changed files with 99 additions and 8 deletions

View file

@ -2876,6 +2876,81 @@ udmf
} }
} }
linedefexecplayer
{
title = "Linedef Executor (player/object)";
426
{
title = "Stop Object";
prefix = "(426)";
arg0
{
title = "Move to center?";
type = 11;
enum = "noyes";
}
}
427
{
title = "Award Score";
prefix = "(427)";
arg0
{
title = "Score";
}
}
432
{
title = "Enable/Disable 2D Mode";
prefix = "(432)";
arg0
{
title = "Mode";
type = 11;
enum
{
0 = "2D";
1 = "3D";
}
}
}
433
{
title = "Enable/Disable Gravity Flip";
prefix = "(433)";
arg0
{
title = "Gravity";
type = 11;
enum
{
0 = "Reverse";
1 = "Normal";
}
}
}
437
{
title = "Disable Player Control";
prefix = "(437)";
arg0
{
title = "Time";
}
arg1
{
title = "Allow jumping?";
type = 11;
enum = "noyes";
}
}
}
linedefexecmisc linedefexecmisc
{ {
title = "Linedef Executor (misc.)"; title = "Linedef Executor (misc.)";

View file

@ -3780,6 +3780,12 @@ static void P_ConvertBinaryMap(void)
lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS; lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
lines[i].args[1] = !!(lines[i].flags & ML_NOCLIMB); lines[i].args[1] = !!(lines[i].flags & ML_NOCLIMB);
break; break;
case 426: //Stop object
lines[i].args[0] = !!(lines[i].flags & ML_NOCLIMB);
break;
case 427: //Award score
lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
break;
case 428: //Start platform movement case 428: //Start platform movement
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;
@ -3804,10 +3810,20 @@ static void P_ConvertBinaryMap(void)
} }
lines[i].special = 429; lines[i].special = 429;
break; break;
case 432: //Enable/disable 2D mode
lines[i].args[0] = !!(lines[i].flags & ML_NOCLIMB);
break;
case 433: //Enable/disable gravity flip
lines[i].args[0] = !!(lines[i].flags & ML_NOCLIMB);
break;
case 435: //Change plane scroller direction case 435: //Change plane scroller direction
lines[i].args[0] = tag; lines[i].args[0] = tag;
lines[i].args[1] = R_PointToDist2(lines[i].v2->x, lines[i].v2->y, lines[i].v1->x, lines[i].v1->y) >> FRACBITS; lines[i].args[1] = R_PointToDist2(lines[i].v2->x, lines[i].v2->y, lines[i].v1->x, lines[i].v1->y) >> FRACBITS;
break; break;
case 437: //Disable player control
lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
lines[i].args[1] = !!(lines[i].flags & ML_NOCLIMB);
break;
case 443: //Call Lua function case 443: //Call Lua function
if (lines[i].text) if (lines[i].text)
{ {

View file

@ -2583,7 +2583,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
if (!mo) if (!mo)
return; return;
if (line->flags & ML_NOCLIMB) if (line->args[0])
{ {
P_UnsetThingPosition(mo); P_UnsetThingPosition(mo);
mo->x = mo->subsector->sector->soundorg.x; mo->x = mo->subsector->sector->soundorg.x;
@ -2618,7 +2618,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
case 427: // Awards points if the mobj is a player case 427: // Awards points if the mobj is a player
if (mo && mo->player) if (mo && mo->player)
P_AddPlayerScore(mo->player, sides[line->sidenum[0]].textureoffset>>FRACBITS); P_AddPlayerScore(mo->player, line->args[0]);
break; break;
case 428: // Start floating platform movement case 428: // Start floating platform movement
@ -2634,10 +2634,10 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
EV_DoCrush(line->args[0], line, crushBothOnce); EV_DoCrush(line->args[0], line, crushBothOnce);
break; break;
case 432: // Enable 2D Mode (Disable if noclimb) case 432: // Enable/Disable 2D Mode
if (mo && mo->player) if (mo && mo->player)
{ {
if (line->flags & ML_NOCLIMB) if (line->args[0])
mo->flags2 &= ~MF2_TWOD; mo->flags2 &= ~MF2_TWOD;
else else
mo->flags2 |= MF2_TWOD; mo->flags2 |= MF2_TWOD;
@ -2651,8 +2651,8 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
} }
break; break;
case 433: // Flip gravity (Flop gravity if noclimb) Works on pushables, too! case 433: // Flip/flop gravity. Works on pushables, too!
if (line->flags & ML_NOCLIMB) if (line->args[0])
mo->flags2 &= ~MF2_OBJECTFLIP; mo->flags2 &= ~MF2_OBJECTFLIP;
else else
mo->flags2 |= MF2_OBJECTFLIP; mo->flags2 |= MF2_OBJECTFLIP;
@ -2750,10 +2750,10 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
case 437: // Disable Player Controls case 437: // Disable Player Controls
if (mo && mo->player) if (mo && mo->player)
{ {
UINT16 fractime = (UINT16)(sides[line->sidenum[0]].textureoffset>>FRACBITS); UINT16 fractime = (UINT16)(line->args[0]);
if (fractime < 1) if (fractime < 1)
fractime = 1; //instantly wears off upon leaving fractime = 1; //instantly wears off upon leaving
if (line->flags & ML_NOCLIMB) if (line->args[1])
fractime |= 1<<15; //more crazy &ing, as if music stuff wasn't enough fractime |= 1<<15; //more crazy &ing, as if music stuff wasn't enough
mo->player->powers[pw_nocontrol] = fractime; mo->player->powers[pw_nocontrol] = fractime;
if (bot) if (bot)