RingRacers/src/d_ticcmd.h
toaster 08d087c6b5 Acceleration Kickstart, my little hobby project.
It's no secret that holding down a button a lot can fuck with your wrists and fingers. It's too late for me to be damageless, but I can at least create an option to reduce further harm.

This accessibility feature, when enabled (kickstartaccel and kickstartaccel2/3/4 in the console) behaves with the following properties:
* Hold accelerate for 1 second to lock it down.
* Press again to release.
* Short holds/presses do nothing (good for POSITION).
* Continue holding it during the releasing press to re-lock it.
* A small triangular UI element is added next to the speedometer sticker, which displays the current state of the acceleration kickstart for visual feedback. (NO SPLITS SUPPORT YET)

In addition:
* Add PF_ACCELDOWN and PF_BRAKEDOWN, and BT_REALACCELERATE (which ACCELDOWN tracks). Even if this feature never gets merged, BT_REALACCELERATE is required because sneakers and boosters force it on too (extending this is how I implemented it).
* Fix the dehacked playerflag list being out of shape.
* I replaced some existing flags during development of this branch, so their old uses have been whittled away.
2021-02-20 23:10:18 +00:00

79 lines
2.1 KiB
C

// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
//
// 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 __GNUG__
#pragma interface
#endif
#define MAXPREDICTTICS 12
// 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_FORWARD = 1<<5, // Aim Item Forward
BT_BACKWARD = 1<<6, // Aim Item Backward
BT_LOOKBACK = 1<<7, // Look Backward
BT_REALACCELERATE = 1<<8, // Accelerate but not influenced by boosting or kickstart
BT_EBRAKEMASK = (BT_ACCELERATE|BT_BRAKE),
// free: 1<<9 to 1<<12
// Lua garbage
BT_CUSTOM1 = 1<<13,
BT_CUSTOM2 = 1<<14,
BT_CUSTOM3 = 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 flags
#define TICCMD_RECEIVED 1
#define TICCMD_TYPING 2/* chat window or console open */
#define TICCMD_KEYSTROKE 4/* chat character input */
#if defined(_MSC_VER)
#pragma pack(1)
#endif
typedef struct
{
SINT8 forwardmove; // -MAXPLMOVE to MAXPLMOVE (50)
INT16 turning; // Turn speed
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;
} ATTRPACK ticcmd_t;
#if defined(_MSC_VER)
#pragma pack()
#endif
#endif