Skip to content

Instantly share code, notes, and snippets.

@sigsegv-mvm
Last active March 30, 2024 03:28
Show Gist options
  • Save sigsegv-mvm/7c2142fba3a8e5d1b07dd91dc2e44f74 to your computer and use it in GitHub Desktop.
Save sigsegv-mvm/7c2142fba3a8e5d1b07dd91dc2e44f74 to your computer and use it in GitHub Desktop.
Destroy Projectiles: old vs new

The Destroy Projectiles upgrade before and after the Two Cities Update

Here's Valve's vague description of how the minigun's Destroy Projectiles upgrade/bot-ability was changed in the Two Cities update:

- Heavy
  - Attack Projectiles Upgrade
    - Now has two levels
      - Level one is less effective than before
      - Level two is more effective than level one used to be
    - Price reduced from 600 to 400 per point

The purpose of this article is to document the actual, precise details of what was changed.

Deflection cylinder radius

Before: the radius is always 48 HU (i.e. projectiles must be within 48 HU of an imaginary line extending forth from your head along your aim direction to be eligible for deflection)

After: the radius is 56 HU if the shooter is a MiniBoss; 38 HU otherwise

(visualization of the post-update cylinder)

Deflection range

Before: 256 HU radius sphere located 256 HU in front of the shooter's head in the direction they're aiming (roughly 512 HU effective range)

After: 300 HU radius sphere located 300 HU in front of the shooter's head in the direction they're aiming (roughly 600 HU effective range)

Deflection interval

Before: the minigun does its deflect-projectiles check every 100 ms; if one or more projectiles are destroyed in a given check, then there's a 500 ms cooldown (effectively +400 ms) before the next deflect-projectiles check will occur

After: the minigun does its deflect-projectiles check every 100 ms; if one or more projectiles are destroyed in a given check, then there's a 300 ms cooldown (effectively +200 ms) before the next deflect-projectiles check will occur

(NOTE: I've previously stated in a few places that the post-Two-Cities level-1-upgrade check always occurs every 300 ms; upon closer inspection I've realized that this was actually incorrect.)

Projectile hit-points

Before: projectiles are always destroyed with 1 hit

After: if the minigun has upgrade level 1 and is not full-critting, then projectiles take 2 hits to destroy; otherwise they require just 1 hit

Projectiles eligible for deflection

Before:

  • rocket-type projectiles: normal rockets, cow mangler energy balls, sentry rockets, flame rockets, all flares, huntsman arrows, crossbow bolts, rescue ranger bolts
  • grenade-type projectiles: grenades, stickybombs, cannonballs, jarate jars, milk jars, cleavers, sandman balls, wrap assassin ornaments

(projectiles listed with strikeout are ones that would be deflectable, but which are explicitly excluded by the game code based on the projectile's weapon ID)

After:

  • rocket-type projectiles: normal rockets, cow mangler energy balls, sentry rockets
  • grenade-type projectiles: grenades, stickybombs, cannonballs, jarate jars, milk jars, cleavers

(the manner in which the game code decides which projectile types are deflectable was reworked to be more robust: it's now a matter of a virtual function call and overrides to that function in the class hierarchy, rather than just a couple of dynamic_casts and a few weapon ID exclusions from that)

Other restrictions on projectile eligibility for deflection

Before:

  • rocket-type projectiles are un-deflectable for first 0.25 seconds after spawning
  • grenade-type projectiles are un-deflectable for first 1.00 seconds after spawning
  • grenade-type projectiles cannot be deflected if they are on the ground (FL_ONGROUND)

After:

  • all projectiles are un-deflectable for the first 0.25 seconds after spawning
  • all projectiles cannot be deflected if they are on the ground (FL_ONGROUND)

Bonus points awarded for deflection

Before: each deflected projectile gives the heavy 0.4 bonus points

After: each deflected projectile gives the heavy 0.2 bonus points

A table showing some of these differences

Comparison table

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment