Merge branch 'better-voltage-release' into 'master'

Allow better steering from trick MT release

See merge request KartKrew/Kart!2352
This commit is contained in:
Oni 2024-05-05 22:36:51 +00:00
commit 6b5eceda95
4 changed files with 38 additions and 6 deletions

View file

@ -779,6 +779,8 @@ struct player_t
UINT16 flamemeter; // Flame Shield dash meter left
UINT8 flamelength; // Flame Shield dash meter, number of segments
UINT16 counterdash; // Flame Shield boost without the flame, largely. Used in places where awarding thrust would affect player control.
UINT16 ballhogcharge; // Ballhog charge up -- the higher this value, the more projectiles
boolean ballhogtap; // Ballhog released during charge: used to allow semirapid tapfire

View file

@ -3484,6 +3484,16 @@ static void K_GetKartBoostPower(player_t *player)
);
}
if (player->counterdash) // "Fake Flame" (bubble, voltage)
{
fixed_t dash = K_FlameShieldDashVar(player->counterdash);
ADDBOOST(
dash, // + infinite top speed
3*FRACUNIT, // + 300% acceleration
FixedMul(FixedDiv(dash, FRACUNIT/2), SLIPTIDEHANDLING/2) // + infinite handling
);
}
if (player->wavedashboost)
{
// NB: This is intentionally under the 25% handleboost threshold required to initiate a sliptide
@ -8921,6 +8931,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
S_StartSoundAtVolume(player->mo, sfx_fshld3, 255/3);
}
if (player->counterdash)
player->counterdash--;
if (player->sneakertimer && player->wipeoutslow > 0 && player->wipeoutslow < wipeoutslowtime+1)
player->wipeoutslow = wipeoutslowtime+1;
@ -10867,10 +10880,21 @@ static void K_KartDrift(player_t *player, boolean onground)
if (player->trickcharge && dokicker)
{
player->driftboost += 20;
player->wavedashboost += 10;
player->wavedashpower = FRACUNIT;
P_Thrust(player->mo, pushdir, player->speed / 2);
// 2.2 - Egg-friendly trick stuff
if (G_CompatLevel(0x000B))
{
player->driftboost += 20;
player->wavedashboost += 10;
player->wavedashpower = FRACUNIT;
P_Thrust(player->mo, pushdir, player->speed / 2);
}
else
{
player->driftboost += TICRATE;
player->counterdash += TICRATE/2;
P_Thrust(player->mo, pushdir, player->speed / 6);
}
S_StartSound(player->mo, sfx_gshba);
player->trickcharge = 0;
player->infinitether = TICRATE*2;
@ -13254,11 +13278,11 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
{
K_ThrowKartItem(player, (player->throwdir > 0), MT_BUBBLESHIELDTRAP, -1, 0, 0);
if (player->throwdir == -1)
{
{
P_InstaThrust(player->mo, player->mo->angle, player->speed + (80 * mapobjectscale));
player->wavedashboost += TICRATE;
player->wavedashpower = FRACUNIT;
player->fakeBoost = TICRATE/2;
player->fakeBoost += TICRATE/2;
}
K_PlayAttackTaunt(player->mo);
player->bubbleblowup = 0;

View file

@ -428,6 +428,8 @@ static int player_get(lua_State *L)
lua_pushinteger(L, plr->bubbleblowup);
else if (fastcmp(field,"flamedash"))
lua_pushinteger(L, plr->flamedash);
else if (fastcmp(field,"counterdash"))
lua_pushinteger(L, plr->counterdash);
else if (fastcmp(field,"flamemeter"))
lua_pushinteger(L, plr->flamemeter);
else if (fastcmp(field,"flamelength"))
@ -984,6 +986,8 @@ static int player_set(lua_State *L)
plr->bubbleblowup = luaL_checkinteger(L, 3);
else if (fastcmp(field,"flamedash"))
plr->flamedash = luaL_checkinteger(L, 3);
else if (fastcmp(field,"counterdash"))
plr->counterdash = luaL_checkinteger(L, 3);
else if (fastcmp(field,"flamemeter"))
plr->flamemeter = luaL_checkinteger(L, 3);
else if (fastcmp(field,"flamelength"))

View file

@ -508,6 +508,7 @@ static void P_NetArchivePlayers(savebuffer_t *save)
WRITEUINT8(save->p, players[i].bubblecool);
WRITEUINT8(save->p, players[i].bubbleblowup);
WRITEUINT16(save->p, players[i].flamedash);
WRITEUINT16(save->p, players[i].counterdash);
WRITEUINT16(save->p, players[i].flamemeter);
WRITEUINT8(save->p, players[i].flamelength);
@ -1110,6 +1111,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
players[i].bubblecool = READUINT8(save->p);
players[i].bubbleblowup = READUINT8(save->p);
players[i].flamedash = READUINT16(save->p);
players[i].counterdash = READUINT16(save->p);
players[i].flamemeter = READUINT16(save->p);
players[i].flamelength = READUINT8(save->p);