Convert remaining FOF types.

This commit is contained in:
Nev3r 2020-03-11 11:21:12 +01:00
parent b90aa624f5
commit d28eb4dd45
6 changed files with 820 additions and 214 deletions

View file

@ -2567,6 +2567,450 @@ udmf
}
}
}
220
{
title = "Intangible";
prefix = "(220)";
flags8text = "[3] Slope skew sides";
3dfloor = true;
3dfloorflags = "8F19";
arg0
{
title = "Sector tag";
type = 13;
}
arg1
{
title = "Flags";
type = 12;
enum
{
1 = "Translucent";
2 = "No shadow";
4 = "Don't render planes";
}
}
}
223
{
title = "Intangible, Invisible";
prefix = "(223)";
3dfloor = true;
3dfloorflags = "41";
arg0
{
title = "Sector tag";
type = 13;
}
}
150
{
title = "Air Bobbing";
prefix = "(150)";
flags8text = "[3] Slope skew sides";
3dfloor = true;
3dfloorflags = "19F";
arg0
{
title = "Sector tag";
type = 13;
}
arg1
{
title = "Bobbing distance"; //Negative for reverse bobbing
}
arg2
{
title = "Spindash to bob?";
type = 12;
enum = "noyes";
}
arg3
{
title = "Tangibility";
type = 12;
enum = "tangibility";
}
}
160
{
title = "Floating, Bobbing";
prefix = "(160)";
flags8text = "[3] Slope skew sides";
3dfloor = true;
3dfloorflags = "4019F";
arg0
{
title = "Sector tag";
type = 13;
}
arg1
{
title = "Tangibility";
type = 12;
enum = "tangibility";
}
}
170
{
title = "Crumbling";
prefix = "(170)";
flags8text = "[3] Slope skew sides";
3dfloor = true;
3dfloorflags = "10019F";
arg0
{
title = "Sector tag";
type = 13;
}
arg1
{
title = "Tangibility";
type = 12;
enum = "tangibility";
}
arg2
{
title = "Flags";
type = 12;
enum
{
1 = "Don't respawn";
2 = "Translucent";
4 = "Bobbing";
8 = "Spindash to bob";
16 = "Float on water";
32 = "No shadow";
}
}
arg3
{
title = "Bobbing distance";
}
}
190
{
title = "Rising Platform";
prefix = "(190)";
flags8text = "[3] Slope skew sides";
3dfloor = true;
3dfloorflags = "19F";
arg0
{
title = "Sector tag";
type = 13;
}
arg1
{
title = "Speed";
}
arg2
{
title = "Spindash to move?";
type = 11;
enum = "noyes";
}
arg3
{
title = "Tangibility";
type = 12;
enum = "tangibility";
}
arg4
{
title = "Visibility";
type = 11;
enum
{
0 = "Opaque";
1 = "Translucent";
2 = "Invisible";
}
}
arg5
{
title = "Shadow?";
type = 11;
enum = "yesno";
}
}
}
fofspecial
{
title = "FOF (special)";
200
{
title = "Light Block";
prefix = "(200)";
3dfloor = true;
3dfloorflags = "20201";
arg0
{
title = "Sector tag";
type = 13;
}
arg1
{
title = "Expand to bottom?";
type = 11;
enum = "noyes";
}
}
202
{
title = "Fog Block";
prefix = "(202)";
3dfloor = true;
3dfloorflags = "3EF19";
arg0
{
title = "Sector tag";
type = 13;
}
}
250
{
title = "Mario Block";
prefix = "(250)";
3dfloor = true;
3dfloorflags = "40019F";
arg0
{
title = "Sector tag";
type = 13;
}
arg1
{
title = "Block type";
type = 11;
enum
{
0 = "Normal";
1 = "Brick";
2 = "Invisible";
3 = "Invisible brick";
}
}
}
251
{
title = "Thwomp Block";
prefix = "(251)";
3dfloor = true;
3dfloorflags = "19F";
arg0
{
title = "Sector tag";
type = 13;
}
arg1
{
title = "Falling speed";
default = 80;
}
arg2
{
title = "Rising speed";
default = 16;
}
arg0str
{
title = "Crushing sound";
}
}
254
{
title = "Bustable Block";
prefix = "(254)";
flags8text = "[3] Slope skew sides";
3dfloor = true;
3dfloorflags = "80001F";
flags643dfloorflagsadd = "20000000";
arg0
{
title = "Sector tag";
type = 13;
}
arg1
{
title = "Busted by";
type = 11;
enum
{
0 = "Touching";
1 = "Spinning";
2 = "Spindashing";
3 = "Knuckles touching";
}
}
arg2
{
title = "Translucent?";
type = 11;
enum = "noyes";
}
arg3
{
title = "Tangibility";
type = 12;
enum = "tangibility";
}
arg4
{
title = "Flags";
type = 12;
enum
{
1 = "Bustable by pushables";
2 = "Trigger linedef executor";
4 = "Only from below";
}
}
arg5
{
title = "Linedef executor tag";
}
}
257
{
title = "Quicksand";
prefix = "(257)";
flags8text = "[3] Slope skew sides";
3dfloor = true;
3dfloorflags = "1008219";
flags10243dfloorflagsadd = "40000000";
arg0
{
title = "Sector tag";
type = 13;
}
arg1
{
title = "Ripple effect?";
type = 11;
enum = "yesno";
}
arg2
{
title = "Sinking speed";
default = 32;
}
arg3
{
title = "Sludginess";
default = 32;
}
}
258
{
title = "Laser";
prefix = "(258)";
flags8text = "[3] Slope skew sides";
3dfloor = true;
3dfloorflags = "959";
arg0
{
title = "Sector tag";
type = 13;
}
arg1
{
title = "Damage bosses?";
type = 11;
enum = "yesno";
}
}
259
{
title = "Custom FOF";
prefix = "(259)";
3dfloor = true;
3dfloorcustom = true;
arg0
{
title = "Sector tag";
type = 13;
}
arg1
{
title = "Flags";
type = 12;
enum
{
1 = "Exists";
2 = "Block players";
4 = "Block other objects";
8 = "Render sides";
16 = "Render planes";
32 = "Water";
64 = "No shadow";
128 = "Cut obscured solid pixels";
256 = "Cut obscured translucent pixels";
512 = "Split sprites";
1024 = "Always render both planes";
2048 = "Can be obscured";
4096 = "Translucent";
8192 = "Fog";
16384 = "Invert planes";
32768 = "Render insides and outsides";
65536 = "Render only insides";
131072 = "Separate shadow";
262144 = "Float and bob";
524288 = "No respawn";
1048576 = "Crumbling";
2097152 = "Shatter bottom/Goo water";
4194304 = "Mario block";
8388608 = "Bustable";
16777216 = "Quicksand";
33554432 = "Intangible from below";
67108864 = "Intangible from above";
134217728 = "Shatter block";
268435456 = "Spin-bustable";
536870912 = "Knuckles-bustable";
1073741824 = "Ripple effect";
2147483648 = "Ignore light level";
}
arg2
{
title = "Quicksand sinking speed";
default = 32;
}
arg3
{
title = "Quicksand sludginess";
default = 32;
}
arg4
{
title = "Bustable block flags";
type = 12;
enum
{
1 = "Shattered by pushables";
2 = "Trigger linedef executor";
}
}
arg5
{
title = "Bustable block tag";
}
}
}
}
slope

View file

@ -1887,10 +1887,7 @@ void T_ThwompSector(levelspecthink_t *thwomp)
sides[thwomp->sourceline->sidenum[0]].midtexture = sides[thwomp->sourceline->sidenum[0]].bottomtexture;
/// \note this should only have to be done once, but is already done repeatedly, above
if (thwomp->sourceline->flags & ML_EFFECT5)
thwomp->speed = thwomp->sourceline->dx/8;
else
thwomp->speed = 2*FRACUNIT;
thwomp->speed = thwomp->sourceline->args[2]/8;
res = T_MovePlane
(
@ -1926,10 +1923,7 @@ void T_ThwompSector(levelspecthink_t *thwomp)
// Set the texture from the upper one (angry)
sides[thwomp->sourceline->sidenum[0]].midtexture = sides[thwomp->sourceline->sidenum[0]].toptexture;
if (thwomp->sourceline->flags & ML_EFFECT5)
thwomp->speed = thwomp->sourceline->dy/8;
else
thwomp->speed = 10*FRACUNIT;
thwomp->speed = thwomp->sourceline->args[1]/8;
res = T_MovePlane
(
@ -2432,7 +2426,7 @@ void T_RaiseSector(levelspecthink_t *raise)
if (raise->sector->crumblestate >= 3 || raise->sector->ceilingdata)
return;
for (i = -1; (i = P_FindSectorFromTag(raise->sourceline->tag, i)) >= 0 ;)
for (i = -1; (i = P_FindSectorFromTag(raise->sourceline->args[0], i)) >= 0 ;)
{
sector = &sectors[i];

View file

@ -1747,8 +1747,8 @@ static void P_PushableCheckBustables(mobj_t *mo)
if (!(rover->flags & FF_BUSTUP)) continue;
// Needs ML_EFFECT4 flag for pushables to break it
if (!(rover->master->flags & ML_EFFECT4)) continue;
// Needs flag for pushables to break it
if (!(rover->master->args[4] & 1)) continue;
if (!rover->master->frontsector->crumblestate)
{

View file

@ -2793,6 +2793,227 @@ static void P_ConvertBinaryMap(void)
lines[i].special = 100;
break;
case 150: //FOF: air bobbing
case 151: //FOF: air bobbing (adjustable)
case 152: //FOF: reverse air bobbing (adjustable)
lines[i].args[0] = lines[i].tag;
lines[i].args[1] = (lines[i].special == 150) ? 16 : P_AproxDistance(lines[i].dx, lines[i].dy) >> FRACBITS;
if (lines[i].special == 152)
lines[i].args[1] = -lines[i].args[1];
lines[i].args[2] = (lines[i].flags & ML_NOCLIMB) == ML_NOCLIMB;
if (lines[i].flags & ML_EFFECT1)
lines[i].args[3] |= 8;
if (lines[i].flags & ML_EFFECT2)
lines[i].args[3] |= 4;
lines[i].special = 150;
break;
case 160: //FOF: floating, bobbing
lines[i].args[0] = lines[i].tag;
if (lines[i].flags & ML_EFFECT1)
lines[i].args[1] |= 8;
if (lines[i].flags & ML_EFFECT2)
lines[i].args[1] |= 4;
break;
case 170: //FOF: crumbling, respawn
case 171: //FOF: crumbling, no respawn
case 172: //FOF: crumbling, respawn, intangible from bottom
case 173: //FOF: crumbling, no respawn, intangible from bottom
case 174: //FOF: crumbling, respawn, intangible from bottom, translucent
case 175: //FOF: crumbling, no respawn, intangible from bottom, translucent
case 176: //FOF: crumbling, respawn, floating, bobbing
case 177: //FOF: crumbling, no respawn, floating, bobbing
case 178: //FOF: crumbling, respawn, floating
case 179: //FOF: crumbling, no respawn, floating
case 180: //FOF: crumbling, respawn, air bobbing
lines[i].args[0] = lines[i].tag;
//Intangible from below?
if (lines[i].special >= 172 && lines[i].special <= 175)
{
lines[i].args[1] = 2;
if (lines[i].flags & ML_NOCLIMB)
lines[i].args[2] |= 32;
}
else
lines[i].args[1] = 0;
//Block players/others?
if (lines[i].flags & ML_EFFECT1)
lines[i].args[1] |= 8;
if (lines[i].flags & ML_EFFECT2)
lines[i].args[1] |= 4;
//No respawn?
if (lines[i].special % 2 == 1)
lines[i].args[2] |= 1;
//Translucent?
if (lines[i].special == 174 || lines[i].special == 175)
{
lines[i].args[2] |= 2;
lines[i].alpha = (sides[lines[i].sidenum[0]].toptexture << FRACBITS) / 255;
}
//Bobbing?
if (lines[i].special == 176 || lines[i].special == 177 || lines[i].special == 180)
{
lines[i].args[2] |= 4;
lines[i].args[3] = 16;
if (lines[i].flags & ML_NOCLIMB)
lines[i].args[2] |= 8;
}
//Float on water?
if (lines[i].special >= 176 && lines[i].special <= 179)
lines[i].args[2] |= 16;
lines[i].special = 170;
break;
case 190: //FOF: rising platform, solid, opaque, shadowcasting
case 191: //FOF: rising platform, solid, opaque, non-shadowcasting
case 192: //FOF: rising platform, solid, translucent
case 193: //FOF: rising platform, solid, invisible
case 194: //FOF: rising platform, intangible from bottom, opaque
case 195: //FOF: rising platform, intangible from bottom, translucent
lines[i].args[0] = lines[i].tag;
lines[i].args[1] = P_AproxDistance(lines[i].dx, lines[i].dy) >> FRACBITS;
lines[i].args[2] = (lines[i].flags & ML_NOCLIMB) == ML_NOCLIMB;
//Tangibility
if (lines[i].special == 194 || lines[i].special == 195)
lines[i].args[3] |= 2;
if (lines[i].flags & ML_EFFECT1)
lines[i].args[3] |= 8;
if (lines[i].flags & ML_EFFECT2)
lines[i].args[3] |= 4;
//Visibility
if (lines[i].special == 193)
lines[i].args[4] = 2;
else if (lines[i].special == 192 || lines[i].special == 195)
{
lines[i].args[4] = 1;
lines[i].alpha = (sides[lines[i].sidenum[0]].toptexture << FRACBITS) / 255;
}
else
lines[i].args[4] = 0;
//Shadow?
if (lines[i].special == 190)
lines[i].args[5] = 0;
else if (lines[i].special == 194 || lines[i].special == 195)
lines[i].args[5] = (lines[i].flags & ML_NOCLIMB) == ML_NOCLIMB;
else
lines[i].args[5] = 1;
lines[i].special = 190;
break;
case 200: //FOF: Light block
case 201: //FOF: Half light block
lines[i].args[0] = lines[i].tag;
lines[i].args[1] = (lines[i].special == 201) ? 1 : 0;
lines[i].special = 200;
break;
case 202: //FOF: Fog block
case 223: //FOF: intangible, invisible
lines[i].args[0] = lines[i].tag;
break;
case 220: //FOF: intangible, opaque
case 221: //FOF: intangible, translucent
case 222: //FOF: intangible, sides only
lines[i].args[0] = lines[i].tag;
if (lines[i].special == 221)
{
lines[i].args[1] |= 1;
lines[i].alpha = (sides[lines[i].sidenum[0]].toptexture << FRACBITS) / 255;
}
if (lines[i].special != 220 && !(lines[i].flags & ML_NOCLIMB))
lines[i].args[1] |= 2;
if (lines[i].special == 222)
lines[i].args[2] |= 4;
lines[i].special = 220;
break;
case 250: //FOF: Mario block
lines[i].args[0] = lines[i].tag;
if (lines[i].flags & ML_NOCLIMB)
lines[i].args[1] |= 1;
if (lines[i].flags & ML_EFFECT1)
lines[i].args[1] |= 2;
break;
case 251: //FOF: Thwomp block
//TODO: Crushing sound
lines[i].args[0] = lines[i].tag;
lines[i].args[1] = (lines[i].flags == ML_EFFECT5) ? (lines[i].dy >> FRACBITS) : 80;
lines[i].args[2] = (lines[i].flags == ML_EFFECT5) ? (lines[i].dx >> FRACBITS) : 16;
break;
case 252: //FOF: Shatter block
case 253: //FOF: Shatter block, translucent
case 254: //FOF: Bustable block
case 255: //FOF: Spin-bustable block
case 256: //FOF: Spin-bustable block, translucent
lines[i].args[0] = lines[i].tag;
//Busted by?
if (lines[i].special == 252 || lines[i].special == 253)
lines[i].args[1] = 0;
else if (lines[i].special == 254)
lines[i].args[1] = (lines[i].flags == ML_NOCLIMB) ? 3 : 2;
else
lines[i].args[1] = 1;
//Translucent?
if (lines[i].special == 253 || lines[i].special == 256)
{
lines[i].args[2] = 1;
lines[i].alpha = (sides[lines[i].sidenum[0]].toptexture << FRACBITS) / 255;
}
else
lines[i].args[2] = 0;
//Tangibility
if (lines[i].flags & ML_EFFECT1)
lines[i].args[3] |= 8;
if (lines[i].flags & ML_EFFECT2)
lines[i].args[3] |= 4;
//Flags
if (lines[i].flags & ML_EFFECT4)
lines[i].args[4] |= 1;
if (lines[i].flags & ML_EFFECT5)
lines[i].args[4] |= 2;
if (lines[i].special == 252 && lines[i].flags & ML_NOCLIMB)
lines[i].args[4] |= 4;
//Linedef executor tag
lines[i].args[5] = P_AproxDistance(lines[i].dx, lines[i].dy) >> FRACBITS;
lines[i].special = 254;
break;
case 257: //FOF: Quicksand
lines[i].args[0] = lines[i].tag;
lines[i].args[1] = (lines[i].flags & ML_EFFECT5) != ML_EFFECT5;
lines[i].args[2] = lines[i].dx >> FRACBITS;
lines[i].args[3] = lines[i].dy >> FRACBITS;
break;
case 258: //FOF: Laser
lines[i].args[0] = lines[i].tag;
lines[i].args[1] = (lines[i].flags & ML_EFFECT1) == ML_EFFECT1;
break;
case 259: //FOF: Custom
lines[i].args[0] = lines[i].tag;
if (lines[i].sidenum[1] == 0xffff)
I_Error("Custom FOF (tag %d) found without a linedef back side!", lines[i].args[0]);
lines[i].args[1] = sides[lines[i].sidenum[1]].toptexture;
lines[i].args[2] = lines[i].dx >> FRACBITS;
lines[i].args[3] = lines[i].dy >> FRACBITS;
if (lines[i].flags & ML_EFFECT4)
lines[i].args[4] |= 1;
if (lines[i].flags & ML_EFFECT5)
lines[i].args[4] |= 2;
lines[i].args[5] = P_AproxDistance(lines[i].dx, lines[i].dy) >> FRACBITS;
lines[i].alpha = (sides[lines[i].sidenum[0]].toptexture << FRACBITS) / 255;
break;
case 443: //Call Lua function
if (lines[i].text)
{

View file

@ -5742,7 +5742,7 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
{
fixed_t tempceiling = sec2->ceilingheight;
//flip the sector around and print an error instead of crashing 12.1.08 -Inuyasha
CONS_Alert(CONS_ERROR, M_GetText("A FOF tagged %d has a top height below its bottom.\n"), master->tag);
CONS_Alert(CONS_ERROR, M_GetText("A FOF tagged %d has a top height below its bottom.\n"), master->args[0]);
sec2->ceilingheight = sec2->floorheight;
sec2->floorheight = tempceiling;
}
@ -5802,12 +5802,6 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
sec->hasslope = true;
#endif
if ((flags & FF_SOLID) && (master->flags & ML_EFFECT1)) // Block player only
flags &= ~FF_BLOCKOTHERS;
if ((flags & FF_SOLID) && (master->flags & ML_EFFECT2)) // Block all BUT player
flags &= ~FF_BLOCKPLAYER;
fflr->spawnflags = fflr->flags = flags;
fflr->master = master;
fflr->norender = INFTICS;
@ -5865,12 +5859,7 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
if (flags & FF_TRANSLUCENT)
{
if (sides[master->sidenum[0]].toptexture > 0)
fflr->alpha = sides[master->sidenum[0]].toptexture; // for future reference, "#0" is 1, and "#255" is 256. Be warned
else
fflr->alpha = 0x80;
}
fflr->alpha = sides[master->sidenum[0]].toptexture > 0 ? (master->alpha * 0xff) >> FRACBITS : 0x80;
else
fflr->alpha = 0xff;
@ -6047,12 +6036,14 @@ static void P_AddBlockThinker(sector_t *sec, line_t *sourceline)
* there already.
*
* \param sec Control sector.
* \param actionsector Target sector.
* \param sourceline Control linedef.
* \param spindash Require spindash to move?
* \param speed Movement speed.
* \param reverse Sink instead of rise?
* \sa P_SpawnSpecials, T_RaiseSector
* \author SSNTails <http://www.ssntails.org>
*/
static void P_AddRaiseThinker(sector_t *sec, line_t *sourceline)
static void P_AddRaiseThinker(sector_t *sec, line_t *sourceline, boolean spindash, fixed_t speed, boolean reverse)
{
levelspecthink_t *raise;
@ -6061,7 +6052,7 @@ static void P_AddRaiseThinker(sector_t *sec, line_t *sourceline)
raise->thinker.function.acp1 = (actionf_p1)T_RaiseSector;
if (sourceline->flags & ML_BLOCKMONSTERS)
if (reverse)
raise->vars[0] = 1;
else
raise->vars[0] = 0;
@ -6070,12 +6061,12 @@ static void P_AddRaiseThinker(sector_t *sec, line_t *sourceline)
raise->sector = sec;
// Require a spindash to activate
if (sourceline->flags & ML_NOCLIMB)
if (spindash)
raise->vars[1] = 1;
else
raise->vars[1] = 0;
raise->vars[2] = P_AproxDistance(sourceline->dx, sourceline->dy);
raise->vars[2] = speed;
raise->vars[2] = FixedDiv(raise->vars[2], 4*FRACUNIT);
raise->vars[3] = raise->vars[2];
@ -6090,7 +6081,7 @@ static void P_AddRaiseThinker(sector_t *sec, line_t *sourceline)
raise->sourceline = sourceline;
}
static void P_AddAirbob(sector_t *sec, line_t *sourceline, boolean noadjust, boolean dynamic)
static void P_AddAirbob(sector_t *sec, line_t *sourceline, boolean spindash, fixed_t distance, boolean reverse, boolean dynamic)
{
levelspecthink_t *airbob;
@ -6103,23 +6094,21 @@ static void P_AddAirbob(sector_t *sec, line_t *sourceline, boolean noadjust, boo
airbob->sector = sec;
// Require a spindash to activate
if (sourceline->flags & ML_NOCLIMB)
if (spindash)
airbob->vars[1] = 1;
else
airbob->vars[1] = 0;
airbob->vars[2] = FRACUNIT;
if (noadjust)
airbob->vars[7] = airbob->sector->ceilingheight-16*FRACUNIT;
else
airbob->vars[7] = airbob->sector->ceilingheight - P_AproxDistance(sourceline->dx, sourceline->dy);
airbob->vars[7] = airbob->sector->ceilingheight - distance;
airbob->vars[6] = airbob->vars[7]
- (sec->ceilingheight - sec->floorheight);
airbob->vars[3] = airbob->vars[2];
if (sourceline->flags & ML_BLOCKMONSTERS)
if (reverse)
airbob->vars[0] = 1;
else
airbob->vars[0] = 0;
@ -6294,7 +6283,7 @@ void T_LaserFlash(laserthink_t *flash)
{
thing = node->m_thing;
if ((fflr->master->flags & ML_EFFECT1)
if ((fflr->master->args[1])
&& thing->flags & MF_BOSS)
continue; // Don't hurt bosses
@ -6767,7 +6756,7 @@ void P_SpawnSpecials(boolean fromnetsave)
{
if (lines[i].args[2] == 0)
{
if (lines[i].args[3] & 3)
if (lines[i].args[3] & 7)
{
//At least partially intangible: You can see it from the inside
ffloorflags |= FF_ALLSIDES;
@ -6781,7 +6770,7 @@ void P_SpawnSpecials(boolean fromnetsave)
if (lines[i].args[2] == 1)
ffloorflags |= FF_TRANSLUCENT | FF_EXTRA | FF_CUTEXTRA;
if (lines[i].args[2] == 2)
ffloorflags |= FF_TRANSLUCENT | FF_CUTLEVEL | FF_BOTHPLANES | FF_ALLSIDES;
ffloorflags |= FF_TRANSLUCENT | FF_CUTEXTRA | FF_BOTHPLANES | FF_ALLSIDES;
}
if (lines[i].args[3] & 1)
@ -6814,142 +6803,101 @@ void P_SpawnSpecials(boolean fromnetsave)
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break;
case 150: // Air bobbing platform
case 151: // Adjustable air bobbing platform
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL, secthinkers);
lines[i].flags |= ML_BLOCKMONSTERS;
P_AddAirbob(lines[i].frontsector, lines + i, (lines[i].special != 151), false);
break;
case 152: // Adjustable air bobbing platform in reverse
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL, secthinkers);
P_AddAirbob(lines[i].frontsector, lines + i, true, false);
break;
case 153: // Dynamic Sinking Platform
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL, secthinkers);
lines[i].flags |= ML_BLOCKMONSTERS;
P_AddAirbob(lines[i].frontsector, lines + i, false, true);
case 150: // FOF (air bobbing)
ffloorflags = FF_EXISTS | FF_SOLID | FF_RENDERALL | FF_CUTLEVEL;
if (lines[i].args[1] & 1)
ffloorflags |= FF_REVERSEPLATFORM;
if (lines[i].args[1] & 2)
ffloorflags |= FF_PLATFORM;
if (lines[i].args[1] & 4)
ffloorflags &= ~FF_BLOCKPLAYER;
if (lines[i].args[1] & 7)
ffloorflags &= ~FF_CUTLEVEL;
if (lines[i].args[1] & 8)
ffloorflags &= ~FF_BLOCKOTHERS;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
P_AddAirbob(lines[i].frontsector, lines + i, lines[i].args[2], abs(lines[i].args[1]) << FRACBITS, lines[i].args[1] < 0, false);
break;
case 160: // Float/bob platform
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL|FF_FLOATBOB, secthinkers);
break;
case 170: // Crumbling platform
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL|FF_CRUMBLE, secthinkers);
break;
case 171: // Crumbling platform that will not return
P_AddFakeFloorsByLine(i,
FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL|FF_CRUMBLE|FF_NORETURN, secthinkers);
break;
case 172: // "Platform" that crumbles and returns
ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_PLATFORM|FF_CRUMBLE|FF_BOTHPLANES|FF_ALLSIDES;
if (lines[i].flags & ML_NOCLIMB) // shade it unless no-climb
ffloorflags |= FF_NOSHADE;
case 160: // FOF (floating, bobbing)
ffloorflags = FF_EXISTS | FF_SOLID | FF_RENDERALL | FF_CUTLEVEL | FF_FLOATBOB;
if (lines[i].args[1] & 1)
ffloorflags |= FF_REVERSEPLATFORM;
if (lines[i].args[1] & 2)
ffloorflags |= FF_PLATFORM;
if (lines[i].args[1] & 4)
ffloorflags &= ~FF_BLOCKPLAYER;
if (lines[i].args[1] & 7)
ffloorflags &= ~FF_CUTLEVEL;
if (lines[i].args[1] & 8)
ffloorflags &= ~FF_BLOCKOTHERS;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break;
case 173: // "Platform" that crumbles and doesn't return
ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_PLATFORM|FF_CRUMBLE|FF_NORETURN|FF_BOTHPLANES|FF_ALLSIDES;
if (lines[i].flags & ML_NOCLIMB) // shade it unless no-climb
case 170: // FOF (crumbling)
ffloorflags = FF_EXISTS | FF_SOLID | FF_RENDERALL | FF_CRUMBLE;
if (lines[i].args[1] & 1)
ffloorflags |= FF_REVERSEPLATFORM | FF_BOTHPLANES | FF_ALLSIDES;
if (lines[i].args[1] & 2)
ffloorflags |= FF_PLATFORM | FF_BOTHPLANES | FF_ALLSIDES;
if (lines[i].args[1] & 4)
ffloorflags &= ~FF_BLOCKPLAYER;
if (lines[i].args[1] & 8)
ffloorflags &= ~FF_BLOCKOTHERS;
if (lines[i].args[2] & 1)
ffloorflags |= FF_NORETURN;
if (lines[i].args[2] & 2)
ffloorflags |= FF_TRANSLUCENT | FF_CUTEXTRA;
else
{
//No FF_CUTLEVEL if FOF is partially intangible.
if (!(lines[i].args[1] & 7))
ffloorflags |= FF_CUTLEVEL;
}
if (lines[i].args[1] & 16)
ffloorflags |= FF_FLOATBOB;
if (lines[i].args[1] & 32)
ffloorflags |= FF_NOSHADE;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
if (lines[i].args[2] & 4)
P_AddAirbob(lines[i].frontsector, lines + i, lines[i].args[2] & 8, abs(lines[i].args[3]) << FRACBITS, lines[i].args[3] < 0, false);
break;
case 174: // Translucent "platform" that crumbles and returns
ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL|FF_PLATFORM|FF_CRUMBLE|FF_TRANSLUCENT|FF_BOTHPLANES|FF_ALLSIDES;
if (lines[i].flags & ML_NOCLIMB) // shade it unless no-climb
case 190: // FOF (rising)
ffloorflags = FF_EXISTS | FF_SOLID | FF_RENDERALL;
if (lines[i].args[3] & 1)
ffloorflags |= FF_REVERSEPLATFORM | FF_BOTHPLANES | FF_ALLSIDES;
if (lines[i].args[3] & 2)
ffloorflags |= FF_PLATFORM | FF_BOTHPLANES | FF_ALLSIDES;
if (lines[i].args[3] & 4)
ffloorflags &= ~FF_BLOCKPLAYER;
if (lines[i].args[3] & 8)
ffloorflags &= ~FF_BLOCKOTHERS;
if (lines[i].args[4] == 0)
{
//No FF_CUTLEVEL if FOF is partially intangible.
if (!(lines[i].args[1] & 7))
ffloorflags |= FF_CUTLEVEL;
}
else if (lines[i].args[4] == 1)
ffloorflags |= FF_TRANSLUCENT | FF_EXTRA | FF_CUTEXTRA;
else
ffloorflags &= ~FF_RENDERALL;
if (lines[i].args[5])
ffloorflags |= FF_NOSHADE;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
P_AddRaiseThinker(lines[i].frontsector, &lines[i], lines[i].args[2], abs(lines[i].args[1]) << FRACBITS, lines[i].args[1] < 0);
break;
case 175: // Translucent "platform" that crumbles and doesn't return
ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL|FF_PLATFORM|FF_CRUMBLE|FF_NORETURN|FF_TRANSLUCENT|FF_BOTHPLANES|FF_ALLSIDES;
if (lines[i].flags & ML_NOCLIMB) // shade it unless no-climb
ffloorflags |= FF_NOSHADE;
case 200: // Light effect
ffloorflags = FF_EXISTS | FF_CUTSPRITES;
if (!(lines[i].args[1]))
ffloorflags |= FF_DOUBLESHADOW;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break;
case 176: // Air bobbing platform that will crumble and bob on the water when it falls and hits
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_FLOATBOB|FF_CRUMBLE, secthinkers);
lines[i].flags |= ML_BLOCKMONSTERS;
P_AddAirbob(lines[i].frontsector, lines + i, true, false);
break;
case 177: // Air bobbing platform that will crumble and bob on
// the water when it falls and hits, then never return
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL|FF_FLOATBOB|FF_CRUMBLE|FF_NORETURN, secthinkers);
lines[i].flags |= ML_BLOCKMONSTERS;
P_AddAirbob(lines[i].frontsector, lines + i, true, false);
break;
case 178: // Crumbling platform that will float when it hits water
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CRUMBLE|FF_FLOATBOB, secthinkers);
break;
case 179: // Crumbling platform that will float when it hits water, but not return
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL|FF_CRUMBLE|FF_FLOATBOB|FF_NORETURN, secthinkers);
break;
case 180: // Air bobbing platform that will crumble
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL|FF_CRUMBLE, secthinkers);
lines[i].flags |= ML_BLOCKMONSTERS;
P_AddAirbob(lines[i].frontsector, lines + i, true, false);
break;
case 190: // Rising Platform FOF (solid, opaque, shadows)
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL, secthinkers);
P_AddRaiseThinker(lines[i].frontsector, &lines[i]);
break;
case 191: // Rising Platform FOF (solid, opaque, no shadows)
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_NOSHADE|FF_CUTLEVEL, secthinkers);
P_AddRaiseThinker(lines[i].frontsector, &lines[i]);
break;
case 192: // Rising Platform TL block: FOF (solid, translucent)
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_NOSHADE|FF_TRANSLUCENT|FF_EXTRA|FF_CUTEXTRA, secthinkers);
P_AddRaiseThinker(lines[i].frontsector, &lines[i]);
break;
case 193: // Rising Platform FOF (solid, invisible)
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_NOSHADE, secthinkers);
P_AddRaiseThinker(lines[i].frontsector, &lines[i]);
break;
case 194: // Rising Platform 'Platform' - You can jump up through it
// If line has no-climb set, don't give it shadows, otherwise do
ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_PLATFORM|FF_BOTHPLANES|FF_ALLSIDES;
if (lines[i].flags & ML_NOCLIMB)
ffloorflags |= FF_NOSHADE;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
P_AddRaiseThinker(lines[i].frontsector, &lines[i]);
break;
case 195: // Rising Platform Translucent "platform"
// If line has no-climb set, don't give it shadows, otherwise do
ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_PLATFORM|FF_TRANSLUCENT|FF_BOTHPLANES|FF_ALLSIDES|FF_EXTRA|FF_CUTEXTRA;
if (lines[i].flags & ML_NOCLIMB)
ffloorflags |= FF_NOSHADE;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
P_AddRaiseThinker(lines[i].frontsector, &lines[i]);
break;
case 200: // Double light effect
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_CUTSPRITES|FF_DOUBLESHADOW, secthinkers);
break;
case 201: // Light effect
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_CUTSPRITES, secthinkers);
break;
case 202: // Fog
ffloorflags = FF_EXISTS|FF_RENDERALL|FF_FOG|FF_BOTHPLANES|FF_INVERTPLANES|FF_ALLSIDES|FF_INVERTSIDES|FF_CUTEXTRA|FF_EXTRA|FF_DOUBLESHADOW|FF_CUTSPRITES;
sec = sides[*lines[i].sidenum].sector - sectors;
@ -6959,24 +6907,21 @@ void P_SpawnSpecials(boolean fromnetsave)
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break;
case 220: // Like opaque water, but not swimmable. (Good for snow effect on FOFs)
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_RENDERALL|FF_BOTHPLANES|FF_ALLSIDES|FF_CUTEXTRA|FF_EXTRA|FF_CUTSPRITES, secthinkers);
break;
case 221: // FOF (intangible, translucent)
// If line has no-climb set, give it shadows, otherwise don't
ffloorflags = FF_EXISTS|FF_RENDERALL|FF_TRANSLUCENT|FF_EXTRA|FF_CUTEXTRA|FF_CUTSPRITES;
if (!(lines[i].flags & ML_NOCLIMB))
case 220: // FOF (intangible)
ffloorflags = FF_EXISTS | FF_RENDERSIDES | FF_CUTSPRITES;
if (lines[i].args[1] & 1)
ffloorflags |= FF_TRANSLUCENT | FF_EXTRA | FF_CUTEXTRA;
else
ffloorflags |= FF_ALLSIDES;
if (lines[i].args[1] & 2)
ffloorflags |= FF_NOSHADE;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break;
case 222: // FOF with no floor/ceiling (good for GFZGRASS effect on FOFs)
// If line has no-climb set, give it shadows, otherwise don't
ffloorflags = FF_EXISTS|FF_RENDERSIDES|FF_ALLSIDES;
if (!(lines[i].flags & ML_NOCLIMB))
ffloorflags |= FF_NOSHADE|FF_CUTSPRITES;
if (lines[i].args[1] & 4)
{
if (!(lines[i].args[1] & 2))
ffloorflags &= ~FF_CUTSPRITES;
}
else
ffloorflags |= FF_RENDERPLANES | FF_BOTHPLANES | FF_CUTEXTRA | FF_EXTRA;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break;
@ -6987,9 +6932,9 @@ void P_SpawnSpecials(boolean fromnetsave)
case 250: // Mario Block
ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL|FF_MARIO;
if (lines[i].flags & ML_NOCLIMB)
if (lines[i].args[1] & 1)
ffloorflags |= FF_SHATTERBOTTOM;
if (lines[i].flags & ML_EFFECT1)
if (lines[i].args[1] & 2)
ffloorflags &= ~(FF_SOLID|FF_RENDERALL|FF_CUTLEVEL);
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
@ -6997,7 +6942,7 @@ void P_SpawnSpecials(boolean fromnetsave)
case 251: // A THWOMP!
sec = sides[*lines[i].sidenum].sector - sectors;
for (s = -1; (s = P_FindSectorFromLineTag(lines + i, s)) >= 0 ;)
for (s = -1; (s = P_FindSectorFromTag(lines[i].args[0], s)) >= 0 ;)
{
P_AddThwompThinker(&sectors[sec], &sectors[s], &lines[i]);
P_AddFakeFloor(&sectors[s], &sectors[sec], lines + i,
@ -7005,37 +6950,45 @@ void P_SpawnSpecials(boolean fromnetsave)
}
break;
case 252: // Shatter block (breaks when touched)
ffloorflags = FF_EXISTS|FF_BLOCKOTHERS|FF_RENDERALL|FF_BUSTUP|FF_SHATTER;
if (lines[i].flags & ML_NOCLIMB)
ffloorflags |= FF_BLOCKPLAYER|FF_SHATTERBOTTOM;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break;
case 253: // Translucent shatter block (see 76)
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_BLOCKOTHERS|FF_RENDERALL|FF_BUSTUP|FF_SHATTER|FF_TRANSLUCENT, secthinkers);
break;
case 254: // Bustable block
ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_BUSTUP;
if (lines[i].flags & ML_NOCLIMB)
ffloorflags |= FF_STRONGBUST;
ffloorflags = FF_EXISTS|FF_RENDERALL|FF_BUSTUP;
switch (lines[i].args[1])
{
case 0:
ffloorflags |= FF_SHATTER;
break;
case 1:
ffloorflags |= FF_SPINBUST;
break;
case 2:
ffloorflags |= FF_SOLID;
break;
case 3:
ffloorflags |= FF_SOLID | FF_STRONGBUST;
break;
default:
break;
}
if (lines[i].args[2])
ffloorflags |= FF_TRANSLUCENT;
if (lines[i].args[3] & 1)
ffloorflags |= FF_REVERSEPLATFORM | FF_BOTHPLANES | FF_ALLSIDES;
if (lines[i].args[3] & 2)
ffloorflags |= FF_PLATFORM | FF_BOTHPLANES | FF_ALLSIDES;
if (lines[i].args[3] & 4)
ffloorflags &= ~FF_BLOCKPLAYER;
if (lines[i].args[3] & 8)
ffloorflags &= ~FF_BLOCKOTHERS;
if (lines[i].args[4] & 4)
ffloorflags |= FF_SOLID | FF_SHATTERBOTTOM;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break;
case 255: // Spin bust block (breaks when jumped or spun downwards onto)
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_BUSTUP|FF_SPINBUST, secthinkers);
break;
case 256: // Translucent spin bust block (see 78)
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_BUSTUP|FF_SPINBUST|FF_TRANSLUCENT, secthinkers);
break;
case 257: // Quicksand
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;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
@ -7045,18 +6998,12 @@ void P_SpawnSpecials(boolean fromnetsave)
sec = sides[*lines[i].sidenum].sector - sectors;
// No longer totally disrupts netgames
for (s = -1; (s = P_FindSectorFromLineTag(lines + i, s)) >= 0 ;)
for (s = -1; (s = P_FindSectorFromTag(lines[i].args[0], s)) >= 0 ;)
EV_AddLaserThinker(&sectors[s], &sectors[sec], lines + i, secthinkers);
break;
case 259: // Custom FOF
if (lines[i].sidenum[1] != 0xffff)
{
ffloortype_e fofflags = sides[lines[i].sidenum[1]].toptexture;
P_AddFakeFloorsByLine(i, fofflags, secthinkers);
}
else
I_Error("Custom FOF (tag %d) found without a linedef back side!", lines[i].tag);
P_AddFakeFloorsByLine(i, lines[i].args[1], secthinkers);
break;
case 300: // Linedef executor (combines with sector special 974/975) and commands
@ -7325,7 +7272,7 @@ static void P_AddFakeFloorsByLine(size_t line, ffloortype_e ffloorflags, thinker
INT32 s;
size_t sec = sides[*lines[line].sidenum].sector-sectors;
for (s = -1; (s = P_FindSectorFromLineTag(lines+line, s)) >= 0 ;)
for (s = -1; (s = P_FindSectorFromTag(lines[line].args[0], s)) >= 0 ;)
P_AddFakeFloor(&sectors[s], &sectors[sec], lines+line, ffloorflags, secthinkers);
}

View file

@ -395,7 +395,7 @@ void P_GiveFinishFlags(player_t *player)
mobj_t* flag = P_SpawnMobjFromMobj(player->mo, xoffs, yoffs, 0, MT_FINISHFLAG);
flag->angle = angle;
angle += FixedAngle(120*FRACUNIT);
P_SetTarget(&flag->target, player->mo);
}
}
@ -2670,7 +2670,7 @@ static void P_CheckBustableBlocks(player_t *player)
EV_CrumbleChain(NULL, rover); // node->m_sector
// Run a linedef executor??
if (rover->master->flags & ML_EFFECT5)
if (rover->master->args[4] & 2)
P_LinedefExecute((INT16)(P_AproxDistance(rover->master->dx, rover->master->dy)>>FRACBITS), player->mo, node->m_sector);
goto bustupdone;
@ -2870,7 +2870,7 @@ static void P_CheckQuicksand(player_t *player)
if (topheight >= player->mo->z && bottomheight < player->mo->z + player->mo->height)
{
sinkspeed = abs(rover->master->v1->x - rover->master->v2->x)>>1;
sinkspeed = rover->master->args[2]>>1;
sinkspeed = FixedDiv(sinkspeed,TICRATE*FRACUNIT);
@ -2899,7 +2899,7 @@ static void P_CheckQuicksand(player_t *player)
P_PlayerHitFloor(player, false);
}
friction = abs(rover->master->v1->y - rover->master->v2->y)>>6;
friction = rover->master->args[3]>>6;
player->mo->momx = FixedMul(player->mo->momx, friction);
player->mo->momy = FixedMul(player->mo->momy, friction);