Merge branch 'pterabyte-tweaks' into 'next'

Fix Pterabyte spawns (+ behavior tweaks)

See merge request STJr/SRB2!1839
This commit is contained in:
Eidolon 2022-11-13 23:40:56 +00:00
commit c5527f9470
3 changed files with 10 additions and 7 deletions

View file

@ -14322,7 +14322,7 @@ void A_SpawnPterabytes(mobj_t *actor)
return;
if (actor->spawnpoint)
amount = min(1, actor->spawnpoint->args[0]);
amount = max(1, actor->spawnpoint->args[0]);
interval = FixedAngle(FRACUNIT*360/amount);

View file

@ -593,7 +593,7 @@ static void P_DoPterabyteCarry(player_t *player, mobj_t *ptera)
player->mo->x = ptera->x;
player->mo->y = ptera->y;
P_SetThingPosition(player->mo);
ptera->movefactor = 3*TICRATE;
ptera->movefactor = 3*TICRATE; // timer before dropping
ptera->watertop = ptera->waterbottom = ptera->cusval = 0;
}

View file

@ -4370,7 +4370,7 @@ void P_DoJump(player_t *player, boolean soundandstate)
if (player->powers[pw_carry] == CR_PTERABYTE)
{
S_StartSound(player->mo, sfx_s3kd7s);
player->mo->tracer->cusval += 10;
player->mo->tracer->cusval += 10; // attempting to break free
player->mo->tracer->watertop = P_RandomRange(-player->mo->tracer->cusval, player->mo->tracer->cusval) << (FRACBITS - 1);
player->mo->tracer->waterbottom = P_RandomRange(-player->mo->tracer->cusval, player->mo->tracer->cusval) << (FRACBITS - 1);
player->mo->tracer->cvmem = P_RandomRange(-player->mo->tracer->cusval, player->mo->tracer->cusval) << (FRACBITS - 1);
@ -12712,6 +12712,9 @@ void P_PlayerAfterThink(player_t *player)
}
case CR_PTERABYTE: // being carried by a Pterabyte
{
#define DROPTHRESHOLD TICRATE
mobj_t *ptera = player->mo->tracer;
mobj_t *spawnpoint = ptera->tracer->tracer;
player->mo->height = FixedDiv(P_GetPlayerHeight(player), FixedDiv(14 * FRACUNIT, 10 * FRACUNIT));
@ -12719,7 +12722,7 @@ void P_PlayerAfterThink(player_t *player)
if (ptera->health <= 0)
goto dropoff;
if (P_MobjAboveLava(ptera) && ptera->movefactor <= 3*TICRATE - 10)
if (P_MobjAboveLava(ptera) && ptera->movefactor < DROPTHRESHOLD)
goto dropoff;
if (player->mo->eflags & MFE_VERTICALFLIP)
@ -12728,7 +12731,7 @@ void P_PlayerAfterThink(player_t *player)
&& (ptera->eflags & MFE_VERTICALFLIP)) // Reverse gravity check for the carrier - Flame
player->mo->z = ptera->z + ptera->height + FixedMul(FRACUNIT, player->mo->scale);
if (ptera->ceilingz - ptera->z > spawnpoint->ceilingz - spawnpoint->z + 512*FRACUNIT && ptera->movefactor <= 3 * TICRATE - 10)
if (ptera->ceilingz - ptera->z > spawnpoint->ceilingz - spawnpoint->z + 512*FRACUNIT && ptera->movefactor < DROPTHRESHOLD)
goto dropoff;
}
else
@ -12737,7 +12740,7 @@ void P_PlayerAfterThink(player_t *player)
&& !(ptera->eflags & MFE_VERTICALFLIP)) // Correct gravity check for the carrier - Flame
player->mo->z = ptera->z - player->mo->height - FixedMul(FRACUNIT, player->mo->scale);
if (ptera->z - ptera->floorz > spawnpoint->z - spawnpoint->floorz + 512 * FRACUNIT && ptera->movefactor <= 3 * TICRATE - 10)
if (ptera->z - ptera->floorz > spawnpoint->z - spawnpoint->floorz + 512 * FRACUNIT && ptera->movefactor < DROPTHRESHOLD)
goto dropoff;
}
@ -12745,7 +12748,7 @@ void P_PlayerAfterThink(player_t *player)
if (!ptera->movefactor)
goto dropoff;
if (ptera->cusval >= 30)
if (ptera->cusval >= 50) // breaking free
{
player->powers[pw_carry] = CR_NONE;
P_SetTarget(&player->mo->tracer, NULL);