mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-16 01:31:26 +00:00
Merge branch 'sal-misc' into sonicitems
This commit is contained in:
commit
1554f4d771
2 changed files with 11 additions and 10 deletions
12
src/k_kart.c
12
src/k_kart.c
|
@ -1583,9 +1583,9 @@ fixed_t K_3dKartMovement(player_t *player, boolean onground, fixed_t forwardmove
|
|||
|
||||
if (player->kartstuff[k_pogospring]) // Pogo Spring minimum/maximum thrust
|
||||
{
|
||||
const fixed_t scale = mapheaderinfo[gamemap-1]->mobj_scale + abs(player->mo->scale - mapheaderinfo[gamemap-1]->mobj_scale);
|
||||
const fixed_t minspeed = 24*scale;
|
||||
const fixed_t maxspeed = 36*scale;
|
||||
const fixed_t hscale = mapheaderinfo[gamemap-1]->mobj_scale + (mapheaderinfo[gamemap-1]->mobj_scale - player->mo->scale);
|
||||
const fixed_t minspeed = 24*hscale;
|
||||
const fixed_t maxspeed = 36*hscale;
|
||||
|
||||
if (newspeed > maxspeed && player->kartstuff[k_pogospring] == 2)
|
||||
newspeed = maxspeed;
|
||||
|
@ -2712,7 +2712,7 @@ static void K_DoSPB(player_t *victim, player_t *source)
|
|||
|
||||
void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, boolean mute)
|
||||
{
|
||||
fixed_t scale = mapheaderinfo[gamemap-1]->mobj_scale + abs(mo->scale - mapheaderinfo[gamemap-1]->mobj_scale);
|
||||
const fixed_t vscale = mapheaderinfo[gamemap-1]->mobj_scale + (mo->scale - mapheaderinfo[gamemap-1]->mobj_scale);
|
||||
|
||||
if (mo->player && mo->player->spectator)
|
||||
return;
|
||||
|
@ -2757,10 +2757,10 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, boolean mute)
|
|||
thrust = 32<<FRACBITS;
|
||||
}
|
||||
|
||||
mo->momz = FixedMul(FINESINE(ANGLE_22h>>ANGLETOFINESHIFT), FixedMul(thrust, scale));
|
||||
mo->momz = FixedMul(FINESINE(ANGLE_22h>>ANGLETOFINESHIFT), FixedMul(thrust, vscale));
|
||||
}
|
||||
else
|
||||
mo->momz = FixedMul(vertispeed, scale);
|
||||
mo->momz = FixedMul(vertispeed, vscale);
|
||||
|
||||
if (!mute)
|
||||
S_StartSound(mo, sfx_kc2f);
|
||||
|
|
|
@ -116,7 +116,8 @@ boolean P_TeleportMove(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z)
|
|||
boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
||||
{
|
||||
//INT32 pflags;
|
||||
const fixed_t scale = mapheaderinfo[gamemap-1]->mobj_scale + abs(object->scale - mapheaderinfo[gamemap-1]->mobj_scale); //max(mapheaderinfo[gamemap-1]->mobj_scale, object->scale)
|
||||
const fixed_t hscale = mapheaderinfo[gamemap-1]->mobj_scale + (mapheaderinfo[gamemap-1]->mobj_scale - object->scale);
|
||||
const fixed_t vscale = mapheaderinfo[gamemap-1]->mobj_scale + (object->scale - mapheaderinfo[gamemap-1]->mobj_scale);
|
||||
fixed_t offx, offy;
|
||||
fixed_t vertispeed = spring->info->mass;
|
||||
fixed_t horizspeed = spring->info->damage;
|
||||
|
@ -179,12 +180,12 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
}
|
||||
|
||||
if (vertispeed)
|
||||
object->momz = FixedMul(vertispeed,FixedSqrt(FixedMul(scale, spring->scale)));
|
||||
object->momz = FixedMul(vertispeed,FixedSqrt(FixedMul(vscale, spring->scale)));
|
||||
|
||||
if (horizspeed)
|
||||
{
|
||||
if (!object->player)
|
||||
P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(horizspeed,FixedSqrt(FixedMul(scale, spring->scale))));
|
||||
P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(horizspeed,FixedSqrt(FixedMul(hscale, spring->scale))));
|
||||
else
|
||||
{
|
||||
fixed_t finalSpeed = horizspeed;
|
||||
|
@ -193,7 +194,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
if (pSpeed > finalSpeed)
|
||||
finalSpeed = pSpeed;
|
||||
|
||||
P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(finalSpeed,FixedSqrt(FixedMul(scale, spring->scale))));
|
||||
P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(finalSpeed,FixedSqrt(FixedMul(hscale, spring->scale))));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue