perks/PerkBulletForce.cs

A Perk class for a game that increases bullet knockback. It registers an Epic rarity perk named "Bullet Force" with UI text and applies a multiplicative modifier to the player's BulletForce stat based on perk level.

Reflection
🐞 GetValue’s non-percent branch adds 1f twice, so ModifierType.Mult uses 2 + 2*level (e.g. 4x at level 1) while the description implies 1 + 2*level (3x at level 1).
using System;
using Sandbox;

[Perk( Rarity.Epic, locked: true, alwaysOfferDebug: false )]
public class PerkBulletForce : Perk
{
	private enum Mod { BulletForce };

	static PerkBulletForce()
	{
		Register<PerkBulletForce>(
			name: "Bullet Force",
			imagePath: "textures/icons/vector/bullet_force.png",
			description: level => $"+{GetValue( level, Mod.BulletForce, true )}% bullet-icon knockback",
			upgradeDescription: level => $"+{GetValue( level - 1, Mod.BulletForce, true )}%→{GetValue( level, Mod.BulletForce, true )}% bullet-icon knockback"
		);
	}

	public override void Start()
	{
		base.Start();
	}

	public override void Refresh()
	{
		base.Refresh();

		Player.Modify( this, PlayerStat.BulletForce, GetValue( Level, Mod.BulletForce ), ModifierType.Mult ); 
	}

	private static float GetValue( int level, Mod mod, bool isPercent = false )
	{
		switch ( mod )
		{
			case Mod.BulletForce:
			default:
				return isPercent
					? 100f + 200f * level
					: 1f + 1f + 2f * level;
		}
	}
}