Skip to content

Adding Cards

Alchyr edited this page Mar 21, 2026 · 3 revisions

This template includes a file template for cards.

Creating the File

First, create a folder to put your cards in. Most commonly this is simply called Cards. If you want additional organization you can make folders for rarity and/or type.

Right click the folder you created and choose Add. You should see the option for Custom Card.

image

If you enabled Publicization (only on empty mod template) when creating your project from the template, use the Publicized version.

Enter a name and create the file.

image

This should result in a class inheriting CustomCardModel with a few fields at the top highlighted. These are the "template" values. The first one is cost. You can just type a number, which will replace int. After you're done setting a field, press TAB to move to the next one.

image

The next 3 entries will open a dropdown. Use the up/down arrow keys and then press TAB after selecting the desired option, or just double-click on them.

You now have a card that has no effect. If using the character template, it should be inheriting an abstract named for your mod and will automatically be added to that character's card pool. Otherwise, you'll need to add it to a specific pool yourself.

Card Pool

To add it to a card pool, add the [Pool] attribute above the class.

image

If making an Ironclad card, it would look like this.

image

The character and content mod templates will have an abstract class and file template already set up, but if you need to make your own, you can edit file templates at Ctrl+Alt+S (Settings) -> Editor -> File Templates -> C#.

image

Select the template you are using and replace BaseLib.Abstracts.CustomCardModel near the top with the full name of your abstract card class. Then, DO NOT click Save directly; click the dropdown arrow on the button and choose the team-shared option.

image

Localization

All localization will go in your ModName folder, which should contain mod_image.png.

image

If it doesn't exist, create a localization/eng folder. (You can use a different language, but you will have to identify their folder names. It will be an ISO 639-2 code.) Inside that folder, create a cards.json file. This will hold the localization for all your cards.

image

Inside the .json file, simply add a pair of curly brackets if they are not present.

{

}

Adding Localization for a Card

If you hover over your card's class name, you should see an error like this.

image

This template uses a custom analyzer that will report missing localization, and can help with generating placeholder localization. Click the class name and press Alt+Enter. This should show a list of actions that can be taken.

image

Click the Generate localization option. This will generate some text above your class definition.

image

Select it, cut it (ctrl+x), paste it into cards.json, and save the file.

image image

Your card should now have no errors.

Functionality

TODO -

A tutorial for a basic card will be added eventually, but regardless you are recommended to decompile basegame cards to see how they implement their effects.

Clone this wiki locally