Merge branch 'spinbust' into 'master'

Make spinbust behavior consistent with other bustable blocks

Closes #254

See merge request STJr/SRB2Internal!398
This commit is contained in:
MascaraSnake 2019-10-23 02:51:47 -04:00
commit 0ef50557c2
5 changed files with 36 additions and 33 deletions

View File

@ -1527,7 +1527,7 @@ linedeftypes
title = "Bustable Block";
prefix = "(254)";
flags8text = "[3] Slope skew sides";
flags64text = "[6] Only bustable by Knuckles";
flags64text = "[6] Strong characters only";
flags128text = "[7] Only block non-players";
flags512text = "[9] Shattered by pushables";
flags1024text = "[10] Trigger linedef executor";

View File

@ -8919,9 +8919,9 @@ struct {
{"FF_PLATFORM",FF_PLATFORM}, ///< You can jump up through this to the top.
{"FF_REVERSEPLATFORM",FF_REVERSEPLATFORM}, ///< A fall-through floor in normal gravity, a platform in reverse gravity.
{"FF_INTANGABLEFLATS",FF_INTANGABLEFLATS}, ///< Both flats are intangable, but the sides are still solid.
{"FF_SHATTER",FF_SHATTER}, ///< Used with ::FF_BUSTUP. Thinks everyone's Knuckles.
{"FF_SPINBUST",FF_SPINBUST}, ///< Used with ::FF_BUSTUP. Jump or fall onto it while curled in a ball.
{"FF_ONLYKNUX",FF_ONLYKNUX}, ///< Used with ::FF_BUSTUP. Only Knuckles can break this rock.
{"FF_SHATTER",FF_SHATTER}, ///< Used with ::FF_BUSTUP. Bustable on mere touch.
{"FF_SPINBUST",FF_SPINBUST}, ///< Used with ::FF_BUSTUP. Also bustable if you're in your spinning frames.
{"FF_STRONGBUST",FF_STRONGBUST }, ///< Used with ::FF_BUSTUP. Only bustable by "strong" characters (Knuckles) and abilities (bouncing, twinspin, melee).
{"FF_RIPPLE",FF_RIPPLE}, ///< Ripple the flats
{"FF_COLORMAPONLY",FF_COLORMAPONLY}, ///< Only copy the colormap, not the lightlevel
{"FF_GOOWATER",FF_GOOWATER}, ///< Used with ::FF_SWIMMABLE. Makes thick bouncey goop.

View File

@ -7092,7 +7092,7 @@ void P_SpawnSpecials(INT32 fromnetsave)
case 254: // Bustable block
ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_BUSTUP;
if (lines[i].flags & ML_NOCLIMB)
ffloorflags |= FF_ONLYKNUX;
ffloorflags |= FF_STRONGBUST;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break;

View File

@ -2456,39 +2456,42 @@ static void P_CheckBustableBlocks(player_t *player)
if ((rover->flags & FF_BUSTUP)/* && !rover->master->frontsector->crumblestate*/)
{
// If it's an FF_SPINBUST, you have to either be jumping, or coming down
// onto the top from a spin.
if (rover->flags & FF_SPINBUST && ((!(player->pflags & PF_JUMPED) && !(player->pflags & PF_SPINNING) && !(player->pflags & PF_BOUNCING)) || (player->pflags & PF_STARTDASH)))
// If it's an FF_SHATTER, you can break it just by touching it.
if (rover->flags & FF_SHATTER)
goto bust;
// If it's an FF_SPINBUST, you can break it if you are in your spinning frames
// (either from jumping or spindashing).
if (rover->flags & FF_SPINBUST
&& (((player->pflags & PF_SPINNING) && !(player->pflags & PF_STARTDASH))
|| (player->pflags & PF_JUMPED && !(player->pflags & PF_NOJUMPDAMAGE))))
goto bust;
// You can always break it if you have CA_GLIDEANDCLIMB
// or if you are bouncing on it
// or you are using CA_TWINSPIN/CA2_MELEE.
if (player->charability == CA_GLIDEANDCLIMB
|| (player->pflags & PF_BOUNCING)
|| ((player->charability == CA_TWINSPIN) && (player->panim == PA_ABILITY))
|| (player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2))
goto bust;
if (rover->flags & FF_STRONGBUST)
continue;
// if it's not an FF_SHATTER, you must be spinning (and not jumping)
// or be super
// or have CA_GLIDEANDCLIMB
// or be in dashmode with SF_DASHMODE
// or be using CA_TWINSPIN
// or be using CA2_MELEE
// or are drilling in NiGHTS
// or are recording for Metal Sonic
if (!(rover->flags & FF_SHATTER) && !(rover->flags & FF_SPINBUST)
&& !((player->pflags & PF_SPINNING) && !(player->pflags & PF_JUMPED))
// If it's not an FF_STRONGBUST, you can break if you are spinning (and not jumping)
// or you are super
// or you are in dashmode with SF_DASHMODE
// or you are drilling in NiGHTS
// or you are recording for Metal Sonic
if (!((player->pflags & PF_SPINNING) && !(player->pflags & PF_JUMPED))
&& !(player->powers[pw_super])
&& !(player->charability == CA_GLIDEANDCLIMB)
&& !(player->pflags & PF_BOUNCING)
&& !((player->charflags & SF_DASHMODE) && (player->dashmode >= 3*TICRATE))
&& !((player->charability == CA_TWINSPIN) && (player->panim == PA_ABILITY))
&& !(player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2)
&& !(player->pflags & PF_DRILLING)
&& !metalrecording)
continue;
// Only players with CA_GLIDEANDCLIMB, or CA_TWINSPIN/CA2_MELEE users can break this rock...
if (!(rover->flags & FF_SHATTER) && (rover->flags & FF_ONLYKNUX)
&& !(player->charability == CA_GLIDEANDCLIMB
|| (player->pflags & PF_BOUNCING)
|| ((player->charability == CA_TWINSPIN) && (player->panim == PA_ABILITY))
|| (player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2)))
continue;
bust:
topheight = P_GetFOFTopZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL);
bottomheight = P_GetFOFBottomZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL);

View File

@ -139,9 +139,9 @@ typedef enum
FF_PLATFORM = 0x2000000, ///< You can jump up through this to the top.
FF_REVERSEPLATFORM = 0x4000000, ///< A fall-through floor in normal gravity, a platform in reverse gravity.
FF_INTANGABLEFLATS = 0x6000000, ///< Both flats are intangable, but the sides are still solid.
FF_SHATTER = 0x8000000, ///< Used with ::FF_BUSTUP. Thinks everyone's Knuckles.
FF_SPINBUST = 0x10000000, ///< Used with ::FF_BUSTUP. Jump or fall onto it while curled in a ball.
FF_ONLYKNUX = 0x20000000, ///< Used with ::FF_BUSTUP. Only Knuckles can break this rock.
FF_SHATTER = 0x8000000, ///< Used with ::FF_BUSTUP. Bustable on mere touch.
FF_SPINBUST = 0x10000000, ///< Used with ::FF_BUSTUP. Also bustable if you're in your spinning frames.
FF_STRONGBUST = 0x20000000, ///< Used with ::FF_BUSTUP. Only bustable by "strong" characters (Knuckles) and abilities (bouncing, twinspin, melee).
FF_RIPPLE = 0x40000000, ///< Ripple the flats
FF_COLORMAPONLY = 0x80000000, ///< Only copy the colormap, not the lightlevel
FF_GOOWATER = FF_SHATTERBOTTOM, ///< Used with ::FF_SWIMMABLE. Makes thick bouncey goop.