From e0f6dee8bef1e67f17c315676530ef785c892a22 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Fri, 10 Aug 2018 00:20:30 -0400 Subject: [PATCH] MT_FLINGBLUESPHERE and MT_FLINGNIGHTSCHIP implementation --- src/p_inter.c | 7 +++++++ src/p_mobj.c | 10 ++++++++++ src/p_setup.c | 3 ++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/p_inter.c b/src/p_inter.c index 5737e2c2a..f908601bb 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -490,7 +490,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) P_DoNightsScore(player); break; case MT_BLUESPHERE: + case MT_FLINGBLUESPHERE: case MT_NIGHTSCHIP: + case MT_FLINGNIGHTSCHIP: if (!(P_CanPickupItem(player, false)) && !(special->flags2 & MF2_NIGHTSPULL)) return; @@ -3373,6 +3375,7 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings) angle_t fa; fixed_t ns; fixed_t z; + boolean nightsreplace = ((maptol & TOL_NIGHTS) && !G_IsSpecialStage(gamemap)); // Better safe than sorry. if (!player) @@ -3396,6 +3399,8 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings) INT32 objType = mobjinfo[MT_RING].reactiontime; if (mariomode) objType = mobjinfo[MT_COIN].reactiontime; + else if (player->powers[pw_carry] == CR_NIGHTSFALL) + objType = mobjinfo[(nightsreplace ? MT_NIGHTSCHIP : MT_BLUESPHERE)].reactiontime; z = player->mo->z; if (player->mo->eflags & MFE_VERTICALFLIP) @@ -3424,6 +3429,8 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings) P_SetObjectMomZ(mo, 8*FRACUNIT, false); mo->fuse = 20*TICRATE; // Adjust fuse for NiGHTS + + P_SetMobjState(mo, (player->bonustime ? mo->info->raisestate : mo->info->spawnstate)); } else { diff --git a/src/p_mobj.c b/src/p_mobj.c index be373fbf4..4353e67c3 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1539,6 +1539,8 @@ fixed_t P_GetMobjGravity(mobj_t *mo) { case MT_FLINGRING: case MT_FLINGCOIN: + case MT_FLINGBLUESPHERE: + case MT_FLINGNIGHTSCHIP: case MT_FLINGEMERALD: case MT_BOUNCERING: case MT_RAILRING: @@ -2523,6 +2525,8 @@ static boolean P_ZMovement(mobj_t *mo) case MT_BLUETEAMRING: case MT_FLINGRING: case MT_FLINGCOIN: + case MT_FLINGBLUESPHERE: + case MT_FLINGNIGHTSCHIP: case MT_FLINGEMERALD: // Remove flinged stuff from death pits. if (P_CheckDeathPitCollide(mo)) @@ -2709,6 +2713,8 @@ static boolean P_ZMovement(mobj_t *mo) // Flingrings bounce if (mo->type == MT_FLINGRING || mo->type == MT_FLINGCOIN + || mo->type == MT_FLINGBLUESPHERE + || mo->type == MT_FLINGNIGHTSCHIP || P_WeaponOrPanel(mo->type) || mo->type == MT_FLINGEMERALD || mo->type == MT_BIGTUMBLEWEED @@ -7941,6 +7947,8 @@ void P_MobjThinker(mobj_t *mobj) // Flung items case MT_FLINGRING: case MT_FLINGCOIN: + case MT_FLINGBLUESPHERE: + case MT_FLINGNIGHTSCHIP: if (mobj->flags2 & MF2_NIGHTSPULL) P_NightsItemChase(mobj); else @@ -8278,6 +8286,8 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s #ifdef ESLOPE // Sliding physics for slidey mobjs! if (mobj->type == MT_FLINGRING || mobj->type == MT_FLINGCOIN + || mobj->type == MT_FLINGBLUESPHERE + || mobj->type == MT_FLINGNIGHTSCHIP || P_WeaponOrPanel(mobj->type) || mobj->type == MT_FLINGEMERALD || mobj->type == MT_BIGTUMBLEWEED diff --git a/src/p_setup.c b/src/p_setup.c index 1a0736cc2..7597b7d87 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -885,7 +885,8 @@ void P_SwitchSpheresBonusMode(boolean bonustime) mo = (mobj_t *)th; - if (mo->type != MT_BLUESPHERE && mo->type != MT_NIGHTSCHIP) + if (mo->type != MT_BLUESPHERE && mo->type != MT_NIGHTSCHIP + && mo->type != MT_FLINGBLUESPHERE && mo->type != MT_FLINGNIGHTSCHIP) continue; if (!mo->health)