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.

203 lines
5.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef TFITEMCONSTANTS_H // ECON_ITEM_CONSTANTS_H is used by src/common/econ_item_view.h
  7. #define TFITEMCONSTANTS_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. //-----------------------------------------------------------------------------
  12. // Weapon Types
  13. //-----------------------------------------------------------------------------
  14. enum
  15. {
  16. TF_WPN_TYPE_PRIMARY = 0,
  17. TF_WPN_TYPE_SECONDARY,
  18. TF_WPN_TYPE_MELEE,
  19. TF_WPN_TYPE_GRENADE,
  20. TF_WPN_TYPE_BUILDING,
  21. TF_WPN_TYPE_PDA,
  22. TF_WPN_TYPE_ITEM1,
  23. TF_WPN_TYPE_ITEM2,
  24. TF_WPN_TYPE_HEAD,
  25. TF_WPN_TYPE_MISC,
  26. TF_WPN_TYPE_MELEE_ALLCLASS,
  27. TF_WPN_TYPE_SECONDARY2,
  28. TF_WPN_TYPE_PRIMARY2,
  29. //
  30. // ADD NEW ITEMS HERE TO AVOID BREAKING DEMOS
  31. //
  32. TF_WPN_TYPE_COUNT,
  33. };
  34. //-----------------------------------------------------------------------------
  35. // Purpose: Slots for items within loadouts
  36. //-----------------------------------------------------------------------------
  37. enum loadout_positions_t
  38. {
  39. LOADOUT_POSITION_INVALID = -1,
  40. // Weapons & Equipment
  41. LOADOUT_POSITION_PRIMARY = 0,
  42. LOADOUT_POSITION_SECONDARY,
  43. LOADOUT_POSITION_MELEE,
  44. LOADOUT_POSITION_UTILITY,
  45. LOADOUT_POSITION_BUILDING,
  46. LOADOUT_POSITION_PDA,
  47. LOADOUT_POSITION_PDA2,
  48. // Wearables. If you add new wearable slots, make sure you add them to IsWearableSlot() below this.
  49. LOADOUT_POSITION_HEAD,
  50. LOADOUT_POSITION_MISC,
  51. // other
  52. LOADOUT_POSITION_ACTION,
  53. // More wearables, yay!
  54. LOADOUT_POSITION_MISC2,
  55. // taunts
  56. LOADOUT_POSITION_TAUNT,
  57. LOADOUT_POSITION_TAUNT2,
  58. LOADOUT_POSITION_TAUNT3,
  59. LOADOUT_POSITION_TAUNT4,
  60. LOADOUT_POSITION_TAUNT5,
  61. LOADOUT_POSITION_TAUNT6,
  62. LOADOUT_POSITION_TAUNT7,
  63. LOADOUT_POSITION_TAUNT8,
  64. #ifdef STAGING_ONLY
  65. // Extra PDA mod slots
  66. LOADOUT_POSITION_PDA_ADDON1,
  67. LOADOUT_POSITION_PDA_ADDON2,
  68. LOADOUT_POSITION_PDA3,
  69. //LOADOUT_POSITION_MISC3,
  70. //LOADOUT_POSITION_MISC4,
  71. //LOADOUT_POSITION_MISC5,
  72. //LOADOUT_POSITION_MISC6,
  73. //LOADOUT_POSITION_MISC7,
  74. //LOADOUT_POSITION_MISC8,
  75. //LOADOUT_POSITION_MISC9,
  76. //LOADOUT_POSITION_MISC10,
  77. LOADOUT_POSITION_BUILDING2,
  78. #endif // STAGING_ONLY
  79. CLASS_LOADOUT_POSITION_COUNT,
  80. };
  81. enum account_loadout_positions_t
  82. {
  83. ACCOUNT_LOADOUT_POSITION_ACCOUNT1,
  84. ACCOUNT_LOADOUT_POSITION_ACCOUNT2,
  85. ACCOUNT_LOADOUT_POSITION_ACCOUNT3,
  86. ACCOUNT_LOADOUT_POSITION_COUNT,
  87. };
  88. // We use this to determine the maximum number of wearable instances we'll send from the server down to
  89. // connected clients. This was previously hardcoded to be 8 and because of the way RecvPropUtlVector works
  90. // we can't easily change this without doing some kludgy work and breaking network/demo compatibility. In
  91. // the shorter term, we'll break compatibility in staging where no-one cares but leave public unchanged.
  92. #ifdef STAGING_ONLY
  93. #define LOADOUT_MAX_WEARABLES_COUNT ( CLASS_LOADOUT_POSITION_COUNT )
  94. #else
  95. #define LOADOUT_MAX_WEARABLES_COUNT ( 8 /* !!! -- LOADOUT_POSITION_COUNT - 3 */ )
  96. #endif
  97. inline bool IsMiscSlot( int iSlot )
  98. {
  99. return iSlot == LOADOUT_POSITION_MISC
  100. || iSlot == LOADOUT_POSITION_MISC2
  101. || iSlot == LOADOUT_POSITION_HEAD
  102. #ifdef STAGING_ONLY
  103. //|| iSlot == LOADOUT_POSITION_MISC3
  104. //|| iSlot == LOADOUT_POSITION_MISC4
  105. //|| iSlot == LOADOUT_POSITION_MISC5
  106. //|| iSlot == LOADOUT_POSITION_MISC6
  107. //|| iSlot == LOADOUT_POSITION_MISC7
  108. //|| iSlot == LOADOUT_POSITION_MISC8
  109. //|| iSlot == LOADOUT_POSITION_MISC9
  110. //|| iSlot == LOADOUT_POSITION_MISC10
  111. #endif // STAGING_ONLY
  112. ;
  113. }
  114. inline bool IsBuildingSlot( int iSlot )
  115. {
  116. return iSlot == LOADOUT_POSITION_BUILDING
  117. #ifdef STAGING_ONLY
  118. || iSlot == LOADOUT_POSITION_BUILDING2
  119. #endif // STAGING_ONLY
  120. ;
  121. }
  122. inline bool IsTauntSlot( int iSlot )
  123. {
  124. return iSlot == LOADOUT_POSITION_TAUNT
  125. || iSlot == LOADOUT_POSITION_TAUNT2
  126. || iSlot == LOADOUT_POSITION_TAUNT3
  127. || iSlot == LOADOUT_POSITION_TAUNT4
  128. || iSlot == LOADOUT_POSITION_TAUNT5
  129. || iSlot == LOADOUT_POSITION_TAUNT6
  130. || iSlot == LOADOUT_POSITION_TAUNT7
  131. || iSlot == LOADOUT_POSITION_TAUNT8;
  132. }
  133. inline bool IsWearableSlot( int iSlot )
  134. {
  135. return iSlot == LOADOUT_POSITION_HEAD
  136. || iSlot == LOADOUT_POSITION_MISC
  137. || iSlot == LOADOUT_POSITION_ACTION
  138. || IsMiscSlot( iSlot )
  139. || IsTauntSlot( iSlot );
  140. }
  141. inline bool IsQuestSlot( int iSlot )
  142. {
  143. return iSlot == ACCOUNT_LOADOUT_POSITION_ACCOUNT1
  144. || iSlot == ACCOUNT_LOADOUT_POSITION_ACCOUNT2
  145. || iSlot == ACCOUNT_LOADOUT_POSITION_ACCOUNT3;
  146. }
  147. inline bool IsValidItemSlot( int iSlot )
  148. {
  149. return iSlot > LOADOUT_POSITION_INVALID && iSlot < CLASS_LOADOUT_POSITION_COUNT;
  150. }
  151. inline bool IsValidPickupWeaponSlot( int iSlot )
  152. {
  153. return iSlot == LOADOUT_POSITION_PRIMARY
  154. || iSlot == LOADOUT_POSITION_SECONDARY
  155. || iSlot == LOADOUT_POSITION_MELEE;
  156. }
  157. // The total number of loadouts to track for each player.
  158. // Right now, hardcoded to match TF's 10 classes.
  159. #define LOADOUT_COUNT (10+1) // 0th class is undefined
  160. // Halloween! (Shared by GC and game client.)
  161. enum EHalloweenMap
  162. {
  163. kHalloweenMap_MannManor,
  164. kHalloweenMap_Viaduct,
  165. kHalloweenMap_Lakeside,
  166. kHalloweenMap_Hightower,
  167. kHalloweenMapCount
  168. };
  169. enum EHalloweenGiftSpawnMetaInfo
  170. {
  171. kHalloweenGiftMeta_IsUnderworldOnViaduct_DEPRECATED = 0x01,
  172. };
  173. #endif // TFITEMCONSTANTS_H