// Copyright (C) 1999-2000 Id Software, Inc. // // bg_public.h -- definitions shared by both the server game and client game modules #ifndef BG_PUBLIC_H_ #define BG_PUBLIC_H_ #ifdef _MSC_VER #include #include #else #include #endif // meh somehow preprocessor G_LUA won't work for me #define G_LUA 1 #define CG_LUA 1 // because games can change separately from the main system version, we need a // second version that must match between game and cgame #define RPGX_VERSION "RPG-X V 2.4.1ua" static const char RPGX_COMPILEDATE[] = __DATE__ " " __TIME__; static const char RPGX_COMPILEDBY[] = "Jenkins Buildserver"; #define GAME_VERSION "RPG-X v" RPGX_VERSION static const uint32_t INJURED_MODE_HEALTH = 20; //! MAX_CONFIGSTRINGS #error overflow: (CS_MAX) > MAX_CONFIGSTRINGS #endif typedef enum { GT_FFA, //!< free for all GT_TOURNAMENT, //!< one on one tournament GT_SINGLE_PLAYER, //!< single player tournament //-- team games go after this -- GT_TEAM, //!< team deathmatch GT_CTF, //!< capture the flag GT_MAX_GAME_TYPE } gametype_t; typedef enum { GENDER_MALE, GENDER_FEMALE, GENDER_NEUTER } gender_t; //TiM - Global variables for the player weight/height system static const double BASE_HEIGHT = 185.0; static const double BASE_WEIGHT = 90.0; static const double FEMALE_OFFSET = 0.73; static const double MAX_HEIGHT = 1.15; static const double MIN_HEIGHT = 0.9; static const double MAX_WEIGHT = 1.1; static const double MIN_WEIGHT = 0.9; static const char HEIGHT_UNIT[] = "cm"; static const char WEIGHT_UNIT[] = "kg"; /* =================================================================================== PMOVE MODULE The pmove code takes a player_state_t and a usercmd_t and generates a new player_state_t and some other output data. Used for local prediction on the client game and true movement on the server game. =================================================================================== */ /** \enum pmtype_t * */ typedef enum { PM_NORMAL, //!< can accelerate and turn PM_NOCLIP, //!< noclip movement PM_SPECTATOR, //!< still run into walls PM_DEAD, //!< no acceleration or turning, but free falling PM_FREEZE, //!< stuck in place with no control PM_INTERMISSION,//!< no movement or status bar PM_CCAM //!< cinematic cam mode } pmtype_t; /** \enum weaponstate_t * */ typedef enum { WEAPON_READY, WEAPON_RAISING, WEAPON_DROPPING, WEAPON_FIRING } weaponstate_t; // pmove->pm_flags enum bg_pmFlag_e { PMF_DUCKED = 1, //1 //2 PMF_JUMP_HELD = 2, //2 //4 PMF_BACKWARDS_JUMP = 8, //!< go into backwards land PMF_BACKWARDS_RUN = 16, //!< coast down to backwards run PMF_TIME_LAND = 32, //!< pm_time is time before rejump PMF_TIME_KNOCKBACK = 64, //!< pm_time is an air-accelerate only time ANIM_ALERT = 128, //TiM: How was this missed!? PMF_TIME_WATERJUMP = 256, //!< pm_time is waterjump PMF_RESPAWNED = 512, //!< clear after attack and jump buttons come up PMF_USE_ITEM_HELD = 1024, ANIM_ALERT2 = 2048, //TiM: This makes it full I think PMF_FOLLOW = 4096, //!< spectate following another player PMF_SCOREBOARD = 8192, //!< spectate as a scoreboard ANIM_ONLADDER = 16384, ANIM_DIDFLY = 32768, PMF_ALL_TIMES = (PMF_TIME_WATERJUMP | PMF_TIME_LAND | PMF_TIME_KNOCKBACK) }; /** * \struct pmove_t */ typedef struct { // state (in / out) playerState_t *ps; // command (in) usercmd_t cmd; int32_t tracemask; //!< collide against these types of surfaces int32_t debugLevel; //!< if set, diagnostic output will be printed qboolean noFootsteps; //!< if the game is setup for no footsteps by the server qboolean pModDisintegration; //!< true if the Disintegration playerMod is on // results (out) int32_t numtouch; int32_t touchents[MAXTOUCH]; int32_t useEvent; vec3_t mins, maxs; //!< bounding box size int32_t watertype; int32_t waterlevel; double xyspeed; double xyzspeed; //TiM : in case body is falling as well qboolean admin; qboolean medic; qboolean borg; // callbacks to test the world // these will be different functions during game and cgame void(*trace)(trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int32_t passEntityNum, int32_t contentMask); int32_t(*pointcontents)(const vec3_t point, int32_t passEntityNum); } pmove_t; // if a full pmove isn't done on the client, you can just update the angles void PM_UpdateViewAngles(playerState_t *ps, const usercmd_t *cmd); void Pmove(pmove_t *pmove); //=================================================================================== // player_state->stats[] indexes // // maximum of MAX_STATS...currently 16 //TiM: Ooohhh! Usable space! /** \enum statIndex_t * Each of these array cells can store data up to 2^16 bits of data! * This is good in the fact that we are capable of using this place to store data * that is larger for its previous cells, for example, animation data. */ typedef enum { STAT_HEALTH, STAT_HOLDABLE_ITEM, STAT_WEAPONS, //!< 16 bit fields STAT_ARMOR, STAT_DEAD_YAW, //!< look this direction when dead (FIXME: get rid of?) STAT_CLIENTS_READY, //!< bit mask of clients wishing to exit the intermission (FIXME: configstring?) STAT_MAX_HEALTH, //!< health / armor limit, changable by handicap STAT_USEABLE_PLACED, //!< have we placed the detpack yet? //TiM : Placeholder for emotes data and anim holding TORSOTIMER, //!