mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 07:22:28 +00:00
Cleaned up the shield-ability stuff to be cleaner (and reduce MT_OVERLAY thinking).
This commit is contained in:
parent
c693af96b1
commit
366e282495
2 changed files with 36 additions and 28 deletions
63
src/p_mobj.c
63
src/p_mobj.c
|
@ -6776,50 +6776,57 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
}
|
||||
else
|
||||
P_AddOverlay(mobj);
|
||||
if ((mobj->target->type == MT_ELEMENTAL_ORB)
|
||||
&& (mobj->target->target)
|
||||
&& (mobj->target->target->player)
|
||||
&& ((mobj->target->target->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL)
|
||||
&& (mobj->target->target->player->pflags & PF_SHIELDABILITY)
|
||||
&& (mobj->state->nextstate < mobj->target->info->raisestate)) // Special casing for elemental shield piercing attack.
|
||||
{
|
||||
P_SetMobjState(mobj, mobj->target->info->raisestate);
|
||||
mobj->tics++;
|
||||
}
|
||||
else if ((mobj->target->type == MT_THUNDERCOIN_ORB)
|
||||
&& (mobj->target->target)
|
||||
&& (mobj->target->target->player)
|
||||
&& ((mobj->target->target->player->powers[pw_shield] & SH_NOSTACK) == SH_THUNDERCOIN)
|
||||
&& (mobj->target->target->player->pflags & PF_SHIELDABILITY)) // Special casing for thundercoin shield jump..
|
||||
{
|
||||
P_SetMobjState(mobj, mobj->target->info->raisestate);
|
||||
P_SetMobjState(mobj->target, mobj->target->info->painstate);
|
||||
mobj->target->target->player->pflags &= ~PF_SHIELDABILITY;
|
||||
mobj->tics++;
|
||||
}
|
||||
break;
|
||||
case MT_ARMAGEDDON_ORB:
|
||||
case MT_WHIRLWIND_ORB:
|
||||
case MT_ELEMENTAL_ORB:
|
||||
case MT_FORCE_ORB:
|
||||
case MT_PITY_ORB:
|
||||
case MT_WHIRLWIND_ORB:
|
||||
case MT_ARMAGEDDON_ORB:
|
||||
case MT_FORCE_ORB:
|
||||
case MT_FLAMEAURA_ORB:
|
||||
case MT_BUBBLEWRAP_ORB:
|
||||
case MT_THUNDERCOIN_ORB:
|
||||
if (!P_AddShield(mobj))
|
||||
return;
|
||||
break;
|
||||
case MT_ATTRACT_ORB:
|
||||
if (!P_AddShield(mobj))
|
||||
return;
|
||||
if ((mobj->target)
|
||||
if (/*(mobj->target) -- the following is implicit by P_AddShield
|
||||
&& (mobj->target->player)
|
||||
&& (mobj->target->player->homing))
|
||||
&&*/ (mobj->target->player->homing))
|
||||
{
|
||||
P_SetMobjState(mobj, mobj->info->painstate);
|
||||
mobj->tics++;
|
||||
}
|
||||
break;
|
||||
case MT_ELEMENTAL_ORB:
|
||||
if (!P_AddShield(mobj))
|
||||
return;
|
||||
if (mobj->tracer
|
||||
/* && mobj->target -- the following is implicit by P_AddShield
|
||||
&& mobj->target->player
|
||||
&& (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL*/
|
||||
&& (mobj->target->player->pflags & PF_SHIELDABILITY)
|
||||
&& (mobj->tracer->state->nextstate < mobj->info->raisestate))
|
||||
{
|
||||
P_SetMobjState(mobj->tracer, mobj->info->raisestate);
|
||||
mobj->tracer->tics++;
|
||||
}
|
||||
break;
|
||||
case MT_THUNDERCOIN_ORB:
|
||||
if (!P_AddShield(mobj))
|
||||
return;
|
||||
if (mobj->tracer
|
||||
/* && mobj->target -- the following is implicit by P_AddShield
|
||||
&& mobj->target->player
|
||||
&& (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_THUNDERCOIN*/
|
||||
&& (mobj->target->player->pflags & PF_SHIELDABILITY))
|
||||
{
|
||||
P_SetMobjState(mobj, mobj->info->painstate);
|
||||
mobj->tics++;
|
||||
P_SetMobjState(mobj->tracer, mobj->info->raisestate);
|
||||
mobj->tracer->tics++;
|
||||
mobj->target->player->pflags &= ~PF_SHIELDABILITY; // prevent eternal spark
|
||||
}
|
||||
break;
|
||||
case MT_WATERDROP:
|
||||
P_SceneryCheckWater(mobj);
|
||||
if ((mobj->z <= mobj->floorz || mobj->z <= mobj->watertop)
|
||||
|
|
|
@ -1398,6 +1398,7 @@ void P_SpawnShieldOrb(player_t *player)
|
|||
ov = P_SpawnMobj(shieldobj->x, shieldobj->y, shieldobj->z, MT_OVERLAY);
|
||||
P_SetTarget(&ov->target, shieldobj);
|
||||
P_SetMobjState(ov, shieldobj->info->seestate);
|
||||
P_SetTarget(&shieldobj->tracer, ov);
|
||||
}
|
||||
if (shieldobj->info->meleestate)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue