diff --git a/src/d_netcmd.c b/src/d_netcmd.c index d5384170f..776d8568d 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2430,7 +2430,8 @@ static void Command_Map_f(void) return; } - newgametype = GT_RACE; // sensible default + if (newgametype == -1) + newgametype = GT_RACE; // sensible default } } diff --git a/src/d_player.h b/src/d_player.h index c132ca4e9..d079de9a8 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -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? diff --git a/src/k_kart.c b/src/k_kart.c index 7beb2896b..33a9ae545 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -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; } diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 6fe1e325d..0bda04838 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -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")) diff --git a/src/p_saveg.c b/src/p_saveg.c index 865732692..1860b84e8 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -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); diff --git a/src/sounds.c b/src/sounds.c index cbb5836a2..dcfa01cc3 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -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"}, diff --git a/src/sounds.h b/src/sounds.h index a19d2b4ed..0d686b3c2 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -1187,6 +1187,10 @@ typedef enum sfx_fshld2, sfx_fshld3, + // RR - Trick panels + sfx_trick0, + sfx_trick1, + // RR - Ballhog Charge sfx_bhog00, sfx_bhog01,