Bail button

Transforms BT_RESPAWN into BT_BAIL
User bindings should migrate along with this
Respawn is now EBRAKE+BAIL
Respawn blocks LOOKBACK
Time Attack quick respawn is now VOTE
This commit is contained in:
Ashnal 2025-06-07 17:32:42 -04:00
parent 4e6fa59b48
commit f5aa2a701b
15 changed files with 32 additions and 25 deletions

View file

@ -5397,7 +5397,7 @@ static void FuzzTiccmd(ticcmd_t* target)
{
target->buttons |= BT_ACCELERATE;
target->buttons &= ~BT_LOOKBACK;
target->buttons &= ~BT_RESPAWN;
target->buttons &= ~BT_BAIL;
target->buttons &= ~BT_BRAKE;
}
}

View file

@ -32,12 +32,13 @@ typedef enum
BT_BRAKE = 1<<3, // Brake
BT_ATTACK = 1<<4, // Use Item
BT_LOOKBACK = 1<<5, // Look Backward
BT_RESPAWN = 1<<6, // Respawn
BT_BAIL = 1<<6, // Bail
BT_VOTE = 1<<7, // Vote
BT_SPINDASH = 1<<8, // Spindash
BT_EBRAKEMASK = (BT_ACCELERATE|BT_BRAKE),
BT_SPINDASHMASK = (BT_ACCELERATE|BT_BRAKE|BT_DRIFT),
BT_RESPAWNMASK = (BT_EBRAKEMASK|BT_BAIL),
// free: 1<<9 to 1<<12

View file

@ -5057,11 +5057,12 @@ struct int_const_s const INT_CONST[] = {
{"BT_BRAKE",BT_BRAKE},
{"BT_ATTACK",BT_ATTACK},
{"BT_LOOKBACK",BT_LOOKBACK},
{"BT_RESPAWN",BT_RESPAWN},
{"BT_BAIL",BT_BAIL},
{"BT_VOTE",BT_VOTE},
{"BT_SPINDASH",BT_SPINDASH}, // Real button now, but triggers the macro same as always.
{"BT_EBRAKEMASK",BT_EBRAKEMASK}, // Macro button
{"BT_SPINDASHMASK",BT_SPINDASHMASK}, // Macro button
{"BT_RESPAWNMASK",BT_RESPAWNMASK}, // Macro button
{"BT_LUAA",BT_LUAA}, // Lua customizable
{"BT_LUAB",BT_LUAB}, // Lua customizable
{"BT_LUAC",BT_LUAC}, // Lua customizable

View file

@ -404,10 +404,7 @@ class TiccmdBuilder
map(gc_item, BT_ATTACK); // fire
map(gc_lookback, BT_LOOKBACK); // rear view
if (!modeattacking)
{
map(gc_respawn, BT_RESPAWN | (freecam() ? 0 : BT_EBRAKEMASK)); // respawn
}
map(gc_bail, BT_BAIL); // bail
map(gc_vote, BT_VOTE); // mp general function button
// lua buttons a thru c

View file

@ -123,7 +123,7 @@ typedef enum
gc_lookback = gc_b,
gc_spindash = gc_c,
gc_brake = gc_x,
gc_respawn = gc_y,
gc_bail = gc_y,
gc_vote = gc_z,
gc_item = gc_l,
gc_drift = gc_r,

View file

@ -113,7 +113,7 @@ void K_DrawInputDisplay(float x, float y, INT32 flags, char mode, UINT8 pid, boo
box.patch(but('B', gc_b, BT_LOOKBACK));
box.patch(but('C', gc_c, BT_SPINDASH));
box.patch(but('X', gc_x, BT_BRAKE));
box.patch(but('Y', gc_y, BT_RESPAWN));
box.patch(but('Y', gc_y, BT_BAIL));
box.patch(but('Z', gc_z, BT_VOTE));
box.patch(but('L', gc_l, BT_ATTACK));
box.patch(but('R', gc_r, BT_DRIFT));

View file

@ -198,7 +198,7 @@ void K_drawSpectatorHUD(boolean director)
}
else
{
bool press = D_LocalTiccmd(viewnum)->buttons & BT_RESPAWN;
bool press = D_LocalTiccmd(viewnum)->buttons & BT_BAIL;
const char* label = (press && I_GetTime() % 16 < 8) ? "> <" : ">< ";
list.insert({{label, press ? "<y_pressed>" : "<y>"}, {"Exit", "<c_animated>"}});

View file

@ -1803,7 +1803,7 @@ static void K_BuildBotTiccmdNormal(player_t *player, ticcmd_t *cmd)
if (K_TryRingShooter(player, botController) == true && player->botvars.respawnconfirm >= BOTRESPAWNCONFIRM)
{
// We want to respawn. Simply hold Y and stop here!
cmd->buttons |= (BT_RESPAWN | BT_EBRAKEMASK);
cmd->buttons |= BT_RESPAWNMASK;
return;
}

View file

@ -546,7 +546,7 @@ void K_HandleFollower(player_t *player)
}
// Sal: Turn the follower around when looking backwards.
if ( player->cmd.buttons & BT_LOOKBACK )
if (K_GetKartButtons(player) & BT_LOOKBACK)
{
destAngle += ANGLE_180;
}

View file

@ -4876,7 +4876,7 @@ static void K_drawKartPlayerCheck(void)
return;
}
if (stplyr->cmd.buttons & BT_LOOKBACK)
if (K_GetKartButtons(stplyr) & BT_LOOKBACK)
{
return;
}
@ -7521,7 +7521,7 @@ void K_drawKartHUD(void)
if (ta)
{
using srb2::Draw;
Draw::TextElement text = Draw::TextElement().parse("<y> Restart");
Draw::TextElement text = Draw::TextElement().parse("<z> Restart");
Draw(BASEVIDWIDTH - 19, 2)
.flags(flags | V_YELLOWMAP)
.align(Draw::Align::kRight)

View file

@ -4069,8 +4069,16 @@ boolean K_KartKickstart(const player_t *player)
UINT16 K_GetKartButtons(const player_t *player)
{
return (player->cmd.buttons |
(K_KartKickstart(player) ? BT_ACCELERATE : 0));
UINT16 buttons = player->cmd.buttons;
if ((buttons & BT_RESPAWNMASK) == BT_RESPAWNMASK)
{
buttons &= ~BT_LOOKBACK;
}
if (K_KartKickstart(player))
{
buttons = buttons | BT_ACCELERATE;
}
return buttons;
}
SINT8 K_GetForwardMove(const player_t *player)
@ -10129,7 +10137,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
K_RemoveGrowShrink(player);
}
if (player->respawn.state != RESPAWNST_MOVE && (player->cmd.buttons & BT_RESPAWN) == BT_RESPAWN)
if (player->respawn.state != RESPAWNST_MOVE && (player->cmd.buttons & BT_RESPAWNMASK) == BT_RESPAWNMASK)
{
player->finalfailsafe++; // Decremented by ringshooter to "freeze" this timer
// Part-way through the auto-respawn timer, you can tap Ring Shooter to respawn early
@ -13955,7 +13963,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
}
if ((player->cmd.buttons & BT_VOTE) && ((player->itemtype && player->itemamount) || (player->rings > 0) || player->superring > 0 || player->pickuprings > 0 || player->itemRoulette.active))
if ((player->cmd.buttons & BT_BAIL) && (player->cmd.buttons & BT_RESPAWNMASK) != BT_RESPAWNMASK && ((player->itemtype && player->itemamount) || (player->rings > 0) || player->superring > 0 || player->pickuprings > 0 || player->itemRoulette.active))
{
boolean grounded = P_IsObjectOnGround(player->mo);
onground && player->tumbleBounces == 0 ? player->bailcharge += 2 : player->bailcharge++; // charge twice as fast on the ground

View file

@ -466,7 +466,7 @@ boolean M_Responder(event_t *ev)
if (Playing() && !demo.playback)
{
// Quick Retry (Y in modeattacking)
if (modeattacking && G_PlayerInputDown(0, gc_respawn, splitscreen + 1) == true)
if (modeattacking && G_PlayerInputDown(0, gc_bail, splitscreen + 1) == true)
{
M_TryAgain(0);
return true;

View file

@ -39,10 +39,10 @@ menuitem_t OPTIONS_ProfileControls[] = {
{IT_CONTROL, "Brake / Go back", "Brake / Go back",
"TLB_X", {.routine = M_ProfileSetControl}, gc_x, 0},
{IT_CONTROL, "Respawn", "Respawn",
{IT_CONTROL, "Ring Bail", "Ring Bail / Burst",
"TLB_Y", {.routine = M_ProfileSetControl}, gc_y, 0},
{IT_CONTROL, "Action", "Multiplayer quick-chat / quick-vote",
{IT_CONTROL, "Action", "Quick-vote / Quick-chat / Time Attack Quick Restart",
"TLB_Z", {.routine = M_ProfileSetControl}, gc_z, 0},
{IT_CONTROL, "Use Item", "Use item",

View file

@ -668,7 +668,7 @@ boolean Obj_PlayerRingShooterFreeze(const player_t *player)
const mobj_t *base = player->ringShooter;
if (AllowRingShooter(player) == true
&& (player->cmd.buttons & BT_RESPAWN) == BT_RESPAWN
&& (player->cmd.buttons & BT_RESPAWNMASK) == BT_RESPAWNMASK
&& P_MobjWasRemoved(base) == false)
{
return (rs_base_canceled(base) == 0);
@ -682,7 +682,7 @@ void Obj_RingShooterInput(player_t *player)
mobj_t *const base = player->ringShooter;
if (AllowRingShooter(player) == true
&& (player->cmd.buttons & BT_RESPAWN) == BT_RESPAWN)
&& (player->cmd.buttons & BT_RESPAWNMASK) == BT_RESPAWNMASK)
{
// "Freeze" final-failsafe timer if we're eligible to ringshooter, but don't reset it.
if (player->finalfailsafe)

View file

@ -3067,7 +3067,7 @@ void P_DemoCameraMovement(camera_t *cam, UINT8 num)
}
// if you hold Y, you will lock on to displayplayer. (The last player you were ""f12-ing"")
if (cam->freecam && cmd->buttons & BT_RESPAWN)
if (cam->freecam && cmd->buttons & BT_BAIL)
{
lastp = &players[displayplayers[0]]; // Fun fact, I was trying displayplayers[0]->mo as if it was Lua like an absolute idiot.
cam->angle = R_PointToAngle2(cam->x, cam->y, lastp->mo->x, lastp->mo->y);
@ -3369,7 +3369,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
if (P_CameraThinker(player, thiscam, resetcalled))
return true;
lookback = ( player->cmd.buttons & BT_LOOKBACK );
lookback = K_GetKartButtons(player) & BT_LOOKBACK;
camspeed = cv_cam_speed[num].value;
camstill = cv_cam_still[num].value || player->seasaw; // RR: seasaws lock the camera so that it isn't disorienting.