Merge branch 'blankart-dev' into newinput
This commit is contained in:
commit
b4b9a250d4
5 changed files with 43 additions and 30 deletions
|
|
@ -941,10 +941,7 @@ static void G_DoAnglePrediction(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer, p
|
|||
|
||||
cmd->angle *= realtics;
|
||||
|
||||
if (((player->mo && player->speed > 0) // Moving
|
||||
|| (((gametyperules & GTR_FREEROAM) || leveltime > starttime) && (cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE)) // Rubber-burn turn
|
||||
|| (player->respawn) // Respawning
|
||||
|| (player->spectator || objectplacing))) // Not a physical player
|
||||
if (P_CanPlayerTurn(player, cmd))
|
||||
localangle[ssplayer-1] += (cmd->angle<<TICCMD_REDUCE);
|
||||
|
||||
cmd->angle = (INT16)(localangle[ssplayer-1] >> TICCMD_REDUCE);
|
||||
|
|
|
|||
|
|
@ -3835,13 +3835,12 @@ static void K_drawInput(void)
|
|||
INT32 offs, col;
|
||||
const INT32 accent1 = splitflags | skincolors[stplyr->skincolor].ramp[5];
|
||||
const INT32 accent2 = splitflags | skincolors[stplyr->skincolor].ramp[9];
|
||||
ticcmd_t *cmd = &stplyr->cmd;
|
||||
|
||||
#define BUTTW 8
|
||||
#define BUTTH 11
|
||||
|
||||
#define drawbutt(xoffs, butt, symb)\
|
||||
if (!stplyr->exiting && (cmd->buttons & butt))\
|
||||
if (!stplyr->exiting && (K_GetKartButtons(stplyr) & butt))\
|
||||
{\
|
||||
offs = 2*FRACUNIT;\
|
||||
col = accent1;\
|
||||
|
|
|
|||
32
src/k_kart.c
32
src/k_kart.c
|
|
@ -2429,8 +2429,7 @@ static SINT8 K_GlanceAtPlayers(player_t *glancePlayer)
|
|||
*/
|
||||
static void K_RespawnChecker(player_t *player)
|
||||
{
|
||||
ticcmd_t *cmd = &player->cmd;
|
||||
|
||||
UINT16 buttons = K_GetKartButtons(player);
|
||||
if (player->spectator)
|
||||
return;
|
||||
|
||||
|
|
@ -2490,7 +2489,7 @@ static void K_RespawnChecker(player_t *player)
|
|||
// Sal: The old behavior was stupid and prone to accidental usage.
|
||||
// Let's rip off Mania instead, and turn this into a Drop Dash!
|
||||
|
||||
if (cmd->buttons & BT_ACCELERATE)
|
||||
if (buttons & BT_ACCELERATE)
|
||||
player->dropdash++;
|
||||
else
|
||||
player->dropdash = 0;
|
||||
|
|
@ -2506,7 +2505,7 @@ static void K_RespawnChecker(player_t *player)
|
|||
}
|
||||
else
|
||||
{
|
||||
if ((cmd->buttons & BT_ACCELERATE) && (player->dropdash >= TICRATE/4))
|
||||
if ((buttons & BT_ACCELERATE) && (player->dropdash >= TICRATE/4))
|
||||
{
|
||||
S_StartSound(player->mo, sfx_s23c);
|
||||
player->startboost = 50;
|
||||
|
|
@ -3462,9 +3461,7 @@ SINT8 K_GetForwardMove(player_t *player)
|
|||
|
||||
if (K_KartKickstart(player)) // unlike the brute forward of sneakers, allow for backwards easing here
|
||||
{
|
||||
forwardmove += MAXPLMOVE;
|
||||
if (forwardmove > MAXPLMOVE)
|
||||
forwardmove = MAXPLMOVE;
|
||||
forwardmove = MAXPLMOVE;
|
||||
}
|
||||
|
||||
if ((player->exiting || mapreset) || player->pflags & PF_STASIS || player->spinouttimer) // pw_introcam?
|
||||
|
|
@ -8392,6 +8389,7 @@ static void K_KartDrift(player_t *player, boolean onground)
|
|||
INT32 dstwo = dsone*2;
|
||||
INT32 dsthree = cv_kartpurpledrift.value ? dsone*3 : dsone*4;
|
||||
INT32 dsfour = dsone*4;
|
||||
UINT16 buttons = K_GetKartButtons(player);
|
||||
|
||||
// Grown players taking yellow spring panels will go below minspeed for one tic,
|
||||
// and will then wrongdrift or have their sparks removed because of this.
|
||||
|
|
@ -8588,8 +8586,8 @@ static void K_KartDrift(player_t *player, boolean onground)
|
|||
}
|
||||
|
||||
if (player->drift
|
||||
&& ((player->cmd.buttons & BT_BRAKE)
|
||||
|| !(player->cmd.buttons & BT_ACCELERATE))
|
||||
&& ((buttons & BT_BRAKE)
|
||||
|| !(buttons & BT_ACCELERATE))
|
||||
&& P_IsObjectOnGround(player->mo))
|
||||
{
|
||||
if (!(player->pflags & PF_BRAKEDRIFT))
|
||||
|
|
@ -9036,8 +9034,8 @@ void K_UnsetItemOut(player_t *player)
|
|||
//
|
||||
void K_MoveKartPlayer(player_t *player, boolean onground)
|
||||
{
|
||||
ticcmd_t *cmd = &player->cmd;
|
||||
boolean ATTACK_IS_DOWN = ((cmd->buttons & BT_ATTACK) && !(player->oldcmd.buttons & BT_ATTACK));
|
||||
UINT16 buttons = K_GetKartButtons(player);
|
||||
boolean ATTACK_IS_DOWN = ((buttons & BT_ATTACK) && !(player->oldcmd.buttons & BT_ATTACK));
|
||||
boolean HOLDING_ITEM = (player->itemflags & (IF_ITEMOUT|IF_EGGMANOUT));
|
||||
boolean NO_HYUDORO = (player->stealingtimer == 0 && player->stolentimer == 0);
|
||||
|
||||
|
|
@ -9059,7 +9057,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
player->positiondelay--;
|
||||
|
||||
// Prevent ring misfire
|
||||
if (!(cmd->buttons & BT_ATTACK))
|
||||
if (!(buttons & BT_ATTACK))
|
||||
{
|
||||
if (player->itemtype == KITEM_NONE
|
||||
&& NO_HYUDORO && (K_RingsActive() == true) && !(HOLDING_ITEM
|
||||
|
|
@ -9110,7 +9108,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
// Ring boosting
|
||||
else if (player->itemflags & IF_USERINGS)
|
||||
{
|
||||
if ((cmd->buttons & BT_ATTACK) && !player->ringdelay && player->rings > 0)
|
||||
if ((buttons & BT_ATTACK) && !player->ringdelay && player->rings > 0)
|
||||
{
|
||||
mobj_t *ring = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_RING);
|
||||
P_SetMobjState(ring, S_FASTRING1);
|
||||
|
|
@ -9184,7 +9182,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
player->itemflags |= IF_HOLDREADY;
|
||||
}
|
||||
|
||||
if ((cmd->buttons & BT_ATTACK) && (player->itemflags & IF_HOLDREADY) && onground)
|
||||
if ((buttons & BT_ATTACK) && (player->itemflags & IF_HOLDREADY) && onground)
|
||||
{
|
||||
// TODO: gametyperules
|
||||
const SINT8 incr = gametype == GT_BATTLE ? 3 : 2;
|
||||
|
|
@ -9223,7 +9221,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
{
|
||||
if (player->growcancel >= 0)
|
||||
{
|
||||
if (cmd->buttons & BT_ATTACK)
|
||||
if (buttons & BT_ATTACK)
|
||||
{
|
||||
player->growcancel++;
|
||||
if (player->growcancel > 26)
|
||||
|
|
@ -9234,7 +9232,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
}
|
||||
else
|
||||
{
|
||||
if ((cmd->buttons & BT_ATTACK) || (player->oldcmd.buttons & BT_ATTACK))
|
||||
if ((buttons & BT_ATTACK) || (player->oldcmd.buttons & BT_ATTACK))
|
||||
player->growcancel = -1;
|
||||
else
|
||||
player->growcancel = 0;
|
||||
|
|
@ -9623,7 +9621,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
|
||||
if (!HOLDING_ITEM && NO_HYUDORO)
|
||||
{
|
||||
if ((cmd->buttons & BT_ATTACK) && (player->itemflags & IF_HOLDREADY))
|
||||
if ((buttons & BT_ATTACK) && (player->itemflags & IF_HOLDREADY))
|
||||
{
|
||||
if (player->bubbleblowup == 0)
|
||||
S_StartSound(player->mo, sfx_s3k75);
|
||||
|
|
|
|||
|
|
@ -165,6 +165,8 @@ void P_DemoCameraMovement(camera_t *cam);
|
|||
boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcalled);
|
||||
void P_InitCameraCmd(void);
|
||||
|
||||
boolean P_CanPlayerTurn(player_t *player, ticcmd_t *cmd);
|
||||
|
||||
boolean P_PlayerInPain(player_t *player);
|
||||
void P_ResetPlayer(player_t *player);
|
||||
boolean P_PlayerCanDamage(player_t *player, mobj_t *thing);
|
||||
|
|
|
|||
31
src/p_user.c
31
src/p_user.c
|
|
@ -1751,6 +1751,7 @@ static void P_3dMovement(player_t *player)
|
|||
angle_t dangle; // replaces old quadrants bits
|
||||
fixed_t oldMagnitude, newMagnitude;
|
||||
vector3_t totalthrust;
|
||||
UINT16 buttons = K_GetKartButtons(player);
|
||||
|
||||
totalthrust.x = totalthrust.y = 0; // I forget if this is needed
|
||||
totalthrust.z = FRACUNIT*P_MobjFlip(player->mo)/3; // A bit of extra push-back on slopes
|
||||
|
|
@ -1846,7 +1847,7 @@ static void P_3dMovement(player_t *player)
|
|||
if (player->mo->movefactor != FRACUNIT) // Friction-scaled acceleration...
|
||||
movepushforward = FixedMul(movepushforward, player->mo->movefactor);
|
||||
|
||||
if (cmd->buttons & BT_BRAKE && (player->cmd.forwardmove == 0)) // SRB2kart - braking isn't instant
|
||||
if (buttons & BT_BRAKE && (player->cmd.forwardmove == 0)) // SRB2kart - braking isn't instant
|
||||
movepushforward /= 64;
|
||||
|
||||
if (player->cmd.forwardmove > 0)
|
||||
|
|
@ -1951,6 +1952,26 @@ static void P_3dMovement(player_t *player)
|
|||
}
|
||||
}
|
||||
|
||||
boolean P_CanPlayerTurn(player_t *player, ticcmd_t *cmd)
|
||||
{
|
||||
if (player->spectator || objectplacing) // Spectators come first.
|
||||
return true;
|
||||
|
||||
if (!(gametyperules & GTR_FREEROAM) && !(leveltime > starttime)) // You can't move yet.
|
||||
return false;
|
||||
|
||||
if ((cmd->buttons & BT_ACCELERATE) && (cmd->buttons & BT_BRAKE)) // You are rubberburn turning.
|
||||
return true;
|
||||
|
||||
if (player->respawn) // You are Respawning.
|
||||
return true;
|
||||
|
||||
if (player->mo && player->speed == 0) // You need to be moving.
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// P_UpdatePlayerAngle
|
||||
//
|
||||
|
|
@ -1965,11 +1986,7 @@ static void P_UpdatePlayerAngle(player_t *player)
|
|||
int i;
|
||||
|
||||
// Kart: store the current turn range for later use
|
||||
if (((player->mo && player->speed > 0) // Moving
|
||||
|| (leveltime > starttime && (cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE)) // Rubber-burn turn
|
||||
|| (player->respawn) // Respawning
|
||||
|| (player->spectator || objectplacing)) // Not a physical player
|
||||
)
|
||||
if (P_CanPlayerTurn(player, cmd))
|
||||
{
|
||||
player->lturn_max[leveltime%MAXPREDICTTICS] = K_GetKartTurnValue(player, KART_FULLTURN)+1;
|
||||
player->rturn_max[leveltime%MAXPREDICTTICS] = K_GetKartTurnValue(player, -KART_FULLTURN)-1;
|
||||
|
|
@ -2040,7 +2057,7 @@ static void P_SpectatorMovement(player_t *player)
|
|||
{
|
||||
ticcmd_t *cmd = &player->cmd;
|
||||
|
||||
P_UpdatePlayerAngle(player);
|
||||
player->mo->angle = cmd->angle<<16;
|
||||
|
||||
ticruned++;
|
||||
if (!(cmd->flags & TICCMD_RECEIVED))
|
||||
|
|
|
|||
Loading…
Reference in a new issue