Skip to content
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
50 changes: 25 additions & 25 deletions src/game/server/tf/tf_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14085,31 +14085,31 @@ int CTFPlayer::GiveAmmo( int iCount, int iAmmoIndex, bool bSuppressSound, EAmmoS
// ammo.
if ( iAmmoIndex != TF_AMMO_METAL )
{
//int iAmmoBecomesHealth = 0;
//CALL_ATTRIB_HOOK_INT( iAmmoBecomesHealth, ammo_becomes_health );
//if ( iAmmoBecomesHealth == 1 )
//{
// // Ammo from ground pickups is converted to health.
// if ( eAmmoSource == kAmmoSource_Pickup )
// {
// int iTakenHealth = TakeHealth( iCount, DMG_GENERIC );
// if ( iTakenHealth > 0 )
// {
// if ( !bSuppressSound )
// {
// EmitSound( "BaseCombatCharacter.AmmoPickup" );
// }
// m_Shared.HealthKitPickupEffects( iCount );
// }
// return iTakenHealth;
// }

// // Ammo from the cart or engineer dispensers is flatly ignored.
// if ( eAmmoSource == kAmmoSource_DispenserOrCart )
// return 0;

// Assert( eAmmoSource == kAmmoSource_Resupply );
//}
int iAmmoBecomesHealth = 0;
CALL_ATTRIB_HOOK_INT( iAmmoBecomesHealth, ammo_becomes_health );
if ( iAmmoBecomesHealth == 1 )
{
// Ammo from ground pickups is converted to health.
if ( eAmmoSource == kAmmoSource_Pickup )
{
int iTakenHealth = TakeHealth( iCount, DMG_GENERIC );
if ( iTakenHealth > 0 )
{
if ( !bSuppressSound )
{
EmitSound( "BaseCombatCharacter.AmmoPickup" );
}
m_Shared.HealthKitPickupEffects( iCount );
}
return iTakenHealth;
}

// Ammo from the cart or engineer dispensers is flatly ignored.
if ( eAmmoSource == kAmmoSource_DispenserOrCart )
return 0;

Assert( eAmmoSource == kAmmoSource_Resupply );
}

// Items that rely on timers to refill ammo use these attributes
// Prevents "touch supply closet and spam the thing" scenario.
Expand Down
30 changes: 15 additions & 15 deletions src/game/shared/tf/tf_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6278,21 +6278,21 @@ bool CTFGameRules::ApplyOnDamageModifyRules( CTakeDamageInfo &info, CBaseEntity
}

//// Some weapons minicrit *any* target in the air, regardless of how they got there.
//int iMiniCritAirborneDeploy = 0;
//CALL_ATTRIB_HOOK_INT_ON_OTHER( pWeapon, iMiniCritAirborneDeploy, mini_crit_airborne_deploy );
//if ( iMiniCritAirborneDeploy > 0 &&
// pWeapon &&
// ( gpGlobals->curtime - pWeapon->GetLastDeployTime() ) < iMiniCritAirborneDeploy &&
// //

// pVictim && !( pVictim->GetFlags() & FL_ONGROUND ) &&
// ( pVictim->GetWaterLevel() == WL_NotInWater ) )
//{
// bAllSeeCrit = true;
// info.SetCritType( CTakeDamageInfo::CRIT_MINI );
// eBonusEffect = kBonusEffect_MiniCrit;
// break;
//}
int iMiniCritAirborneDeploy = 0;
CALL_ATTRIB_HOOK_INT_ON_OTHER( pWeapon, iMiniCritAirborneDeploy, mini_crit_airborne_deploy );
if ( iMiniCritAirborneDeploy > 0 &&
pWeapon &&
( gpGlobals->curtime - pWeapon->GetLastDeployTime() ) < iMiniCritAirborneDeploy &&

pVictim && !( pVictim->GetFlags() & FL_ONGROUND ) &&
( pVictim->GetWaterLevel() == WL_NotInWater ) )
{
bAllSeeCrit = true;
info.SetCritType( CTakeDamageInfo::CRIT_MINI );
eBonusEffect = kBonusEffect_MiniCrit;
break;
}
}
}

Expand Down
33 changes: 16 additions & 17 deletions src/game/shared/tf/tf_weaponbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ const char *CTFWeaponBase::GetViewModel( int iViewModel ) const
int iHandModelIndex = 0;
if ( pPlayer )
{
//CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( pPlayer, iHandModelIndex, override_hand_model_index ); // this is a cleaner way of doing it, but...
CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( pPlayer, iHandModelIndex, override_hand_model_index ); // this is a cleaner way of doing it, but...
CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( pPlayer, iHandModelIndex, wrench_builds_minisentry ); // ...the gunslinger is the only thing that uses this attribute for now
}

Expand Down Expand Up @@ -2257,19 +2257,19 @@ void CTFWeaponBase::SetReloadTimer( float flReloadTime )
CALL_ATTRIB_HOOK_FLOAT( flReloadTime, fast_reload );
CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( pPlayer, flReloadTime, hwn_mult_reload_time );

//int iPanicAttack = 0;
//CALL_ATTRIB_HOOK_INT( iPanicAttack, panic_attack );
//if ( iPanicAttack )
//{
// if ( pPlayer->GetHealth() < pPlayer->GetMaxHealth() * 0.33f )
// {
// flReloadTime *= 0.3f;
// }
// else if ( pPlayer->GetHealth() < pPlayer->GetMaxHealth() * 0.66f )
// {
// flReloadTime *= 0.6f;
// }
//}
int iPanicAttack = 0;
CALL_ATTRIB_HOOK_INT( iPanicAttack, panic_attack );
if ( iPanicAttack )
{
if ( pPlayer->GetHealth() < pPlayer->GetMaxHealth() * 0.33f )
{
flReloadTime *= 0.3f;
}
else if ( pPlayer->GetHealth() < pPlayer->GetMaxHealth() * 0.66f )
{
flReloadTime *= 0.6f;
}
}

// Haste Powerup Rune adds multiplier to reload time.
if ( pPlayer->m_Shared.GetCarryingRuneType() == RUNE_HASTE )
Expand Down Expand Up @@ -5316,15 +5316,14 @@ void CTFWeaponBase::ApplyOnHitAttributes( CBaseEntity *pVictimBaseEntity, CTFPla
}

// Damage bonus on hit
// Disabled because we have no attributes that use it
/*

float flAddDamageDoneBonusOnHit = 0;
CALL_ATTRIB_HOOK_FLOAT( flAddDamageDoneBonusOnHit, addperc_ondmgdone_tmpbuff );
if ( flAddDamageDoneBonusOnHit )
{
pAttacker->m_Shared.AddTmpDamageBonus( flAddDamageDoneBonusOnHit, 10.0 );
}
*/


if ( pVictim )
{
Expand Down
15 changes: 7 additions & 8 deletions src/game/shared/tf/tf_weaponbase_gun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,12 +706,12 @@ CBaseEntity *CTFWeaponBaseGun::FirePipeBomb( CTFPlayer *pPlayer, int iPipeBombTy
pProjectile->SetCritical( IsCurrentAttackACrit() );
pProjectile->SetLauncher( this );

//float flFizzle = 0;
//CALL_ATTRIB_HOOK_FLOAT( flFizzle, stickybomb_fizzle_time );
//if ( flFizzle )
//{
// pProjectile->SetDetonateTimerLength( flFizzle );
//}
float flFizzle = 0;
CALL_ATTRIB_HOOK_FLOAT( flFizzle, stickybomb_fizzle_time );
if ( flFizzle )
{
pProjectile->SetDetonateTimerLength( flFizzle );
}
CAttribute_String attrCustomModelName;
GetCustomProjectileModel( &attrCustomModelName );
if ( attrCustomModelName.has_value() )
Expand Down Expand Up @@ -1054,8 +1054,7 @@ void CTFWeaponBaseGun::ZoomIn( void )
// TODO: The weapon fov should be gotten from the script file.
float fBaseZoom = TF_WEAPON_ZOOM_FOV;

// Disabled this for now, because we have no attributes using it
//CALL_ATTRIB_HOOK_FLOAT( fBaseZoom, mult_zoom_fov );
CALL_ATTRIB_HOOK_FLOAT( fBaseZoom, mult_zoom_fov );

pPlayer->SetFOV( pPlayer, fBaseZoom, 0.1f );
pPlayer->m_Shared.AddCond( TF_COND_ZOOMED );
Expand Down