From 9faace9e5d7bc6c41859e28b102ad32b711eafea Mon Sep 17 00:00:00 2001 From: mazmazz Date: Tue, 14 Aug 2018 19:17:34 -0400 Subject: [PATCH 01/14] capsule->extravalue2 tic timer --- src/p_mobj.c | 3 ++- src/p_user.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 4353e67c3..b88692d76 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8751,7 +8751,8 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) nummaprings = -1; // no perfect bonus, rings are free break; case MT_EGGCAPSULE: - mobj->extravalue1 = -1; // timer for how long a player has been at the capsule + mobj->extravalue1 = -1; // sphere timer for how long a player has been at the capsule + mobj->extravalue2 = -1; // tic timer for how long a player has been at the capsule break; case MT_REDTEAMRING: mobj->color = skincolor_redteam; diff --git a/src/p_user.c b/src/p_user.c index fd09b0847..a89deaa9e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -5927,6 +5927,8 @@ static void P_DoNiGHTSCapsule(player_t *player) { INT32 i; + player->capsule->extravalue2++; + if (abs(player->mo->x-player->capsule->x) <= 2*FRACUNIT) { P_UnsetThingPosition(player->mo); @@ -6011,7 +6013,7 @@ static void P_DoNiGHTSCapsule(player_t *player) player->capsule->flags &= ~MF_NOGRAVITY; player->capsule->momz = 5*FRACUNIT; player->capsule->reactiontime = 0; - player->capsule->extravalue1 = -1; + player->capsule->extravalue1 = player->capsule->extravalue2 = -1; for (i = 0; i < MAXPLAYERS; i++) if (playeringame[i] && !player->exiting && players[i].mare == player->mare) @@ -6088,7 +6090,7 @@ static void P_DoNiGHTSCapsule(player_t *player) player->texttimer = 4*TICRATE; player->textvar = 3; // Get more rings! player->capsule->reactiontime = 0; - player->capsule->extravalue1 = -1; + player->capsule->extravalue1 = player->capsule->extravalue2 = -1; } } else From 56d8f47aaa5aa600a391ae4ef40e55a8dd26398d Mon Sep 17 00:00:00 2001 From: mazmazz Date: Tue, 14 Aug 2018 19:39:25 -0400 Subject: [PATCH 02/14] Nights capsule faster attract timing --- src/p_user.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index a89deaa9e..35274f7a9 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -5929,7 +5929,7 @@ static void P_DoNiGHTSCapsule(player_t *player) player->capsule->extravalue2++; - if (abs(player->mo->x-player->capsule->x) <= 2*FRACUNIT) + if (abs(player->mo->x-player->capsule->x) <= 3*FRACUNIT) { P_UnsetThingPosition(player->mo); player->mo->x = player->capsule->x; @@ -5937,7 +5937,7 @@ static void P_DoNiGHTSCapsule(player_t *player) player->mo->momx = 0; } - if (abs(player->mo->y-player->capsule->y) <= 2*FRACUNIT) + if (abs(player->mo->y-player->capsule->y) <= 3*FRACUNIT) { P_UnsetThingPosition(player->mo); player->mo->y = player->capsule->y; @@ -5952,19 +5952,19 @@ static void P_DoNiGHTSCapsule(player_t *player) } if (player->mo->x > player->capsule->x) - player->mo->momx = -2*FRACUNIT; + player->mo->momx = -3*FRACUNIT; else if (player->mo->x < player->capsule->x) - player->mo->momx = 2*FRACUNIT; + player->mo->momx = 3*FRACUNIT; if (player->mo->y > player->capsule->y) - player->mo->momy = -2*FRACUNIT; + player->mo->momy = -3*FRACUNIT; else if (player->mo->y < player->capsule->y) - player->mo->momy = 2*FRACUNIT; + player->mo->momy = 3*FRACUNIT; if (player->mo->z > player->capsule->z+(player->capsule->height/3)) - player->mo->momz = -2*FRACUNIT; + player->mo->momz = -3*FRACUNIT; else if (player->mo->z < player->capsule->z+(player->capsule->height/3)) - player->mo->momz = 2*FRACUNIT; + player->mo->momz = 3*FRACUNIT; if (player->powers[pw_carry] == CR_NIGHTSMODE) { From 7cdce4324b05a891259fd5c11afc82a795825333 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Tue, 14 Aug 2018 20:10:32 -0400 Subject: [PATCH 03/14] Attempt 1: Guesstimate sphere pop rate and use that as the Capsule handling duration --- src/p_mobj.c | 7 +++++-- src/p_user.c | 28 +++++++++++++++++++++++----- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index b88692d76..08b705de9 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8751,8 +8751,11 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) nummaprings = -1; // no perfect bonus, rings are free break; case MT_EGGCAPSULE: - mobj->extravalue1 = -1; // sphere timer for how long a player has been at the capsule - mobj->extravalue2 = -1; // tic timer for how long a player has been at the capsule + mobj->extravalue1 = -1; // sphere timer for how long a player has been at the capsule + mobj->extravalue2 = -1; // tic timer for how long a player has been at the capsule + mobj->lastlook = -1; + mobj->cusval = -1; + mobj->movecount = -1; break; case MT_REDTEAMRING: mobj->color = skincolor_redteam; diff --git a/src/p_user.c b/src/p_user.c index 35274f7a9..a6cefd85e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -5995,14 +5995,32 @@ static void P_DoNiGHTSCapsule(player_t *player) && player->mo->y == player->capsule->y && player->mo->z == player->capsule->z+(player->capsule->height/3)) { + if (player->capsule->lastlook < 0) + { + INT32 popduration = max(60 - player->capsule->extravalue2, 1); + INT32 spherecount = min(player->spheres, player->capsule->health); + 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) { - player->spheres--; - player->capsule->health--; - player->capsule->extravalue1++; + if (!((player->capsule->extravalue2 - player->capsule->movecount) % player->capsule->cusval)) + { + 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 < 0) + player->capsule->health = 0; // Spawn a 'pop' for every 5 rings you deposit - if (!(player->capsule->extravalue1 % 5)) + 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)<texttimer = 4*TICRATE; player->textvar = 3; // Get more rings! player->capsule->reactiontime = 0; - player->capsule->extravalue1 = player->capsule->extravalue2 = -1; + player->capsule->extravalue1 = player->capsule->extravalue2 = player->capsule->lastlook = player->capsule->cusval = player->capsule->movecount = -1; } } else From 11075717449c5ca32634a848ea117899836a2020 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 15 Aug 2018 00:48:13 -0400 Subject: [PATCH 04/14] 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 From 52e451aad58b1464bf1a3d4bd98809e81c2696a9 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 15 Aug 2018 12:22:46 -0400 Subject: [PATCH 05/14] Counter fix --- src/p_user.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 56c0848de..87f32ccdb 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6003,9 +6003,10 @@ static void P_DoNiGHTSCapsule(player_t *player) 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; + player->capsule->cvmem = popduration; } - if (player->capsule->extravalue2 - player->capsule->movecount < 60) + if (player->capsule->extravalue2 - player->capsule->movecount < player->capsule->cvmem) { if (!((player->capsule->extravalue2 - player->capsule->movecount) % player->capsule->cusval) && player->capsule->health > player->capsule->extravalue1) From 59f71e4c48d5faa4fa8c5baf41b91aca7fedfac9 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 15 Aug 2018 12:29:06 -0400 Subject: [PATCH 06/14] Make camera further if on-foot and destroying the Egg Capsule --- src/p_user.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 87f32ccdb..4219630ef 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8927,7 +8927,8 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall // sets ideal cam pos if (twodlevel || (mo->flags2 & MF2_TWOD)) dist = 480<powers[pw_carry] == CR_NIGHTSMODE) + else if (player->powers[pw_carry] == CR_NIGHTSMODE + || ((maptol & TOL_NIGHTS) && player->capsule && player->capsule->reactiontime > 0 && player == &players[player->capsule->reactiontime-1])) dist = 320< Date: Wed, 15 Aug 2018 13:38:15 -0400 Subject: [PATCH 07/14] Fixed capsule timing logic * Force a total time, stretch out sphere deduction within that time * Make it more readable --- src/p_mobj.c | 9 ++++---- src/p_user.c | 63 ++++++++++++++++++++++++++++++++-------------------- 2 files changed, 43 insertions(+), 29 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index b5cb5de83..3a2498c07 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8751,11 +8751,10 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) nummaprings = -1; // no perfect bonus, rings are free break; case MT_EGGCAPSULE: - mobj->extravalue1 = -1; // sphere timer for how long a player has been at the capsule - mobj->extravalue2 = -1; // tic timer for how long a player has been at the capsule - mobj->lastlook = -1; - mobj->cusval = -1; - mobj->movecount = -1; + mobj->reactiontime = 0; + mobj->extravalue1 = mobj->cvmem =\ + mobj->cusval = mobj->movecount =\ + mobj->lastlook = mobj->extravalue2 = -1; break; case MT_REDTEAMRING: mobj->color = skincolor_redteam; diff --git a/src/p_user.c b/src/p_user.c index 4219630ef..11d1681ba 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -5925,9 +5925,8 @@ static void P_NightsTransferPoints(player_t *player, fixed_t xspeed, fixed_t rad // static void P_DoNiGHTSCapsule(player_t *player) { - INT32 i; - - player->capsule->extravalue2++; + INT32 i, spherecount, totalduration, popduration, deductinterval, deductquantity, sphereresult, firstpoptic; + INT32 tictimer = ++player->capsule->extravalue2; if (abs(player->mo->x-player->capsule->x) <= 3*FRACUNIT) { @@ -5997,32 +5996,46 @@ static void P_DoNiGHTSCapsule(player_t *player) { if (player->capsule->lastlook < 0) { - 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; - player->capsule->cvmem = popduration; + // Stretch the sphere deduction across the capsule time! + // 1. Force the remaining capsule time to `popduration` + // 2. Given `popduration` and `spherecount`, at what tic interval do we deduct spheres? `deductinterval` + // 3. And on each deduction, how many spheres do we deduct? `deductquantity` + // 4. Store the expected capsule health upon completion: `sphereresult` + spherecount = min(player->spheres, player->capsule->health); + totalduration = min(40 + spherecount, 60); + + popduration = player->capsule->extravalue1 = max(totalduration - tictimer, 1); + deductinterval = player->capsule->cvmem = max(FixedFloor(FixedDiv(popduration, spherecount))/FRACUNIT, 1); + deductquantity = player->capsule->cusval = max(FixedRound(FixedDiv(spherecount, popduration))/FRACUNIT, 1); + sphereresult = player->capsule->movecount = player->capsule->health - spherecount; + firstpoptic = player->capsule->lastlook = tictimer; + } + else + { + popduration = player->capsule->extravalue1; + deductinterval = player->capsule->cvmem; + deductquantity = player->capsule->cusval; + sphereresult = player->capsule->movecount; + firstpoptic = player->capsule->lastlook; } - if (player->capsule->extravalue2 - player->capsule->movecount < player->capsule->cvmem) + if (tictimer - firstpoptic < popduration) { - if (!((player->capsule->extravalue2 - player->capsule->movecount) % player->capsule->cusval) - && player->capsule->health > player->capsule->extravalue1) + if (!((tictimer - firstpoptic) % deductinterval) + && player->capsule->health > sphereresult) { - player->spheres -= player->capsule->lastlook; - player->capsule->health -= player->capsule->lastlook; + player->spheres -= deductquantity; + player->capsule->health -= deductquantity; if (player->spheres < 0) player->spheres = 0; - if (player->capsule->health < player->capsule->extravalue1) - player->capsule->health = player->capsule->extravalue1; + if (player->capsule->health < sphereresult) + player->capsule->health = sphereresult; } - // Spawn a 'pop' for every 5 rings you deposit - if (!((player->capsule->extravalue2 - player->capsule->movecount) % 5)) + // Spawn a 'pop' for every 5 tics + if (!((tictimer - firstpoptic) % 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 > sphereresult) + player->capsule->health = sphereresult; if (player->capsule->health <= 0) { player->capsule->flags &= ~MF_NOGRAVITY; player->capsule->momz = 5*FRACUNIT; player->capsule->reactiontime = 0; - player->capsule->extravalue2 = -1; + tictimer = -1; for (i = 0; i < MAXPLAYERS; i++) if (playeringame[i] && !player->exiting && players[i].mare == player->mare) @@ -6124,12 +6137,14 @@ static void P_DoNiGHTSCapsule(player_t *player) 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; + player->capsule->extravalue1 = player->capsule->cvmem =\ + player->capsule->cusval = player->capsule->movecount =\ + player->capsule->lastlook = player->capsule->extravalue2 = -1; } } } else - player->capsule->extravalue1 = -1; + player->capsule->lastlook = -1; } // From ae0b7c9be8123b44f15084b8469f93864713a14e Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 15 Aug 2018 13:49:03 -0400 Subject: [PATCH 08/14] Fix issue where capsule immediately re-triggers if player gains rings during destruct --- src/p_user.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index 11d1681ba..98b35ab4c 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6046,6 +6046,10 @@ static void P_DoNiGHTSCapsule(player_t *player) if (player->capsule->health > sphereresult) player->capsule->health = sphereresult; + // did player somehow get more spheres? deduct that too + if (player->spheres > 0) + player->capsule->health -= player->spheres; + if (player->capsule->health <= 0) { player->capsule->flags &= ~MF_NOGRAVITY; From 45612f9add00eff05c54532fbddfef0432a5663c Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 15 Aug 2018 13:59:27 -0400 Subject: [PATCH 09/14] Recalc capsule timing when leaving the capsule during destruct sequence (somehow) * Would be nice to have more sophisticated behavior, e.g., resume the old timing; or drop out the capsule entirely. But how often is this case really going to happen? --- src/p_user.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 98b35ab4c..7d002561a 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6147,8 +6147,10 @@ static void P_DoNiGHTSCapsule(player_t *player) } } } - else - player->capsule->lastlook = -1; + else if (player->capsule->lastlook > -1) + // We somehow moved out of the capsule (OBJECTPLACE?) + // So recalculate all the timings + player->capsule->lastlook = player->capsule->extravalue2 = -1; } // From c3cb08d7124222196ce004a016851765a266a520 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 15 Aug 2018 14:40:25 -0400 Subject: [PATCH 10/14] Reconcile spheres at end of destruct if you somehow gained or lost an unexpected # after timing calculations --- src/p_user.c | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 7d002561a..8c5c253c5 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -5925,7 +5925,7 @@ static void P_NightsTransferPoints(player_t *player, fixed_t xspeed, fixed_t rad // static void P_DoNiGHTSCapsule(player_t *player) { - INT32 i, spherecount, totalduration, popduration, deductinterval, deductquantity, sphereresult, firstpoptic; + INT32 i, spherecount, totalduration, popduration, deductinterval, deductquantity, sphereresult, firstpoptic, startingspheres; INT32 tictimer = ++player->capsule->extravalue2; if (abs(player->mo->x-player->capsule->x) <= 3*FRACUNIT) @@ -6021,11 +6021,17 @@ static void P_DoNiGHTSCapsule(player_t *player) if (tictimer - firstpoptic < popduration) { - if (!((tictimer - firstpoptic) % deductinterval) - && player->capsule->health > sphereresult) + if (!((tictimer - firstpoptic) % deductinterval)) { - player->spheres -= deductquantity; - player->capsule->health -= deductquantity; + // Did you somehow get more spheres during destruct? + if (player->capsule->health <= sphereresult && player->spheres > 0 && player->capsule->health > 0) + sphereresult = max(sphereresult - player->spheres, 0); + + if (player->capsule->health > sphereresult && player->spheres > 0) + { + player->spheres -= deductquantity; + player->capsule->health -= deductquantity; + } if (player->spheres < 0) player->spheres = 0; @@ -6043,12 +6049,20 @@ static void P_DoNiGHTSCapsule(player_t *player) } else { - if (player->capsule->health > sphereresult) - player->capsule->health = sphereresult; - - // did player somehow get more spheres? deduct that too - if (player->spheres > 0) - player->capsule->health -= player->spheres; + if (player->spheres != 0 && player->capsule->health > 0) + { + if (player->spheres < player->capsule->health) + { + player->capsule->health -= player->spheres; + player->spheres = 0; + } + else + { + startingspheres = player->spheres - player->capsule->health; + player->capsule->health = 0; + player->spheres = startingspheres; + } + } if (player->capsule->health <= 0) { From 81dade0cc42bd6424a563ea3fad6633b65feee6d Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 15 Aug 2018 23:11:32 -0400 Subject: [PATCH 11/14] Force non-nights player into rolling animation when destructing capsule --- src/p_user.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index 8c5c253c5..7d6c4d36b 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -5978,6 +5978,13 @@ static void P_DoNiGHTSCapsule(player_t *player) P_SetPlayerMobjState(player->mo, S_PLAY_NIGHTS_ATTACK); } } + else + { + if (!(player->pflags & PF_JUMPED) && !(player->pflags & PF_SPINNING)) + player->pflags |= PF_JUMPED; + if (player->panim != PA_ROLL) + P_SetPlayerMobjState(player->mo, S_PLAY_ROLL); + } if (G_IsSpecialStage(gamemap)) { // In special stages, share rings. Everyone gives up theirs to the capsule player always, because we can't have any individualism here! From c0ffbdafce4100d7e8fd8560bc8821b2e1d44b6c Mon Sep 17 00:00:00 2001 From: mazmazz Date: Fri, 7 Sep 2018 08:56:53 -0400 Subject: [PATCH 12/14] Revert "Ideya fixes when a player has more than one Ideya" This reverts commit e3facccb9d624c4d390eddca99cc7e258676f852. --- src/p_inter.c | 11 +++-------- src/p_mobj.c | 1 - src/p_user.c | 10 ---------- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 135dfa2e8..4c9bba896 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -799,15 +799,10 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (toucher->tracer) // Move the ideya over to the drone! { mobj_t *hnext = special->hnext; - P_SetTarget(&special->hnext, toucher->tracer); - if (!special->hnext->hnext) - P_SetTarget(&special->hnext->hnext, hnext); // Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo. - else - P_SetTarget(&special->hnext->hnext->target, special); + P_SetTarget(&special->hnext->hnext, hnext); // Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo. P_SetTarget(&special->hnext->target, special); P_SetTarget(&toucher->tracer, NULL); - if (hnext) { special->hnext->extravalue1 = (angle_t)(hnext->extravalue1 - 72*ANG1); @@ -966,8 +961,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (player->powers[pw_carry] == CR_NIGHTSMODE && !toucher->target) return; - if (toucher->tracer && toucher->tracer->health > 0) - return; // Don't have multiple ideya, unless it's the first one given (health = 0) + if (toucher->tracer && toucher->tracer->state-states > S_ORBIDYA1) + return; // Don't have multiple ideya, unless it's the first one given if (player->mare != special->threshold) // wrong mare return; diff --git a/src/p_mobj.c b/src/p_mobj.c index fb354e79b..6aec4bdd6 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9500,7 +9500,6 @@ void P_SpawnPlayer(INT32 playernum) if (p == players) // this is totally the wrong place to do this aaargh. { mobj_t *idya = P_SpawnMobjFromMobj(mobj, 0, 0, mobj->height, MT_GOTEMERALD); - idya->health = 0; // for identification P_SetTarget(&idya->target, mobj); P_SetMobjState(idya, mobjinfo[MT_GOTEMERALD].missilestate); P_SetTarget(&mobj->tracer, idya); diff --git a/src/p_user.c b/src/p_user.c index f471d567c..921bd95d9 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6143,7 +6143,6 @@ static void P_DoNiGHTSCapsule(player_t *player) UINT8 em = P_GetNextEmerald(); // Only give it to ONE person, and THAT player has to get to the goal! mobj_t *emmo = P_SpawnMobjFromMobj(player->mo, 0, 0, player->mo->height, MT_GOTEMERALD); - emmo->health = em; // for identification P_SetTarget(&emmo->target, player->mo); P_SetMobjState(emmo, mobjinfo[MT_GOTEMERALD].meleestate + em); P_SetTarget(&player->mo->tracer, emmo); @@ -6170,17 +6169,8 @@ static void P_DoNiGHTSCapsule(player_t *player) }*/ mobj_t *idya = P_SpawnMobjFromMobj(player->mo, 0, 0, player->mo->height, MT_GOTEMERALD); idya->extravalue2 = player->mare/5; - idya->health = player->mare + 1; // for identification P_SetTarget(&idya->target, player->mo); P_SetMobjState(idya, mobjinfo[MT_GOTEMERALD].missilestate + ((player->mare + 1) % 5)); - - if (player->mo->tracer) - { - P_SetTarget(&idya->hnext, player->mo->tracer); - idya->extravalue1 = (angle_t)(player->mo->tracer->extravalue1 - 72*ANG1); - if (idya->extravalue1 > player->mo->tracer->extravalue1) - idya->extravalue1 -= (72*ANG1)/idya->extravalue1; - } P_SetTarget(&player->mo->tracer, idya); } for (i = 0; i < MAXPLAYERS; i++) From 3b39895e4fcc46cfdedee4afa776a5610b6ef677 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Fri, 7 Sep 2018 09:01:38 -0400 Subject: [PATCH 13/14] Stray nights-onfootfix line --- src/p_inter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 4c9bba896..9a05bae28 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -961,8 +961,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (player->powers[pw_carry] == CR_NIGHTSMODE && !toucher->target) return; - if (toucher->tracer && toucher->tracer->state-states > S_ORBIDYA1) - return; // Don't have multiple ideya, unless it's the first one given + if (toucher->tracer) + return; // Don't have multiple ideya if (player->mare != special->threshold) // wrong mare return; From 7a3eb31b57bf05f749f111031128926bca25e6a5 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sun, 9 Sep 2018 20:51:08 -0400 Subject: [PATCH 14/14] A number --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 921bd95d9..5bd76ede6 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -5974,7 +5974,7 @@ static void P_DoNiGHTSCapsule(player_t *player) player->mo->momy = 0; } - if (abs(player->mo->z - (player->capsule->z+(player->capsule->height/3))) <= 2*FRACUNIT) + if (abs(player->mo->z - (player->capsule->z+(player->capsule->height/3))) <= 3*FRACUNIT) { player->mo->z = player->capsule->z+(player->capsule->height/3); player->mo->momz = 0;