diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /mp/src/game/shared/sdk/sdk_shareddefs.cpp | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/game/shared/sdk/sdk_shareddefs.cpp')
| -rw-r--r-- | mp/src/game/shared/sdk/sdk_shareddefs.cpp | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/mp/src/game/shared/sdk/sdk_shareddefs.cpp b/mp/src/game/shared/sdk/sdk_shareddefs.cpp new file mode 100644 index 00000000..687ca838 --- /dev/null +++ b/mp/src/game/shared/sdk/sdk_shareddefs.cpp @@ -0,0 +1,116 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=====================================================================================//
+
+#include "cbase.h"
+#include "weapon_sdkbase.h"
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include "tier0/memdbgon.h"
+
+// the 1 / 2 / 3 respectively are all identical in our template mod to start, I've made the base ones (pc_class1, pc_class2, pc_class3) and then duplicated them for the teams.
+//Tony; for our template we have two versions.
+#if defined ( SDK_USE_PLAYERCLASSES ) && defined ( SDK_USE_TEAMS )
+const char *pszTeamBlueClasses[] =
+{
+ "blue_class1",
+ "blue_class2",
+ "blue_class3",
+ NULL
+};
+
+const char *pszTeamRedClasses[] =
+{
+ "red_class1",
+ "red_class2",
+ "red_class3",
+ NULL
+};
+ConVar mp_limit_blue_class1( "mp_limit_blue_class1", "-1", FCVAR_REPLICATED, "Class limit for Blue class 1" );
+ConVar mp_limit_blue_class2( "mp_limit_blue_class2", "-1", FCVAR_REPLICATED, "Class limit for Blue class 2" );
+ConVar mp_limit_blue_class3( "mp_limit_blue_class3", "-1", FCVAR_REPLICATED, "Class limit for Blue class 3" );
+
+ConVar mp_limit_red_class1( "mp_limit_red_class1", "-1", FCVAR_REPLICATED, "Class limit for Red class 1" );
+ConVar mp_limit_red_class2( "mp_limit_red_class2", "-1", FCVAR_REPLICATED, "Class limit for Red class 2" );
+ConVar mp_limit_red_class3( "mp_limit_red_class3", "-1", FCVAR_REPLICATED, "Class limit for Red class 3" );
+
+//Tony; not using teams, but we are using classes
+#elif defined ( SDK_USE_PLAYERCLASSES ) && !defined( SDK_USE_TEAMS )
+const char *pszPlayerClasses[] =
+{
+ "pc_class1",
+ "pc_class2",
+ "pc_class3",
+ NULL
+};
+ConVar mp_limit_pc_class1( "mp_limit_pc_class1", "-1", FCVAR_REPLICATED, "Class limit for class 1" );
+ConVar mp_limit_pc_class2( "mp_limit_pc_class2", "-1", FCVAR_REPLICATED, "Class limit for class 2" );
+ConVar mp_limit_pc_class3( "mp_limit_pc_class3", "-1", FCVAR_REPLICATED, "Class limit for class 3" );
+#endif
+
+const char *pszTeamNames[] =
+{
+ "#SDK_Team_Unassigned",
+ "#SDK_Team_Spectator",
+#if defined ( SDK_USE_TEAMS )
+ "#SDK_Team_Blue",
+ "#SDK_Team_Red",
+#endif
+};
+
+//Tony; We need to precache all possible player models that we're going to use
+const char *pszPossiblePlayerModels[] =
+{
+ SDK_PLAYER_MODEL,
+ "models/player/american_rifleman.mdl",
+ "models/player/german_rifleman.mdl",
+ NULL
+};
+
+// ----------------------------------------------------------------------------- //
+// Global Weapon Definitions
+// ----------------------------------------------------------------------------- //
+
+//--------------------------------------------------------------------------------------------------------
+static const char * s_WeaponAliasInfo[] =
+{
+ "none", // WEAPON_NONE
+ "mp5", // SDK_WEAPON_MP5
+ "shotgun", // SDK_WEAPON_SHOTGUN
+ "grenade", // SDK_WEAPON_GRENADE
+ "pistol", // SDK_WEAPON_PISTOL
+ "crowbar", // SDK_WEAPON_CROWBAR
+ NULL, // WEAPON_NONE
+};
+
+//--------------------------------------------------------------------------------------------------------
+//
+// Given an alias, return the associated weapon ID
+//
+int AliasToWeaponID( const char *alias )
+{
+ if (alias)
+ {
+ for( int i=0; s_WeaponAliasInfo[i] != NULL; ++i )
+ if (!Q_stricmp( s_WeaponAliasInfo[i], alias ))
+ return i;
+ }
+
+ return WEAPON_NONE;
+}
+
+//--------------------------------------------------------------------------------------------------------
+//
+// Given a weapon ID, return its alias
+//
+const char *WeaponIDToAlias( int id )
+{
+ if ( (id >= WEAPON_MAX) || (id < 0) )
+ return NULL;
+
+ return s_WeaponAliasInfo[id];
+}
+
+
|