Merge branch 'fast-snake' into 'master'

Quick reptile

See merge request KartKrew/Kart!451
This commit is contained in:
James R 2021-11-22 07:30:33 +00:00
commit 8109bc8e61
3 changed files with 23 additions and 2 deletions

View file

@ -263,6 +263,7 @@ typedef struct respawnvars_s
fixed_t pointz;
boolean flip; // Flip upside down or not
tic_t timer; // Time left on respawn animation once you're there
tic_t airtimer; // Time spent in the air before respawning
UINT32 distanceleft; // How far along the course to respawn you
tic_t dropdash; // Drop Dash charge timer
} respawnvars_t;

View file

@ -276,6 +276,8 @@ void K_DoIngameRespawn(player_t *player)
player->respawn.timer = RESPAWN_TIME;
player->respawn.state = RESPAWNST_MOVE;
player->respawn.airtimer = player->airtime;
}
/*--------------------------------------------------
@ -318,8 +320,9 @@ size_t K_NextRespawnWaypointIndex(waypoint_t *waypoint)
--------------------------------------------------*/
static void K_MovePlayerToRespawnPoint(player_t *player)
{
const fixed_t realstepamt = (64 * mapobjectscale);
fixed_t stepamt = realstepamt;
const int airCompensation = 128;
fixed_t realstepamt = (64 * mapobjectscale);
fixed_t stepamt;
vector3_t dest, step, laser;
angle_t stepha, stepva;
@ -330,6 +333,13 @@ static void K_MovePlayerToRespawnPoint(player_t *player)
waypoint_t *laserwp;
boolean laserflip;
/* speed up if in the air for a long time */
realstepamt += FixedMul(realstepamt,
(player->respawn.airtimer * FRACUNIT)
/ airCompensation);
stepamt = realstepamt;
player->mo->momx = player->mo->momy = player->mo->momz = 0;
player->flashing = 2;

View file

@ -2966,6 +2966,10 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
else
lookbackdelay[num]--;
}
else if (player->respawn.state != RESPAWNST_NONE)
{
camspeed = 3*FRACUNIT/4;
}
lookbackdown = (lookbackdelay[num] == MAXLOOKBACKDELAY) != lookbackactive[num];
lookbackactive[num] = (lookbackdelay[num] == MAXLOOKBACKDELAY);
#undef MAXLOOKBACKDELAY
@ -4090,6 +4094,12 @@ DoABarrelRoll (player_t *player)
fixed_t smoothing;
if (player->respawn.state != RESPAWNST_NONE)
{
player->tilt = 0;
return;
}
if (player->exiting)
{
return;