From 4281c9ca103eb2ab718e0311f61f04ff2717fd00 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Mon, 26 Mar 2018 01:40:15 -0400 Subject: [PATCH 1/5] Nightserize: Reset player another/flyangle on new mare --- src/p_user.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index f422e9b65..bdc493a75 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -758,6 +758,8 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) player->marebegunat = leveltime; player->rings = 0; + player->flyangle = 0; + player->anotherflyangle = 0; } else { From ac8be33752cae1e293c180bb3349c0cefe8c0519 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Mon, 26 Mar 2018 01:54:38 -0400 Subject: [PATCH 2/5] Reset player->another/flyangle on any Nightserize or DeNightserize --- 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 bdc493a75..6a87f8ca3 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -586,6 +586,8 @@ static void P_DeNightserizePlayer(player_t *player) player->climbing = 0; player->mo->fuse = 0; player->speed = 0; + player->flyangle = 0; + player->anotherflyangle = 0; P_SetTarget(&player->mo->target, NULL); P_SetTarget(&player->axis1, P_SetTarget(&player->axis2, NULL)); @@ -659,6 +661,8 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) player->speed = 0; player->climbing = 0; player->secondjump = 0; + player->flyangle = 0; + player->anotherflyangle = 0; player->powers[pw_shield] = SH_NONE; player->powers[pw_super] = 0; @@ -758,8 +762,6 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) player->marebegunat = leveltime; player->rings = 0; - player->flyangle = 0; - player->anotherflyangle = 0; } else { From 294d5831665e9b23b19d90540fb2a9da7db80b0f Mon Sep 17 00:00:00 2001 From: mazmazz Date: Mon, 2 Apr 2018 10:02:16 -0400 Subject: [PATCH 3/5] Dumb stupid hack where NiGHTS faces you upon Nightserizing Because I can't figure out how to tell which player angle is "forward" in an axis track. --- src/p_user.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index f422e9b65..24c3f1249 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -770,6 +770,11 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) player->texttimer = (UINT8)(110 - timeinmap); } + // make NiGHTS face you only upon Nightserizing (w/ attitude!) + // calculate player->angle_pos ourselves because it won't be set the first time + if (player->mo->target) + player->mo->angle = R_PointToAngle2(player->mo->target->x, player->mo->target->y, player->mo->x, player->mo->y); + player->powers[pw_carry] = CR_NIGHTSMODE; } From 49682f58bf12edebe73bbc1c5406036001f390b6 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Mon, 2 Apr 2018 15:21:19 -0400 Subject: [PATCH 4/5] Make NiGHTS face forward or backward upon Nightserizing --- src/p_user.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 24c3f1249..8f1d2f380 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -770,10 +770,14 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) player->texttimer = (UINT8)(110 - timeinmap); } - // make NiGHTS face you only upon Nightserizing (w/ attitude!) + // force NiGHTS to face forward or backward // calculate player->angle_pos ourselves because it won't be set the first time if (player->mo->target) - player->mo->angle = R_PointToAngle2(player->mo->target->x, player->mo->target->y, player->mo->x, player->mo->y); + player->mo->angle = R_PointToAngle2(player->mo->target->x, player->mo->target->y, player->mo->x, player->mo->y) + + ((player->mo->target->flags2 & MF2_AMBUSH) ? // if axis is invert, take the opposite right angle + (player->flyangle > 90 && player->flyangle < 270 ? ANGLE_90 : -ANGLE_90) + : (player->flyangle > 90 && player->flyangle < 270 ? -ANGLE_90 : ANGLE_90) + ); player->powers[pw_carry] = CR_NIGHTSMODE; } From 7cf2c78522400da5337d05260bbc911757b2332b Mon Sep 17 00:00:00 2001 From: Digiku Date: Sat, 7 Apr 2018 06:28:31 -0400 Subject: [PATCH 5/5] Fix whitespace weirdness --- src/p_user.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 19ddde833..d59b4ec15 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -777,10 +777,9 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) // force NiGHTS to face forward or backward if (player->mo->target) player->mo->angle = R_PointToAngle2(player->mo->target->x, player->mo->target->y, player->mo->x, player->mo->y) // player->angle_pos, won't be set on first instance - + ((player->mo->target->flags2 & MF2_AMBUSH) ? // if axis is invert, take the opposite right angle - (player->flyangle > 90 && player->flyangle < 270 ? ANGLE_90 : -ANGLE_90) - : (player->flyangle > 90 && player->flyangle < 270 ? -ANGLE_90 : ANGLE_90) - ); + + ((player->mo->target->flags2 & MF2_AMBUSH) ? // if axis is invert, take the opposite right angle + (player->flyangle > 90 && player->flyangle < 270 ? ANGLE_90 : -ANGLE_90) + : (player->flyangle > 90 && player->flyangle < 270 ? -ANGLE_90 : ANGLE_90)); player->powers[pw_carry] = CR_NIGHTSMODE; }