A Gem subclass that represents a charcoal gem item which increases bullet damage. It defines the item id, computes damage per gem level, and applies an additive bullet damage modifier on run start; it also provides description and upgrade description strings formatted with one decimal place.
using Sandbox;
public class GemCharcoal : Gem
{
public const string ItemId = "gem_charcoal";
private static float GetBulletDmg( int level ) => 0.1f * level;
public static string Description( int level ) => $"+{GetBulletDmg( level ).ToString("0.#")} bullet-icon damage";
public static string UpgradeDescription( int level ) => $"+{GetBulletDmg( level - 1 ).ToString( "0.#" )}→+{GetBulletDmg( level ).ToString( "0.#" )} bullet-icon damage";
public override void OnRunStart()
{
Player.Modify( this, PlayerStat.BulletDamage, GetBulletDmg( Level ), ModifierType.Add );
}
}