Dashmode fixes:
- Don't force the player's default normalspeed and jumpfactor while not in dashmode - Properly trim the fuse for followmobj ghosts spawned during dashmode - Add deliberate dashmode ghosts for Metal's jet fume
This commit is contained in:
parent
279ad0707e
commit
165b6c2435
|
@ -2377,6 +2377,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
||||||
fixed_t height;
|
fixed_t height;
|
||||||
fixed_t spinheight;
|
fixed_t spinheight;
|
||||||
INT32 exiting;
|
INT32 exiting;
|
||||||
|
tic_t dashmode;
|
||||||
INT16 numboxes;
|
INT16 numboxes;
|
||||||
INT16 totalring;
|
INT16 totalring;
|
||||||
UINT8 laps;
|
UINT8 laps;
|
||||||
|
@ -2411,6 +2412,8 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
||||||
if (!(netgame || multiplayer))
|
if (!(netgame || multiplayer))
|
||||||
pflags |= (players[player].pflags & (PF_GODMODE|PF_NOCLIP|PF_INVIS));
|
pflags |= (players[player].pflags & (PF_GODMODE|PF_NOCLIP|PF_INVIS));
|
||||||
|
|
||||||
|
dashmode = players[player].dashmode;
|
||||||
|
|
||||||
numboxes = players[player].numboxes;
|
numboxes = players[player].numboxes;
|
||||||
laps = players[player].laps;
|
laps = players[player].laps;
|
||||||
totalring = players[player].totalring;
|
totalring = players[player].totalring;
|
||||||
|
@ -2509,6 +2512,8 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
||||||
p->spinheight = spinheight;
|
p->spinheight = spinheight;
|
||||||
p->exiting = exiting;
|
p->exiting = exiting;
|
||||||
|
|
||||||
|
p->dashmode = dashmode;
|
||||||
|
|
||||||
p->numboxes = numboxes;
|
p->numboxes = numboxes;
|
||||||
p->laps = laps;
|
p->laps = laps;
|
||||||
p->totalring = totalring;
|
p->totalring = totalring;
|
||||||
|
|
|
@ -11393,6 +11393,14 @@ void P_SpawnPlayer(INT32 playernum)
|
||||||
p->realtime = leveltime;
|
p->realtime = leveltime;
|
||||||
p->followitem = skins[p->skin].followitem;
|
p->followitem = skins[p->skin].followitem;
|
||||||
|
|
||||||
|
// Make sure player's stats are reset if they were in dashmode!
|
||||||
|
if (p->dashmode)
|
||||||
|
{
|
||||||
|
p->dashmode = 0;
|
||||||
|
p->normalspeed = skins[p->skin].normalspeed;
|
||||||
|
p->jumpfactor = skins[p->skin].jumpfactor;
|
||||||
|
}
|
||||||
|
|
||||||
//awayview stuff
|
//awayview stuff
|
||||||
p->awayviewmobj = NULL;
|
p->awayviewmobj = NULL;
|
||||||
p->awayviewtics = 0;
|
p->awayviewtics = 0;
|
||||||
|
|
15
src/p_user.c
15
src/p_user.c
|
@ -11485,6 +11485,13 @@ static void P_DoMetalJetFume(player_t *player, mobj_t *fume)
|
||||||
fume->y = mo->y + P_ReturnThrustY(fume, angle, dist);
|
fume->y = mo->y + P_ReturnThrustY(fume, angle, dist);
|
||||||
fume->z = mo->z + ((mo->height - fume->height) >> 1);
|
fume->z = mo->z + ((mo->height - fume->height) >> 1);
|
||||||
P_SetThingPosition(fume);
|
P_SetThingPosition(fume);
|
||||||
|
|
||||||
|
// If dashmode is high enough, spawn a trail
|
||||||
|
if (!(fume->flags2 & MF2_DONTDRAW) && player->normalspeed >= skins[player->skin].normalspeed*2)
|
||||||
|
{
|
||||||
|
mobj_t *ghost = P_SpawnGhostMobj(fume);
|
||||||
|
ghost->tics = 4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -12279,6 +12286,7 @@ void P_PlayerThink(player_t *player)
|
||||||
// Dash mode - thanks be to VelocitOni
|
// Dash mode - thanks be to VelocitOni
|
||||||
if ((player->charflags & SF_DASHMODE) && !player->gotflag && !player->powers[pw_carry] && !player->exiting && !(maptol & TOL_NIGHTS) && !metalrecording) // woo, dashmode! no nights tho.
|
if ((player->charflags & SF_DASHMODE) && !player->gotflag && !player->powers[pw_carry] && !player->exiting && !(maptol & TOL_NIGHTS) && !metalrecording) // woo, dashmode! no nights tho.
|
||||||
{
|
{
|
||||||
|
tic_t prevdashmode = dashmode;
|
||||||
boolean totallyradical = player->speed >= FixedMul(player->runspeed, player->mo->scale);
|
boolean totallyradical = player->speed >= FixedMul(player->runspeed, player->mo->scale);
|
||||||
boolean floating = (player->secondjump == 1);
|
boolean floating = (player->secondjump == 1);
|
||||||
|
|
||||||
|
@ -12302,10 +12310,13 @@ void P_PlayerThink(player_t *player)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dashmode < DASHMODE_THRESHOLD) // Exits Dash Mode if you drop below speed/dash counter tics. Not in the above block so it doesn't keep disabling in midair.
|
if (dashmode < DASHMODE_THRESHOLD) // Exits Dash Mode if you drop below speed/dash counter tics. Not in the above block so it doesn't keep disabling in midair.
|
||||||
|
{
|
||||||
|
if (prevdashmode >= DASHMODE_THRESHOLD)
|
||||||
{
|
{
|
||||||
player->normalspeed = skins[player->skin].normalspeed; // Reset to default if not capable of entering dash mode.
|
player->normalspeed = skins[player->skin].normalspeed; // Reset to default if not capable of entering dash mode.
|
||||||
player->jumpfactor = skins[player->skin].jumpfactor;
|
player->jumpfactor = skins[player->skin].jumpfactor;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (P_IsObjectOnGround(player->mo)) // Activate dash mode if we're on the ground.
|
else if (P_IsObjectOnGround(player->mo)) // Activate dash mode if we're on the ground.
|
||||||
{
|
{
|
||||||
if (player->normalspeed < skins[player->skin].normalspeed*2) // If the player normalspeed is not currently at normalspeed*2 in dash mode, add speed each tic
|
if (player->normalspeed < skins[player->skin].normalspeed*2) // If the player normalspeed is not currently at normalspeed*2 in dash mode, add speed each tic
|
||||||
|
@ -12319,6 +12330,10 @@ void P_PlayerThink(player_t *player)
|
||||||
{
|
{
|
||||||
mobj_t *ghost = P_SpawnGhostMobj(player->mo); // Spawns afterimages
|
mobj_t *ghost = P_SpawnGhostMobj(player->mo); // Spawns afterimages
|
||||||
ghost->fuse = 2; // Makes the images fade quickly
|
ghost->fuse = 2; // Makes the images fade quickly
|
||||||
|
if (ghost->tracer)
|
||||||
|
{
|
||||||
|
ghost->tracer->fuse = ghost->fuse;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (dashmode)
|
else if (dashmode)
|
||||||
|
|
Loading…
Reference in a new issue