mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Several changes to respawning and race start.
* Becoming a spectator is now instant, and leaves no bumpable corpse behind.
* Players will now FAULT if they:
* change from a spectator into a player after the initial camera turnaround but before the end of POSITION.
* touch an instant kill FOF or get crushed during POSITION.
* become a spectator during POSITION. (I might change this later, seems overkill)
* If you respawn during POSITION, the jingle will not restart from the beginning.
* Change the FAULT animation to match spinout/currents.
* Clean up some of the spawning code to not place spectators on the ground.
This commit is contained in:
parent
1858811fbc
commit
2ec943a214
7 changed files with 87 additions and 25 deletions
|
|
@ -3374,9 +3374,11 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
|||
{
|
||||
if (players[playernum].mo)
|
||||
{
|
||||
P_DamageMobj(players[playernum].mo, NULL, NULL, 1, DMG_INSTAKILL);
|
||||
P_DamageMobj(players[playernum].mo, NULL, NULL, 1,
|
||||
(NetPacket.packet.newteam ? DMG_INSTAKILL : DMG_SPECTATOR));
|
||||
}
|
||||
else
|
||||
//else
|
||||
if (!NetPacket.packet.newteam)
|
||||
{
|
||||
players[playernum].playerstate = PST_REBORN;
|
||||
}
|
||||
|
|
|
|||
27
src/g_game.c
27
src/g_game.c
|
|
@ -2084,6 +2084,8 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
INT32 wanted;
|
||||
boolean songcredit = false;
|
||||
boolean eliminated;
|
||||
UINT16 nocontrol;
|
||||
INT32 khudfault;
|
||||
|
||||
score = players[player].score;
|
||||
marescore = players[player].marescore;
|
||||
|
|
@ -2183,6 +2185,14 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
wanted = players[player].kartstuff[k_wanted];
|
||||
}
|
||||
|
||||
if (!betweenmaps)
|
||||
{
|
||||
khudfault = players[player].karthud[khud_fault];
|
||||
nocontrol = players[player].powers[pw_nocontrol];
|
||||
}
|
||||
else
|
||||
khudfault = nocontrol = 0;
|
||||
|
||||
// Obliterate follower from existence
|
||||
P_SetTarget(&players[player].follower, NULL);
|
||||
|
||||
|
|
@ -2244,6 +2254,8 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
p->kartstuff[k_wanted] = wanted;
|
||||
p->kartstuff[k_eggmanblame] = -1;
|
||||
p->kartstuff[k_lastdraft] = -1;
|
||||
p->karthud[khud_fault] = khudfault;
|
||||
p->powers[pw_nocontrol] = nocontrol;
|
||||
|
||||
memcpy(&p->respawn, &respawn, sizeof (p->respawn));
|
||||
|
||||
|
|
@ -2297,6 +2309,9 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
if (betweenmaps)
|
||||
return;
|
||||
|
||||
if (leveltime < starttime)
|
||||
return;
|
||||
|
||||
if (p-players == consoleplayer)
|
||||
{
|
||||
if (mapmusflags & MUSIC_RELOADRESET)
|
||||
|
|
@ -2319,11 +2334,6 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
|
||||
if (songcredit)
|
||||
S_ShowMusicCredit();
|
||||
|
||||
if (leveltime > (starttime + (TICRATE/2)) && !p->spectator)
|
||||
{
|
||||
K_DoIngameRespawn(p);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
|
@ -2385,10 +2395,17 @@ void G_SpawnPlayer(INT32 playernum)
|
|||
|
||||
void G_MovePlayerToSpawnOrStarpost(INT32 playernum)
|
||||
{
|
||||
#if 0
|
||||
if (leveltime <= introtime && !players[playernum].spectator)
|
||||
P_MovePlayerToSpawn(playernum, G_FindMapStart(playernum));
|
||||
else
|
||||
P_MovePlayerToStarpost(playernum);
|
||||
#else
|
||||
if (leveltime > starttime)
|
||||
P_MovePlayerToStarpost(playernum);
|
||||
else
|
||||
P_MovePlayerToSpawn(playernum, G_FindMapStart(playernum));
|
||||
#endif
|
||||
}
|
||||
|
||||
mapthing_t *G_FindTeamStart(INT32 playernum)
|
||||
|
|
|
|||
|
|
@ -85,6 +85,23 @@ static void K_RespawnAtWaypoint(player_t *player, waypoint_t *waypoint)
|
|||
player->respawn.pointz += K_RespawnOffset(player, player->respawn.flip);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
void K_DoFault(player_t *player)
|
||||
|
||||
See header file for description.
|
||||
--------------------------------------------------*/
|
||||
|
||||
void K_DoFault(player_t *player)
|
||||
{
|
||||
player->powers[pw_nocontrol] = (starttime - leveltime) + 50;
|
||||
if (!(player->pflags & PF_FAULT))
|
||||
{
|
||||
S_StartSound(player->mo, sfx_s3k83);
|
||||
player->karthud[khud_fault] = 1;
|
||||
player->pflags |= PF_FAULT;
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
void K_DoIngameRespawn(player_t *player)
|
||||
|
||||
|
|
@ -103,18 +120,14 @@ void K_DoIngameRespawn(player_t *player)
|
|||
return;
|
||||
}
|
||||
|
||||
if (leveltime < introtime)
|
||||
if (leveltime <= introtime)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (leveltime < starttime) // FAULT
|
||||
{
|
||||
player->powers[pw_nocontrol] = (starttime - leveltime) + 50;
|
||||
player->pflags |= PF_FAULT;
|
||||
S_StartSound(player->mo, sfx_s3k83);
|
||||
player->karthud[khud_fault] = 1;
|
||||
}
|
||||
// FAULT
|
||||
if (leveltime < starttime)
|
||||
K_DoFault(player);
|
||||
|
||||
player->kartstuff[k_ringboost] = 0;
|
||||
player->kartstuff[k_driftboost] = 0;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,21 @@
|
|||
fixed_t K_RespawnOffset(player_t *player, boolean flip);
|
||||
|
||||
|
||||
/*--------------------------------------------------
|
||||
void K_DoFault(player_t *player);
|
||||
|
||||
Faults the specified player.
|
||||
|
||||
Input Arguments:-
|
||||
player - Player to preform this for.
|
||||
|
||||
Return:-
|
||||
None
|
||||
--------------------------------------------------*/
|
||||
|
||||
void K_DoFault(player_t *player);
|
||||
|
||||
|
||||
/*--------------------------------------------------
|
||||
void K_DoIngameRespawn(player_t *player);
|
||||
|
||||
|
|
|
|||
|
|
@ -1370,6 +1370,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
|||
break;
|
||||
|
||||
case MT_PLAYER:
|
||||
if (damagetype != DMG_SPECTATOR)
|
||||
{
|
||||
angle_t flingAngle;
|
||||
mobj_t *kart;
|
||||
|
|
@ -1755,6 +1756,12 @@ static boolean P_KillPlayer(player_t *player, mobj_t *inflictor, mobj_t *source,
|
|||
break;
|
||||
}
|
||||
|
||||
// FAULT
|
||||
if (leveltime < starttime)
|
||||
{
|
||||
K_DoFault(player);
|
||||
}
|
||||
|
||||
K_DropEmeraldsFromPlayer(player, player->powers[pw_emeralds]);
|
||||
K_SetHitLagForObjects(player->mo, inflictor, 15);
|
||||
|
||||
|
|
|
|||
10
src/p_mobj.c
10
src/p_mobj.c
|
|
@ -10591,7 +10591,7 @@ void P_MovePlayerToSpawn(INT32 playernum, mapthing_t *mthing)
|
|||
{
|
||||
fixed_t offset = mthing->z << FRACBITS;
|
||||
|
||||
if (p->respawn.state != RESPAWNST_NONE)
|
||||
if (p->respawn.state != RESPAWNST_NONE || p->spectator)
|
||||
offset += K_RespawnOffset(p, (mthing->options & MTF_OBJECTFLIP));
|
||||
|
||||
// Flagging a player's ambush will make them start on the ceiling
|
||||
|
|
@ -10637,6 +10637,12 @@ void P_MovePlayerToSpawn(INT32 playernum, mapthing_t *mthing)
|
|||
|
||||
mobj->angle = angle;
|
||||
|
||||
// FAULT
|
||||
if (leveltime > introtime)
|
||||
{
|
||||
K_DoIngameRespawn(p);
|
||||
}
|
||||
|
||||
P_AfterPlayerSpawn(playernum);
|
||||
}
|
||||
|
||||
|
|
@ -10690,6 +10696,8 @@ void P_MovePlayerToStarpost(INT32 playernum)
|
|||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
p->drawangle = mobj->angle; // default to the camera angle
|
||||
|
||||
P_AfterPlayerSpawn(playernum);
|
||||
}
|
||||
|
|
|
|||
18
src/p_user.c
18
src/p_user.c
|
|
@ -2123,11 +2123,7 @@ void P_MovePlayer(player_t *player)
|
|||
|
||||
// Control relinquishing stuff!
|
||||
if (player->powers[pw_nocontrol])
|
||||
{
|
||||
player->pflags |= PF_STASIS;
|
||||
if (!(player->powers[pw_nocontrol] & (1<<15)))
|
||||
player->pflags |= PF_JUMPSTASIS;
|
||||
}
|
||||
|
||||
// note: don't unset stasis here
|
||||
|
||||
|
|
@ -2183,9 +2179,13 @@ void P_MovePlayer(player_t *player)
|
|||
player->drawangle -= ANGLE_22h;
|
||||
player->mo->rollangle = 0;
|
||||
}
|
||||
else if (player->kartstuff[k_spinouttimer] > 0)
|
||||
else if ((player->pflags & PF_FAULT) || (player->kartstuff[k_spinouttimer] > 0))
|
||||
{
|
||||
UINT8 speed = max(1, min(8, player->kartstuff[k_spinouttimer]/8));
|
||||
UINT16 speed = ((player->pflags & PF_FAULT) ? player->powers[pw_nocontrol] : player->kartstuff[k_spinouttimer])/8;
|
||||
if (speed > 8)
|
||||
speed = 8;
|
||||
else if (speed < 1)
|
||||
speed = 1;
|
||||
|
||||
P_SetPlayerMobjState(player->mo, S_KART_SPINOUT);
|
||||
|
||||
|
|
@ -2196,7 +2196,7 @@ void P_MovePlayer(player_t *player)
|
|||
|
||||
player->mo->rollangle = 0;
|
||||
}
|
||||
else if (player->pflags & PF_FAULT)
|
||||
/*else if (player->pflags & PF_FAULT) -- v1 fault
|
||||
{
|
||||
P_SetPlayerMobjState(player->mo, S_KART_SPINOUT);
|
||||
|
||||
|
|
@ -2206,7 +2206,7 @@ void P_MovePlayer(player_t *player)
|
|||
player->drawangle -= ANGLE_11hh;
|
||||
|
||||
player->mo->rollangle = 0;
|
||||
}
|
||||
}*/
|
||||
else
|
||||
{
|
||||
K_KartMoveAnimation(player);
|
||||
|
|
@ -4571,7 +4571,7 @@ void P_PlayerThink(player_t *player)
|
|||
player->powers[pw_flashing]--;
|
||||
}
|
||||
|
||||
if (player->powers[pw_nocontrol] & ((1<<15)-1) && player->powers[pw_nocontrol] < UINT16_MAX)
|
||||
if (player->powers[pw_nocontrol] && player->powers[pw_nocontrol] < UINT16_MAX)
|
||||
{
|
||||
if (!(--player->powers[pw_nocontrol]))
|
||||
player->pflags &= ~PF_FAULT;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue