From 57cf1f870d634e9b660738f166d0ca26dddcaa12 Mon Sep 17 00:00:00 2001 From: spherallic Date: Tue, 25 Oct 2022 13:11:30 +0200 Subject: [PATCH] Fix Pterabyte spawns, revert mashing requirement, increase grace period --- src/p_enemy.c | 2 +- src/p_map.c | 2 +- src/p_user.c | 13 ++++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 4c36446af..cacec465e 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -14320,7 +14320,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); diff --git a/src/p_map.c b/src/p_map.c index 2bb02503f..039139be4 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -568,7 +568,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; } diff --git a/src/p_user.c b/src/p_user.c index 2f522ad4b..bdc6c097c 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4324,7 +4324,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); @@ -12655,6 +12655,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)); @@ -12662,7 +12665,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) @@ -12671,7 +12674,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 @@ -12680,7 +12683,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; } @@ -12688,7 +12691,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);