Pikcube.Common 0.2.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package Pikcube.Common --version 0.2.5
                    
NuGet\Install-Package Pikcube.Common -Version 0.2.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Pikcube.Common" Version="0.2.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Pikcube.Common" Version="0.2.5" />
                    
Directory.Packages.props
<PackageReference Include="Pikcube.Common" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Pikcube.Common --version 0.2.5
                    
#r "nuget: Pikcube.Common, 0.2.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Pikcube.Common@0.2.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Pikcube.Common&version=0.2.5
                    
Install as a Cake Addin
#tool nuget:?package=Pikcube.Common&version=0.2.5
                    
Install as a Cake Tool

Pikcube.Common

This is a collection of generic utilities and extension I wrote for my own mods.

Another mod says it needs Pikcube.Common to work, how do I install it?

Just download the .zip file and place the contents of it inside your mods folder. Or download it from the workshop (once workshop support drops).

Requirements

This mod uses C# extension blocks, a language feature added in C# 14. You will need to add <LangVersion>14<LangVersion/> to your project file to use this library.

Feature: Relic Spawn Filter API

An API that allows for removing relics from the common Relic Grab Bag. Doesn't prevent relics from spawning from events and ancients.

Adding a rule is as easy as calling RegisterRule and passing in a filter.

RelicSpawnManager relicSpawnManager = new();
relicSpawnManager.RegisterRule<UnceasingTop>(runstate => runstate.AscensionLevel < 4); // Only allows UnceasingTop to spawn below Ascension 4.

Your rule can be any function that takes an IRunState as a parameter and returns a bool. Return true if the relic is allowed to spawn and return false if the relic should not be allowed to spawn.

You can also remove rules if that behavior is destired.

relicSpawnManager.DeregisterRuleIfExist<UnceasingTop>(); //Use the same relicSpawnManager you used to create the rule in the first place

Registration uses the type itself instead of the canonical instance as a key, so you are free to create rules before ModelDB is initialized.

Feature: An implementation of the Cursed Debuff from Dicey Dungeons

Like I said, I wrote these for my own mods. I'm a huge fan of Dicey Dungeons, and I use this debuff enough it was easier to just stick it in my common library.

You can read up on it here, but the upshot is that each card has a 50/50 chance to be discarded without being played. Disappears when triggered or at the end of the turn.

Utilities: Way Too Many Extensions

I love extension methods and I add them for nearly everything. Examples include

  • Creating a card with Claw.CreateInstance(player), the equivalent of player.RunState.CreateCard<Claw>(player)
  • Getting a relic's canonical instance with SneckoEye.Canonical, the equivalent of ModelDb.Relic<SneckoEye>().CanonicalInstance
  • Replacing an item in a list with myList.TryReplaceValue(oldItem, newItem), which is a bit more complicated than a simple alias

How To Use as a Developer

You can easilly download this from NuGet as "Pikcube.Common" using your IDE's package manager.

Alternatively, add this line to your .csproj file

<PackageReference Include="Pikcube.Common" Version="0.1.53" />

Alternatively, you can install it manually.

Download Pikcube.Common.dll, add it as a reference to your project, and include "Pikcube.Common" as a dependency in your mod's json definition. You can copy the .pdb files over to your game's mod directory if you want them for interactive debugging purposes.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.9 94 6/15/2026
0.2.8 96 6/12/2026
0.2.6 89 6/9/2026
0.2.5 90 6/9/2026
0.2.4 96 6/6/2026
0.2.3 101 6/5/2026
0.2.2 98 6/4/2026
0.2.1 94 6/3/2026
0.2.0 97 5/29/2026
0.1.55 107 5/28/2026
0.1.53 111 5/22/2026
0.1.52 93 5/22/2026
0.1.51 108 5/21/2026
0.1.50 105 5/17/2026
0.1.49 90 5/16/2026
0.1.48 89 5/11/2026
0.1.46 100 5/9/2026