mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 04:21:47 +00:00
Revert speed change to Redshells, but give them a speedcap in their thinker.
This commit is contained in:
parent
c224929345
commit
aac35d8e8f
2 changed files with 11 additions and 1 deletions
|
|
@ -14695,7 +14695,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_DEADRED, // deathstate
|
S_DEADRED, // deathstate
|
||||||
S_NULL, // xdeathstate
|
S_NULL, // xdeathstate
|
||||||
sfx_shbrk, // deathsound
|
sfx_shbrk, // deathsound
|
||||||
(14*FRACUNIT)/5,// speed
|
7*FRACUNIT, // speed
|
||||||
16*FRACUNIT, // radius
|
16*FRACUNIT, // radius
|
||||||
32*FRACUNIT, // height
|
32*FRACUNIT, // height
|
||||||
0, // display offset
|
0, // display offset
|
||||||
|
|
|
||||||
10
src/p_mobj.c
10
src/p_mobj.c
|
|
@ -7438,11 +7438,21 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
S_StartSound(mobj, mobj->info->activesound);
|
S_StartSound(mobj, mobj->info->activesound);
|
||||||
break;
|
break;
|
||||||
case MT_REDITEM:
|
case MT_REDITEM:
|
||||||
|
{
|
||||||
if (mobj->threshold > 0)
|
if (mobj->threshold > 0)
|
||||||
mobj->threshold--;
|
mobj->threshold--;
|
||||||
if (leveltime % 7 == 0)
|
if (leveltime % 7 == 0)
|
||||||
S_StartSound(mobj, mobj->info->activesound);
|
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;
|
break;
|
||||||
|
}
|
||||||
case MT_REDITEMDUD:
|
case MT_REDITEMDUD:
|
||||||
mobj->angle = R_PointToAngle2(mobj->x, mobj->y, mobj->x+mobj->momx, mobj->y+mobj->momy);
|
mobj->angle = R_PointToAngle2(mobj->x, mobj->y, mobj->x+mobj->momx, mobj->y+mobj->momy);
|
||||||
P_InstaThrust(mobj, mobj->angle, mobj->info->speed);
|
P_InstaThrust(mobj, mobj->angle, mobj->info->speed);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue