mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 07:22:28 +00:00
Players can jostle free from Pterabytes
This commit is contained in:
parent
788415a4db
commit
bc794a2227
2 changed files with 29 additions and 2 deletions
|
@ -523,6 +523,7 @@ static void P_DoPterabyteCarry(player_t *player, mobj_t *ptera)
|
||||||
player->mo->y = ptera->y;
|
player->mo->y = ptera->y;
|
||||||
P_SetThingPosition(player->mo);
|
P_SetThingPosition(player->mo);
|
||||||
ptera->movefactor = 3*TICRATE;
|
ptera->movefactor = 3*TICRATE;
|
||||||
|
ptera->watertop = ptera->waterbottom = ptera->cusval = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void P_DoTailsCarry(player_t *sonic, player_t *tails)
|
static void P_DoTailsCarry(player_t *sonic, player_t *tails)
|
||||||
|
|
30
src/p_user.c
30
src/p_user.c
|
@ -4291,7 +4291,14 @@ void P_DoJump(player_t *player, boolean soundandstate)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (player->powers[pw_carry] == CR_PTERABYTE)
|
if (player->powers[pw_carry] == CR_PTERABYTE)
|
||||||
|
{
|
||||||
|
S_StartSound(player->mo, sfx_s3kd7s);
|
||||||
|
player->mo->tracer->cusval += 10;
|
||||||
|
player->mo->tracer->watertop = P_RandomRange(-player->mo->tracer->cusval, player->mo->tracer->cusval) << (FRACBITS - 1);
|
||||||
|
player->mo->tracer->waterbottom = P_RandomRange(-player->mo->tracer->cusval, player->mo->tracer->cusval) << (FRACBITS - 1);
|
||||||
|
player->mo->tracer->cvmem = P_RandomRange(-player->mo->tracer->cusval, player->mo->tracer->cusval) << (FRACBITS - 1);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Jump this high.
|
// Jump this high.
|
||||||
if (player->powers[pw_carry] == CR_PLAYER)
|
if (player->powers[pw_carry] == CR_PLAYER)
|
||||||
|
@ -11968,14 +11975,33 @@ void P_PlayerAfterThink(player_t *player)
|
||||||
if (!ptera->movefactor)
|
if (!ptera->movefactor)
|
||||||
goto dropoff;
|
goto dropoff;
|
||||||
|
|
||||||
P_TryMove(player->mo, ptera->x, ptera->y, true);
|
if (ptera->cusval >= 50)
|
||||||
|
{
|
||||||
|
player->powers[pw_carry] = CR_NONE;
|
||||||
|
P_SetTarget(&player->mo->tracer, NULL);
|
||||||
|
P_KillMobj(ptera, player->mo, player->mo, 0);
|
||||||
|
player->mo->momz = 9*FRACUNIT;
|
||||||
|
player->pflags |= PF_APPLYAUTOBRAKE|PF_JUMPED|PF_THOKKED;
|
||||||
|
P_SetMobjState(player->mo, S_PLAY_ROLL);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ptera->cusval)
|
||||||
|
ptera->cusval--;
|
||||||
|
|
||||||
|
P_TryMove(player->mo, ptera->x + ptera->watertop, ptera->y + ptera->waterbottom, true);
|
||||||
|
player->mo->z += ptera->cvmem;
|
||||||
player->mo->momx = ptera->momx;
|
player->mo->momx = ptera->momx;
|
||||||
player->mo->momy = ptera->momy;
|
player->mo->momy = ptera->momy;
|
||||||
player->mo->momz = ptera->momz;
|
player->mo->momz = ptera->momz;
|
||||||
|
|
||||||
if (P_AproxDistance(player->mo->x - ptera->x, player->mo->y - ptera->y) > player->mo->radius)
|
if (P_AproxDistance(player->mo->x - ptera->x - ptera->watertop, player->mo->y - ptera->y - ptera->waterbottom) > player->mo->radius)
|
||||||
goto dropoff;
|
goto dropoff;
|
||||||
|
|
||||||
|
ptera->watertop >>= 1;
|
||||||
|
ptera->waterbottom >>= 1;
|
||||||
|
ptera->cvmem >>= 1;
|
||||||
|
|
||||||
if (player->mo->state-states != S_PLAY_FALL)
|
if (player->mo->state-states != S_PLAY_FALL)
|
||||||
P_SetPlayerMobjState(player->mo, S_PLAY_FALL);
|
P_SetPlayerMobjState(player->mo, S_PLAY_FALL);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue