Adapt moving platform linedef specials to UDMF

This commit is contained in:
MascaraSnake 2021-06-25 11:33:16 +02:00
parent 259700be3c
commit 770612bc9d
3 changed files with 86 additions and 9 deletions

View file

@ -1566,6 +1566,44 @@ udmf
} }
} }
planemove
{
title = "Plane Movement";
60
{
title = "Activate Moving Platform";
prefix = "(60)";
arg0
{
title = "Target sector tag";
type = 13;
}
arg1
{
title = "Speed";
}
arg2
{
title = "Starting delay";
}
arg3
{
title = "Delay before flip";
}
arg4
{
title = "Starting direction";
type = 11;
enum
{
0 = "Down";
1 = "Up";
}
}
}
}
fofmodifiers fofmodifiers
{ {
title = "FOF Modifiers"; title = "FOF Modifiers";
@ -2243,6 +2281,44 @@ udmf
} }
} }
linedefexecplane
{
title = "Linedef Executor (plane movement)";
428
{
title = "Start Platform Movement";
prefix = "(428)";
arg0
{
title = "Target sector tag";
type = 13;
}
arg1
{
title = "Speed";
}
arg2
{
title = "Starting delay";
}
arg3
{
title = "Delay before flip";
}
arg4
{
title = "Starting direction";
type = 11;
enum
{
0 = "Down";
1 = "Up";
}
}
}
}
linedefexecmisc linedefexecmisc
{ {
title = "Linedef Executor (misc.)"; title = "Linedef Executor (misc.)";

View file

@ -2045,6 +2045,7 @@ void EV_DoElevator(mtag_t tag, line_t *line, elevator_e elevtype)
elevator->type = elevtype; elevator->type = elevtype;
elevator->sourceline = line; elevator->sourceline = line;
elevator->distance = 1; // Always crush unless otherwise elevator->distance = 1; // Always crush unless otherwise
elevator->sector = sec;
// set up the fields according to the type of elevator action // set up the fields according to the type of elevator action
switch (elevtype) switch (elevtype)
@ -2052,7 +2053,6 @@ void EV_DoElevator(mtag_t tag, line_t *line, elevator_e elevtype)
// elevator down to next floor // elevator down to next floor
case elevateDown: case elevateDown:
elevator->direction = -1; elevator->direction = -1;
elevator->sector = sec;
elevator->speed = ELEVATORSPEED/2; // half speed elevator->speed = ELEVATORSPEED/2; // half speed
elevator->floordestheight = P_FindNextLowestFloor(sec, sec->floorheight); elevator->floordestheight = P_FindNextLowestFloor(sec, sec->floorheight);
break; break;
@ -2060,7 +2060,6 @@ void EV_DoElevator(mtag_t tag, line_t *line, elevator_e elevtype)
// elevator up to next floor // elevator up to next floor
case elevateUp: case elevateUp:
elevator->direction = 1; elevator->direction = 1;
elevator->sector = sec;
elevator->speed = ELEVATORSPEED/4; // quarter speed elevator->speed = ELEVATORSPEED/4; // quarter speed
elevator->floordestheight = P_FindNextHighestFloor(sec, sec->floorheight); elevator->floordestheight = P_FindNextHighestFloor(sec, sec->floorheight);
break; break;
@ -2068,14 +2067,12 @@ void EV_DoElevator(mtag_t tag, line_t *line, elevator_e elevtype)
// elevator up to highest floor // elevator up to highest floor
case elevateHighest: case elevateHighest:
elevator->direction = 1; elevator->direction = 1;
elevator->sector = sec;
elevator->speed = ELEVATORSPEED/4; // quarter speed elevator->speed = ELEVATORSPEED/4; // quarter speed
elevator->floordestheight = P_FindHighestFloorSurrounding(sec); elevator->floordestheight = P_FindHighestFloorSurrounding(sec);
break; break;
// elevator to floor height of activating switch's front sector // elevator to floor height of activating switch's front sector
case elevateCurrent: case elevateCurrent:
elevator->sector = sec;
elevator->speed = ELEVATORSPEED; elevator->speed = ELEVATORSPEED;
elevator->floordestheight = line->frontsector->floorheight; elevator->floordestheight = line->frontsector->floorheight;
elevator->direction = elevator->floordestheight > sec->floorheight? 1 : -1; elevator->direction = elevator->floordestheight > sec->floorheight? 1 : -1;
@ -2085,8 +2082,7 @@ void EV_DoElevator(mtag_t tag, line_t *line, elevator_e elevtype)
elevator->origspeed = line->args[1] << (FRACBITS - 2); elevator->origspeed = line->args[1] << (FRACBITS - 2);
elevator->speed = elevator->origspeed; elevator->speed = elevator->origspeed;
elevator->sector = sec; elevator->low = !line->args[4]; // go down first unless args[4] is set
elevator->low = !(line->flags & ML_NOCLIMB); // go down first unless noclimb is on
if (elevator->low) if (elevator->low)
{ {
elevator->direction = 1; elevator->direction = 1;
@ -2100,13 +2096,12 @@ void EV_DoElevator(mtag_t tag, line_t *line, elevator_e elevtype)
elevator->floorwasheight = elevator->sector->floorheight; elevator->floorwasheight = elevator->sector->floorheight;
elevator->ceilingwasheight = elevator->sector->ceilingheight; elevator->ceilingwasheight = elevator->sector->ceilingheight;
elevator->delay = sides[line->sidenum[0]].textureoffset >> FRACBITS; elevator->delay = line->args[3];
elevator->delaytimer = sides[line->sidenum[0]].rowoffset >> FRACBITS; // Initial delay elevator->delaytimer = line->args[2]; // Initial delay
break; break;
case bridgeFall: case bridgeFall:
elevator->direction = -1; elevator->direction = -1;
elevator->sector = sec;
elevator->speed = ELEVATORSPEED*4; // quadruple speed elevator->speed = ELEVATORSPEED*4; // quadruple speed
elevator->floordestheight = P_FindNextLowestFloor(sec, sec->floorheight); elevator->floordestheight = P_FindNextLowestFloor(sec, sec->floorheight);
break; break;

View file

@ -3103,6 +3103,9 @@ static void P_ConvertBinaryMap(void)
case 60: //Activate moving platform (adjustable speed) case 60: //Activate moving platform (adjustable speed)
lines[i].args[0] = tag; lines[i].args[0] = tag;
lines[i].args[1] = (lines[i].special == 60) ? P_AproxDistance(lines[i].dx, lines[i].dy) >> FRACBITS : 8; lines[i].args[1] = (lines[i].special == 60) ? P_AproxDistance(lines[i].dx, lines[i].dy) >> FRACBITS : 8;
lines[i].args[2] = sides[lines[i].sidenum[0]].rowoffset >> FRACBITS;
lines[i].args[3] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
lines[i].args[4] = (lines[i].flags & ML_NOCLIMB) ? 1 : 0;
lines[i].special = 60; lines[i].special = 60;
break; break;
case 61: //Crusher (Ceiling to floor) case 61: //Crusher (Ceiling to floor)
@ -3525,6 +3528,9 @@ static void P_ConvertBinaryMap(void)
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;
lines[i].args[2] = sides[lines[i].sidenum[0]].rowoffset >> FRACBITS;
lines[i].args[3] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
lines[i].args[4] = (lines[i].flags & ML_NOCLIMB) ? 1 : 0;
break; break;
case 429: //Crush ceiling once case 429: //Crush ceiling once
case 430: //Crush floor once case 430: //Crush floor once