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.

111 lines
2.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef TF_WEAPON_PARSE_H
  7. #define TF_WEAPON_PARSE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "weapon_parse.h"
  12. #include "networkvar.h"
  13. #include "tf_shareddefs.h"
  14. //=============================================================================
  15. //
  16. // TF Weapon Info
  17. //
  18. struct WeaponData_t
  19. {
  20. int m_nDamage;
  21. int m_nBulletsPerShot;
  22. float m_flRange;
  23. float m_flSpread;
  24. float m_flPunchAngle;
  25. float m_flTimeFireDelay; // Time to delay between firing
  26. float m_flTimeIdle; // Time to idle after firing
  27. float m_flTimeIdleEmpty; // Time to idle after firing last bullet in clip
  28. float m_flTimeReloadStart; // Time to start into a reload (ie. shotgun)
  29. float m_flTimeReload; // Time to reload
  30. bool m_bDrawCrosshair; // Should the weapon draw a crosshair
  31. int m_iProjectile; // The type of projectile this mode fires
  32. int m_iAmmoPerShot; // How much ammo each shot consumes
  33. float m_flProjectileSpeed; // Start speed for projectiles (nail, etc.); NOTE: union with something non-projectile
  34. float m_flSmackDelay; // how long after swing should damage happen for melee weapons
  35. bool m_bUseRapidFireCrits;
  36. void Init( void )
  37. {
  38. m_nDamage = 0;
  39. m_nBulletsPerShot = 0;
  40. m_flRange = 0.0f;
  41. m_flSpread = 0.0f;
  42. m_flPunchAngle = 0.0f;
  43. m_flTimeFireDelay = 0.0f;
  44. m_flTimeIdle = 0.0f;
  45. m_flTimeIdleEmpty = 0.0f;
  46. m_flTimeReloadStart = 0.0f;
  47. m_flTimeReload = 0.0f;
  48. m_iProjectile = TF_PROJECTILE_NONE;
  49. m_iAmmoPerShot = 0;
  50. m_flProjectileSpeed = 0.0f;
  51. m_flSmackDelay = 0.0f;
  52. m_bUseRapidFireCrits = false;
  53. };
  54. };
  55. class CTFWeaponInfo : public FileWeaponInfo_t
  56. {
  57. public:
  58. DECLARE_CLASS_GAMEROOT( CTFWeaponInfo, FileWeaponInfo_t );
  59. CTFWeaponInfo();
  60. ~CTFWeaponInfo();
  61. virtual void Parse( ::KeyValues *pKeyValuesData, const char *szWeaponName );
  62. WeaponData_t const &GetWeaponData( int iWeapon ) const { return m_WeaponData[iWeapon]; }
  63. public:
  64. WeaponData_t m_WeaponData[2];
  65. int m_iWeaponType;
  66. // Grenade.
  67. bool m_bGrenade;
  68. float m_flDamageRadius;
  69. float m_flPrimerTime;
  70. bool m_bLowerWeapon;
  71. bool m_bSuppressGrenTimer;
  72. // Skins
  73. bool m_bHasTeamSkins_Viewmodel;
  74. bool m_bHasTeamSkins_Worldmodel;
  75. // Muzzle flash
  76. char m_szMuzzleFlashModel[128];
  77. float m_flMuzzleFlashModelDuration;
  78. char m_szMuzzleFlashParticleEffect[128];
  79. // Tracer
  80. char m_szTracerEffect[128];
  81. // Eject Brass
  82. bool m_bDoInstantEjectBrass;
  83. char m_szBrassModel[128];
  84. // Explosion Effect
  85. char m_szExplosionSound[128];
  86. char m_szExplosionEffect[128];
  87. char m_szExplosionPlayerEffect[128];
  88. char m_szExplosionWaterEffect[128];
  89. bool m_bDontDrop;
  90. };
  91. #endif // TF_WEAPON_PARSE_H