A gem item class that increases a players movement speed. It defines the item id, computes move speed bonus per level, provides descriptions, and applies a multiplicative move speed modifier when the gem effect runs.
using Sandbox;
public class GemSapphire : Gem
{
public const string ItemId = "gem_sapphire";
private static int GetMoveSpeed( int level ) => 1 + level * 1;
public static string Description( int level ) => $"+{GetMoveSpeed( level )}% move speed";
public static string UpgradeDescription( int level ) => $"+{GetMoveSpeed( level - 1 )}%→+{GetMoveSpeed( level )}% move speed";
public override void OnRunStart()
{
Player.Modify( this, PlayerStat.MoveSpeedMultiplier, 1f + GetMoveSpeed( Level ) * 0.01f, ModifierType.Mult );
}
}