Implement FOF type 257

This commit is contained in:
MascaraSnake 2020-04-14 11:56:11 +02:00
parent e3b86d0c74
commit 5389344a32
4 changed files with 35 additions and 3 deletions

View file

@ -1744,6 +1744,31 @@ udmf
} }
} }
257
{
title = "Quicksand";
prefix = "(257)";
arg0
{
title = "Target sector tag";
type = 13;
}
arg1
{
title = "Ripple effect?";
type = 11;
enum = "yesno";
}
arg2
{
title = "Sinking speed";
}
arg3
{
title = "Friction";
}
}
258 258
{ {
title = "Laser"; title = "Laser";

View file

@ -3022,6 +3022,13 @@ static void P_ConvertBinaryMap(void)
lines[i].special = 254; lines[i].special = 254;
break; break;
case 257: //FOF: Quicksand
lines[i].args[0] = lines[i].tag;
if (!(lines[i].flags & ML_EFFECT5))
lines[i].args[1] = 1; //No ripple effect
lines[i].args[2] = lines[i].dx >> FRACBITS; //Sinking speed
lines[i].args[3] = lines[i].dy >> FRACBITS; //Friction
break;
case 258: //FOF: Laser case 258: //FOF: Laser
lines[i].args[0] = lines[i].tag; lines[i].args[0] = lines[i].tag;
if (lines[i].flags & ML_EFFECT1) if (lines[i].flags & ML_EFFECT1)

View file

@ -7041,7 +7041,7 @@ void P_SpawnSpecials(boolean fromnetsave)
case 257: // Quicksand case 257: // Quicksand
ffloorflags = FF_EXISTS|FF_QUICKSAND|FF_RENDERALL|FF_ALLSIDES|FF_CUTSPRITES; ffloorflags = FF_EXISTS|FF_QUICKSAND|FF_RENDERALL|FF_ALLSIDES|FF_CUTSPRITES;
if (lines[i].flags & ML_EFFECT5) if (!(lines[i].args[1]))
ffloorflags |= FF_RIPPLE; ffloorflags |= FF_RIPPLE;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers); P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);

View file

@ -2844,7 +2844,7 @@ static void P_CheckQuicksand(player_t *player)
if (topheight >= player->mo->z && bottomheight < player->mo->z + player->mo->height) if (topheight >= player->mo->z && bottomheight < player->mo->z + player->mo->height)
{ {
sinkspeed = abs(rover->master->v1->x - rover->master->v2->x)>>1; sinkspeed = abs(rover->master->args[2]) << (FRACBITS - 1);
sinkspeed = FixedDiv(sinkspeed,TICRATE*FRACUNIT); sinkspeed = FixedDiv(sinkspeed,TICRATE*FRACUNIT);
@ -2873,7 +2873,7 @@ static void P_CheckQuicksand(player_t *player)
P_PlayerHitFloor(player, false); P_PlayerHitFloor(player, false);
} }
friction = abs(rover->master->v1->y - rover->master->v2->y)>>6; friction = abs(rover->master->args[3]) << (FRACBITS - 6);
player->mo->momx = FixedMul(player->mo->momx, friction); player->mo->momx = FixedMul(player->mo->momx, friction);
player->mo->momy = FixedMul(player->mo->momy, friction); player->mo->momy = FixedMul(player->mo->momy, friction);