Skip to content

Adding Cards

modargo edited this page Jul 21, 2026 · 8 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.

If this option doesn't show up, it may be because you did not check the box for Put solution and project in same directory when you made the project step 4 of setup or you made a project using the empty template (instead of the character or content mod templates). You can fix those issues by recreating the project. If that doesn't help, you can proceed by creating a new class instead and filling in the code yourself (it's inconvenient but doesn't take that much longer).

image

Enter a name and create the file.

image

This should result in a class inheriting from the card model for your mod (e.g. YourModNameCard). There will be 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. If you are using the character template, you do not need to do this, as the base class is already marked with the pool attribute for the character.

image

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

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.

Art

Card art goes in the folder YourModName/images/card_portraits/big/. The image should be a 1000x760 PNG (or 606x852 for full art cards). Name it the same as the card's class, except all lowercase and with underscores between words; so for example, CardName becomes card_name.png. You can see an example image named card.png created by the template (which will be used as the default image for cards without their own images). It's okay if the image is smaller as long as you keep the same ratio; the image will be scaled up.

The one image in the big folder is all you need for a card to work. There are two other images you can add (that should be named the same but go in different folders):

  • In the folder YourModName/images/card_portraits/, you can put a 250x190 (250x350 for full art) version of your card image. This will make things a bit more efficient for the game (but isn't necessary; the game can just scale down the big image).
  • In the folder YourModName/images/card_portraits/beta, you can put a beta art version of your card image. This will be visible if people have beta art on (cards without beta art will use their normal art).

Functionality

A tutorial for a basic card will be added eventually, but regardless you are recommended to decompile base game cards and look at their text to see how they implement their effects.

Editing the card template

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

image

Select the template you are using and change whatever you want (e.g., you could add a card pool attribute). Then, DO NOT click Save directly; click the dropdown arrow on the button and choose the team-shared option.

image

Clone this wiki locally