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.

275 lines
9.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "dod_shareddefs.h"
  8. #include "weapon_dodbase.h"
  9. //Voice commands
  10. DodVoiceCommand_t g_VoiceCommands[] =
  11. {
  12. //Voice command // Command Name //HS //Allied subtitle //german subtitle //brit subtitle
  13. // Menu A
  14. {"voice_attack", "Moveout", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_attack", "#Voice_subtitle_moveout"},
  15. {"voice_hold", "Hold", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_hold" },
  16. {"voice_left", "FlankLeft", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_left" },
  17. {"voice_right", "FlankRight", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_right" },
  18. {"voice_sticktogether", "StickTogether", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_sticktogether" },
  19. {"voice_cover", "CoveringFire", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_cover" },
  20. {"voice_usesmoke", "UseSmoke", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_usesmoke" },
  21. {"voice_usegrens", "UseGrenades", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_usegrens" },
  22. {"voice_ceasefire", "CeaseFire", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_ceasefire" },
  23. // Menu B
  24. {"voice_yessir", "YesSir", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_yessir" },
  25. {"voice_negative", "Negative", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_negative" },
  26. {"voice_backup", "BackUp", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_backup" },
  27. {"voice_fireinhole", "FireInHole", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_fireinhole" },
  28. {"voice_grenade", "Grenade", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_grenade" },
  29. {"voice_sniper", "Sniper", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_sniper" },
  30. {"voice_niceshot", "NiceShot", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_niceshot" },
  31. {"voice_thanks", "Thanks", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_thanks" },
  32. {"voice_areaclear", "Clear", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_areaclear" },
  33. // Menu C
  34. {"voice_dropweapons", "DropWeapons", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_dropyourweapons" },
  35. {"voice_displace", "Displace", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_displace" },
  36. {"voice_mgahead", "MgAhead", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_mgahead" },
  37. {"voice_enemybehind", "BehindUs", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_enemybehind" },
  38. {"voice_wegothim", "WeGotHim", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_wegothim" },
  39. {"voice_moveupmg", "MoveUpMg", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_moveupmg_30cal", "#Voice_subtitle_moveupmg_mg", "#Voice_subtitle_moveupmg_bren"},
  40. {"voice_needammo", "NeedAmmo", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_needammo" },
  41. {"voice_usebazooka", "UseRocket", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_usebazooka", "#Voice_subtitle_usepschreck", "#Voice_subtitle_usepiat"},
  42. {"voice_bazookaspotted","RocketSpotted", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_pschreckspotted", "#Voice_subtitle_bazookaspotted", "#Voice_subtitle_pschreckspotted"},
  43. // Voice commands that aren't in a menu
  44. {"voice_gogogo", "Moveout", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_attack", "#Voice_subtitle_moveout"},
  45. {"voice_medic", "Medic", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_medic" },
  46. {"voice_coverflanks", "CoverFlanks", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_coverflanks" },
  47. {"voice_tank", "TankAhead", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_tigerahead", "#Voice_subtitle_tankahead*" },
  48. {"voice_takeammo", "TakeAmmo", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_takeammo" },
  49. {"voice_movewithtank", "MoveWithTank", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_movewithtank" },
  50. {"voice_wtf", "WhiskeyTangoFoxtrot", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_wtf" },
  51. {"voice_fireleft", "TakingFireLeft", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_fireleft" },
  52. {"voice_fireright", "TakingFireRight", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_fireright" },
  53. {"voice_mgahead", "MgAhead", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_mgahead" },
  54. {"voice_enemyahead", "EnemyAhead", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_enemyahead" },
  55. {"voice_fallback", "FallBack", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_fallback" },
  56. // Must be last in the list
  57. { NULL }
  58. };
  59. // Hand Signals
  60. DodHandSignal_t g_HandSignals[] =
  61. {
  62. //command // anim event //subtitle
  63. {"signal_sticktogether", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_sticktogether" },
  64. {"signal_fallback", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_fallback" },
  65. {"signal_no", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_negative" },
  66. {"signal_yes", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_yessir" },
  67. {"signal_sniper", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_sniper" },
  68. {"signal_backup", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_backup" },
  69. {"signal_enemyleft", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_fireleft" },
  70. {"signal_enemyright", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_fireright" },
  71. {"signal_grenade", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_grenade" },
  72. {"signal_flankleft", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_left" },
  73. {"signal_flankright", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_right" },
  74. {"signal_moveout", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_attack" },
  75. {"signal_areaclear", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_areaclear" },
  76. {"signal_coveringfire", PLAYERANIMEVENT_HANDSIGNAL, "#Voice_subtitle_cover" },
  77. // Must be last in the list
  78. { NULL }
  79. };
  80. const char * s_WeaponAliasInfo[] =
  81. {
  82. "none", // WEAPON_NONE = 0,
  83. //Melee
  84. "amerknife", //WEAPON_AMERKNIFE,
  85. "spade", //WEAPON_SPADE,
  86. //Pistols
  87. "colt", //WEAPON_COLT,
  88. "p38", //WEAPON_P38,
  89. "c96", //WEAPON_C96
  90. //Rifles
  91. "garand", //WEAPON_GARAND,
  92. "m1carbine", //WEAPON_M1CARBINE,
  93. "k98", //WEAPON_K98,
  94. //Sniper Rifles
  95. "spring", //WEAPON_SPRING,
  96. "k98_scoped", //WEAPON_K98_SCOPED,
  97. //SMG
  98. "thompson", //WEAPON_THOMPSON,
  99. "mp40", //WEAPON_MP40,
  100. "mp44", //WEAPON_MP44,
  101. "bar", //WEAPON_BAR,
  102. //Machine guns
  103. "30cal", //WEAPON_30CAL,
  104. "mg42", //WEAPON_MG42,
  105. //Rocket weapons
  106. "bazooka", //WEAPON_BAZOOKA,
  107. "pschreck", //WEAPON_PSCHRECK,
  108. //Grenades
  109. "frag_us", //WEAPON_FRAG_US,
  110. "frag_ger", //WEAPON_FRAG_GER,
  111. "frag_us_live", //WEAPON_FRAG_US_LIVE
  112. "frag_ger_live", //WEAPON_FRAG_GER_LIVE
  113. "smoke_us", //WEAPON_SMOKE_US
  114. "smoke_ger", //WEAPON_SMOKE_GER
  115. "riflegren_us", //WEAPON_RIFLEGREN_US
  116. "riflegren_ger", //WEAPON_RIFLEGREN_GER
  117. "riflegren_us_live", //WEAPON_RIFLEGREN_US_LIVE
  118. "riflegren_ger_live", //WEAPON_RIFLEGREN_GER_LIVE
  119. // not actually separate weapons, but defines used in stats recording
  120. "thompson_punch", //WEAPON_THOMPSON_PUNCH
  121. "mp40_punch", //WEAPON_MP40_PUNCH
  122. "garand_zoomed", //WEAPON_GARAND_ZOOMED,
  123. "k98_zoomed", //WEAPON_K98_ZOOMED
  124. "spring_zoomed", //WEAPON_SPRING_ZOOMED
  125. "k98s_zoomed", //WEAPON_K98_SCOPED_ZOOMED
  126. "30cal_undeployed", //WEAPON_30CAL_UNDEPLOYED,
  127. "mg42_undeployed", //WEAPON_MG42_UNDEPLOYED,
  128. "bar_semiauto", //WEAPON_BAR_SEMIAUTO,
  129. "mp44_semiauto", //WEAPON_MP44_SEMIAUTO,
  130. NULL, // end of list marker
  131. };
  132. const char *m_pszHelmetModels[NUM_HELMETS] =
  133. {
  134. "models/helmets/helmet_american.mdl",
  135. "models/helmets/helmet_german.mdl",
  136. };
  137. const char *g_pszHintMessages[] =
  138. {
  139. "#Hint_spotted_a_friend",
  140. "#Hint_spotted_an_enemy",
  141. "#Hint_try_not_to_injure_teammates",
  142. "#Hint_careful_around_teammates",
  143. "#Hint_killing_enemies_is_good",
  144. "#Hint_touched_area_capture",
  145. "#Hint_touched_control_point",
  146. "#Hint_picked_up_object",
  147. "#Hint_mgs_fire_better_deployed",
  148. "#Hint_sandbag_area_touch",
  149. "#Hint_rocket_weapon_pickup",
  150. "#Hint_out_of_ammo",
  151. "#Hint_prone",
  152. "#Hint_low_stamina",
  153. "#Hint_area_requires_object",
  154. "#Hint_player_killed_wavetime",
  155. "#Hint_mg_overheat",
  156. "#game_shoulder_rpg",
  157. "#Hint_pick_up_weapon",
  158. "#Hint_pick_up_grenade",
  159. "#Hint_death_cam",
  160. "#Hint_class_menu",
  161. "#Hint_use_2e_melee",
  162. "#Hint_use_zoom",
  163. "#Hint_use_iron_sights",
  164. "#Hint_use_semi_auto",
  165. "#Hint_use_sprint",
  166. "#Hint_use_deploy",
  167. "#Hint_use_prime",
  168. "#Hint_mg_deploy_usage",
  169. "#Dod_mg_reload",
  170. "#Hint_garand_reload",
  171. "#Hint_turn_off_hints",
  172. "#Hint_need_bomb_to_plant",
  173. "#Hint_bomb_planted",
  174. "#Hint_defuse_bomb",
  175. "#Hint_bomb_target",
  176. "#Hint_bomb_pickup",
  177. "#Hint_bomb_defuse_onground",
  178. "#Hint_bomb_plant_map",
  179. "#Hint_bomb_first_select",
  180. };
  181. const char *pszTeamAlliesClasses[] =
  182. {
  183. "us_garand",
  184. "us_tommy",
  185. "us_bar",
  186. "us_spring",
  187. "us_30cal",
  188. "us_bazooka",
  189. NULL
  190. };
  191. const char *pszTeamAxisClasses[] =
  192. {
  193. "axis_k98",
  194. "axis_mp40",
  195. "axis_mp44",
  196. "axis_k98s",
  197. "axis_mg42",
  198. "axis_pschreck",
  199. NULL
  200. };
  201. const char *pszWinPanelCategoryHeaders[] =
  202. {
  203. "",
  204. "#winpanel_topbomb",
  205. "#winpanel_topcappers",
  206. "#winpanel_topdefenders",
  207. "#winpanel_kills"
  208. };
  209. const char *g_pszAchievementAwards[NUM_ACHIEVEMENT_AWARDS] =
  210. {
  211. "",
  212. "DOD_KILLS_AS_RIFLEMAN",
  213. "DOD_KILLS_AS_ASSAULT",
  214. "DOD_KILLS_AS_SUPPORT",
  215. "DOD_KILLS_AS_SNIPER",
  216. "DOD_KILLS_AS_MG",
  217. "DOD_KILLS_AS_BAZOOKAGUY",
  218. "DOD_ALL_PACK_1",
  219. };
  220. const char *g_pszAchievementAwardMaterials_Allies[NUM_ACHIEVEMENT_AWARDS] =
  221. {
  222. "sprites/player_icons/american",
  223. "sprites/player_icons/american_rifleman",
  224. "sprites/player_icons/american_assault",
  225. "sprites/player_icons/american_support",
  226. "sprites/player_icons/american_sniper",
  227. "sprites/player_icons/american_mg",
  228. "sprites/player_icons/american_rocket",
  229. "sprites/player_icons/american_hero",
  230. };
  231. const char *g_pszAchievementAwardMaterials_Axis[NUM_ACHIEVEMENT_AWARDS] =
  232. {
  233. "sprites/player_icons/german",
  234. "sprites/player_icons/german_rifleman",
  235. "sprites/player_icons/german_assault",
  236. "sprites/player_icons/german_support",
  237. "sprites/player_icons/german_sniper",
  238. "sprites/player_icons/german_mg",
  239. "sprites/player_icons/german_rocket",
  240. "sprites/player_icons/german_hero",
  241. };