Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. #ifndef HL1MP_GAMERULES_H
  3. #define HL1MP_GAMERULES_H
  4. #pragma once
  5. #include "gamerules.h"
  6. #include "teamplay_gamerules.h"
  7. extern ConVar sk_mp_dmg_multiplier ;
  8. #ifdef CLIENT_DLL
  9. #define CHL1MPRules C_HL1MPRules
  10. #define CHL1MPGameRulesProxy C_HL1MPGameRulesProxy
  11. #endif
  12. class CHL1MPGameRulesProxy : public CGameRulesProxy
  13. {
  14. public:
  15. DECLARE_CLASS( CHL1MPGameRulesProxy, CGameRulesProxy );
  16. DECLARE_NETWORKCLASS();
  17. };
  18. class CHL1MPRules : public CTeamplayRules
  19. {
  20. public:
  21. DECLARE_CLASS( CHL1MPRules, CTeamplayRules );
  22. #ifdef CLIENT_DLL
  23. DECLARE_CLIENTCLASS_NOBASE();
  24. #else
  25. DECLARE_SERVERCLASS_NOBASE();
  26. #endif
  27. CHL1MPRules();
  28. virtual ~CHL1MPRules();
  29. virtual void CreateStandardEntities( void );
  30. virtual bool IsTeamplay( void )
  31. {
  32. return m_bTeamPlayEnabled;
  33. }
  34. virtual float GetAmmoDamage( CBaseEntity *pAttacker, CBaseEntity *pVictim, int nAmmoType );
  35. virtual float GetDamageMultiplier( void );
  36. virtual bool IsConnectedUserInfoChangeAllowed( CBasePlayer *pPlayer )
  37. {
  38. return true;
  39. }
  40. bool ClientCommand( CBaseEntity *pEdict, const CCommand &args );
  41. #ifdef CLIENT_DLL
  42. #else
  43. virtual const char *GetGameDescription( void ) { return "Half-Life Deathmatch: Source"; } // this is the game name that gets seen in the server browser
  44. virtual void Think ( void );
  45. virtual void GoToIntermission( void );
  46. virtual void InitDefaultAIRelationships( void );
  47. virtual float FlWeaponRespawnTime( CBaseCombatWeapon *pWeapon );
  48. virtual float FlItemRespawnTime( CItem *pItem );
  49. virtual const char *SetDefaultPlayerTeam( CBasePlayer *pPlayer );
  50. virtual void InitHUD( CBasePlayer *pPlayer );
  51. virtual void ChangePlayerTeam( CBasePlayer *pPlayer, const char *pTeamName, bool bKill, bool bGib );
  52. virtual void ClientSettingsChanged( CBasePlayer *pPlayer );
  53. virtual int GetTeamIndex( const char * pName );
  54. #endif
  55. private:
  56. const char *TeamWithFewestPlayers( void );
  57. CNetworkVar( bool, m_bTeamPlayEnabled );
  58. };
  59. inline CHL1MPRules* HL1MPRules()
  60. {
  61. return dynamic_cast<CHL1MPRules*>(g_pGameRules);
  62. }
  63. #endif