diff --git a/extras/conf/udb/Includes/SRB222_linedefs.cfg b/extras/conf/udb/Includes/SRB222_linedefs.cfg index 99ec6ec79..54ddd17bb 100644 --- a/extras/conf/udb/Includes/SRB222_linedefs.cfg +++ b/extras/conf/udb/Includes/SRB222_linedefs.cfg @@ -1917,6 +1917,54 @@ udmf } } + 259 + { + title = "Custom"; + prefix = "(259)"; + arg0 + { + title = "Target sector tag"; + type = 13; + } + arg1 + { + title = "Flags"; + type = 12; + enum + { + 1 = "Exists"; + 2 = "Block player"; + 4 = "Block others"; + 8 = "Render sides"; + 16 = "Render planes"; + 32 = "Water"; + 64 = "No shadow"; + 128 = "Cut solid walls"; + 256 = "Cut extra walls"; + 512 = "Split sprites"; + 1024 = "Render inside planes"; + 2048 = "Extra"; + 4096 = "Translucent"; + 8192 = "Fog"; + 16384 = "Only render inside planes"; + 32768 = "Render inside walls"; + 65536 = "Only render inside walls"; + 131072 = "Double shadow"; + 262144 = "Water bobbing"; + 524288 = "Don't respawn"; + 1048576 = "Crumbling"; + 2097152 = "Goo water"; + 4194304 = "Mario block"; + 8388608 = "Bustable"; + 16777216 = "Quicksand"; + 33554432 = "Intangible from below"; + 67108864 = "Intangible from above"; + 1073741824 = "Ripple effect"; + 2147483648 = "Don't copy light level"; + } + } + } + 260 { title = "Add Raise Thinker"; diff --git a/src/p_setup.c b/src/p_setup.c index a3876888b..2b47464ff 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3157,6 +3157,20 @@ static void P_ConvertBinaryMap(void) if (lines[i].flags & ML_EFFECT1) lines[i].args[1] = 1; break; + case 259: //Custom FOF + if (lines[i].sidenum[1] == 0xffff) + I_Error("Custom FOF (tag %d) found without a linedef back side!", lines[i].tag); + + lines[i].args[0] = lines[i].tag; + lines[i].args[1] = sides[lines[i].sidenum[1]].toptexture; + if (lines[i].args[1] & FF_TRANSLUCENT) + { + if (sides[lines[i].sidenum[0]].toptexture > 0) + lines[i].alpha = (sides[lines[i].sidenum[0]].toptexture << FRACBITS)/255; + else + lines[i].alpha = FRACUNIT/2; + } + break; case 443: //Call Lua function if (lines[i].text) { diff --git a/src/p_spec.c b/src/p_spec.c index a324e5a15..6040ac6eb 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -6947,7 +6947,7 @@ void P_SpawnSpecials(boolean fromnetsave) { ffloor_t *fflr = P_AddFakeFloor(§ors[s], lines[i].frontsector, lines + i, ffloorflags, secthinkers); fflr->sinkspeed = abs(lines[i].args[2]) << (FRACBITS - 1); - fflr->fricttion = abs(lines[i].args[3]) << (FRACBITS - 6); + fflr->friction = abs(lines[i].args[3]) << (FRACBITS - 6); } break; @@ -6957,13 +6957,39 @@ void P_SpawnSpecials(boolean fromnetsave) break; case 259: // Custom FOF - if (lines[i].sidenum[1] != 0xffff) + for (s = -1; (s = P_FindSectorFromTag(lines[i].args[0], s)) >= 0 ;) { - ffloortype_e fofflags = sides[lines[i].sidenum[1]].toptexture; - P_AddFakeFloorsByLine(i, fofflags, secthinkers); + ffloor_t *fflr = P_AddFakeFloor(§ors[s], lines[i].frontsector, lines + i, lines[i].args[1], secthinkers); + if (!udmf) // Ugly backwards compatibility stuff + { + if (lines[i].args[1] & FF_QUICKSAND) + { + fflr->sinkspeed = abs(lines[i].dx) >> 1; + fflr->friction = abs(lines[i].dy) >> 6; + } + if (lines[i].args[1] & FF_BUSTUP) + { + if (lines[i].args[1] & BFF_SHATTER) + fflr->busttype = BT_TOUCH; + else if (lines[i].args[1] & BFF_SPINBUST) + fflr->busttype = BT_SPIN; + else if (lines[i].args[1] & BFF_STRONGBUST) + fflr->busttype = BT_STRONG; + else + fflr->busttype = BT_REGULAR; + + if (lines[i].args[1] & BFF_SHATTERBOTTOM) + fflr->bustflags |= BF_ONLYBOTTOM; + if (lines[i].flags & ML_EFFECT4) + fflr->bustflags |= BF_PUSHABLES; + if (lines[i].flags & ML_EFFECT5) + { + fflr->bustflags |= BF_EXECUTOR; + fflr->busttag = P_AproxDistance(lines[i].dx, lines[i].dy) >> FRACBITS; + } + } + } } - else - I_Error("Custom FOF (tag %d) found without a linedef back side!", lines[i].tag); break; case 260: // Add raise thinker to FOF @@ -7326,6 +7352,7 @@ void P_SpawnSpecials(boolean fromnetsave) continue; rover->flags |= FF_BUSTUP; + rover->spawnflags |= FF_BUSTUP; rover->busttype = busttype; rover->bustflags = bustflags; rover->busttag = lines[i].args[3]; @@ -7336,9 +7363,44 @@ void P_SpawnSpecials(boolean fromnetsave) } break; } + + case 265: // Make FOF quicksand + { + if (!udmf) + break; + + for (l = -1; (l = P_FindLineFromTag(lines[i].args[0], l)) >= 0 ;) + { + if (lines[l].special < 100 || lines[l].special >= 300) + continue; + + for (s = -1; (s = P_FindSectorFromTag(lines[l].args[0], s)) >= 0 ;) + { + ffloor_t *rover; + + for (rover = sectors[s].ffloors; rover; rover = rover->next) + { + if (rover->master != lines + l) + continue; + + rover->flags |= FF_QUICKSAND; + rover->spawnflags |= FF_QUICKSAND; + rover->sinkspeed = abs(lines[i].args[1]) << (FRACBITS - 1); + rover->friction = abs(lines[i].args[2]) << (FRACBITS - 6); + CheckForQuicksand = true; + break; + } + } + } + break; + } } } + + + + // Allocate each list for (i = 0; i < numsectors; i++) if(secthinkers[i].thinkers) diff --git a/src/r_defs.h b/src/r_defs.h index 508b1f062..c791117ba 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -148,6 +148,12 @@ typedef enum FF_COLORMAPONLY = 0x80000000, ///< Only copy the colormap, not the lightlevel } ffloortype_e; +//Binary map format ffloor flags, for backwards compatibility only +#define BFF_SHATTERBOTTOM 0x200000 +#define BFF_SHATTER 0x8000000 +#define BFF_SPINBUST 0x10000000 +#define BFF_STRONGBUST 0x20000000 + typedef enum { BT_TOUCH,