guns/GunActiveReload.cs

A gun item subclass that represents an "Active Reload" starting gun. It defines an item id, a description string that references PerkActiveReload rich text tokens, and on run start it notifies local chat and adds the PerkActiveReload perk to the player.

public class GunActiveReload : Gun
{
	public const string ItemId = "gun_active_reload";

	public static string Description() => $"Start with {Perk.GetRichTextNameToken( typeof( PerkActiveReload ) )} {Perk.GetRichTextToken( nameof(PerkActiveReload) )}";

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

		Manager.Instance.Chat.AddLocalChatMessage( $"Got {Perk.GetRichTextNameToken( typeof( PerkActiveReload ) )} {Perk.GetRichTextToken( nameof( PerkActiveReload ) )}", from: "" );

		Player.AddPerk( TypeLibrary.GetType( typeof( PerkActiveReload ) ) );
	}
}