Each of the nine player classes in TF2 has a dedicated set of weapons implemented as separate C++ files underDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/sr2echa/TF2-Source-Code/llms.txt
Use this file to discover all available pages before exploring further.
game/shared/tf/. The naming convention is tf_weapon_<name>.cpp/.h. All weapons ultimately derive from CTFWeaponBase; most ranged weapons extend CTFWeaponBaseGun and melee weapons extend CTFWeaponBaseMelee.
Weapons by class
Scout
Scout
| File | Weapon |
|---|---|
tf_weapon_scattergun | Scattergun (shotgun variant) |
tf_weapon_pistol | Pistol |
tf_weapon_bat | Bat |
tf_weapon_lunchbox | Sandvich / Bonk drink items |
tf_weapon_grapplinghook | Grappling Hook |
Soldier
Soldier
| File | Weapon |
|---|---|
tf_weapon_rocketlauncher | Rocket Launcher |
tf_weapon_shotgun | Shotgun |
tf_weapon_shovel | Shovel |
tf_weapon_buff_item | Buff Banner / War Banner |
tf_weapon_rocketpack | Thermal Thruster |
tf_weapon_parachute | BASE Jumper |
Pyro
Pyro
| File | Weapon |
|---|---|
tf_weapon_flamethrower | Flamethrower |
tf_weapon_shotgun | Shotgun (shared) |
tf_weapon_fireaxe | Fire Axe |
tf_weapon_flaregun | Flare Gun |
tf_weapon_jar | Jarate / Gas Passer |
tf_weapon_throwable | Thermal Thruster throwables |
Demoman
Demoman
| File | Weapon |
|---|---|
tf_weapon_grenadelauncher | Grenade Launcher |
tf_weapon_pipebomblauncher | Stickybomb Launcher |
tf_weapon_bottle | Bottle |
tf_weapon_sword | Eyelander / Claymore |
tf_weapon_stickbomb | Ullapool Caber |
tf_weapon_grenade_pipebomb | Pipebomb projectile |
Heavy
Heavy
| File | Weapon |
|---|---|
tf_weapon_minigun | Minigun |
tf_weapon_shotgun | Shotgun (shared) |
tf_weapon_fists | Fists |
tf_weapon_lunchbox | Sandvich (shared item slot) |
Engineer
Engineer
| File | Weapon |
|---|---|
tf_weapon_shotgun | Shotgun (shared) |
tf_weapon_pistol | Pistol (shared) |
tf_weapon_wrench | Wrench |
tf_weapon_pda | Build/Destroy PDA |
tf_weapon_laser_pointer | Wrangler |
tf_weapon_mechanical_arm | Gunslinger |
Medic
Medic
| File | Weapon |
|---|---|
tf_weapon_syringegun | Syringe Gun |
tf_weapon_medigun | Medi Gun |
tf_weapon_bonesaw | Bonesaw |
Sniper
Sniper
| File | Weapon |
|---|---|
tf_weapon_sniperrifle | Sniper Rifle |
tf_weapon_smg | SMG |
tf_weapon_club | Kukri |
tf_weapon_compound_bow | Huntsman |
tf_weapon_jar | Jarate (shared) |
tf_weapon_decoy | Decoy |
Spy
Spy
| File | Weapon |
|---|---|
tf_weapon_revolver | Revolver |
tf_weapon_invis | Invisibility Watch |
tf_weapon_knife | Knife |
tf_weapon_pda | Sapper (PDA variant) |
Notable implementation patterns
Medi Gun — beam healing
CWeaponMedigun (in tf_weapon_medigun.h) extends CTFWeaponBaseGun and supports four weapon sub-types:
MedigunEffects_t structs keyed by charge type. The weapon maintains a beam to a single healing target (MAX_HEALING_TARGETS 1) and tracks the target via a CTFReviveMarker handle for MvM revival.
Flamethrower — state machine and airblast
CTFFlameThrower (in tf_weapon_flamethrower.h) extends CTFWeaponBaseGun and on the server also implements CGameEventListener. Firing is controlled by a four-state enum:
CTFFlameRocket entity, not a hitscan trace, which is why flames have travel time and can be reflected.