WIP: Trick Panel crack

This commit is contained in:
AJ Martinez 2023-11-07 03:46:11 -07:00
parent af24fcd4bd
commit 49fb2fe6b6
7 changed files with 50 additions and 7 deletions

View file

@ -2430,7 +2430,8 @@ static void Command_Map_f(void)
return;
}
newgametype = GT_RACE; // sensible default
if (newgametype == -1)
newgametype = GT_RACE; // sensible default
}
}

View file

@ -909,6 +909,7 @@ struct player_t
INT16 incontrol; // -1 to -175 when spinning out or tumbling, 1 to 175 when not. Use to check for combo hits or emergency inputs.
boolean markedfordeath;
boolean dotrickfx;
UINT8 ringboxdelay; // Delay until Ring Box auto-activates
UINT8 ringboxaward; // Where did we stop?

View file

@ -8498,6 +8498,12 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
player->instaWhipCooldown--;
}
if (player->dotrickfx && !player->mo->hitlag)
{
S_StartSound(player->mo, sfx_trick1);
player->dotrickfx = false;
}
// Don't screw up chain ring pickup/usage with instawhip charge.
// If the button stays held, delay charge a bit.
if (player->instaWhipChargeLockout)
@ -10920,9 +10926,10 @@ boolean K_FastFallBounce(player_t *player)
player->pflags |= PF_UPDATEMYRESPAWN;
player->fastfall = 0;
player->mo->momz = bounce * P_MobjFlip(player->mo);
player->fastfall = 0;
return true;
}
@ -12193,6 +12200,9 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
const angle_t angledelta = FixedAngle(36*FRACUNIT);
angle_t baseangle = player->mo->angle + angledelta/2;
S_StartSound(player->mo, sfx_trick0);
player->dotrickfx = true;
if (cmd->turning > 0)
{
P_InstaThrust(player->mo, player->mo->angle + lr, max(basespeed, speed*5/2));
@ -12245,6 +12255,9 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
}
else if (aimingcompare > TRICKTHRESHOLD) // forward/back trick
{
S_StartSound(player->mo, sfx_trick0);
player->dotrickfx = true;
if (cmd->throwdir > 0) // back trick
{
if (player->mo->momz * P_MobjFlip(player->mo) > 0)
@ -12321,12 +12334,26 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
K_trickPanelTimingVisual(player, momz);
}
else if (player->trickpanel == 4 && P_IsObjectOnGround(player->mo)) // Upwards trick landed!
else if (player->trickpanel && P_IsObjectOnGround(player->mo)) // Landed from trick
{
//CONS_Printf("apply boost\n");
S_StartSound(player->mo, sfx_s23c);
K_SpawnDashDustRelease(player);
player->trickboost = TICRATE - player->trickboostdecay;
if (player->fastfall)
{
player->mo->hitlag = 3;
K_SpawnDashDustRelease(player);
P_InstaThrust(player->mo, player->mo->angle, 30*FRACUNIT);
S_StartSound(player->mo, sfx_gshce);
player->fastfall = 0; // intentionally skip bounce
}
if (player->trickpanel == 4) // upward trick
{
S_StartSound(player->mo, sfx_s23c);
K_SpawnDashDustRelease(player);
player->trickboost = TICRATE - player->trickboostdecay;
}
player->sliptideZip += 300;
player->sliptideZipDelay = 0;
player->trickpanel = player->trickboostdecay = 0;
}

View file

@ -255,6 +255,8 @@ static int player_get(lua_State *L)
lua_pushboolean(L, plr->flipDI);
else if (fastcmp(field,"markedfordeath"))
lua_pushboolean(L, plr->markedfordeath);
else if (fastcmp(field,"dotrickfx"))
lua_pushboolean(L, plr->dotrickfx);
else if (fastcmp(field,"ringboxdelay"))
lua_pushinteger(L, plr->ringboxdelay);
else if (fastcmp(field,"ringboxaward"))
@ -737,6 +739,8 @@ static int player_set(lua_State *L)
plr->flipDI = luaL_checkboolean(L, 3);
else if (fastcmp(field,"markedfordeath"))
plr->markedfordeath = luaL_checkboolean(L, 3);
else if (fastcmp(field,"dotrickfx"))
plr->dotrickfx = luaL_checkboolean(L, 3);
else if (fastcmp(field,"ringboxdelay"))
plr->ringboxdelay = luaL_checkinteger(L, 3);
else if (fastcmp(field,"ringboxaward"))

View file

@ -560,6 +560,7 @@ static void P_NetArchivePlayers(savebuffer_t *save)
WRITEINT16(save->p, players[i].incontrol);
WRITEUINT8(save->p, players[i].markedfordeath);
WRITEUINT8(save->p, players[i].dotrickfx);
WRITEUINT8(save->p, players[i].ringboxdelay);
WRITEUINT8(save->p, players[i].ringboxaward);
@ -1077,6 +1078,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
players[i].incontrol = READINT16(save->p);
players[i].markedfordeath = READUINT8(save->p);
players[i].dotrickfx = READUINT8(save->p);
players[i].ringboxdelay = READUINT8(save->p);
players[i].ringboxaward = READUINT8(save->p);

View file

@ -1119,6 +1119,10 @@ sfxinfo_t S_sfx[NUMSFX] =
{"fshld2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flame Shield burst"},
{"fshld3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flame Shield cooldown"},
// RR - Trick Panel
{"trick0", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Trick confirm"},
{"trick1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Trick"},
// RR - Ballhog Charge
{"bhog00", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Ballhog charging"},
{"bhog01", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Ballhog charging"},

View file

@ -1187,6 +1187,10 @@ typedef enum
sfx_fshld2,
sfx_fshld3,
// RR - Trick panels
sfx_trick0,
sfx_trick1,
// RR - Ballhog Charge
sfx_bhog00,
sfx_bhog01,