Merge branch 'unnerf-missiles' into 'master'

Add player speed to thrown items, no mention of top speed

Closes #434

See merge request KartKrew/Kart!1050
This commit is contained in:
Gunla 2023-03-25 00:50:53 +00:00
commit 954409fa2f
3 changed files with 11 additions and 19 deletions

View file

@ -23387,7 +23387,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_ORBINAUT_DEAD,// deathstate
S_NULL, // xdeathstate
sfx_s3k5d, // deathsound
64*FRACUNIT, // speed
24*FRACUNIT, // speed
24*FRACUNIT, // radius
32*FRACUNIT, // height
0, // display offset
@ -23441,7 +23441,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_JAWZ_DEAD1, // deathstate
S_JAWZ_DEAD2, // xdeathstate
sfx_s3k5d, // deathsound
64*FRACUNIT, // speed
24*FRACUNIT, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
0, // display offset
@ -23765,7 +23765,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_BALLHOG_DEAD, // deathstate
S_NULL, // xdeathstate
sfx_hogbom, // deathsound
80*FRACUNIT, // speed
20*FRACUNIT, // speed
26*FRACUNIT, // radius
32*FRACUNIT, // height
0, // display offset
@ -24062,7 +24062,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_GARDENTOP_DEAD, // deathstate
S_NULL, // xdeathstate
sfx_s3k7a, // deathsound
40*FRACUNIT, // speed
20*FRACUNIT, // speed
30*FRACUNIT, // radius
68*FRACUNIT, // height
-1, // display offset
@ -24440,7 +24440,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_GACHABOM, // deathstate
S_NULL, // xdeathstate
sfx_s3k5d, // deathsound
64*FRACUNIT, // speed
24*FRACUNIT, // speed
24*FRACUNIT, // radius
32*FRACUNIT, // height
0, // display offset

View file

@ -4556,31 +4556,23 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t an, I
{
mobj_t *th;
fixed_t x, y, z;
fixed_t topspeed = K_GetKartSpeed(source->player, false, false);
fixed_t finalspeed = speed;
fixed_t finalscale = mapobjectscale;
mobj_t *throwmo;
if (source->player != NULL)
{
const angle_t delta = AngleDelta(source->angle, an);
const fixed_t deltaFactor = FixedDiv(AngleFixed(ANGLE_180 - delta), 180 * FRACUNIT);
if (source->player->itemscale == ITEMSCALE_SHRINK)
{
// Nerf the base item speed a bit.
speed = finalspeed = FixedMul(speed, SHRINK_PHYSICS_SCALE);
}
if (source->player->speed > topspeed)
{
angle_t delta = AngleDelta(source->angle, an);
finalspeed = max(speed, FixedMul(
speed,
FixedMul(
FixedDiv(source->player->speed, topspeed), // Multiply speed to be proportional to your own, boosted maxspeed.
FixedDiv(AngleFixed(ANGLE_180 - delta), 180 * FRACUNIT) // multiply speed based on angle diff... i.e: don't do this for firing backward :V
)
));
}
// Add player speed on top, multiplied based on angle diff... i.e: don't do this for firing backward :V
finalspeed += FixedMul(source->player->speed, deltaFactor);
finalscale = K_ItemScaleForPlayer(source->player);
}

View file

@ -441,7 +441,7 @@ anchor_top (mobj_t *top)
static void
loose_think (mobj_t *top)
{
const fixed_t thrustamount = top->movefactor;
const fixed_t thrustamount = top->movefactor / 2;
const angle_t momangle = K_MomentumAngle(top);
angle_t ang = top->angle;