The most crucial part of the entire engine are the card templates. They define the appearance of the cards and some of the core functionality.
Body definition
A card body has two parts:
- An external body, that defines the full size of the card.
- An element/character mask. Both of these are of the same size, smaller than the external body, but they're specified separately because they serve two different purposes:
- The element mask is used to create the background of the inner body, based on the color or pattern of the character's base element (fire, water, earth, etc.)
- The character mask is used to fit the character image into the inner body, stripping out overflowing pixels.
Also, a backface is specified to show the back of opponent cards:
And, finally, border masks are defined to mark the card's set type (normal, rare, unique, etc.): an «external» border that limits the body from the character/element mask and «internal» border used to simulate sockets:
Attack directions
Attack directions are arrows pointing out the card. Since cards are octagonal, every side becomes an attack direction, and an arrow on that side tells the card can attack that way and can defend from attacks in that direction. All arrows are defined as masks for composition using the colors or patterns that define the card's hierarchy class (minion, boss, king, etc).
Stat bars
Four stat bars are used to show the main attributes for the cards:
- A red bar indicating the Hit Points (life). Shown as needed.
- A blue bar indicating the Mana Points (magic power). Shown if the card is of magical type or has a Hit Dice above zero.
- A purple bar indicating the Energy Points (mind power). Shown if the card is of psionic type or has an Energy Dice above zero.
- A white bar indicating the card's Experience Points. Shown as needed.
Sockets
A card template can hold from one to four "sockets". These are used to insert add-ons, either orbs or accessories.
Sockets can be independent or linked. When objects are inserted in linked sockets, the combined boosts receive bonuses and might provide extras.
Icons
There are four icons that every template should include:
- A poison effect turns count icon, that shows for how long the poison-based attack damage will last.
- A negative altered state icon that shows if the card has one or more states negatively affecting its actions.
- A positive altered state icon that show if the card has one or more positive boosts.
- An insurance class clip that shows the insurance class of the card.
Using templates
There shouldn't be a big amount of card templates, just a handful of them, and mainly to make socket holding differences, E.G.:
- Base template w/o sockets.
- With one socket.
- With two independent sockets.
- With two linked sockets.
- With four independent sockets.
- ...and so on.
Making templates with different appearance is discouraged, and should be done in extreme cases for shared universes to avoid user confusion. But making exclusive templates for exclusive universes might be better if a different user experience wants to be achieved.