Difference between revisions of "Dynamite Sapper"

From Team Fortress Wiki
Jump to: navigation, search
m (Better functionality snippet)
 
(7 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 
{{beta|experimental}}
 
{{beta|experimental}}
{{stub}}
 
 
{{Item infobox
 
{{Item infobox
 
| name          = Dynamite Sapper
 
| name          = Dynamite Sapper
Line 12: Line 11:
 
}}
 
}}
  
The '''Dynamite Sapper''' is a scrapped Spy sapper, referenced in code in some places.
+
The '''Dynamite Sapper''' is a [[scrapped]] Spy [[Sapper]], referenced in certain places within the code. It was likely to have worked like the normal Sapper, but instead of simply destroying the buildig, it would also create a damaging explosion upon completion. The internal name for the attribute related to this weapon is <tt>sapper_explodes_on_det</tt>.
 
 
<!--Begin-->#ifdef STAGING_ONLY
 
  PrecacheScriptSound( "WeaponDynamiteSapper.TickTock" );
 
  PrecacheScriptSound( "WeaponDynamiteSapper.BellRing" );
 
#endif<!--End-->
 
 
 
<!--Begin-->#ifdef STAGING_ONLY
 
  // // Attr on Det
 
  float flExplodeOnTimer = 0;
 
  CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( GetBuilder(), flExplodeOnTimer, sapper_explodes_on_det );
 
  if ( flExplodeOnTimer )
 
  {
 
      EmitSound( "Weapon_Sapper.Timer" );
 
      return "WeaponDynamiteSapper.TickTock";
 
  }
 
#endif<!--End-->
 
 
 
<!--Begin-->#ifdef STAGING_ONLY
 
  CTFPlayer *pBuilder = GetBuilder();
 
  if ( pBuilder && pParent->GetHealth() < 0 )
 
  {
 
      // Attr on Det
 
      float flExplodeOnTimer = 0;
 
      CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( pBuilder, flExplodeOnTimer, sapper_explodes_on_det );
 
 
      if ( flExplodeOnTimer )
 
      {
 
          float flDamage = pParent->GetMaxHealth() * 1.5;
 
          Vector vecOrigin = GetAbsOrigin();
 
 
          // Use the building as the det position       
 
          CTakeDamageInfo detInfo;
 
          detInfo.SetDamage( flDamage );
 
          detInfo.SetAttacker( this );
 
          detInfo.SetInflictor( this );
 
          detInfo.SetDamageType( DMG_BLAST );
 
 
          // Generate Large Radius Damage
 
          float flRadius = 200.0f;
 
          CTFRadiusDamageInfo radiusinfo( &detInfo, vecOrigin, flRadius, NULL, flRadius );
 
          TFGameRules()->RadiusDamage( radiusinfo );
 
 
          DispatchParticleEffect( "explosionTrail_seeds_mvm", vecOrigin, GetAbsAngles() );
 
      }
 
  }
 
#endif<!--End-->
 
  
 
{{Unused Content Nav}}
 
{{Unused Content Nav}}

Latest revision as of 00:22, 20 February 2024

The Dynamite Sapper is a scrapped Spy Sapper, referenced in certain places within the code. It was likely to have worked like the normal Sapper, but instead of simply destroying the buildig, it would also create a damaging explosion upon completion. The internal name for the attribute related to this weapon is sapper_explodes_on_det.