WIP: Trick panel decrackening

This commit is contained in:
AJ Martinez 2023-11-09 00:45:50 -07:00
parent 954bd85139
commit c11394ce83
5 changed files with 60 additions and 16 deletions

View file

@ -898,8 +898,10 @@ struct player_t
UINT16 wavedash; // How long is our chained sliptide? Grant a proportional boost when it's over.
UINT8 wavedashdelay; // How long since the last sliptide? Only boost once you've been straightened out for a bit.
UINT16 wavedashboost; // The actual boost granted from wavedash.
UINT16 trickdashboost; // The actual boost granted from wavedash.
boolean trickdash;
UINT16 trickdashboost; // Trickdashes grant a snappier boost that permits sliptide. [UNUSED, TOO MUCH CRACK]
boolean trickdash; // Is the wavedash we're charging right now getting upgraded to a trickdash? [UNUSED]
UINT16 trickcharge; // Landed normally from a trick panel? Get the benefits package!
UINT8 lastsafelap;

View file

@ -1266,6 +1266,9 @@ static boolean K_HasInfiniteTether(player_t *player)
if (player->trickdash)
return true;
if (player->trickcharge)
return true;
return false;
}
@ -3245,6 +3248,11 @@ static void K_GetKartBoostPower(player_t *player)
ADDBOOST(8*FRACUNIT/10, 8*FRACUNIT, 3*SLIPTIDEHANDLING/5); // + 80% top speed, + 800% acceleration, +30% handling
}
if (player->trickcharge)
{
ADDBOOST(0, 0, 2*SLIPTIDEHANDLING/10); // 0% speed 0% accel 20% handle
}
if (player->spindashboost) // Spindash boost
{
const fixed_t MAXCHARGESPEED = K_GetSpindashChargeSpeed(player);
@ -8422,6 +8430,13 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
player->trickdashboost--;
}
if (player->trickcharge > 0 && onground == true)
{
player->trickcharge--;
if (player->drift)
player->trickcharge = max(player->trickcharge, 1);
}
if (player->spindashboost)
{
player->spindashboost--;
@ -8853,6 +8868,14 @@ void K_KartResetPlayerColor(player_t *player)
}
}
if (player->trickcharge && (leveltime & 1))
{
player->mo->colorized = true;
player->mo->color = SKINCOLOR_INVINCFLASH;
fullbright = true;
goto finalise;
}
if (player->ringboost && (leveltime & 1)) // ring boosting
{
player->mo->colorized = true;
@ -9899,6 +9922,15 @@ static void K_KartDrift(player_t *player, boolean onground)
K_SpawnDriftBoostExplosion(player, 4);
K_SpawnDriftElectricSparks(player, K_DriftSparkColor(player, player->driftcharge), false);
}
if (player->trickcharge)
{
player->driftboost += 20;
player->wavedashboost += 10;
P_Thrust(player->mo, pushdir, player->speed / 2);
S_StartSound(player->mo, sfx_gshba);
player->trickcharge = 0;
}
}
// Remove charge
@ -10017,6 +10049,9 @@ static void K_KartDrift(player_t *player, boolean onground)
driftadditive = 0;
}
if (player->trickcharge && driftadditive)
driftadditive += 24;
// This spawns the drift sparks
if ((player->driftcharge + driftadditive >= dsone)
|| (player->driftcharge < 0))
@ -12412,17 +12447,17 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
{
S_StartSound(player->mo, sfx_s23c);
K_SpawnDashDustRelease(player);
player->trickboost = TICRATE - player->trickboostdecay;
player->wavedash += 150; // bonus for the slow fall
//player->wavedashdelay = TICRATE/2 - 2;
player->wavedashdelay = 0;
UINT8 award = TICRATE - player->trickboostdecay;
//player->trickboost = award;
player->trickcharge += award*4;
K_AwardPlayerRings(player, award/2, true);
if (player->trickpanel == TRICKSTATE_FORWARD)
player->trickboostpower /= 18;
else if (player->trickpanel != TRICKSTATE_BACK)
player->trickboostpower /= 9;
player->trickdash = true;
}
player->trickpanel = TRICKSTATE_NONE;

View file

@ -157,6 +157,7 @@ void K_DoIngameRespawn(player_t *player)
player->driftboost = player->strongdriftboost = 0;
player->gateBoost = 0;
player->trickdash = 0;
player->trickcharge = 0;
player->wavedash = player->wavedashboost = player->wavedashdelay = player->trickdashboost = 0;
K_TumbleInterrupt(player);

View file

@ -331,10 +331,12 @@ static int player_get(lua_State *L)
lua_pushinteger(L, plr->wavedashdelay);
else if (fastcmp(field,"wavedashboost"))
lua_pushinteger(L, plr->wavedashboost);
else if (fastcmp(field,"trickdashboost"))
lua_pushinteger(L, plr->trickdashboost);
else if (fastcmp(field,"trickdash"))
lua_pushinteger(L, plr->trickdash);
else if (fastcmp(field,"trickcharge"))
lua_pushinteger(L, plr->trickcharge);
//else if (fastcmp(field,"trickdashboost"))
// lua_pushinteger(L, plr->trickdashboost);
//else if (fastcmp(field,"trickdash"))
// lua_pushinteger(L, plr->trickdash);
else if (fastcmp(field,"lastsafelap"))
lua_pushinteger(L, plr->lastsafelap);
else if (fastcmp(field,"instaWhipCharge"))
@ -819,10 +821,12 @@ static int player_set(lua_State *L)
plr->wavedashdelay = luaL_checkinteger(L, 3);
else if (fastcmp(field,"wavedashboost"))
plr->wavedashboost = luaL_checkinteger(L, 3);
else if (fastcmp(field,"trickdashboost"))
plr->trickdashboost = luaL_checkinteger(L, 3);
else if (fastcmp(field,"trickdash"))
plr->trickdash = luaL_checkinteger(L, 3);
else if (fastcmp(field,"trickcharge"))
plr->trickcharge = luaL_checkinteger(L, 3);
//else if (fastcmp(field,"trickdashboost"))
// plr->trickdashboost = luaL_checkinteger(L, 3);
//else if (fastcmp(field,"trickdash"))
// plr->trickdash = luaL_checkinteger(L, 3);
else if (fastcmp(field,"lastsafelap"))
plr->lastsafelap = luaL_checkinteger(L, 3);
else if (fastcmp(field,"instaWhipCharge"))

View file

@ -547,6 +547,7 @@ static void P_NetArchivePlayers(savebuffer_t *save)
WRITEUINT16(save->p, players[i].wavedashboost);
WRITEUINT8(save->p, players[i].trickdash);
WRITEUINT16(save->p, players[i].trickdashboost);
WRITEUINT16(save->p, players[i].trickcharge);
WRITEUINT8(save->p, players[i].lastsafelap);
@ -1067,6 +1068,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
players[i].wavedashboost = READUINT16(save->p);
players[i].trickdash = READUINT8(save->p);
players[i].trickdashboost = READUINT16(save->p);
players[i].trickcharge = READUINT16(save->p);
players[i].lastsafelap = READUINT8(save->p);