Remove ebrake, spindash and fastfall. cleanup unused states and sprites

This commit is contained in:
NepDisk 2024-07-31 12:46:03 -04:00
parent e01804c691
commit f2f1a0aa66
20 changed files with 10 additions and 847 deletions

View file

@ -306,7 +306,6 @@ typedef struct botvars_s
SINT8 turnconfirm; // Confirm turn direction
tic_t spindashconfirm; // When high enough, they will try spindashing
} botvars_t;
// player_t struct for all skybox variables
@ -436,12 +435,6 @@ typedef struct player_s
UINT16 springstars; // Spawn stars around a player when they hit a spring
UINT16 springcolor; // Color of spring stars
UINT8 dashpadcooldown; // Separate the vanilla SA-style dash pads from using flashing
UINT16 spindash; // Spindash charge timer
fixed_t spindashspeed; // Spindash release speed
UINT8 spindashboost; // Spindash release boost timer
fixed_t fastfall; // Fast fall momentum
fixed_t boostpower; // Base boost value, for offroad
fixed_t speedboost; // Boost value smoothing for max speed

View file

@ -4388,23 +4388,6 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
"S_WATERTRAILUNDERLAY6",
"S_WATERTRAILUNDERLAY7",
"S_WATERTRAILUNDERLAY8",
"S_SPINDASHDUST",
"S_SPINDASHWIND",
"S_SOFTLANDING1",
"S_SOFTLANDING2",
"S_SOFTLANDING3",
"S_SOFTLANDING4",
"S_SOFTLANDING5",
"S_DOWNLINE1",
"S_DOWNLINE2",
"S_DOWNLINE3",
"S_DOWNLINE4",
"S_DOWNLINE5",
"S_HOLDBUBBLE",
// Funny Spike
"S_DEBTSPIKE1",
@ -5487,12 +5470,6 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
"MT_WATERTRAIL",
"MT_WATERTRAILUNDERLAY",
"MT_SPINDASHDUST",
"MT_SPINDASHWIND",
"MT_SOFTLANDING",
"MT_DOWNLINE",
"MT_HOLDBUBBLE",
"MT_PAPERITEMSPOT",
"MT_BEAMPOINT",

View file

@ -2777,8 +2777,6 @@ static boolean F_GetTextPromptTutorialTag(char *tag, INT32 length)
gcs = G_GetControlScheme(gamecontrol[0], gcl_brake, num_gcl_brake);
else if (!strncmp(tag, "TAD", 3)) // Drift
gcs = G_GetControlScheme(gamecontrol[0], gcl_drift, num_gcl_drift);
else if (!strncmp(tag, "TAS", 3)) // Spindash
gcs = G_GetControlScheme(gamecontrol[0], gcl_spindash, num_gcl_spindash);
else if (!strncmp(tag, "TAM", 3)) // Movement
gcs = G_GetControlScheme(gamecontrol[0], gcl_movement, num_gcl_movement);
else if (!strncmp(tag, "TAI", 3)) // Item usage

View file

@ -1091,12 +1091,6 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
if (PlayerInputDown(ssplayer, gc_drift) || (usejoystick && axis > 0))
cmd->buttons |= BT_DRIFT;
// Spindash with any button/key
// Simply holds all of the inputs for you.
axis = PlayerJoyAxis(ssplayer, AXISSPINDASH);
if (PlayerInputDown(ssplayer, gc_spindash) || (usejoystick && axis > 0))
cmd->buttons |= (BT_ACCELERATE|BT_BRAKE|BT_DRIFT);
// rear view with any button/key
axis = PlayerJoyAxis(ssplayer, AXISLOOKBACK);
if (PlayerInputDown(ssplayer, gc_lookback) || (usejoystick && axis > 0))
@ -3711,7 +3705,7 @@ static void G_DoCompleted(void)
//Make sure the map actually exists before you try to go to it!
if ((W_CheckNumForName(G_BuildMapName(cm + 1)) == LUMPERROR))
{
CONS_Alert(CONS_ERROR, M_GetText("Next map given (MAP %d) doesn't exist! Reverting to MAP01.\n"), cm+1);
//CONS_Alert(CONS_ERROR, M_GetText("Next map given (MAP %d) doesn't exist! Reverting to MAP01.\n"), cm+1);
cm = 0;
break;
}

View file

@ -110,7 +110,6 @@ typedef enum
AXISFIRE = AXISDIGITAL,
AXISDRIFT,
AXISSPINDASH,
AXISLOOKBACK,
AXISAIM,
} axis_input_e;

View file

@ -739,8 +739,6 @@ char sprnames[NUMSPRITES + 1][5] =
"OTLS",
"OTCP",
"DBOS", // Drift boost flame
"WAYP",
"EGOO",
@ -749,16 +747,6 @@ char sprnames[NUMSPRITES + 1][5] =
"GCHA", // follower: generic chao
"CHEZ", // follower: cheese
"DBCL", // Drift boost clip
"DBNC", // Drift boost clip's sparks
"DBST", // Drift boost plume
"SDDS", // Spindash dust
"SDWN", // Spindash wind
"EBRK", // Soft Landing / Ebrake aura stuff.
"HMTR", // Down Lines
"HBUB", // HOLD! Bubble
"TRCK",
// First person view sprites; this is a sprite so that it can be replaced by a specialized MD2 draw later
@ -4973,26 +4961,6 @@ state_t states[NUMSTATES] =
{SPR_WTRL, FF_TRANS50|FF_PAPERSPRITE|14, 2, {NULL}, 0, 0, S_NULL}, // S_WATERTRAILUNDERLAY7
{SPR_WTRL, FF_TRANS50|FF_PAPERSPRITE|15, 2, {NULL}, 0, 0, S_NULL}, // S_WATERTRAILUNDERLAY8
{SPR_SDDS, FF_ANIMATE, 9, {NULL}, 9, 1, S_NULL}, // S_SPINDASHDUST
{SPR_SDWN, FF_ANIMATE|FF_PAPERSPRITE, 18, {NULL}, 9, 2, S_NULL}, // S_SPINDASHWIND
// Soft Landing
{SPR_EBRK, 0|FF_ADD|FF_FLOORSPRITE, 4, {NULL}, 0, 0, S_SOFTLANDING2}, // S_SOFTLANDING1
{SPR_EBRK, 1|FF_ADD|FF_FLOORSPRITE, 4, {NULL}, 0, 0, S_SOFTLANDING3}, // S_SOFTLANDING2
{SPR_EBRK, 2|FF_ADD|FF_FLOORSPRITE, 4, {NULL}, 0, 0, S_SOFTLANDING4}, // S_SOFTLANDING3
{SPR_EBRK, 3|FF_ADD|FF_FLOORSPRITE, 4, {NULL}, 0, 0, S_SOFTLANDING5}, // S_SOFTLANDING4
{SPR_EBRK, 4|FF_ADD|FF_FLOORSPRITE, 4, {NULL}, 0, 0, S_NULL}, // S_SOFTLANDING5
// Downwards Lines
{SPR_HMTR, 0|FF_ADD, 1, {NULL}, 0, 0, S_DOWNLINE2}, // S_DOWNLINE1
{SPR_HMTR, 1|FF_ADD, 1, {NULL}, 0, 0, S_DOWNLINE3}, // S_DOWNLINE2
{SPR_HMTR, 2|FF_ADD, 1, {NULL}, 0, 0, S_DOWNLINE4}, // S_DOWNLINE3
{SPR_HMTR, 3|FF_ADD, 1, {NULL}, 0, 0, S_DOWNLINE5}, // S_DOWNLINE4
{SPR_HMTR, 4|FF_ADD, 1, {NULL}, 0, 0, S_NULL}, // S_DOWNLINE5
// HOLD Bubble
{SPR_HBUB, 0|FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_HOLDBUBBLE}, // S_HOLDBUBBLE
// Funny Spike
{SPR_DEBT, 0|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_DEBTSPIKE2}, // S_DEBTSPIKE1
{SPR_DEBT, 7|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_DEBTSPIKE3}, // S_DEBTSPIKE2
@ -28361,141 +28329,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
{ // MT_SPINDASHDUST
-1, // doomednum
S_SPINDASHDUST, // spawnstate
1000, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
12*FRACUNIT, // radius
24*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},
{ // MT_SPINDASHWIND
-1, // doomednum
S_SPINDASHWIND, // spawnstate
1000, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
12*FRACUNIT, // radius
24*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},
{ // MT_SOFTLANDING
-1, // doomednum
S_SOFTLANDING1, // spawnstate
1000, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
12*FRACUNIT, // radius
24*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},
{ // MT_DOWNLINE
-1, // doomednum
S_DOWNLINE1, // spawnstate
1000, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
12*FRACUNIT, // radius
24*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},
{ // MT_HOLDBUBBLE
-1, // doomednum
S_HOLDBUBBLE, // spawnstate
1000, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
12*FRACUNIT, // radius
24*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},
{ // MT_PAPERITEMSPOT
-1, // doomednum
S_INVISIBLE, // spawnstate

View file

@ -1285,8 +1285,6 @@ typedef enum sprite
SPR_OTLS,
SPR_OTCP,
SPR_DBOS, // Drift boost flame
SPR_WAYP,
SPR_EGOO,
@ -1295,16 +1293,6 @@ typedef enum sprite
SPR_GCHA, // follower: generic chao
SPR_CHEZ, // follower: cheese
SPR_DBCL, // Drift boost clip
SPR_DBNC, // Drift boost clip's sparks
SPR_DBST, // Drift boost plume
SPR_SDDS, // Spindash dust
SPR_SDWN, // Spindash wind
SPR_EBRK, // Soft Landing / Ebrake aura stuff.
SPR_HMTR, // downwards line
SPR_HBUB, // HOLD! Bubble
SPR_TRCK,
// First person view sprites; this is a sprite so that it can be replaced by a specialized MD2 draw later
@ -5392,23 +5380,6 @@ typedef enum state
S_WATERTRAILUNDERLAY7,
S_WATERTRAILUNDERLAY8,
S_SPINDASHDUST,
S_SPINDASHWIND,
S_SOFTLANDING1,
S_SOFTLANDING2,
S_SOFTLANDING3,
S_SOFTLANDING4,
S_SOFTLANDING5,
S_DOWNLINE1,
S_DOWNLINE2,
S_DOWNLINE3,
S_DOWNLINE4,
S_DOWNLINE5,
S_HOLDBUBBLE,
S_DEBTSPIKE1,
S_DEBTSPIKE2,
S_DEBTSPIKE3,
@ -6509,12 +6480,6 @@ typedef enum mobj_type
MT_WATERTRAIL,
MT_WATERTRAILUNDERLAY,
MT_SPINDASHDUST,
MT_SPINDASHWIND,
MT_SOFTLANDING,
MT_DOWNLINE,
MT_HOLDBUBBLE,
MT_PAPERITEMSPOT,
MT_BEAMPOINT,

View file

@ -775,101 +775,6 @@ static botprediction_t *K_CreateBotPrediction(player_t *player)
return predict;
}
/*--------------------------------------------------
static UINT8 K_TrySpindash(player_t *player)
Determines conditions where the bot should attempt to spindash.
Input Arguments:-
player - Bot player to check.
Return:-
0 to make the bot drive normally, 1 to e-brake, 2 to e-brake & charge spindash.
(TODO: make this an enum)
--------------------------------------------------*/
static UINT8 K_TrySpindash(player_t *player)
{
const tic_t difficultyModifier = (TICRATE/6);
const fixed_t oldSpeed = R_PointToDist2(0, 0, player->rmomx, player->rmomy);
const fixed_t baseAccel = K_GetNewSpeed(player) - oldSpeed;
const fixed_t speedDiff = player->speed - player->lastspeed;
const INT32 angleDiff = AngleDelta(player->mo->angle, K_MomentumAngle(player->mo));
if (player->spindashboost // You just released a spindash, you don't need to try again yet, jeez.
|| P_PlayerInPain(player) || !P_IsObjectOnGround(player->mo)) // Not in a state where we want 'em to spindash.
{
player->botvars.spindashconfirm = 0;
return 0;
}
// Try "start boosts" first
if (leveltime == starttime)
{
// Forces them to release, even if they haven't fully charged.
// Don't want them to keep charging if they didn't have time to.
return 0;
}
if (leveltime < starttime)
{
INT32 boosthold = starttime - K_GetSpindashChargeTime(player);
boosthold -= (DIFFICULTBOT - min(DIFFICULTBOT, player->botvars.difficulty)) * difficultyModifier;
if (leveltime >= (unsigned)boosthold)
{
// Start charging...
return 2;
}
else
{
// Just hold your ground and e-brake.
return 1;
}
}
if (player->botvars.spindashconfirm >= BOTSPINDASHCONFIRM)
{
INT32 chargingPoint = (K_GetSpindashChargeTime(player) + difficultyModifier);
// Release quicker the higher the difficulty is.
// Sounds counter-productive, but that's actually the best strategy after the race has started.
chargingPoint -= min(DIFFICULTBOT, player->botvars.difficulty) * difficultyModifier;
if (player->spindash > chargingPoint)
{
// Time to release.
return 0;
}
return 2;
}
else
{
// Logic for normal racing.
if (speedDiff < (baseAccel / 8) // Moving too slowly
|| angleDiff > ANG60) // Being pushed backwards
{
if (player->botvars.spindashconfirm < BOTSPINDASHCONFIRM)
{
player->botvars.spindashconfirm++;
}
}
else if (player->botvars.spindashconfirm >= BOTSPINDASHCONFIRM)
{
if (player->botvars.spindashconfirm > 0)
{
player->botvars.spindashconfirm--;
}
}
}
// We're doing just fine, we don't need to spindash, thanks.
return 0;
}
/*--------------------------------------------------
static void K_DrawPredictionDebug(botprediction_t *predict, player_t *player)
@ -1228,9 +1133,7 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd)
{
precise_t t = 0;
botprediction_t *predict = NULL;
boolean trySpindash = true;
angle_t destangle = 0;
UINT8 spindash = 0;
INT32 turnamt = 0;
line_t *botController = NULL;
@ -1315,7 +1218,6 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd)
}
if (leveltime <= starttime)
{
trySpindash = false;
if (leveltime >= starttime-TICRATE-TICRATE/7)
{
@ -1342,27 +1244,7 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd)
turnamt = K_HandleBotTrack(player, cmd, predict, destangle);
}
if (trySpindash == true)
{
// Spindashing
spindash = K_TrySpindash(player);
if (spindash > 0)
{
cmd->buttons |= BT_EBRAKEMASK;
cmd->forwardmove = 0;
if (spindash == 2 && player->speed < 6*mapobjectscale)
{
cmd->buttons |= BT_DRIFT;
}
}
}
if (spindash == 0)
{
// Don't pointlessly try to use rings/sneakers while charging a spindash.
// TODO: Allowing projectile items like orbinaut while e-braking would be nice, maybe just pass in the spindash variable?
t = I_GetPreciseTime();
K_BotItemUsage(player, cmd, turnamt);
ps_bots[player - players].item = I_GetPreciseTime() - t;

View file

@ -1293,7 +1293,6 @@ static void K_PlayerJustBumped(player_t *player)
}
player->justbumped = bumptime;
player->spindash = 0;
if (player->spinouttimer)
{
@ -1763,7 +1762,7 @@ void K_SpawnDashDustRelease(player_t *player)
if (!P_IsObjectOnGround(player->mo))
return;
if (!player->speed && !player->startboost && !player->spindash)
if (!player->speed && !player->startboost)
return;
travelangle = player->mo->angle;
@ -2688,24 +2687,6 @@ static fixed_t K_FlameShieldDashVar(INT32 val)
return (3*FRACUNIT/4) + (((val * FRACUNIT) / TICRATE) / 2);
}
INT16 K_GetSpindashChargeTime(player_t *player)
{
// more charge time for higher speed
// Tails = 2s, Knuckles = 2.6s, Metal = 3.2s
return (player->kartspeed + 8) * (TICRATE/5);
}
fixed_t K_GetSpindashChargeSpeed(player_t *player)
{
// more speed for higher weight & speed
// Tails = +18.75%, Fang = +46.88%, Mighty = +46.88%, Metal = +56.25%
// (can be higher than this value when overcharged)
const fixed_t val = ((player->kartspeed + player->kartweight) + 2) * (FRACUNIT/32);
// TODO: gametyperules
return (gametype == GT_BATTLE) ? (4 * val) : val;
}
// sets boostpower, speedboost, accelboost, and handleboost to whatever we need it to be
static void K_GetKartBoostPower(player_t *player)
{
@ -2785,19 +2766,6 @@ static void K_GetKartBoostPower(player_t *player)
);
}
if (player->spindashboost) // Spindash boost
{
const fixed_t MAXCHARGESPEED = K_GetSpindashChargeSpeed(player);
const fixed_t exponent = FixedMul(player->spindashspeed, player->spindashspeed);
// character & charge dependent
ADDBOOST(
FixedMul(MAXCHARGESPEED, exponent), // + 0 to K_GetSpindashChargeSpeed()% top speed
(40 * exponent), // + 0% to 4000% acceleration
0 // + 0% handling
);
}
if (player->startboost) // Startup Boost
{
ADDBOOST(FRACUNIT/4, 6*FRACUNIT, sliptidehandling/2); // + 25% top speed, + 300% acceleration, +25% handling
@ -3002,12 +2970,12 @@ SINT8 K_GetForwardMove(player_t *player)
return 0;
}
if (player->sneakertimer || player->spindashboost)
if (player->sneakertimer)
{
return MAXPLMOVE;
}
if (player->spinouttimer || K_PlayerEBrake(player))
if (player->spinouttimer)
{
return 0;
}
@ -6021,11 +5989,6 @@ static void K_UpdateEngineSounds(player_t *player)
// Dropdashing
targetsnd = ((buttons & BT_ACCELERATE) ? 12 : 0);
}
else if (K_PlayerEBrake(player) == true)
{
// Spindashing
targetsnd = ((buttons & BT_DRIFT) ? 12 : 0);
}
else
{
// Average out the value of forwardmove and the speed that you're moving at.
@ -6734,16 +6697,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
player->startboost--;
}
if (player->spindashboost)
{
player->spindashboost--;
if (player->spindashboost <= 0)
{
player->spindashspeed = player->spindashboost = 0;
}
}
if (player->invincibilitytimer)
player->invincibilitytimer--;
@ -6890,12 +6843,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
if (cmd->buttons & BT_DRIFT)
{
// Only allow drifting while NOT trying to do an spindash input.
if ((K_GetKartButtons(player) & BT_EBRAKEMASK) != BT_EBRAKEMASK)
{
player->pflags |= PF_DRIFTINPUT;
}
// else, keep the previous value, because it might be brake-drifting.
player->pflags |= PF_DRIFTINPUT;
}
else
{
@ -6918,8 +6866,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
player->tripwireState = TRIPSTATE_NONE;
}
K_KartEbrakeVisuals(player);
if (K_GetKartButtons(player) & BT_BRAKE &&
P_IsObjectOnGround(player->mo) &&
K_GetKartSpeed(player, false, false) / 2 <= player->speed)
@ -8141,363 +8087,11 @@ static INT32 K_FlameShieldMax(player_t *player)
return min(16, 1 + (disttofinish / distv));
}
boolean K_PlayerEBrake(player_t *player)
{
if (player->fastfall != 0)
{
return true;
}
return (K_GetKartButtons(player) & BT_EBRAKEMASK) == BT_EBRAKEMASK
&& player->drift == 0
&& P_PlayerInPain(player) == false
&& player->justbumped == 0
&& player->spindashboost == 0
&& player->nocontrol == 0;
}
SINT8 K_Sliptiding(player_t *player)
{
return player->drift ? 0 : player->aizdriftstrat;
}
// Ebraking visuals for mo
// we use mo->hprev for the hold bubble. If another hprev exists for some reason, remove it.
void K_KartEbrakeVisuals(player_t *p)
{
mobj_t *wave;
mobj_t *spdl;
fixed_t sx, sy;
if (K_PlayerEBrake(p) == true)
{
if (p->ebrakefor % 20 == 0)
{
wave = P_SpawnMobj(p->mo->x, p->mo->y, p->mo->z, MT_SOFTLANDING);
P_SetScale(wave, p->mo->scale);
wave->momx = p->mo->momx;
wave->momy = p->mo->momy;
wave->momz = p->mo->momz;
wave->standingslope = p->mo->standingslope;
}
// sound
if (!S_SoundPlaying(p->mo, sfx_s3kd9s))
S_StartSound(p->mo, sfx_s3kd9s);
// HOLD! bubble.
if (!p->ebrakefor)
{
if (p->mo->hprev && !P_MobjWasRemoved(p->mo->hprev))
{
// for some reason, there's already an hprev. Remove it.
P_RemoveMobj(p->mo->hprev);
}
p->mo->hprev = P_SpawnMobj(p->mo->x, p->mo->y, p->mo->z, MT_HOLDBUBBLE);
p->mo->hprev->renderflags |= (RF_DONTDRAW & ~K_GetPlayerDontDrawFlag(p));
}
// Update HOLD bubble.
if (p->mo->hprev && !P_MobjWasRemoved(p->mo->hprev))
{
P_MoveOrigin(p->mo->hprev, p->mo->x, p->mo->y, p->mo->z);
p->mo->hprev->angle = p->mo->angle;
p->mo->hprev->fuse = TICRATE/2; // When we leave spindash for any reason, make sure this bubble goes away soon after.
K_FlipFromObject(p->mo->hprev, p->mo);
}
if (!p->spindash)
{
// Spawn downwards fastline
sx = p->mo->x + P_RandomRange(-48, 48)*p->mo->scale;
sy = p->mo->y + P_RandomRange(-48, 48)*p->mo->scale;
spdl = P_SpawnMobj(sx, sy, p->mo->z, MT_DOWNLINE);
spdl->colorized = true;
spdl->color = SKINCOLOR_WHITE;
K_MatchGenericExtraFlags(spdl, p->mo);
P_SetScale(spdl, p->mo->scale);
// squish the player a little bit.
p->mo->spritexscale = FRACUNIT*115/100;
p->mo->spriteyscale = FRACUNIT*85/100;
}
else
{
const UINT16 MAXCHARGETIME = K_GetSpindashChargeTime(p);
const fixed_t MAXSHAKE = FRACUNIT;
// update HOLD bubble with numbers based on charge.
if (p->mo->hprev && !P_MobjWasRemoved(p->mo->hprev))
{
UINT8 frame = min(1 + ((p->spindash*3) / MAXCHARGETIME), 4);
// ?! limit.
if (p->spindash >= MAXCHARGETIME +TICRATE)
frame = 5;
p->mo->hprev->frame = frame|FF_FULLBRIGHT;
}
// shake the player as they charge their spindash!
// "gentle" shaking as we start...
if (p->spindash < MAXCHARGETIME)
{
fixed_t shake = FixedMul(((p->spindash)*FRACUNIT/MAXCHARGETIME), MAXSHAKE);
SINT8 mult = leveltime & 1 ? 1 : -1;
p->mo->spritexoffset = shake*mult;
}
else // get VIOLENT on overcharge :)
{
fixed_t shake = MAXSHAKE + FixedMul(((p->spindash-MAXCHARGETIME)*FRACUNIT/TICRATE), MAXSHAKE)*3;
SINT8 mult = leveltime & 1 ? 1 : -1;
p->mo->spritexoffset = shake*mult;
}
// sqish them a little MORE....
p->mo->spritexscale = FRACUNIT*12/10;
p->mo->spriteyscale = FRACUNIT*8/10;
}
p->ebrakefor++;
}
else if (p->ebrakefor) // cancel effects
{
// reset scale
p->mo->spritexscale = FRACUNIT;
p->mo->spriteyscale = FRACUNIT;
// reset shake
p->mo->spritexoffset = 0;
// remove the bubble instantly unless it's in the !? state
if (p->mo->hprev && !P_MobjWasRemoved(p->mo->hprev) && (p->mo->hprev->frame & FF_FRAMEMASK) != 5)
{
P_RemoveMobj(p->mo->hprev);
p->mo->hprev = NULL;
}
p->ebrakefor = 0;
}
}
static void K_KartSpindashDust(mobj_t *parent)
{
fixed_t rad = FixedDiv(FixedHypot(parent->radius, parent->radius), parent->scale);
INT32 i;
for (i = 0; i < 2; i++)
{
fixed_t hmomentum = P_RandomRange(6, 12) * parent->scale;
fixed_t vmomentum = P_RandomRange(2, 6) * parent->scale;
angle_t ang = parent->player->drawangle + ANGLE_180;
SINT8 flip = 1;
mobj_t *dust;
if (i & 1)
ang -= ANGLE_45;
else
ang += ANGLE_45;
dust = P_SpawnMobjFromMobj(parent,
FixedMul(rad, FINECOSINE(ang >> ANGLETOFINESHIFT)),
FixedMul(rad, FINESINE(ang >> ANGLETOFINESHIFT)),
0, MT_SPINDASHDUST
);
flip = P_MobjFlip(dust);
dust->momx = FixedMul(hmomentum, FINECOSINE(ang >> ANGLETOFINESHIFT));
dust->momy = FixedMul(hmomentum, FINESINE(ang >> ANGLETOFINESHIFT));
dust->momz = vmomentum * flip;
}
}
static void K_KartSpindashWind(mobj_t *parent)
{
mobj_t *wind = P_SpawnMobjFromMobj(parent,
P_RandomRange(-36,36) * FRACUNIT,
P_RandomRange(-36,36) * FRACUNIT,
FixedDiv(parent->height / 2, parent->scale) + (P_RandomRange(-20,20) * FRACUNIT),
MT_SPINDASHWIND
);
P_SetTarget(&wind->target, parent);
if (parent->momx || parent->momy)
P_InitAngle(wind, R_PointToAngle2(0, 0, parent->momx, parent->momy));
else
P_InitAngle(wind, parent->player->drawangle);
wind->momx = 3 * parent->momx / 4;
wind->momy = 3 * parent->momy / 4;
wind->momz = 3 * P_GetMobjZMovement(parent) / 4;
K_MatchGenericExtraFlags(wind, parent);
}
// Time after which you get a thrust for releasing spindash
#define SPINDASHTHRUSTTIME 20
static void K_KartSpindash(player_t *player)
{
const boolean onGround = P_IsObjectOnGround(player->mo);
const INT16 MAXCHARGETIME = K_GetSpindashChargeTime(player);
UINT16 buttons = K_GetKartButtons(player);
boolean spawnWind = (leveltime % 2 == 0);
if (P_PlayerInPain(player))
{
player->spindash = 0;
}
if (player->spindash > 0 && (buttons & (BT_DRIFT|BT_BRAKE|BT_ACCELERATE)) != (BT_DRIFT|BT_BRAKE|BT_ACCELERATE))
{
player->spindashspeed = (player->spindash * FRACUNIT) / MAXCHARGETIME;
player->spindashboost = TICRATE;
// if spindash was charged enough, give a small thrust.
if (player->spindash >= SPINDASHTHRUSTTIME)
{
fixed_t thrust = FixedMul(player->mo->scale, player->spindash*FRACUNIT/5);
// TODO: gametyperules
if (gametype == GT_BATTLE)
thrust *= 2;
// Give a bit of a boost depending on charge.
P_InstaThrust(player->mo, player->mo->angle, thrust);
}
player->spindash = 0;
S_StartSound(player->mo, sfx_s23c);
}
if ((player->spindashboost > 0) && (spawnWind == true))
{
K_KartSpindashWind(player->mo);
}
if (player->spindashboost > (TICRATE/2))
{
K_KartSpindashDust(player->mo);
}
if (K_PlayerEBrake(player) == false)
{
player->spindash = 0;
return;
}
// Handle fast falling behaviors first.
if (onGround == false)
{
// Update fastfall.
player->fastfall = player->mo->momz;
player->spindash = 0;
return;
}
else if (player->fastfall != 0)
{
// Handle fastfall bounce.
const fixed_t maxBounce = player->mo->scale * 10;
const fixed_t minBounce = player->mo->scale;
fixed_t bounce = 2 * abs(player->fastfall) / 3;
if (bounce > maxBounce)
{
bounce = maxBounce;
}
else
{
// Lose speed on bad bounce.
player->mo->momx /= 2;
player->mo->momy /= 2;
if (bounce < minBounce)
{
bounce = minBounce;
}
}
S_StartSound(player->mo, sfx_ffbonc);
player->mo->momz = bounce * P_MobjFlip(player->mo);
player->fastfall = 0;
return;
}
if (player->speed == 0 && player->steering != 0 && leveltime % 8 == 0)
{
// Rubber burn turn sfx
S_StartSound(player->mo, sfx_ruburn);
}
if (player->speed < 6*player->mo->scale)
{
if ((buttons & (BT_DRIFT|BT_BRAKE)) == (BT_DRIFT|BT_BRAKE))
{
UINT8 ringdropframes = 2 + (player->kartspeed + player->kartweight);
INT16 chargetime = MAXCHARGETIME - ++player->spindash;
boolean spawnOldEffect = true;
if (player->spindash >= SPINDASHTHRUSTTIME)
{
K_KartSpindashDust(player->mo);
spawnOldEffect = false;
}
if (chargetime <= (MAXCHARGETIME / 4) && spawnWind == true)
{
K_KartSpindashWind(player->mo);
}
if (player->flashing > 0 && (player->spindash % ringdropframes == 0) && player->hyudorotimer == 0)
{
// Every frame that you're invisible from flashing, spill a ring.
// Intentionally a lop-sided trade-off, so the game doesn't become
// Funky Kong's Ring Racers.
P_PlayerRingBurst(player, 1);
}
if (chargetime > 0)
{
UINT16 soundcharge = 0;
UINT8 add = 0;
while ((soundcharge += ++add) < chargetime);
if (soundcharge == chargetime)
{
if (spawnOldEffect == true)
K_SpawnDashDustRelease(player);
S_StartSound(player->mo, sfx_s3kab);
}
}
else if (chargetime < -TICRATE)
{
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_NORMAL);
}
}
}
else
{
if (leveltime % 4 == 0)
S_StartSound(player->mo, sfx_kc2b);
}
}
#undef SPINDASHTHRUSTTIME
static void K_AirFailsafe(player_t *player)
{
const fixed_t maxSpeed = 6*player->mo->scale;
@ -9419,7 +9013,6 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
K_AdjustPlayerFriction(player);
K_KartDrift(player, onground);
K_KartSpindash(player);
if (onground == false)
{

View file

@ -110,8 +110,6 @@ tripwirepass_t K_TripwirePassConditions(player_t *player);
boolean K_TripwirePass(player_t *player);
boolean K_WaterRun(player_t *player);
void K_ApplyTripWire(player_t *player, tripwirestate_t state);
INT16 K_GetSpindashChargeTime(player_t *player);
fixed_t K_GetSpindashChargeSpeed(player_t *player);
fixed_t K_GetKartSpeedFromStat(UINT8 kartspeed);
fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower, boolean dorubberbanding);
fixed_t K_GetKartAccel(player_t *player);
@ -123,14 +121,12 @@ UINT16 K_GetKartButtons(player_t *player);
SINT8 K_GetForwardMove(player_t *player);
fixed_t K_GetNewSpeed(player_t *player);
fixed_t K_3dKartMovement(player_t *player);
boolean K_PlayerEBrake(player_t *player);
SINT8 K_Sliptiding(player_t *player);
void K_MoveKartPlayer(player_t *player, boolean onground);
void K_CheckSpectateStatus(void);
UINT8 K_GetInvincibilityItemFrame(void);
UINT8 K_GetOrbinautItemFrame(UINT8 count);
boolean K_IsSPBInGame(void);
void K_KartEbrakeVisuals(player_t *p);
void K_HandleDirectionalInfluence(player_t *player);
// sound stuff for lua

View file

@ -262,14 +262,6 @@ static int player_get(lua_State *L)
lua_pushinteger(L, plr->springcolor);
else if (fastcmp(field,"dashpadcooldown"))
lua_pushinteger(L, plr->dashpadcooldown);
else if (fastcmp(field,"spindash"))
lua_pushinteger(L, plr->spindash);
else if (fastcmp(field,"spindashspeed"))
lua_pushinteger(L, plr->spindashspeed);
else if (fastcmp(field,"spindashboost"))
lua_pushinteger(L, plr->spindashboost);
else if (fastcmp(field,"fastfall"))
lua_pushfixed(L, plr->fastfall);
else if (fastcmp(field,"boostpower"))
lua_pushinteger(L, plr->boostpower);
else if (fastcmp(field,"speedboost"))
@ -608,14 +600,6 @@ static int player_set(lua_State *L)
plr->springcolor = luaL_checkinteger(L, 3);
else if (fastcmp(field,"dashpadcooldown"))
plr->dashpadcooldown = luaL_checkinteger(L, 3);
else if (fastcmp(field,"spindash"))
plr->spindash = luaL_checkinteger(L, 3);
else if (fastcmp(field,"spindashspeed"))
plr->spindashspeed = luaL_checkinteger(L, 3);
else if (fastcmp(field,"spindashboost"))
plr->spindashboost = luaL_checkinteger(L, 3);
else if (fastcmp(field,"fastfall"))
plr->fastfall = luaL_checkfixed(L, 3);
else if (fastcmp(field,"boostpower"))
plr->boostpower = luaL_checkinteger(L, 3);
else if (fastcmp(field,"speedboost"))

View file

@ -1149,7 +1149,6 @@ static menuitem_t OP_AllControlsMenu[] =
{IT_CONTROL, NULL, "Turn Right", {.routine = M_ChangeControl}, gc_turnright },
{IT_CONTROL, NULL, "Drift", {.routine = M_ChangeControl}, gc_drift },
{IT_CONTROL, NULL, "Brake", {.routine = M_ChangeControl}, gc_brake },
{IT_CONTROL, NULL, "Spindash", {.routine = M_ChangeControl}, gc_spindash },
{IT_CONTROL, NULL, "Use/Throw Item", {.routine = M_ChangeControl}, gc_fire },
{IT_CONTROL, NULL, "Aim Forward", {.routine = M_ChangeControl}, gc_aimforward },
{IT_CONTROL, NULL, "Aim Backward", {.routine = M_ChangeControl}, gc_aimbackward},

View file

@ -1549,10 +1549,6 @@ void T_RaiseSector(raise_t *raise)
if (thing->player && thing->player->spectator)
continue;
// Option to require spindashing.
if ((raise->flags & RF_SPINDASH) && !thing->player->spindash)
continue;
if (!(thing->z == P_GetSpecialTopZ(thing, raise->sector, sector)))
continue;

View file

@ -1362,7 +1362,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
P_RandomRange(-spacing, spacing) * FRACUNIT,
P_RandomRange(-spacing, spacing) * FRACUNIT,
P_RandomRange(0, 4*spacing) * FRACUNIT,
MT_SPINDASHDUST
MT_SPINDUST
);
P_SetScale(puff, (puff->destscale *= 2));

View file

@ -1127,12 +1127,6 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
{
gravityadd = (5*gravityadd)/2;
}
if (mo->player->fastfall != 0)
{
// Fast falling
gravityadd *= 4;
}
}
else
{
@ -5750,7 +5744,7 @@ static void P_MobjSceneryThink(mobj_t *mobj)
P_RandomRange(-spacing, spacing) * FRACUNIT,
P_RandomRange(-spacing, spacing) * FRACUNIT,
P_RandomRange(-spacing, spacing) * FRACUNIT,
MT_SPINDASHDUST
MT_DUST
);
P_SetScale(puff, (puff->destscale *= 5));
@ -6215,7 +6209,6 @@ static void P_MobjSceneryThink(mobj_t *mobj)
if (mobj->tics > 0)
mobj->renderflags ^= RF_DONTDRAW;
break;
case MT_SPINDASHWIND:
case MT_VWREF:
case MT_VWREB:
{
@ -9494,16 +9487,6 @@ void P_SceneryThinker(mobj_t *mobj)
P_CycleMobjState(mobj);
// Flicker softlanding mobj, this just prevents us from needing like 20 states.
if (mobj->type == MT_SOFTLANDING)
{
mobj->renderflags |= RF_NOSPLATBILLBOARD|RF_OBJECTSLOPESPLAT;
if (mobj->tics & 1)
mobj->renderflags |= RF_DONTDRAW;
else
mobj->renderflags &= ~RF_DONTDRAW;
}
if (mobj->type != MT_RANDOMAUDIENCE)
return;

View file

@ -283,12 +283,6 @@ static void P_NetArchivePlayers(void)
WRITEUINT16(save_p, players[i].springcolor);
WRITEUINT8(save_p, players[i].dashpadcooldown);
WRITEUINT16(save_p, players[i].spindash);
WRITEFIXED(save_p, players[i].spindashspeed);
WRITEUINT8(save_p, players[i].spindashboost);
WRITEFIXED(save_p, players[i].fastfall);
WRITEFIXED(save_p, players[i].boostpower);
WRITEFIXED(save_p, players[i].speedboost);
WRITEFIXED(save_p, players[i].accelboost);
@ -393,7 +387,6 @@ static void P_NetArchivePlayers(void)
WRITEUINT32(save_p, players[i].botvars.itemdelay);
WRITEUINT32(save_p, players[i].botvars.itemconfirm);
WRITESINT8(save_p, players[i].botvars.turnconfirm);
WRITEUINT32(save_p, players[i].botvars.spindashconfirm);
}
}
@ -574,12 +567,6 @@ static void P_NetUnArchivePlayers(void)
players[i].springcolor = READUINT16(save_p);
players[i].dashpadcooldown = READUINT8(save_p);
players[i].spindash = READUINT16(save_p);
players[i].spindashspeed = READFIXED(save_p);
players[i].spindashboost = READUINT8(save_p);
players[i].fastfall = READFIXED(save_p);
players[i].boostpower = READFIXED(save_p);
players[i].speedboost = READFIXED(save_p);
players[i].accelboost = READFIXED(save_p);
@ -684,7 +671,6 @@ static void P_NetUnArchivePlayers(void)
players[i].botvars.itemdelay = READUINT32(save_p);
players[i].botvars.itemconfirm = READUINT32(save_p);
players[i].botvars.turnconfirm = READSINT8(save_p);
players[i].botvars.spindashconfirm = READUINT32(save_p);
//players[i].viewheight = P_GetPlayerViewHeight(players[i]); // scale cannot be factored in at this point
}

View file

@ -23,7 +23,6 @@
#include "p_maputl.h"
#include "w_wad.h"
#include "r_fps.h"
#include "k_kart.h" // K_PlayerEBrake
pslope_t *slopelist = NULL;
UINT16 slopecount = 0;
@ -915,15 +914,6 @@ boolean P_CanApplySlopePhysics(mobj_t *mo, pslope_t *slope)
return false;
}*/
if (mo->player != NULL)
{
if (K_PlayerEBrake(mo->player) == true)
{
// Spindash negates slopes.
return false;
}
}
// We can do slope physics.
return true;
}

View file

@ -5645,7 +5645,7 @@ static void P_AddBlockThinker(sector_t *sec, line_t *sourceline)
* \sa P_SpawnSpecials, T_RaiseSector
* \author SSNTails <http://www.ssntails.org>
*/
static void P_AddRaiseThinker(sector_t *sec, INT16 tag, fixed_t speed, fixed_t ceilingtop, fixed_t ceilingbottom, boolean lower, boolean spindash)
static void P_AddRaiseThinker(sector_t *sec, INT16 tag, fixed_t speed, fixed_t ceilingtop, fixed_t ceilingbottom, boolean lower)
{
raise_t *raise;
@ -5664,8 +5664,6 @@ static void P_AddRaiseThinker(sector_t *sec, INT16 tag, fixed_t speed, fixed_t c
if (lower)
raise->flags |= RF_REVERSE;
if (spindash)
raise->flags |= RF_SPINDASH;
// interpolation
R_CreateInterpolator_SectorPlane(&raise->thinker, sec, false);
@ -5691,8 +5689,6 @@ static void P_AddAirbob(sector_t *sec, INT16 tag, fixed_t dist, boolean raise, b
if (!raise)
airbob->flags |= RF_REVERSE;
if (spindash)
airbob->flags |= RF_SPINDASH;
if (dynamic)
airbob->flags |= RF_DYNAMIC;
@ -6599,7 +6595,7 @@ void P_SpawnSpecials(boolean fromnetsave)
ffloorflags |= FF_NOSHADE;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
P_AddRaiseThinker(lines[i].frontsector, tag, speed, ceilingtop, ceilingbottom, !!(lines[i].flags & ML_BLOCKPLAYERS), !!(lines[i].flags & ML_NOCLIMB));
P_AddRaiseThinker(lines[i].frontsector, tag, speed, ceilingtop, ceilingbottom, !!(lines[i].flags & ML_BLOCKPLAYERS));
break;
}

View file

@ -416,7 +416,7 @@ typedef struct
typedef enum
{
RF_REVERSE = 1, //Lower when stood on
RF_SPINDASH = 1<<1, //Require spindash to move
//free = 1<<1,
RF_DYNAMIC = 1<<2, //Dynamically sinking platform
} raiseflag_t;

View file

@ -474,7 +474,6 @@ void P_ResetPlayer(player_t *player)
player->drift = player->driftcharge = 0;
player->trickpanel = 0;
player->glanceDir = 0;
player->fastfall = 0;
player->pogospring = 0;
}