RingRacers/src/d_ticcmd.h
Ashnal f5aa2a701b 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
2025-06-23 18:07:59 -04:00

101 lines
2.6 KiB
C

// DR. ROBOTNIK'S RING RACERS
//-----------------------------------------------------------------------------
// Copyright (C) 2025 by Kart Krew.
// Copyright (C) 2020 by Sonic Team Junior.
// Copyright (C) 2000 by DooM Legacy Team.
// Copyright (C) 1996 by id Software, Inc.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file d_ticcmd.h
/// \brief Button/action code definitions, ticcmd_t
#ifndef __D_TICCMD__
#define __D_TICCMD__
#include "m_fixed.h"
#include "doomtype.h"
#ifdef __cplusplus
extern "C" {
#endif
#define MAXPREDICTTICS 30
// Button/action code definitions.
typedef enum
{
BT_ACCELERATE = 1, // Accelerate
BT_DRIFT = 1<<2, // Drift (direction is cmd->turning)
BT_BRAKE = 1<<3, // Brake
BT_ATTACK = 1<<4, // Use Item
BT_LOOKBACK = 1<<5, // Look Backward
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
// Lua garbage, replace with freeslottable buttons some day
BT_LUAA = 1<<13,
BT_LUA1 = 1<<13,
BT_LUAB = 1<<14,
BT_LUA2 = 1<<14,
BT_LUAC = 1<<15,
BT_LUA3 = 1<<15,
} buttoncode_t;
// The data sampled per tick (single player)
// and transmitted to other peers (multiplayer).
// Mainly movements/button commands per game tick,
// plus a checksum for internal state consistency.
// ticcmd turning bits
#define TICCMD_REDUCE 16
// ticcmd latency mask
#define TICCMD_LATENCYMASK 0xFF
// ticcmd flags
#define TICCMD_RECEIVED (0x01) /* Actual tic recieved from client */
#define TICCMD_TYPING (0x02) /* chat window or console open */
#define TICCMD_KEYSTROKE (0x04) /* chat character input */
#define TICCMD_BOT (0x80) /* generated by bot, demos write bot variables */
#if defined(_MSC_VER)
#pragma pack(1)
#endif
struct ticcmd_t
{
SINT8 forwardmove; // -MAXPLMOVE to MAXPLMOVE (50)
INT16 turning; // Turn speed
INT16 angle; // Predicted angle, use me if you can!
INT16 throwdir; // Aiming direction
INT16 aiming; // vertical aiming, see G_BuildTicCmd
UINT16 buttons;
UINT8 latency; // Netgames: how many tics ago was this ticcmd generated from this player's end?
UINT8 flags;
struct
{
SINT8 turnconfirm;
SINT8 spindashconfirm;
SINT8 itemconfirm;
} bot;
} ATTRPACK;
#if defined(_MSC_VER)
#pragma pack()
#endif
#ifdef __cplusplus
} // extern "C"
#endif
#endif