Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TF2] Restore the Shred Alert's tauntkill (behind a cvar) #1114

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions src/game/client/tf/c_tf_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -818,8 +818,10 @@ void C_TFRagdoll::CreateTFRagdoll()
}

// did we find a death sequence?
if ( iDeathSeq > -1 && (m_iDamageCustom != TF_DMG_CUSTOM_TAUNTATK_BARBARIAN_SWING) &&
(m_iDamageCustom != TF_DMG_CUSTOM_TAUNTATK_ENGINEER_GUITAR_SMASH) && (m_iDamageCustom != TF_DMG_CUSTOM_TAUNTATK_ALLCLASS_GUITAR_RIFF) )
if ( iDeathSeq > -1
&& (m_iDamageCustom != TF_DMG_CUSTOM_TAUNTATK_BARBARIAN_SWING)
&& (m_iDamageCustom != TF_DMG_CUSTOM_TAUNTATK_ENGINEER_GUITAR_SMASH)
&& (m_iDamageCustom != TF_DMG_CUSTOM_TAUNTATK_ALLCLASS_GUITAR_RIFF) )
{
// we only want to show the death anims 25% of the time, unless this is a demoman kill taunt
// always play backstab animations for the ice ragdoll
Expand Down Expand Up @@ -1238,7 +1240,11 @@ void C_TFRagdoll::OnDataChanged( DataUpdateType_t type )
CreateTFRagdoll();
if ( IsDecapitation() )
{
CreateTFHeadGib();
// no head gib if their minds are blown
if ( m_iDamageCustom != TF_DMG_CUSTOM_TAUNTATK_ALLCLASS_GUITAR_RIFF )
{
CreateTFHeadGib();
}
EmitSound( "TFPlayer.Decapitated" );

bool bBlood = true;
Expand Down Expand Up @@ -1301,7 +1307,8 @@ bool C_TFRagdoll::IsDecapitation()
|| (m_iDamageCustom == TF_DMG_CUSTOM_TAUNTATK_BARBARIAN_SWING)
|| (m_iDamageCustom == TF_DMG_CUSTOM_DECAPITATION_BOSS)
|| (m_iDamageCustom == TF_DMG_CUSTOM_HEADSHOT_DECAPITATION)
|| (m_iDamageCustom == TF_DMG_CUSTOM_MERASMUS_DECAPITATION) );
|| (m_iDamageCustom == TF_DMG_CUSTOM_MERASMUS_DECAPITATION)
|| (m_iDamageCustom == TF_DMG_CUSTOM_TAUNTATK_ALLCLASS_GUITAR_RIFF) );
}

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -10060,7 +10067,8 @@ static bool IsDecapitationCustomDamageType( int iCustomDamageType )
return iCustomDamageType == TF_DMG_CUSTOM_DECAPITATION
|| iCustomDamageType == TF_DMG_CUSTOM_TAUNTATK_BARBARIAN_SWING
|| iCustomDamageType == TF_DMG_CUSTOM_DECAPITATION_BOSS
|| iCustomDamageType == TF_DMG_CUSTOM_MERASMUS_DECAPITATION;
|| iCustomDamageType == TF_DMG_CUSTOM_MERASMUS_DECAPITATION
|| iCustomDamageType == TF_DMG_CUSTOM_TAUNTATK_ALLCLASS_GUITAR_RIFF;
}

void C_TFPlayer::CreateBoneAttachmentsFromWearables( C_TFRagdoll *pRagdoll, bool bDisguised )
Expand Down
6 changes: 5 additions & 1 deletion src/game/server/tf/tf_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ ConVar tf_highfive_max_range( "tf_highfive_max_range", "150", FCVAR_CHEAT | FCVA
ConVar tf_highfive_height_tolerance( "tf_highfive_height_tolerance", "12", FCVAR_CHEAT | FCVAR_DEVELOPMENTONLY, "The maximum height difference allowed for two high-fivers." );
ConVar tf_highfive_debug( "tf_highfive_debug", "0", FCVAR_NONE, "Turns on some console spew for debugging high five issues." );

ConVar tf_allow_econ_tauntkill( "tf_allow_econ_tauntkill", "0", FCVAR_NOTIFY, "Allow equippable taunts to tauntkill." );

ConVar tf_test_teleport_home_fx( "tf_test_teleport_home_fx", "0", FCVAR_CHEAT );

ConVar tf_halloween_giant_health_scale( "tf_halloween_giant_health_scale", "10", FCVAR_CHEAT );
Expand Down Expand Up @@ -18745,7 +18747,7 @@ void CTFPlayer::DoTauntAttack( void )
SpawnClientsideFlyingBird( vecPos );
}
}
else if ( iTauntAttack == TAUNTATK_PYRO_ARMAGEDDON )
else if ( iTauntAttack == TAUNTATK_PYRO_ARMAGEDDON || ( tf_allow_econ_tauntkill.GetBool() && iTauntAttack == TAUNTATK_ALLCLASS_GUITAR_RIFF_EXPLODE ) )
{
Vector origin( GetAbsOrigin() );

Expand Down Expand Up @@ -18841,6 +18843,8 @@ void CTFPlayer::DoTauntAttack( void )
}
else if ( iTauntAttack == TAUNTATK_ALLCLASS_GUITAR_RIFF )
{
m_iTauntAttack = TAUNTATK_ALLCLASS_GUITAR_RIFF_EXPLODE;
m_flTauntAttackTime = gpGlobals->curtime + 3.13f;
// We need to parent this to a target instead of the player because the player changing their camera view can twist the rainbow
CBaseEntity *pTarget = CreateEntityByName( "info_target" );
if ( pTarget )
Expand Down
1 change: 1 addition & 0 deletions src/game/shared/tf/tf_player_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13332,6 +13332,7 @@ int CTFPlayerShared::GetSequenceForDeath( CBaseAnimating* pRagdoll, bool bBurnin
case TF_DMG_CUSTOM_TAUNTATK_BARBARIAN_SWING:
case TF_DMG_CUSTOM_DECAPITATION:
case TF_DMG_CUSTOM_HEADSHOT:
case TF_DMG_CUSTOM_TAUNTATK_ALLCLASS_GUITAR_RIFF:
iDeathSeq = pRagdoll->LookupSequence( "primary_death_headshot" );
break;
case TF_DMG_CUSTOM_BACKSTAB:
Expand Down
1 change: 1 addition & 0 deletions src/game/shared/tf/tf_shareddefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,7 @@ static const char* taunt_attack_name[] =
"TAUNTATK_ALLCLASS_GUITAR_RIFF",
"TAUNTATK_MEDIC_HEROIC_TAUNT",
"TAUNTATK_PYRO_GASBLAST",
"TAUNTATK_ALLCLASS_GUITAR_RIFF_EXPLODE",

//
// INSERT NEW ITEMS HERE TO AVOID BREAKING DEMOS
Expand Down
1 change: 1 addition & 0 deletions src/game/shared/tf/tf_shareddefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,7 @@ enum taunt_attack_t
TAUNTATK_ALLCLASS_GUITAR_RIFF,
TAUNTATK_MEDIC_HEROIC_TAUNT,
TAUNTATK_PYRO_GASBLAST,
TAUNTATK_ALLCLASS_GUITAR_RIFF_EXPLODE,

//
// INSERT NEW ITEMS HERE TO AVOID BREAKING DEMOS
Expand Down