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.

35 lines
864 B

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include <KeyValues.h>
  8. #include "sdk_weapon_parse.h"
  9. FileWeaponInfo_t* CreateWeaponInfo()
  10. {
  11. return new CSDKWeaponInfo;
  12. }
  13. CSDKWeaponInfo::CSDKWeaponInfo()
  14. {
  15. }
  16. void CSDKWeaponInfo::Parse( KeyValues *pKeyValuesData, const char *szWeaponName )
  17. {
  18. BaseClass::Parse( pKeyValuesData, szWeaponName );
  19. m_iDamage = pKeyValuesData->GetInt( "Damage", 42 ); // Douglas Adams 1952 - 2001
  20. m_iBullets = pKeyValuesData->GetInt( "Bullets", 1 );
  21. m_flCycleTime = pKeyValuesData->GetFloat( "CycleTime", 0.15 );
  22. const char *pAnimEx = pKeyValuesData->GetString( "PlayerAnimationExtension", "mp5" );
  23. Q_strncpy( m_szAnimExtension, pAnimEx, sizeof( m_szAnimExtension ) );
  24. }