From 6ec3aa337cac4402fa08340e7f5c5b5ce4796c12 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 15 Aug 2018 00:48:13 -0400 Subject: [PATCH] Checkpoint: Force Egg Capsule time at 60 tics --- src/p_user.c | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index a6cefd85e..8a9d82c6c 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -5999,39 +5999,45 @@ static void P_DoNiGHTSCapsule(player_t *player) { INT32 popduration = max(60 - player->capsule->extravalue2, 1); INT32 spherecount = min(player->spheres, player->capsule->health); + player->capsule->extravalue1 = player->capsule->health - spherecount; player->capsule->lastlook = max(FixedRound(FixedDiv(spherecount, popduration))/FRACUNIT, 1); player->capsule->cusval = max(FixedFloor(FixedDiv(popduration, spherecount))/FRACUNIT, 1); player->capsule->movecount = player->capsule->extravalue2; } - if (player->spheres > 0) + if (player->capsule->extravalue2 - player->capsule->movecount < 60) { - if (!((player->capsule->extravalue2 - player->capsule->movecount) % player->capsule->cusval)) + if (!((player->capsule->extravalue2 - player->capsule->movecount) % player->capsule->cusval) + && player->capsule->health > player->capsule->extravalue1) { player->spheres -= player->capsule->lastlook; player->capsule->health -= player->capsule->lastlook; - player->capsule->extravalue1 += player->capsule->lastlook; + + if (player->spheres < 0) + player->spheres = 0; + + if (player->capsule->health < player->capsule->extravalue1) + player->capsule->health = player->capsule->extravalue1; } - if (player->spheres < 0) - player->spheres = 0; - - if (player->capsule->health < 0) - player->capsule->health = 0; - // Spawn a 'pop' for every 5 rings you deposit if (!((player->capsule->extravalue2 - player->capsule->movecount) % 5)) S_StartSound(P_SpawnMobj(player->capsule->x + ((P_SignedRandom()/2)<capsule->y + ((P_SignedRandom()/2)<capsule->z + (player->capsule->height/2) + ((P_SignedRandom()/2)<capsule->health > player->capsule->extravalue1) + player->capsule->health = player->capsule->extravalue1; if (player->capsule->health <= 0) { player->capsule->flags &= ~MF_NOGRAVITY; player->capsule->momz = 5*FRACUNIT; player->capsule->reactiontime = 0; - player->capsule->extravalue1 = player->capsule->extravalue2 = -1; + player->capsule->extravalue2 = -1; for (i = 0; i < MAXPLAYERS; i++) if (playeringame[i] && !player->exiting && players[i].mare == player->mare) @@ -6101,14 +6107,14 @@ static void P_DoNiGHTSCapsule(player_t *player) S_StartScreamSound(player->mo, sfx_ngdone); P_SwitchSpheresBonusMode(true); } - } - else - { - S_StartScreamSound(player->mo, sfx_lose); - player->texttimer = 4*TICRATE; - player->textvar = 3; // Get more rings! - player->capsule->reactiontime = 0; - player->capsule->extravalue1 = player->capsule->extravalue2 = player->capsule->lastlook = player->capsule->cusval = player->capsule->movecount = -1; + else + { + S_StartScreamSound(player->mo, sfx_lose); + player->texttimer = 4*TICRATE; + player->textvar = 3; // Get more rings! + player->capsule->reactiontime = 0; + player->capsule->extravalue1 = player->capsule->extravalue2 = player->capsule->lastlook = player->capsule->cusval = player->capsule->movecount = -1; + } } } else