status/AttackSpeedStillStatus.cs
using System;
using System.Collections.Generic;
using System.Linq;
using Sandbox;

[Status( 7, 0, 1f, 0, false )]
public class AttackSpeedStillStatus : Status
{
	public AttackSpeedStillStatus()
	{
		Title = "Dig In";
		IconPath = "textures/icons/attack_speed_still.png";
	}

	public override void Init( Player player )
	{
		base.Init( player );
	}

	public override void Refresh()
	{
		Description = GetDescription( Level );

		Player.Modify( this, PlayerStat.AttackSpeedStill, GetMultForLevel( Level ), ModifierType.Mult );
	}

	public override string GetDescription( int newLevel )
	{
		return string.Format( "Increase attack speed by {0}% while standing still", GetPercentForLevel( Level ) );
	}

	public override string GetUpgradeDescription( int newLevel )
	{
		return newLevel > 1 ? string.Format( "Increase attack speed by {0}%→{1}% while standing still", GetPercentForLevel( newLevel - 1 ), GetPercentForLevel( newLevel ) ) : GetDescription( newLevel );
	}

	public float GetMultForLevel( int level )
	{
		return 1f + 0.35f * level + (level == 7 ? 0.15f : 0f);
	}

	public float GetPercentForLevel( int level )
	{
		return 35 * level + (level == 7 ? 15 : 0);
	}
}