diff --git a/extras/conf/udb/Includes/SRB222_linedefs.cfg b/extras/conf/udb/Includes/SRB222_linedefs.cfg index 097ac02ebf221a26a38112bd78b9a9cf6f564b48..7c2411dc81d70fa76f0eaed1c0c8893c037d0091 100644 --- a/extras/conf/udb/Includes/SRB222_linedefs.cfg +++ b/extras/conf/udb/Includes/SRB222_linedefs.cfg @@ -1717,6 +1717,7 @@ udmf stringarg0 { title = "Sound"; + type = 2; } } @@ -1740,6 +1741,31 @@ udmf } } + 14 + { + title = "Bustable Block Parameters"; + prefix = "(14)"; + arg0 + { + title = "Debris spacing"; + } + arg1 + { + title = "Debris lifetime"; + } + arg2 + { + title = "Launch from center?"; + type = 11; + enum = "noyes"; + } + stringarg0 + { + title = "Debris object type"; + type = 2; + } + } + 15 { title = "Fan Particle Generator Heights"; @@ -4699,6 +4725,7 @@ udmf stringarg0 { title = "Prompt name"; + type = 2; } } diff --git a/src/p_floor.c b/src/p_floor.c index c3a13d802888567935f4f9e8eaae0252e913ca3f..85a1f54a8ca494995f120667295717c9f69c7240 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -11,6 +11,7 @@ /// \file p_floor.c /// \brief Floor animation, elevators +#include "dehacked.h" #include "doomdef.h" #include "doomstat.h" #include "m_random.h" @@ -1812,7 +1813,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) fixed_t leftx, rightx, topy, bottomy, topz, bottomz, widthfactor, heightfactor, a, b, c, spacing; mobjtype_t type; tic_t lifetime; - INT16 flags; + boolean fromcenter; sector_t *controlsec = rover->master->frontsector; mtag_t tag = Tag_FGet(&controlsec->tags); @@ -1842,25 +1843,20 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) spacing = (32<<FRACBITS); type = MT_ROCKCRUMBLE1; lifetime = 3*TICRATE; - flags = 0; + fromcenter = false; if (tag != 0) { INT32 tagline = Tag_FindLineSpecial(14, tag); if (tagline != -1) { - if (sides[lines[tagline].sidenum[0]].toptexture) - type = (mobjtype_t)sides[lines[tagline].sidenum[0]].toptexture; // Set as object type in p_setup.c... - if (sides[lines[tagline].sidenum[0]].textureoffset) - spacing = sides[lines[tagline].sidenum[0]].textureoffset; - if (sides[lines[tagline].sidenum[0]].rowoffset) - { - if (sides[lines[tagline].sidenum[0]].rowoffset>>FRACBITS != -1) - lifetime = (sides[lines[tagline].sidenum[0]].rowoffset>>FRACBITS); - else - lifetime = 0; - } - flags = lines[tagline].flags; + if (lines[tagline].stringargs[0]) + type = get_number(lines[tagline].stringargs[0]); + if (lines[tagline].args[0]) + spacing = lines[tagline].args[0] << FRACBITS; + if (lines[tagline].args[1]) + lifetime = (lines[tagline].args[1] != -1) ? lines[tagline].args[1] : 0; + fromcenter = !!lines[tagline].args[2]; } } @@ -1895,7 +1891,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) topz = *rover->topheight-(spacing>>1); bottomz = *rover->bottomheight; - if (flags & ML_EFFECT1) + if (fromcenter) { widthfactor = (rightx + topy - leftx - bottomy)>>3; heightfactor = (topz - *rover->bottomheight)>>2; @@ -1918,7 +1914,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) spawned = P_SpawnMobj(a, b, c, type); spawned->angle += P_RandomKey(36)*ANG10; // irrelevant for default objects but might make sense for some custom ones - if (flags & ML_EFFECT1) + if (fromcenter) { P_InstaThrust(spawned, R_PointToAngle2(sec->soundorg.x, sec->soundorg.y, a, b), FixedDiv(P_AproxDistance(a - sec->soundorg.x, b - sec->soundorg.y), widthfactor)); P_SetObjectMomZ(spawned, FixedDiv((c - bottomz), heightfactor), false); diff --git a/src/p_setup.c b/src/p_setup.c index 16019e5c030c1bfe425ad648c20b83cb2ffe5a74..850fee4f1fc2c0d822a35cf9c890d300ecf57685 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3241,6 +3241,12 @@ static void P_ConvertBinaryMap(void) lines[i].args[1] = sides[lines[i].sidenum[0]].rowoffset >> FRACBITS; lines[i].args[2] = !!(lines[i].flags & ML_EFFECT1); break; + case 14: //Bustable block 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_EFFECT1); + P_WriteConstant(sides[lines[i].sidenum[0]].toptexture, &lines[i].stringargs[0]); + break; case 16: //Minecart parameters lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS; break;