mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 15:32:33 +00:00
MT_FLINGBLUESPHERE and MT_FLINGNIGHTSCHIP implementation
This commit is contained in:
parent
fe61678437
commit
e0f6dee8be
3 changed files with 19 additions and 1 deletions
|
@ -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
|
||||
{
|
||||
|
|
10
src/p_mobj.c
10
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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue