mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2025-04-08 11:01:33 +00:00
Merge ee08604dcf
into 65aa7c910e
This commit is contained in:
commit
1c6ca3f7e6
3 changed files with 15 additions and 10 deletions
|
@ -2890,11 +2890,11 @@ void CTFPlayerShared::ConditionGameRulesThink( void )
|
|||
#endif // DEBUG
|
||||
|
||||
// which degree are we burning?
|
||||
if ( m_flAfterburnDuration >= tf_afterburn_duration_ratio_third_degree * tf_afterburn_max_duration )
|
||||
if ( m_flAfterburnDuration >= tf_afterburn_duration_ratio_third_degree * m_flAfterburnMaxDuration )
|
||||
{
|
||||
flBurnDamage *= tf_afterburn_mult_third_degree;
|
||||
}
|
||||
else if ( m_flAfterburnDuration >= tf_afterburn_duration_ratio_second_degree * tf_afterburn_max_duration )
|
||||
else if ( m_flAfterburnDuration >= tf_afterburn_duration_ratio_second_degree * m_flAfterburnMaxDuration )
|
||||
{
|
||||
flBurnDamage *= tf_afterburn_mult_second_degree;
|
||||
}
|
||||
|
@ -6625,12 +6625,18 @@ void CTFPlayerShared::Burn( CTFPlayer *pAttacker, CTFWeaponBase *pWeapon, float
|
|||
static float s_flReachMaxAfterburnTime = 0.f;
|
||||
#endif // DEBUG
|
||||
|
||||
// Cache mult_wpn_burntime instead of calling hook every time
|
||||
float flMultWpnBurntime = 1.0f;
|
||||
CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( pWeapon, flMultWpnBurntime, mult_wpn_burntime );
|
||||
|
||||
if ( !InCond( TF_COND_BURNING ) )
|
||||
{
|
||||
// Start burning
|
||||
AddCond( TF_COND_BURNING, -1.f, pAttacker );
|
||||
m_flFlameBurnTime = gpGlobals->curtime + TF_BURNING_FREQUENCY;
|
||||
m_flAfterburnMaxDuration = tf_afterburn_max_duration * flMultWpnBurntime; // Updated only when starting to burn
|
||||
m_flAfterburnDuration = pWeapon ? pWeapon->GetInitialAfterburnDuration() : 0.f;
|
||||
m_flAfterburnDuration *= flMultWpnBurntime;
|
||||
|
||||
// Reduces direct healing effectiveness
|
||||
AddCond( TF_COND_HEALING_DEBUFF, m_flAfterburnDuration, pAttacker );
|
||||
|
@ -6713,8 +6719,6 @@ void CTFPlayerShared::Burn( CTFPlayer *pAttacker, CTFWeaponBase *pWeapon, float
|
|||
flFlameLife = flBurningTime;
|
||||
}
|
||||
|
||||
CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( pWeapon, flFlameLife, mult_wpn_burntime );
|
||||
|
||||
// flame immunity will always have a fixed duration
|
||||
if ( bAfterburnImmunity )
|
||||
{
|
||||
|
@ -6723,20 +6727,20 @@ void CTFPlayerShared::Burn( CTFPlayer *pAttacker, CTFWeaponBase *pWeapon, float
|
|||
// otherwise stack the duration
|
||||
else
|
||||
{
|
||||
m_flAfterburnDuration += flFlameLife;
|
||||
m_flAfterburnDuration += flFlameLife * flMultWpnBurntime;
|
||||
}
|
||||
|
||||
m_flAfterburnDuration = Clamp( m_flAfterburnDuration, 0.f, tf_afterburn_max_duration );
|
||||
m_flAfterburnDuration = Clamp( m_flAfterburnDuration, 0.f, m_flAfterburnMaxDuration );
|
||||
|
||||
#ifdef DEBUG
|
||||
if ( tf_afterburn_debug.GetBool() )
|
||||
{
|
||||
engine->Con_NPrintf( 1, "Added afterburn duration = %f", m_flAfterburnDuration );
|
||||
|
||||
if ( s_flReachMaxAfterburnTime == 0.f && m_flAfterburnDuration == tf_afterburn_max_duration )
|
||||
if ( s_flReachMaxAfterburnTime == 0.f && m_flAfterburnDuration == flAfterburnMaxDuration )
|
||||
{
|
||||
s_flReachMaxAfterburnTime = gpGlobals->curtime;
|
||||
DevMsg( "took %f seconds to reach max afterburn duration\n", s_flReachMaxAfterburnTime - s_flStartAfterburnTime );
|
||||
DevMsg( "took %f seconds to reach max afterburn duration %f s\n", s_flReachMaxAfterburnTime - s_flStartAfterburnTime, flAfterburnMaxDuration );
|
||||
}
|
||||
}
|
||||
#endif // DEBUG
|
||||
|
|
|
@ -1035,7 +1035,8 @@ private:
|
|||
CHandle<CTFPlayer> m_hOriginalBurnAttacker; // Player who originally ignited this target
|
||||
CHandle<CTFWeaponBase> m_hBurnWeapon;
|
||||
float m_flFlameBurnTime;
|
||||
float m_flAfterburnDuration;
|
||||
float m_flAfterburnDuration; // Active afterburn duration
|
||||
float m_flAfterburnMaxDuration; // Maximum afterburn duration
|
||||
|
||||
// Bleeding
|
||||
struct bleed_struct_t
|
||||
|
|
|
@ -554,7 +554,7 @@ class CTFWeaponBase : public CBaseCombatWeapon, public IHasOwner, public IHasGen
|
|||
void SetClipScale ( float flScale ) { m_flClipScale = flScale; }
|
||||
|
||||
virtual float GetInitialAfterburnDuration() const { return 0.f; }
|
||||
virtual float GetAfterburnRateOnHit() const { return 0.f; }
|
||||
virtual float GetAfterburnRateOnHit() const { return 10.f; }
|
||||
|
||||
// Client specific.
|
||||
#else
|
||||
|
|
Loading…
Reference in a new issue