A game item class for a piercing gun modifier. It defines constants and helpers for pierce count and attack speed, provides a description string, and applies stat modifications to the player when the effect starts.
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 );
}
}