Gun item class for an unpaused-while-choosing perk. Provides an item id, a move speed bonus, a description string, and applies stat modifiers (UnpausedChoosing flag and MoveSpeedMultiplier) when the run starts.
public class GunUnpausedChoosing : Gun
{
public const string ItemId = "gun_unpaused_choosing";
private static float GetMovesSpeed( bool isPercent = false ) => isPercent ? 7f : 1f + 0.07f;
public static string Description() => $"Don't pause while choosing perks\n+{GetMovesSpeed( isPercent: true )}% move speed";
public override void OnRunStart()
{
base.OnRunStart();
Player.Modify( this, PlayerStat.UnpausedChoosing, 1, ModifierType.Add );
Player.Modify( this, PlayerStat.MoveSpeedMultiplier, GetMovesSpeed( isPercent: false ), ModifierType.Mult );
}
}