mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Death: respawn from where you died and take an invisible lightsnake
This commit is contained in:
parent
7a8f3ee88b
commit
1800970ed9
5 changed files with 17 additions and 3 deletions
|
|
@ -281,6 +281,7 @@ typedef struct respawnvars_s
|
|||
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
|
||||
boolean truedeath; // Your soul has left your body
|
||||
} respawnvars_t;
|
||||
|
||||
// player_t struct for all bot variables
|
||||
|
|
|
|||
|
|
@ -278,6 +278,7 @@ void K_DoIngameRespawn(player_t *player)
|
|||
player->respawn.state = RESPAWNST_MOVE;
|
||||
|
||||
player->respawn.airtimer = player->airtime;
|
||||
player->respawn.truedeath = false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
|
|
@ -567,7 +568,9 @@ static void K_MovePlayerToRespawnPoint(player_t *player)
|
|||
lasersteps--;
|
||||
}
|
||||
|
||||
if (lasersteps == 0) // Don't spawn them beyond the respawn point.
|
||||
// Respawning after death: everything about the player
|
||||
// is invisible
|
||||
if (!player->respawn.truedeath && lasersteps == 0) // Don't spawn them beyond the respawn point.
|
||||
{
|
||||
mobj_t *lasermo = P_SpawnMobj(laser.x, laser.y, laser.z + (player->mo->height / 2), MT_DEZLASER);
|
||||
|
||||
|
|
|
|||
|
|
@ -1076,6 +1076,11 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
|||
|
||||
target->player->playerstate = PST_DEAD;
|
||||
|
||||
// respawn from where you died
|
||||
target->player->respawn.pointx = target->x;
|
||||
target->player->respawn.pointy = target->y;
|
||||
target->player->respawn.pointz = target->z;
|
||||
|
||||
if (target->player == &players[consoleplayer])
|
||||
{
|
||||
// don't die in auto map,
|
||||
|
|
|
|||
|
|
@ -11250,8 +11250,6 @@ void P_MovePlayerToStarpost(INT32 playernum)
|
|||
mobj_t *mobj = p->mo;
|
||||
I_Assert(mobj != NULL);
|
||||
|
||||
K_DoIngameRespawn(p);
|
||||
|
||||
P_UnsetThingPosition(mobj);
|
||||
mobj->x = p->respawn.pointx;
|
||||
mobj->y = p->respawn.pointy;
|
||||
|
|
@ -11293,6 +11291,11 @@ void P_MovePlayerToStarpost(INT32 playernum)
|
|||
else
|
||||
p->drawangle = mobj->angle; // default to the camera angle
|
||||
|
||||
K_DoIngameRespawn(p);
|
||||
p->respawn.truedeath = true;
|
||||
|
||||
mobj->renderflags |= RF_DONTDRAW;
|
||||
|
||||
P_AfterPlayerSpawn(playernum);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -373,6 +373,7 @@ static void P_NetArchivePlayers(void)
|
|||
WRITEUINT32(save_p, players[i].respawn.airtimer);
|
||||
WRITEUINT32(save_p, players[i].respawn.distanceleft);
|
||||
WRITEUINT32(save_p, players[i].respawn.dropdash);
|
||||
WRITEUINT8(save_p, players[i].respawn.truedeath);
|
||||
|
||||
// botvars_t
|
||||
WRITEUINT8(save_p, players[i].botvars.difficulty);
|
||||
|
|
@ -654,6 +655,7 @@ static void P_NetUnArchivePlayers(void)
|
|||
players[i].respawn.airtimer = READUINT32(save_p);
|
||||
players[i].respawn.distanceleft = READUINT32(save_p);
|
||||
players[i].respawn.dropdash = READUINT32(save_p);
|
||||
players[i].respawn.truedeath = READUINT8(save_p);
|
||||
|
||||
// botvars_t
|
||||
players[i].botvars.difficulty = READUINT8(save_p);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue