summaryrefslogtreecommitdiff
path: root/game/shared/hl1/hl1mp_gamerules.h
diff options
context:
space:
mode:
Diffstat (limited to 'game/shared/hl1/hl1mp_gamerules.h')
-rw-r--r--game/shared/hl1/hl1mp_gamerules.h91
1 files changed, 91 insertions, 0 deletions
diff --git a/game/shared/hl1/hl1mp_gamerules.h b/game/shared/hl1/hl1mp_gamerules.h
new file mode 100644
index 0000000..c68743a
--- /dev/null
+++ b/game/shared/hl1/hl1mp_gamerules.h
@@ -0,0 +1,91 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+#ifndef HL1MP_GAMERULES_H
+#define HL1MP_GAMERULES_H
+#pragma once
+
+
+#include "gamerules.h"
+#include "teamplay_gamerules.h"
+
+extern ConVar sk_mp_dmg_multiplier ;
+
+#ifdef CLIENT_DLL
+ #define CHL1MPRules C_HL1MPRules
+ #define CHL1MPGameRulesProxy C_HL1MPGameRulesProxy
+#endif
+
+
+class CHL1MPGameRulesProxy : public CGameRulesProxy
+{
+public:
+ DECLARE_CLASS( CHL1MPGameRulesProxy, CGameRulesProxy );
+ DECLARE_NETWORKCLASS();
+};
+
+
+class CHL1MPRules : public CTeamplayRules
+{
+public:
+ DECLARE_CLASS( CHL1MPRules, CTeamplayRules );
+
+#ifdef CLIENT_DLL
+ DECLARE_CLIENTCLASS_NOBASE();
+#else
+ DECLARE_SERVERCLASS_NOBASE();
+#endif
+
+ CHL1MPRules();
+ virtual ~CHL1MPRules();
+
+ virtual void CreateStandardEntities( void );
+
+ virtual bool IsTeamplay( void )
+ {
+ return m_bTeamPlayEnabled;
+ }
+
+ virtual float GetAmmoDamage( CBaseEntity *pAttacker, CBaseEntity *pVictim, int nAmmoType );
+ virtual float GetDamageMultiplier( void );
+
+ virtual bool IsConnectedUserInfoChangeAllowed( CBasePlayer *pPlayer )
+ {
+ return true;
+ }
+ bool ClientCommand( CBaseEntity *pEdict, const CCommand &args );
+
+#ifdef CLIENT_DLL
+#else
+ virtual const char *GetGameDescription( void ) { return "Half-Life Deathmatch: Source"; } // this is the game name that gets seen in the server browser
+
+ virtual void Think ( void );
+
+ virtual void GoToIntermission( void );
+
+ virtual void InitDefaultAIRelationships( void );
+
+ virtual float FlWeaponRespawnTime( CBaseCombatWeapon *pWeapon );
+ virtual float FlItemRespawnTime( CItem *pItem );
+
+ virtual const char *SetDefaultPlayerTeam( CBasePlayer *pPlayer );
+ virtual void InitHUD( CBasePlayer *pPlayer );
+ virtual void ChangePlayerTeam( CBasePlayer *pPlayer, const char *pTeamName, bool bKill, bool bGib );
+ virtual void ClientSettingsChanged( CBasePlayer *pPlayer );
+
+ virtual int GetTeamIndex( const char * pName );
+#endif
+
+private:
+
+ const char *TeamWithFewestPlayers( void );
+
+ CNetworkVar( bool, m_bTeamPlayEnabled );
+};
+
+
+inline CHL1MPRules* HL1MPRules()
+{
+ return dynamic_cast<CHL1MPRules*>(g_pGameRules);
+}
+
+
+#endif