Skip to content

Instantly share code, notes, and snippets.

@sigsegv-mvm
Last active January 31, 2023 12:50
Show Gist options
  • Save sigsegv-mvm/f72e3047c58dc2674493 to your computer and use it in GitHub Desktop.
Save sigsegv-mvm/f72e3047c58dc2674493 to your computer and use it in GitHub Desktop.
Documentation for attribute class "set_weapon_mode"
"set_weapon_mode" attribute documentation
accurate as of TF2 version ~20160327 (updated for ~20190501)
reverse engineering by sigsegv
General Notes
=============
There are many attributes in the game that map to attribute class "set_weapon_mode", with many different names:
- "fists have radial buff"
- "set cloak is feign death"
- "mod bat launches balls"
- "sniper no headshots"
- "set cloak is movement based"
- "revolver use hit locations"
- "mod shovel damage boost"
- "lunchbox adds maxhealth bonus"
- "lunchbox adds minicrits"
- "mod shovel speed boost"
- "mod bat launches ornaments"
- "set icicle knife mode"
- "mod flaregun fires pellets with knockback"
They all do the exact same thing though. All that really changes is the descriptions.
If you happen to want the features from more than one set_weapon_mode value on the same item at once: sorry, that's not possible.
Knives (tf_weapon_knife)
========================
Knife Mode 0
Big Earner Mode 0
Your Eternal Reward Mode 1
Conniver's Kunai Mode 1
Spy-cicle Mode 3
Mode 1:
- Suppresses automatic voice response MP_CONCEPT_KILLED_PLAYER after a kill
- When the weapon is active, sentries are unable to target you if you're in the process of disguising (i.e. not fully disguised)
- Enables some ancient code related to YER's auto-disguise mechanic, likely from before "set_disguise_on_backstab" was invented
(apparently the knife weapon itself would basically just spam the disguise button every frame)
Mode 2:
- Doesn't do anything in the current version of TF2
Mode 3: "set icicle knife mode"
- Enables the HUD recharge bar for the knife
Notes:
- It appears that most or all knife features were originally done by "set_weapon_mode" but were later separated into their own attributes
- Things which you might expect to be controlled by "set_weapon_mode" which are actually controlled by other attributes:
- YER's disguise-on-backstab and cannot-disguise-normally mechanics
- Kunai's health-on-backstab mechanic
- The "silent killer" mechanic
- All of the Spy-cicle's special features, aside from the HUD recharge bar itself
Fists/Gloves (tf_weapon_fists)
==============================
Fists Mode 0
KGB Mode 0
Warrior's Spirit Mode 0
Fists of Steel Mode 0
Eviction Notice Mode 0
Holiday Punch Mode 0
GRU Mode 2
GRU MvM Mode 2
Mode 1: "fists have radial buff"
- This is a relic of a weapon concept that never made it into the game
- Disallows normal taunts
- Killing an enemy with the weapon forces its user to taunt
- Taunting results in a 1.0 second delay, followed by a radius effect on teammates within 1024 HU:
- Gives 50 health
- Applies a 0.5 second temporary +10% crit chance buff
- (TAUNTATK_HEAVY_RADIAL_BUFF)
Mode 2:
- Doesn't do anything in the current version of TF2
Flare Guns (tf_weapon_flaregun and tf_weapon_flaregun_revenge)
==============================================================
Flare Gun Mode 0
Detonator Mode 1
Manmelter Mode 2
Scorch Shot Mode 3
Mode 1:
- Enables alt-fire for flare detonation
- Enables flare radius damage
- Reduces crits on burning players to mini-crits
Mode 2:
- Disables crit-on-hit mechanic
- Changes projectile trail particle to "drg_manmelter_projectile"
- Enables the reload indicator particles and sounds
Mode 3: "mod flaregun fires pellets with knockback"
- Enables flare radius damage
- Enables the projectile-surviving-after-impact mechanic
- Reduces crits on burning players to mini-crits
Sandviches (tf_weapon_lunchbox)
===============================
Sandvich Mode 0
Dalokohs Bar Mode 1
Buffalo Steak Sandvich Mode 2
Robo-Sandvich Mode 3
Festive Sandvich Mode 4
Second Banana Mode 6
Fishcake Mode 7
Mode 1: "lunchbox adds maxhealth bonus"
- Reduces the healing per bite from 75 to 25
- Adds attribute "hidden maxhealth non buffed" 50, for 30 seconds
- Reduces recharge time to 10 seconds (instead of 30 seconds)
- Alt-fire drops item_healthkit_small instead of item_healthkit_medium
- Makes the dropped healthkit use the candy bar model
Mode 2: "lunchbox adds minicrits"
- Applies no healing when used
- Adds condition TF_COND_ENERGY_BUFF for 16 seconds
- Adds condition TF_COND_COND_CANNOT_SWITCH_FROM_MELEE for 16 seconds
- Makes the dropped healthkit use the steak model
Mode 3:
- Makes the dropped healthkit use the robo-sandvich model
Mode 4:
- Makes the dropped healthkit use the festive sandvich model
Mode 5:
- Appears to be an unfinished "ammo sandvich" mechanic
- Each bite restores 25% of your max primary ammo (100% total)
- It still restores 75hp per bite as well (same as regular sandvich)
- Eating it at 100% health doesn't reset the effect bar but does refill your ammo
Mode 6:
- Same as Mode 1
- Also: Alt-fire drops item_healthkit_small instead of item_healthkit_medium
- Also: Makes the dropped healthkit use the banana model
Mode 7:
- Same as Mode 1
- Also: Makes the dropped healthkit use the fishcake model
Drinks (tf_weapon_lunchbox_drink)
=================================
Bonk Mode 0
Crit-a-Cola Mode 2
Mode 1:
- Doesn't do anything in the current version of TF2
Mode 2:
- Changes the condition applied from TF_COND_PHASE to TF_COND_ENERGY_BUFF
- Alters the particles produced by the weapon
Mode 3:
- Appears to possibly be referenced in a couple of places (doesn't do much, though)
Invis Watches (tf_weapon_invis)
===============================
Invis Watch Mode 0
Dead Ringer Mode 1
Cloak and Dagger Mode 2
Mode 1: "set cloak is feign death"
- Enables feign death cloak mechanic
Mode 2: "set cloak is movement based"
- Enables motion-sensitive cloak mechanic
Revolvers (tf_weapon_revolver)
==============================
Revolver Mode 0
L'Etranger Mode 0
Enforcer Mode 0
Diamondback Mode 0
Ambassador Mode 1
Mode 1: "revolver use hit locations"
- Disallows random crits
- Adds damage bit DMG_USE_HITLOCATIONS if last shot was more than a second ago (enables headshots)
- Weapon spread is calculated differently, based on the time since the last shot
- Crosshair scale changes based on the time since the last shot
Shovels (tf_weapon_shovel)
==========================
Shovel Mode 0
Pain Train Mode 0
Market Gardener Mode 0
Disciplinary Action Mode 0
Equalizer Mode 1
Escape Plan Mode 2
Mode 1: "mod shovel damage boost"
- Uses pickaxe kill icon (TF_DMG_CUSTOM_PICKAXE)
- Enables the health-based damage boost mechanic
Mode 2: "mod shovel speed boost"
- Uses pickaxe kill icon (TF_DMG_CUSTOM_PICKAXE)
- Enables the health-based speed boost mechanic
Notes:
- The Half-Zatoichi is not a shovel
Mediguns (tf_weapon_medigun)
============================
Medi Gun Mode 0
Kritzkrieg Mode 1
Quick-Fix Mode 2
Vaccinator Mode 3
Mode 1:
- Changes ubercharge effect to critical
Mode 2:
- Changes ubercharge effect to megaheal
- Enables the Quick Fix's movement speed mirroring effect
- Enables the Quick Fix's demo charge mirroring effect
- Enables the Quick Fix's explosive jump mirroring effect
- Enables the self-heal mechanic
- Changes the heal sound
Mode 3:
- Changes ubercharge effect to resistance bubble things
- Enables passive resistance on heal target
- Enables resistance cycling
- Enables Vaccinator-related TFBot AI logic for ubering and cycling resistances
- Changes the heal sound
- Enables "chunked" ubers of less than 100%
Notes:
- The "set_charge_type" attribute is mostly independent of "set_weapon_mode", so weird combinations may be possible
- Example: a medigun that has QF-like movement abilities yet gives a kritzkrieg-like ubercharge effect
- However, Vaccinator needs "set_weapon_mode" 3 for it to know that it has 3 possible charge conditions
Flamethrowers (tf_weapon_flamethrower)
======================================
Flame Thrower Mode 0
Backburner Mode 0
Degreaser Mode 0
Phlogistinator Mode 1
Rainblower Mode 3
Mode 1:
- Changes flame particle effect to "drg_phlo_stream"/"drg_phlo_stream_crit"
Mode 2:
- Changes flame particle effect to "flamethrower_giant_mvm"/"flamethrower_crit_giant_mvm"
Mode 3:
- Changes flame particle effect to "flamethrower_rainbow"/"flamethrower_rainbow_FP"
- Changes world model to the bubble wand while taunting
- Changes the the flamethrower sound effect
Notes:
- The Dragon's Fury is not a flamethrower
- Mode 2 was clearly intended for the "MVM Giant Flamethrower" item
- Would have had scaled-up flame particles to make it look less wimpy
- Presumably it would have had its actual flame reach extended as well
- As far as I know, this item never actually made it into items_game.txt
- There is still a reference to this item in the TFBot code to this day:
pyro bots who have it will believe their effective range is 875 HU instead of 250 HU
SMGs (tf_weapon_smg and tf_weapon_charged_smg)
==============================================
SMG Mode 0
Cleaner's Carbine Mode 0
Mode 1:
- Disallows random crits
- Adds damage bit DMG_USE_HITLOCATIONS (enables headshots)
Ball Bats (tf_weapon_bat_wood and tf_weapon_bat_giftwrap)
=========================================================
Sandman Mode 1
Wrap Assassin Mode 1
Mode 1: "mod bat launches balls"/"mod bat launches ornaments"
- Allows creation of the ball projectile
Notes:
- Regular bats (tf_weapon_bat) are unable to create ball projectiles, so don't waste your time trying that
Sniper Rifles (tf_weapon_sniperrifle and tf_weapon_sniperrifle_decap and tf_weapon_sniperrifle_classic)
=======================================================================================================
Sniper Rifle Mode 0
Bazaar Bargain Mode 0
Hitman's Heatmaker Mode 0
Sydney Sleeper Mode 1
Machina Mode 2
Classic Mode 3
Mode 1:
- Disallows critical hits unless the player is crit boosted (effectively disables headshot crit bonus)
Mode 2:
- Doesn't do anything in the current version of TF2
Mode 3:
- If the tracer attribute is enabled, changes the tracer effect to "tfc_sniper_distortion_trail"
Syringe Guns (tf_weapon_syringegun_medic)
=========================================
Syringe Gun Mode 0
Blutsauger Mode 0
Overdose Mode 1
Mode 1:
- Enables the ubercharge-level-based speed boost mechanic
Notes:
- The crossbow is not a syringe gun
Power Up Canteens (tf_weapon_powerup_bottle)
============================================
Battery Canteens Mode 0
Kritz Or Treat Canteen Mode 0
Power Up Canteen Mode 1
Mode 0:
- The skin index (0 or 1) is used to indicate whether the canteen has a charge
Mode 1:
- The world model is changed to indicate whether the canteen has a charge and the charge type
Bonesaws (tf_weapon_bonesaw)
============================
Bonesaw Mode 0
Amputator Mode 0
Solemn Vow Mode 0
Ubersaw Mode 1
Vita-Saw Mode 2
Mode 1:
- Doesn't do anything in the current version of TF2
- Was used to force the ubersaw taunt before "special_taunt" was invented
Mode 2:
- Doesn't do anything in the current version of TF2
- Was used to force the vita-saw taunt before "special_taunt" was invented
Mode 3:
- Doesn't do anything in the current version of TF2
- Was used to force the amputator taunt before "special_taunt" was invented
Miniguns (tf_weapon_minigun)
============================
Minigun Mode 0
Brass Beast Mode 0
Tomislav Mode 0
Huo-Long Heater Mode 0
Natascha Mode 1
Mode 1:
- Doesn't do anything in the current version of TF2
Bows (tf_weapon_compound_bow and tf_weapon_crossbow)
====================================================
Huntsman Mode 0
Crusader's Crossbow Mode 1
Mode 1: "sniper no headshots"
- Doesn't do anything in the current version of TF2
- In old versions of TF2, this was responsible for disallowing headshots with the crossbow
(nowadays, it's hard-coded into the game based on the projectile type)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment