A gun item class that adds piercing bullets and modifies attack speed. It defines item id, pierce count, attack speed value, a description string, and applies stat modifications when activated.
public class GunPierce : Gun
{
public const string ItemId = "gun_pierce";
private static int GetPierce() => 2;
private static int GetAttackSpeed() => 70;
public static string Description() => $"+{GetPierce()} bullet-icon pierce\n-{GetAttackSpeed()}% attack speed";
public override void OnRunStart()
{
Player.Modify( this, PlayerStat.BulletNumPiercing, GetPierce(), ModifierType.Add );
Player.Modify( this, PlayerStat.AttackSpeed, 1f - (GetAttackSpeed() * 0.01f), ModifierType.Mult );
}
}