Revert speed change to Redshells, but give them a speedcap in their thinker.

This commit is contained in:
Sryder 2017-03-07 23:47:06 +00:00
parent c224929345
commit aac35d8e8f
2 changed files with 11 additions and 1 deletions

View file

@ -14695,7 +14695,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_DEADRED, // deathstate
S_NULL, // xdeathstate
sfx_shbrk, // deathsound
(14*FRACUNIT)/5,// speed
7*FRACUNIT, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
0, // display offset

View file

@ -7438,11 +7438,21 @@ void P_MobjThinker(mobj_t *mobj)
S_StartSound(mobj, mobj->info->activesound);
break;
case MT_REDITEM:
{
if (mobj->threshold > 0)
mobj->threshold--;
if (leveltime % 7 == 0)
S_StartSound(mobj, mobj->info->activesound);
// Do a similar thing to what is done to the player to keep the red shell at a speed cap
fixed_t magnitude = P_AproxDistance(mobj->momx, mobj->momy);
if (magnitude > 64*FRACUNIT)
{
mobj->momx = FixedMul(FixedDiv(mobj->momx, magnitude), 64*FRACUNIT);
mobj->momy = FixedMul(FixedDiv(mobj->momy, magnitude), 64*FRACUNIT);
}
break;
}
case MT_REDITEMDUD:
mobj->angle = R_PointToAngle2(mobj->x, mobj->y, mobj->x+mobj->momx, mobj->y+mobj->momy);
P_InstaThrust(mobj, mobj->angle, mobj->info->speed);