Merge branch 'linedef-153' into 'master'
Dynamic Sinking Platform (for Red Volcano Zone) See merge request STJr/SRB2Internal!401
This commit is contained in:
commit
1c1fefe25f
|
@ -2425,7 +2425,7 @@ void T_RaiseSector(levelspecthink_t *raise)
|
||||||
mobj_t *thing;
|
mobj_t *thing;
|
||||||
sector_t *sector;
|
sector_t *sector;
|
||||||
INT32 i;
|
INT32 i;
|
||||||
boolean playeronme = false;
|
boolean playeronme = false, active = false;
|
||||||
fixed_t ceilingdestination, floordestination;
|
fixed_t ceilingdestination, floordestination;
|
||||||
result_e res = 0;
|
result_e res = 0;
|
||||||
|
|
||||||
|
@ -2460,7 +2460,52 @@ void T_RaiseSector(levelspecthink_t *raise)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (raise->vars[9]) // Dynamically Sinking Platform^tm
|
||||||
|
{
|
||||||
|
#define shaketime 10
|
||||||
|
if (raise->vars[11] > shaketime) // State: moving
|
||||||
|
{
|
||||||
|
if (playeronme) // If player is standing on the platform, accelerate
|
||||||
|
{
|
||||||
|
raise->vars[10] += (FRACUNIT >> 5);
|
||||||
|
}
|
||||||
|
else // otherwise, decelerate until inflection
|
||||||
|
{
|
||||||
|
raise->vars[10] -= FRACUNIT >> 3;
|
||||||
|
if (raise->vars[10] <= 0) // inflection!
|
||||||
|
{
|
||||||
|
raise->vars[10] = 0;
|
||||||
|
raise->vars[11] = 0; // allow the shake to occur again (fucks over players attempting to jump-cheese)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
active = raise->vars[10] > 0;
|
||||||
|
}
|
||||||
|
else // State: shaking
|
||||||
|
{
|
||||||
|
if (playeronme || raise->vars[11])
|
||||||
|
{
|
||||||
|
active = true;
|
||||||
|
if (++raise->vars[11] > shaketime)
|
||||||
|
{
|
||||||
if (playeronme)
|
if (playeronme)
|
||||||
|
raise->vars[10] = FRACUNIT >> 5;
|
||||||
|
else
|
||||||
|
raise->vars[10] = FRACUNIT << 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
raise->vars[10] = ((shaketime/2) - raise->vars[11]) << FRACBITS;
|
||||||
|
if (raise->vars[10] < -raise->vars[2]/2)
|
||||||
|
raise->vars[10] = -raise->vars[2]/2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#undef shaketime
|
||||||
|
}
|
||||||
|
else // Air bobbing platform (not a Dynamically Sinking Platform^tm)
|
||||||
|
active = playeronme;
|
||||||
|
|
||||||
|
if (active)
|
||||||
{
|
{
|
||||||
raise->vars[3] = raise->vars[2];
|
raise->vars[3] = raise->vars[2];
|
||||||
|
|
||||||
|
@ -2554,6 +2599,8 @@ void T_RaiseSector(levelspecthink_t *raise)
|
||||||
raise->vars[3] = origspeed;
|
raise->vars[3] = origspeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
raise->vars[3] += raise->vars[10];
|
||||||
|
|
||||||
res = T_MovePlane
|
res = T_MovePlane
|
||||||
(
|
(
|
||||||
raise->sector, // sector
|
raise->sector, // sector
|
||||||
|
|
22
src/p_spec.c
22
src/p_spec.c
|
@ -5987,8 +5987,6 @@ static void P_AddBlockThinker(sector_t *sec, line_t *sourceline)
|
||||||
* to the lowest nearby height if not
|
* to the lowest nearby height if not
|
||||||
* there already.
|
* there already.
|
||||||
*
|
*
|
||||||
* Replaces the old "AirBob".
|
|
||||||
*
|
|
||||||
* \param sec Control sector.
|
* \param sec Control sector.
|
||||||
* \param actionsector Target sector.
|
* \param actionsector Target sector.
|
||||||
* \param sourceline Control linedef.
|
* \param sourceline Control linedef.
|
||||||
|
@ -6033,8 +6031,7 @@ static void P_AddRaiseThinker(sector_t *sec, line_t *sourceline)
|
||||||
raise->sourceline = sourceline;
|
raise->sourceline = sourceline;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to maintain backwards compatibility
|
static void P_AddAirbob(sector_t *sec, line_t *sourceline, boolean noadjust, boolean dynamic)
|
||||||
static void P_AddOldAirbob(sector_t *sec, line_t *sourceline, boolean noadjust)
|
|
||||||
{
|
{
|
||||||
levelspecthink_t *airbob;
|
levelspecthink_t *airbob;
|
||||||
|
|
||||||
|
@ -6072,6 +6069,8 @@ static void P_AddOldAirbob(sector_t *sec, line_t *sourceline, boolean noadjust)
|
||||||
airbob->vars[4] = airbob->vars[5]
|
airbob->vars[4] = airbob->vars[5]
|
||||||
- (sec->ceilingheight - sec->floorheight);
|
- (sec->ceilingheight - sec->floorheight);
|
||||||
|
|
||||||
|
airbob->vars[9] = dynamic ? 1 : 0;
|
||||||
|
|
||||||
airbob->sourceline = sourceline;
|
airbob->sourceline = sourceline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6894,11 +6893,16 @@ void P_SpawnSpecials(INT32 fromnetsave)
|
||||||
case 151: // Adjustable air bobbing platform
|
case 151: // Adjustable air bobbing platform
|
||||||
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL, secthinkers);
|
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL, secthinkers);
|
||||||
lines[i].flags |= ML_BLOCKMONSTERS;
|
lines[i].flags |= ML_BLOCKMONSTERS;
|
||||||
P_AddOldAirbob(lines[i].frontsector, lines + i, (lines[i].special != 151));
|
P_AddAirbob(lines[i].frontsector, lines + i, (lines[i].special != 151), false);
|
||||||
break;
|
break;
|
||||||
case 152: // Adjustable air bobbing platform in reverse
|
case 152: // Adjustable air bobbing platform in reverse
|
||||||
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL, secthinkers);
|
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL, secthinkers);
|
||||||
P_AddOldAirbob(lines[i].frontsector, lines + i, true);
|
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);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 160: // Float/bob platform
|
case 160: // Float/bob platform
|
||||||
|
@ -6949,14 +6953,14 @@ void P_SpawnSpecials(INT32 fromnetsave)
|
||||||
case 176: // Air bobbing platform that will crumble and bob on the water when it falls and hits
|
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);
|
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_FLOATBOB|FF_CRUMBLE, secthinkers);
|
||||||
lines[i].flags |= ML_BLOCKMONSTERS;
|
lines[i].flags |= ML_BLOCKMONSTERS;
|
||||||
P_AddOldAirbob(lines[i].frontsector, lines + i, true);
|
P_AddAirbob(lines[i].frontsector, lines + i, true, false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 177: // Air bobbing platform that will crumble and bob on
|
case 177: // Air bobbing platform that will crumble and bob on
|
||||||
// the water when it falls and hits, then never return
|
// 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);
|
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL|FF_FLOATBOB|FF_CRUMBLE|FF_NORETURN, secthinkers);
|
||||||
lines[i].flags |= ML_BLOCKMONSTERS;
|
lines[i].flags |= ML_BLOCKMONSTERS;
|
||||||
P_AddOldAirbob(lines[i].frontsector, lines + i, true);
|
P_AddAirbob(lines[i].frontsector, lines + i, true, false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 178: // Crumbling platform that will float when it hits water
|
case 178: // Crumbling platform that will float when it hits water
|
||||||
|
@ -6970,7 +6974,7 @@ void P_SpawnSpecials(INT32 fromnetsave)
|
||||||
case 180: // Air bobbing platform that will crumble
|
case 180: // Air bobbing platform that will crumble
|
||||||
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL|FF_CRUMBLE, secthinkers);
|
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL|FF_CRUMBLE, secthinkers);
|
||||||
lines[i].flags |= ML_BLOCKMONSTERS;
|
lines[i].flags |= ML_BLOCKMONSTERS;
|
||||||
P_AddOldAirbob(lines[i].frontsector, lines + i, true);
|
P_AddAirbob(lines[i].frontsector, lines + i, true, false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 190: // Rising Platform FOF (solid, opaque, shadows)
|
case 190: // Rising Platform FOF (solid, opaque, shadows)
|
||||||
|
|
Loading…
Reference in New Issue