爆破工兵

From Team Fortress Wiki
< Dynamite Sapper
Revision as of 10:35, 11 July 2020 by Vtopl749 (talk | contribs) (Created page with "{{DISPLAYTITLE:Dynamite Sapper}} {{beta|experimental}} {{stub}} {{Item infobox | name = | type = weapon | unused = yes | image = Unknownw...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Warning: Display title "爆破工兵" overrides earlier display title "Dynamite Sapper".

Dynamite Sapper 是间谍已被废弃的电子工兵武器,通过查阅部分代码可知。该武器与其他电子工兵大致相同,但会在被引爆时,对范围内的敌人造成大量伤害。

#ifdef STAGING_ONLY	
 PrecacheScriptSound( "WeaponDynamiteSapper.TickTock" );
 PrecacheScriptSound( "WeaponDynamiteSapper.BellRing" );
#endif
#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
#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