455 lines
9.4 KiB
C
455 lines
9.4 KiB
C
/***
|
|
*
|
|
* Copyright (C) 2002 The Wastes Project, All Rights Reserved.
|
|
*
|
|
* This product contains software technology from Valve Software, LLC,
|
|
* Copyright © 1996-2001, Valve LLC, All rights reserved.
|
|
*
|
|
* Use, distribution, and modification of this source code and/or resulting
|
|
* object code is restricted to non-commercial enhancements to products from
|
|
* The Wastes Project. All other use, distribution, or modification is prohibited
|
|
* without written permission from The Wastes Project.
|
|
*
|
|
***/
|
|
#ifndef __TW_COMMON_H_
|
|
#define __TW_COMMON_H_
|
|
|
|
//
|
|
// This Header contains generic client /
|
|
// server module shared information
|
|
//
|
|
|
|
#ifdef TW_BETA
|
|
#define TW_BANNER "The Wastes RC 2 (Build 200) %s NOT FOR DISTRIBUTION"
|
|
#endif
|
|
|
|
// Bleeding / Composure / Willpower settings
|
|
#define PLAYER_BLEED_LIMIT 20
|
|
#define PLAYER_COMPOSURE_LIMIT 80
|
|
#define PLAYER_WILLPOWER_LIMIT_LO 40
|
|
#define PLAYER_WILLPOWER_LIMIT_HI 60
|
|
|
|
// Animation enums
|
|
enum single_pistol_anim_e {
|
|
SPISTOL_IDLE = 0,
|
|
SPISTOL_RELOAD,
|
|
SPISTOL_RELOAD_EMPTY,
|
|
SPISTOL_RELOAD2,
|
|
SPISTOL_RELOAD2_EMPTY,
|
|
SPISTOL_DRAW,
|
|
SPISTOL_DRAW_EMPTY,
|
|
SPISTOL_SHOOT,
|
|
SPISTOL_SHOOT_LAST,
|
|
SPISTOL_SHOOT_EMPTY,
|
|
SPISTOL_WHIP1,
|
|
SPISTOL_WHIP1_EMPTY,
|
|
SPISTOL_WHIP2,
|
|
SPISTOL_WHIP2_EMPTY,
|
|
SPISTOL_AIM_IDLE,
|
|
SPISTOL_AIM_SHOOT,
|
|
SPISTOL_AIM_SHOOT_LAST,
|
|
SPISTOL_AIM_SHOOT_EMPTY,
|
|
SPISTOL_GOTO_AIM,
|
|
SPISTOL_GOTO_AIM_EMPTY,
|
|
SPISTOL_END_AIM,
|
|
SPISTOL_END_AIM_EMPTY,
|
|
};
|
|
|
|
enum single_ruger_anim_e {
|
|
RUGER_IDLE = 0,
|
|
RUGER_IDLE2,
|
|
RUGER_RELOAD,
|
|
RUGER_DRAW,
|
|
RUGER_SHOOT,
|
|
RUGER_SHOOT_EMPTY,
|
|
RUGER_AIM_IDLE,
|
|
RUGER_AIM_SHOOT,
|
|
RUGER_GOTO_AIM,
|
|
RUGER_END_AIM
|
|
};
|
|
|
|
enum handcannon_anim_e {
|
|
HC_IDLE = 0,
|
|
HC_SHOOT,
|
|
HC_SHOOT_LAST,
|
|
HC_SHOOT_EMPTY,
|
|
HC_RELOAD_EMPTY,
|
|
HC_RELOAD,
|
|
HC_DRAW,
|
|
HC_DRAW_EMPTY
|
|
};
|
|
|
|
enum single_sawedoff_anim_e {
|
|
SAWED_IDLE = 0,
|
|
SAWED_SHOOT_L,
|
|
SAWED_SHOOT_R,
|
|
SAWED_SHOOT_BOTH,
|
|
SAWED_SHOOT_EMPTY,
|
|
SAWED_RELOAD,
|
|
SAWED_DRAW,
|
|
};
|
|
|
|
enum mossberg_anim_e {
|
|
MOSSBERG_IDLE = 0,
|
|
MOSSBERG_IDLE2,
|
|
MOSSBERG_IDLE3,
|
|
MOSSBERG_GOTO_RELOAD,
|
|
MOSSBERG_RELOAD,
|
|
MOSSBERG_END_RELOAD,
|
|
MOSSBERG_DRAW,
|
|
MOSSBERG_SHOOT,
|
|
MOSSBERG_SHOOT2,
|
|
MOSSBERG_SHOOT_EMPTY,
|
|
MOSSBERG_WHIP,
|
|
};
|
|
|
|
enum winchester_anim_e {
|
|
WINNY_IDLE = 0,
|
|
WINNY_SHOOT,
|
|
WINNY_SHOOT2,
|
|
WINNY_RELOAD_MIDDLE,
|
|
WINNY_RELOAD_END,
|
|
WINNY_RELOAD_START,
|
|
WINNY_DRAW,
|
|
};
|
|
|
|
enum smg9_anim_e {
|
|
SMG9_IDLE = 0,
|
|
SMG9_RELOAD,
|
|
SMG9_RELOAD_EMPTY,
|
|
SMG9_DRAW,
|
|
SMG9_SHOOT,
|
|
SMG9_SHOOT_EMPTY,
|
|
SMG9_SECONDARY_IDLE,
|
|
SMG9_SECONDARY_SHOOT,
|
|
SMG9_SECONDARY_SHOOT_EMPTY,
|
|
SMG9_SECONDARY_RELOAD,
|
|
SMG9_GOTO_SECONDARY,
|
|
SMG9_END_SECONDARY,
|
|
SMG9_SECONDARY_DRAW,
|
|
};
|
|
|
|
enum fnfal_anim_e {
|
|
FNFAL_IDLE1 = 0,
|
|
FNFAL_IDLE2,
|
|
FNFAL_RELOAD,
|
|
FNFAL_DRAW,
|
|
FNFAL_SHOOT,
|
|
FNFAL_SHOOT_EMPTY,
|
|
FNFAL_AIM_IDLE,
|
|
FNFAL_AIM_SHOOT,
|
|
FNFAL_AIM_SHOOT_EMPTY,
|
|
FNFAL_GOTO_AIM,
|
|
FNFAL_END_AIM,
|
|
};
|
|
|
|
enum tommygun_anim_e {
|
|
TOMMYGUN_IDLE = 0,
|
|
TOMMYGUN_IDLE1,
|
|
TOMMYGUN_IDLE2,
|
|
TOMMYGUN_RELOAD,
|
|
TOMMYGUN_DRAW,
|
|
TOMMYGUN_SHOOT,
|
|
TOMMYGUN_SHOOT_EMPTY,
|
|
};
|
|
|
|
enum jackhammer_anim_e {
|
|
JACKHAMMER_IDLE = 0,
|
|
JACKHAMMER_RELOAD,
|
|
JACKHAMMER_DRAW,
|
|
JACKHAMMER_SHOOT,
|
|
};
|
|
|
|
enum g11_anim_e {
|
|
G11_IDLE = 0,
|
|
G11_SHOOT,
|
|
G11_BURST,
|
|
G11_SHOOT_EMPTY,
|
|
G11_DRAW,
|
|
G11_RELOAD,
|
|
G11_ACTIVATE_SCOPE,
|
|
G11_DEACTIVATE_SCOPE,
|
|
};
|
|
|
|
enum boltrifle_anim_e {
|
|
BOLTRIFLE_IDLE1 = 0,
|
|
BOLTRIFLE_RELOAD_EMPTY,
|
|
BOLTRIFLE_RELOAD,
|
|
BOLTRIFLE_DRAW,
|
|
BOLTRIFLE_SHOOT,
|
|
BOLTRIFLE_SHOOT_LAST,
|
|
BOLTRIFLE_STRIKE,
|
|
};
|
|
|
|
enum ak_pistols_anim_e {
|
|
AKPISTOLS_IDLE = 0,
|
|
AKPISTOLS_RSHOOT_LFULL,
|
|
AKPISTOLS_RSHOOTLAST_LFULL,
|
|
AKPISTOLS_RSHOOT_LEMPTY,
|
|
AKPISTOLS_RSHOOTLAST_LEMPTY,
|
|
AKPISTOLS_LSHOOT_RFULL,
|
|
AKPISTOLS_LSHOOTLAST_RFULL,
|
|
AKPISTOLS_LSHOOT_REMPTY,
|
|
AKPISTOLS_LSHOOTLAST_REMPTY,
|
|
AKPISTOLS_RELOAD_EMPTY,
|
|
AKPISTOLS_RELOAD2_EMPTY,
|
|
AKPISTOLS_RELOAD,
|
|
AKPISTOLS_DRAW,
|
|
};
|
|
|
|
enum sten_anim_e {
|
|
STEN_IDLE = 0,
|
|
STEN_IDLE_SILENCED,
|
|
STEN_RELOAD,
|
|
STEN_RELOAD_SILENCED,
|
|
STEN_ADDSILENCER,
|
|
STEN_REMSILENCER,
|
|
STEN_DRAW,
|
|
STEN_DRAW_SILENCED,
|
|
STEN_SHOOT,
|
|
STEN_SHOOT_SILENCED,
|
|
STEN_SHOOT_EMPTY,
|
|
STEN_SHOOT_EMPTY_SILENCED,
|
|
};
|
|
|
|
enum anim_molotov_e {
|
|
MOLOTOV_IDLE = 0,
|
|
MOLOTOV_LIGHT,
|
|
MOLOTOV_THROW,
|
|
MOLOTOV_HOLSTER,
|
|
MOLOTOV_DRAW,
|
|
};
|
|
|
|
enum anim_frag_e {
|
|
FRAG_IDLE = 0,
|
|
FRAG_DRAW,
|
|
FRAG_GOTOTHROW,
|
|
FRAG_GOTOTHROW2,
|
|
FRAG_THROW,
|
|
};
|
|
|
|
enum anim_pipebomb_e {
|
|
PIPEBOMB_IDLE = 0,
|
|
PIPEBOMB_DRAW,
|
|
PIPEBOMB_GOTOTHROW,
|
|
PIPEBOMB_THROW,
|
|
};
|
|
|
|
enum anim_combatknife_e {
|
|
COMBATKNIFE_IDLE1 = 0,
|
|
COMBATKNIFE_DRAW,
|
|
COMBATKNIFE_HOLSTER,
|
|
COMBATKNIFE_ATTACK1,
|
|
COMBATKNIFE_ATTACK1MISS,
|
|
COMBATKNIFE_ATTACK2,
|
|
COMBATKNIFE_ATTACK2HIT,
|
|
COMBATKNIFE_ATTACK3,
|
|
COMBATKNIFE_ATTACK3HIT,
|
|
COMBATKNIFE_IDLE2,
|
|
COMBATKNIFE_IDLE3,
|
|
};
|
|
|
|
enum anim_throwingknife_e {
|
|
TKNIFE_IDLE1 = 0,
|
|
TKNIFE_IDLE2,
|
|
TKNIFE_DRAW,
|
|
TKNIFE_GOTOTHROW,
|
|
TKNIFE_THROW,
|
|
};
|
|
|
|
enum anim_baseballbat_e {
|
|
BAT_IDLE = 0,
|
|
BAT_DRAW,
|
|
BAT_ATTACK1,
|
|
BAT_ATTACK1_MISS,
|
|
BAT_ATTACK2,
|
|
BAT_ATTACK2_MISS,
|
|
BAT_ATTACK3,
|
|
BAT_ATTACK3_MISS,
|
|
};
|
|
|
|
enum anim_sledgehammer_e {
|
|
SLEDGE_IDLE = 0,
|
|
SLEDGE_DRAW,
|
|
SLEDGE_ATTACK1,
|
|
SLEDGE_ATTACK1_MISS,
|
|
SLEDGE_ATTACK2,
|
|
SLEDGE_ATTACK2_MISS,
|
|
};
|
|
|
|
enum anim_katana_e {
|
|
KATANA_ST1_IDLE = 0,
|
|
KATANA_ST2_IDLE,
|
|
KATANA_ST1_ATTACK1,
|
|
KATANA_ST2_ATTACK1,
|
|
KATANA_ST2_ATTACK2,
|
|
KATANA_ST1_GOTO_ST2,
|
|
KATANA_ST2_GOTO_ST1,
|
|
KATANA_DRAW,
|
|
};
|
|
|
|
enum anim_spear_e {
|
|
SPEAR_IDLE1 = 0,
|
|
SPEAR_IDLE2,
|
|
SPEAR_DRAW,
|
|
SPEAR_ATTACK1,
|
|
SPEAR_ATTACK2,
|
|
SPEAR_GOTO_THROW,
|
|
SPEAR_THROW,
|
|
SPEAR_GOTO_STAB,
|
|
};
|
|
|
|
enum anim_cattleprod_e {
|
|
PROD_IDLE1 = 0,
|
|
PROD_DRAW,
|
|
PROD_ATTACK1,
|
|
PROD_ATTACK1MISS,
|
|
PROD_ATTACK2,
|
|
PROD_ATTACK2MISS,
|
|
};
|
|
|
|
enum anim_akimbo_e {
|
|
AKIMBO_IDLE1 = 0,
|
|
AKIMBO_RSHOOT,
|
|
AKIMBO_RSHOOTLAST,
|
|
AKIMBO_RSHOOT_LEMPTY,
|
|
AKIMBO_RSHOOTLAST_LEMPTY,
|
|
AKIMBO_LSHOOT,
|
|
AKIMBO_LSHOOTLAST,
|
|
AKIMBO_LSHOOT_REMPTY,
|
|
AKIMBO_LSHOOTLAST_REMPTY,
|
|
AKIMBO_LSHOOTEMPTY,
|
|
AKIMBO_RSHOOTEMPTY,
|
|
AKIMBO_RELOAD_EMPTY,
|
|
AKIMBO_RELOAD2_EMPTY,
|
|
AKIMBO_RELOAD,
|
|
AKIMBO_DRAW,
|
|
};
|
|
|
|
enum anim_akimbosawedoffs_e {
|
|
AKIMBOSS_IDLE1,
|
|
AKIMBOSS_RELOAD,
|
|
AKIMBOSS_DRAW,
|
|
AKIMBOSS_RSHOOT,
|
|
AKIMBOSS_LSHOOT,
|
|
AKIMBOSS_BSHOOT,
|
|
};
|
|
|
|
// Used by akimbo weapons
|
|
enum akimbo_hand_e { AH_LEFT, AH_RIGHT };
|
|
|
|
// This is a list of all the wasteland weapons, as well
|
|
// as their categories. Used mainly by the client, but
|
|
// used a few places serverside as well.
|
|
enum e_weapcategory {
|
|
CAT_NONE = 0,
|
|
CAT_MELEE,
|
|
CAT_SIDEARM,
|
|
CAT_PRIMARY,
|
|
CAT_UNIQUE,
|
|
CAT_ITEM,
|
|
};
|
|
|
|
typedef struct playeritem_s
|
|
{
|
|
const char *weapon_classname;
|
|
const char *ammo_classname;
|
|
int num_ammospawns;
|
|
int category;
|
|
} playeritem_t;
|
|
|
|
typedef struct playeritemlist_s
|
|
{
|
|
playeritem_t *array;
|
|
int size;
|
|
} playeritemlist_t;
|
|
|
|
extern playeritemlist_t g_MeleeItems;
|
|
extern playeritemlist_t g_SidearmItems;
|
|
extern playeritemlist_t g_PrimaryItems;
|
|
extern playeritemlist_t g_UniqueItems;
|
|
extern playeritemlist_t g_OtherItems;
|
|
|
|
// Wall Penetration macros to sync between client / server
|
|
enum penetration_types_e
|
|
{
|
|
P_NONE = 0,
|
|
P_BERETTA,
|
|
P_COLT,
|
|
P_RUGER,
|
|
P_DEAGLE,
|
|
P_HANDCANNON,
|
|
P_WINCHESTER,
|
|
P_SMG9,
|
|
P_FNFAL,
|
|
P_TOMMYGUN,
|
|
P_G11,
|
|
P_BOLTRIFLE,
|
|
P_STEN,
|
|
};
|
|
|
|
#define MAX_WALLCOUNT 8 // max number of walls we can penetrate
|
|
|
|
#define MAX_THICKNESS_BERETTA 9.0
|
|
#define MAX_THICKNESS_COLT 17.0
|
|
#define MAX_THICKNESS_RUGER 55.0
|
|
#define MAX_THICKNESS_DEAGLE 52.5
|
|
#define MAX_THICKNESS_HANDCANNON 45.0
|
|
#define MAX_THICKNESS_WINCHESTER 30.0
|
|
#define MAX_THICKNESS_SMG9 7.0
|
|
#define MAX_THICKNESS_FNFAL 59.0
|
|
#define MAX_THICKNESS_TOMMYGUN 14.0
|
|
#define MAX_THICKNESS_G11 55.0
|
|
#define MAX_THICKNESS_BOLTRIFLE 59.0
|
|
#define MAX_THICKNESS_STEN 9.0
|
|
|
|
// Must be >1, how weak the round
|
|
// gets as it goes through walls.
|
|
#define FALLOFF_BERETTA 3.0
|
|
#define FALLOFF_COLT 2.5
|
|
#define FALLOFF_RUGER 2.0
|
|
#define FALLOFF_DEAGLE 2.1
|
|
#define FALLOFF_HANDCANNON 1.75
|
|
#define FALLOFF_WINCHESTER 2.5
|
|
#define FALLOFF_SMG9 3.0
|
|
#define FALLOFF_FNFAL 1.25
|
|
#define FALLOFF_TOMMYGUN 3.0
|
|
#define FALLOFF_G11 2.25
|
|
#define FALLOFF_BOLTRIFLE 1.25
|
|
#define FALLOFF_STEN 3.0
|
|
|
|
// prxoy director stuff
|
|
#define DRC_EVENT 3 // informs the dircetor about ann important game event
|
|
|
|
//#define DRC_FLAG_PRIO_MASK 0x0F // priorities between 0 and 15 (15 most important)
|
|
//#define DRC_FLAG_DRAMATIC (1<<5)
|
|
|
|
// sub commands of svc_director:
|
|
#define DRC_CMD_NONE 0 // NULL director command
|
|
#define DRC_CMD_START 1 // start director mode
|
|
#define DRC_CMD_EVENT 2 // informs about director event
|
|
#define DRC_CMD_MODE 3 // switches camera modes
|
|
#define DRC_CMD_CAMERA 4 // sets camera registers
|
|
#define DRC_CMD_TIMESCALE 5 // sets time scale
|
|
#define DRC_CMD_MESSAGE 6 // send HUD centerprint
|
|
#define DRC_CMD_SOUND 7 // plays a particular sound
|
|
#define DRC_CMD_STATUS 8 // status info about broadcast
|
|
#define DRC_CMD_BANNER 9 // banner file name for HLTV gui
|
|
#define DRC_CMD_FADE 10 // send screen fade command
|
|
#define DRC_CMD_SHAKE 11 // send screen shake command
|
|
#define DRC_CMD_STUFFTEXT 12 // like the normal svc_stufftext but as director command
|
|
|
|
#define DRC_CMD_LAST 13
|
|
|
|
// HLTV_EVENT event flags
|
|
#define DRC_FLAG_PRIO_MASK 0x0F // priorities between 0 and 15 (15 most important)
|
|
#define DRC_FLAG_SIDE (1<<4) //I assume this draws the action from the side - Mugsy
|
|
#define DRC_FLAG_DRAMATIC (1<<5) // is a dramatic scene
|
|
#define DRC_FLAG_SLOWMOTION (1<<6) // would look good in SloMo
|
|
#define DRC_FLAG_FACEPLAYER (1<<7) // player is doning something (reload/defuse bomb etc)
|
|
#define DRC_FLAG_INTRO (1<<8) // is a introduction scene
|
|
#define DRC_FLAG_FINAL (1<<9) // is a final scene
|
|
#define DRC_FLAG_NO_RANDOM (1<<10) // don't randomize event data
|
|
|
|
#endif
|