diff --git a/src/info.c b/src/info.c index dc71ad163..fdeafc015 100644 --- a/src/info.c +++ b/src/info.c @@ -12937,7 +12937,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // display offset 1000, // mass 0, // damage - sfx_None, // activesound + sfx_crumbl, // activesound MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_SCENERY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, @@ -12964,7 +12964,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // display offset 1000, // mass 0, // damage - sfx_None, // activesound + sfx_crumbl, // activesound MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_SCENERY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, @@ -12991,7 +12991,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // display offset 1000, // mass 0, // damage - sfx_None, // activesound + sfx_crumbl, // activesound MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_SCENERY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, @@ -13018,7 +13018,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // display offset 1000, // mass 0, // damage - sfx_None, // activesound + sfx_crumbl, // activesound MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_SCENERY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, @@ -13045,7 +13045,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // display offset 1000, // mass 0, // damage - sfx_None, // activesound + sfx_crumbl, // activesound MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_SCENERY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, @@ -13072,7 +13072,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // display offset 1000, // mass 0, // damage - sfx_None, // activesound + sfx_crumbl, // activesound MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_SCENERY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, @@ -13099,7 +13099,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // display offset 1000, // mass 0, // damage - sfx_None, // activesound + sfx_crumbl, // activesound MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_SCENERY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, @@ -13126,7 +13126,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // display offset 1000, // mass 0, // damage - sfx_None, // activesound + sfx_crumbl, // activesound MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_SCENERY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, @@ -13153,7 +13153,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // display offset 1000, // mass 0, // damage - sfx_None, // activesound + sfx_crumbl, // activesound MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_SCENERY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, @@ -13180,7 +13180,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // display offset 1000, // mass 0, // damage - sfx_None, // activesound + sfx_crumbl, // activesound MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_SCENERY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, @@ -13207,7 +13207,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // display offset 1000, // mass 0, // damage - sfx_None, // activesound + sfx_crumbl, // activesound MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_SCENERY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, @@ -13234,7 +13234,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // display offset 1000, // mass 0, // damage - sfx_None, // activesound + sfx_crumbl, // activesound MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_SCENERY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, @@ -13261,7 +13261,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // display offset 1000, // mass 0, // damage - sfx_None, // activesound + sfx_crumbl, // activesound MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_SCENERY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, @@ -13288,7 +13288,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // display offset 1000, // mass 0, // damage - sfx_None, // activesound + sfx_crumbl, // activesound MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_SCENERY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, @@ -13315,7 +13315,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // display offset 1000, // mass 0, // damage - sfx_None, // activesound + sfx_crumbl, // activesound MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_SCENERY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, @@ -13342,7 +13342,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // display offset 1000, // mass 0, // damage - sfx_None, // activesound + sfx_crumbl, // activesound MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_SCENERY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, diff --git a/src/p_floor.c b/src/p_floor.c index af6274f28..18126f263 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -1797,10 +1797,13 @@ static mobj_t *SearchMarioNode(msecnode_t *node) void T_MarioBlockChecker(levelspecthink_t *block) { line_t *masterline = block->sourceline; - if (SearchMarioNode(block->sector->touching_thinglist)) - sides[masterline->sidenum[0]].midtexture = sides[masterline->sidenum[0]].bottomtexture; - else - sides[masterline->sidenum[0]].midtexture = sides[masterline->sidenum[0]].toptexture; + if (!(masterline->flags & ML_NOCLIMB)) // Don't change the textures of a brick block, just a question block + { + if (SearchMarioNode(block->sector->touching_thinglist)) + sides[masterline->sidenum[0]].midtexture = sides[masterline->sidenum[0]].bottomtexture; + else + sides[masterline->sidenum[0]].midtexture = sides[masterline->sidenum[0]].toptexture; + } } // This is the Thwomp's 'brain'. It looks around for players nearby, and if @@ -2878,17 +2881,35 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) fixed_t leftx, rightx; fixed_t topy, bottomy; fixed_t topz; + fixed_t widthfactor, heightfactor; fixed_t a, b, c; mobjtype_t type = MT_ROCKCRUMBLE1; + fixed_t spacing = (32<master->frontsector->special, 3) >= 8) - type = MT_ROCKCRUMBLE1+(GETSECSPECIAL(rover->master->frontsector->special, 3)-7); +#define controlsec rover->master->frontsector + + for (i = 0; i < controlsec->linecount; i++) + { + if (controlsec->lines[i]->special == 14) // If we can use bustable block parameters, we will. + { + if (sides[controlsec->lines[i]->sidenum[0]].toptexture) + type = (mobjtype_t)sides[controlsec->lines[i]->sidenum[0]].toptexture; // Set as object type in p_setup.c... + if (sides[controlsec->lines[i]->sidenum[0]].textureoffset) + spacing = sides[controlsec->lines[i]->sidenum[0]].textureoffset; + if (sides[controlsec->lines[i]->sidenum[0]].rowoffset) + lifetime = (sides[controlsec->lines[i]->sidenum[0]].rowoffset>>FRACBITS); + flags = controlsec->lines[i]->flags; + break; // If someone has multiple parameter linedefs per control sector, TOUGH. + } + } + +#undef controlsec // soundorg z height never gets set normally, so MEH. sec->soundorg.z = sec->floorheight; - S_StartSound(&sec->soundorg, sfx_crumbl); + S_StartSound(&sec->soundorg, mobjinfo[type].activesound); // Find the outermost vertexes in the subsector for (i = 0; i < sec->linecount; i++) @@ -2907,23 +2928,32 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) bottommostvertex = i; } - leftx = sec->lines[leftmostvertex]->v1->x+(16<lines[leftmostvertex]->v1->x+(spacing>>1); rightx = sec->lines[rightmostvertex]->v1->x; - topy = sec->lines[topmostvertex]->v1->y-(16<lines[topmostvertex]->v1->y-(spacing>>1); bottomy = sec->lines[bottommostvertex]->v1->y; - topz = *rover->topheight-(16<topheight-(spacing>>1); - for (a = leftx; a < rightx; a += (32<>3; + heightfactor = (topz - *rover->bottomheight)>>2; + + for (a = leftx; a < rightx; a += spacing) { - for (b = topy; b > bottomy; b -= (32< bottomy; b -= spacing) { if (R_PointInSubsector(a, b)->sector == sec) { mobj_t *spawned = NULL; - for (c = topz; c > *rover->bottomheight; c -= (32< *rover->bottomheight; c -= spacing) { spawned = P_SpawnMobj(a, b, c, type); - spawned->fuse = 3*TICRATE; + if (flags & ML_EFFECT1) + { + 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 - *rover->bottomheight), heightfactor), false); + } + if (lifetime != -1) + spawned->fuse = lifetime; } } } diff --git a/src/p_mobj.c b/src/p_mobj.c index 514952975..80cbcb486 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3068,8 +3068,13 @@ nightsdone: if (rover->flags & FF_MARIO && !(mo->eflags & MFE_VERTICALFLIP) // if you were flipped, your head isn't actually hitting your ceilingz is it? && *rover->bottomheight == mo->ceilingz) // The player's head hit the bottom! + { // DO THE MARIO! - EV_MarioBlock(rover->master->frontsector, node->m_sector, *rover->topheight, mo); + if (rover->master->flags & ML_NOCLIMB) // Brick block! + EV_CrumbleChain(node->m_sector, rover); + else // Question block! + EV_MarioBlock(rover->master->frontsector, node->m_sector, *rover->topheight, mo); + } } } // Ugly ugly billions of braces! Argh! } diff --git a/src/p_setup.c b/src/p_setup.c index b36bf0b80..659c45ed8 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -1476,6 +1476,7 @@ static void P_LoadSideDefs2(lumpnum_t lumpnum) break; } + case 14: // Bustable block parameter case 425: // Calls P_SetMobjState on calling mobj case 434: // Custom Power case 442: // Calls P_SetMobjState on mobjs of a given type in the tagged sectors diff --git a/src/p_spec.c b/src/p_spec.c index d2ac5b6a9..0112d02a7 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3712,7 +3712,7 @@ DoneSection2: } break; - case 7: // Bustable block sprite parameter + case 7: // N/A (formerly bustable block sprite parameters) case 8: case 9: case 10: