A gameplay gem item class that increases player bullet damage. It defines an item id, computes damage bonus by level, provides descriptions for UI, and applies an additive modifier to the player when the gem activates.
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 );
}
}