-
Notifications
You must be signed in to change notification settings - Fork 16
Adding Cards
This template includes a file template for cards.
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 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.
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.
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.
To add it to a card pool, add the [Pool] attribute above the class.
If making an Ironclad card, it would look like this.
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#.
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.
All localization will go in your ModName folder, which should contain mod_image.png.
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.
Inside the .json file, simply add a pair of curly brackets if they are not present.
{
}
If you hover over your card's class name, you should see an error like this.
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.
Click the Generate localization option. This will generate some text above your class definition.
Select it, cut it (ctrl+x), paste it into cards.json, and save the file.
Your card should now have no errors.
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.