Merge branch 'lightsnake-polish' into 'master'

Lightsnake polish

Closes #309 and #299

See merge request KartKrew/Kart!870
This commit is contained in:
Oni 2023-01-07 00:33:46 +00:00
commit cf609113f3
5 changed files with 49 additions and 12 deletions

View file

@ -308,6 +308,7 @@ struct respawnvars_t
tic_t dropdash; // Drop Dash charge timer tic_t dropdash; // Drop Dash charge timer
boolean truedeath; // Your soul has left your body boolean truedeath; // Your soul has left your body
boolean manual; // Respawn coords were manually set, please respawn exactly there boolean manual; // Respawn coords were manually set, please respawn exactly there
boolean init;
}; };
// player_t struct for all bot variables // player_t struct for all bot variables

View file

@ -7596,9 +7596,12 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
if (player->spinouttimer) if (player->spinouttimer)
{ {
if ((P_IsObjectOnGround(player->mo) if (((P_IsObjectOnGround(player->mo)
|| ( player->spinouttype & KSPIN_AIRTIMER )) || ( player->spinouttype & KSPIN_AIRTIMER ))
&& (!player->sneakertimer)) && (!player->sneakertimer))
|| (player->respawn.state != RESPAWNST_NONE
&& player->spinouttimer > 1
&& (leveltime & 1)))
{ {
player->spinouttimer--; player->spinouttimer--;
if (player->wipeoutslow > 1) if (player->wipeoutslow > 1)
@ -9406,17 +9409,28 @@ static INT32 K_FlameShieldMax(player_t *player)
boolean K_PlayerEBrake(player_t *player) boolean K_PlayerEBrake(player_t *player)
{ {
if (player->respawn.state != RESPAWNST_NONE
&& player->respawn.init == true)
{
return false;
}
if (player->fastfall != 0) if (player->fastfall != 0)
{ {
return true; return true;
} }
return (K_GetKartButtons(player) & BT_EBRAKEMASK) == BT_EBRAKEMASK if ((K_GetKartButtons(player) & BT_EBRAKEMASK) == BT_EBRAKEMASK
&& player->drift == 0 && player->drift == 0
&& P_PlayerInPain(player) == false && P_PlayerInPain(player) == false
&& player->justbumped == 0 && player->justbumped == 0
&& player->spindashboost == 0 && player->spindashboost == 0
&& player->nocontrol == 0; && player->nocontrol == 0)
{
return true;
}
return false;
} }
SINT8 K_Sliptiding(player_t *player) SINT8 K_Sliptiding(player_t *player)
@ -9444,10 +9458,13 @@ void K_KartEbrakeVisuals(player_t *p)
{ {
wave = P_SpawnMobj(p->mo->x, p->mo->y, p->mo->z, MT_SOFTLANDING); wave = P_SpawnMobj(p->mo->x, p->mo->y, p->mo->z, MT_SOFTLANDING);
P_SetScale(wave, p->mo->scale); P_SetScale(wave, p->mo->scale);
if (p->respawn.state == RESPAWNST_NONE)
{
wave->momx = p->mo->momx; wave->momx = p->mo->momx;
wave->momy = p->mo->momy; wave->momy = p->mo->momy;
wave->momz = p->mo->momz; wave->momz = p->mo->momz;
wave->standingslope = p->mo->standingslope; wave->standingslope = p->mo->standingslope;
}
K_ReduceVFX(wave, p); K_ReduceVFX(wave, p);
} }
@ -9688,7 +9705,12 @@ static void K_KartSpindash(player_t *player)
} }
// Handle fast falling behaviors first. // Handle fast falling behaviors first.
if (onGround == false) if (player->respawn.state != RESPAWNST_NONE)
{
// This is handled in K_MovePlayerToRespawnPoint.
return;
}
else if (onGround == false)
{ {
// Update fastfall. // Update fastfall.
player->fastfall = player->mo->momz; player->fastfall = player->mo->momz;

View file

@ -269,6 +269,7 @@ void K_DoIngameRespawn(player_t *player)
player->respawn.timer = RESPAWN_TIME; player->respawn.timer = RESPAWN_TIME;
player->respawn.state = RESPAWNST_MOVE; player->respawn.state = RESPAWNST_MOVE;
player->respawn.init = true;
player->respawn.airtimer = player->airtime; player->respawn.airtimer = player->airtime;
player->respawn.truedeath = false; player->respawn.truedeath = false;
@ -337,7 +338,7 @@ static void K_MovePlayerToRespawnPoint(player_t *player)
player->mo->momx = player->mo->momy = player->mo->momz = 0; player->mo->momx = player->mo->momy = player->mo->momz = 0;
player->flashing = 2; player->flashing = 2;
player->nocontrol = max(2, player->nocontrol); //player->nocontrol = max(2, player->nocontrol);
if (leveltime % 8 == 0 && !mapreset) if (leveltime % 8 == 0 && !mapreset)
{ {
@ -366,6 +367,9 @@ static void K_MovePlayerToRespawnPoint(player_t *player)
player->mo->z = dest.z; player->mo->z = dest.z;
P_SetThingPosition(player->mo); P_SetThingPosition(player->mo);
// At the first valid waypoint, permit extra player control options.
player->respawn.init = false;
// Find the next waypoint to head towards // Find the next waypoint to head towards
if (player->respawn.wp != NULL) if (player->respawn.wp != NULL)
{ {
@ -446,6 +450,13 @@ static void K_MovePlayerToRespawnPoint(player_t *player)
player->mo->momz = step.z; player->mo->momz = step.z;
} }
if (player->respawn.init == false && K_PlayerEBrake(player) == true)
{
// Manual drop!
player->respawn.state = RESPAWNST_DROP;
return;
}
// NOW THEN, time for loads of dumb duplication! // NOW THEN, time for loads of dumb duplication!
// "Emulate" the rest of the path, that way we can spawn a particle a certain distance ahead of you. // "Emulate" the rest of the path, that way we can spawn a particle a certain distance ahead of you.

View file

@ -4401,6 +4401,9 @@ static void P_ProcessZoomTube(player_t *player, mtag_t sectag, boolean end)
if (player->mo->tracer && player->mo->tracer->type == MT_TUBEWAYPOINT && player->carry == CR_ZOOMTUBE) if (player->mo->tracer && player->mo->tracer->type == MT_TUBEWAYPOINT && player->carry == CR_ZOOMTUBE)
return; return;
if (player->respawn.state != RESPAWNST_NONE)
return;
// Find line #3 tagged to this sector // Find line #3 tagged to this sector
lineindex = Tag_FindLineSpecial(3, sectag); lineindex = Tag_FindLineSpecial(3, sectag);

View file

@ -2219,7 +2219,7 @@ void P_MovePlayer(player_t *player)
runspd = FixedMul(runspd, player->mo->movefactor); runspd = FixedMul(runspd, player->mo->movefactor);
// Control relinquishing stuff! // Control relinquishing stuff!
if (player->nocontrol) if (player->nocontrol || player->respawn.state == RESPAWNST_MOVE)
player->pflags |= PF_STASIS; player->pflags |= PF_STASIS;
// note: don't unset stasis here // note: don't unset stasis here
@ -4166,7 +4166,7 @@ void P_PlayerThink(player_t *player)
// for a bit after a teleport. // for a bit after a teleport.
player->mo->reactiontime--; player->mo->reactiontime--;
} }
else if (player->mo->tracer && player->mo->tracer->type == MT_TUBEWAYPOINT) else if (player->carry == CR_ZOOMTUBE && player->mo->tracer && player->mo->tracer->type == MT_TUBEWAYPOINT)
{ {
P_DoZoomTube(player); P_DoZoomTube(player);
player->rmomx = player->rmomy = 0; player->rmomx = player->rmomy = 0;
@ -4211,7 +4211,7 @@ void P_PlayerThink(player_t *player)
// Flash player after being hit. // Flash player after being hit.
if (!(player->hyudorotimer // SRB2kart - fixes Hyudoro not flashing when it should. if (!(player->hyudorotimer // SRB2kart - fixes Hyudoro not flashing when it should.
|| player->growshrinktimer > 0 // Grow doesn't flash either. || player->growshrinktimer > 0 // Grow doesn't flash either.
|| (player->respawn.state != RESPAWNST_NONE) // Respawn timer (for drop dash effect) || (player->respawn.state != RESPAWNST_NONE && player->respawn.truedeath == true) // Respawn timer (for drop dash effect)
|| (player->pflags & PF_NOCONTEST) // NO CONTEST explosion || (player->pflags & PF_NOCONTEST) // NO CONTEST explosion
|| ((gametyperules & GTR_BUMPERS) && player->bumpers <= 0 && player->karmadelay))) || ((gametyperules & GTR_BUMPERS) && player->bumpers <= 0 && player->karmadelay)))
{ {