Anatomy of a Card - Monster-Train-2-Modding-Group/Trainworks-Reloaded GitHub Wiki
Overview
Here's a sky high overview of a few concepts involved with the game's data, you'll need to know all of these to be effective in making new content for Monster Train 2.
Cards
The main content of the game, of course, are Cards. Cards come in many flavors determined by the CardType. As of Monster Train 2 there are 6 CardTypes:
- Spell
- Monster
- Blight (not shown in the above image Dante's Candle is an example)
- Junk (in-game name Scourge)
- Equipment
- TrainRoomAttachment (in-game name Room)
No matter the card type, cards will contain the following items
- Cost (in ember)
- Cost type (whether the card is non playable, costs ember to play, or is an X-cost card)
- Card Type (one of the 6 above)
- Rarity
- CardTraits (think of these as "keywords" explained in its own section)
- CardEffects (these effects fire when the card is played)
- CardTriggers (a CardTrigger fires CardEffects, or CardTriggerEffects when a certain condition happens)
Card Types explained
Spells
These are the simplest type of card, all Spells will just have an effect that fires when it is played.
Monsters
Monster cards are like spell cards, except, when played, there's an effect that fires spawns a Monster. The look of a monster card shows its stats, and the text shows the monsters main abilities if they have one.
Blight
Another bad type of card with a different look to it. You usually get these as a negative effect of a card or Monster.
Junk
Like a spell card but it has a different look to it, Like blight these usually come with a negative effect if you don't play it. Enemies usually toss these in your deck.
Equipment.
These are cards that apply a temporary CardUpgrade to a character. It has a special CardEffect used to give the equipment's effect to a character. And the equipment itself is described as a CardUpgrade.
TrainRoomAttachment (aka Rooms)
Like equipment these are cards that apply a temporary CardUpgrade not to a character but a floor. These CardUpgrades can contain effects to modify a room (via a RoomModifier), but can also apply temporary CardUpgrades to eligible characters on a floor as well.
CardEffects
The base unit of things that happen when you play a card. A CardEffect is an effect that fires when you play a card, a trigger is activated, or some Flying Bosses actions.
The main thing for a CardEffect is the EffectStateName pointing to a class which implements the effect. If you aren't a programmer don't worry too much about this, just know that the EffectStateName is like a command telling the game what to do.
Some simple CardEffect classes are
- CardEffectDamage - Do some damage to some character(s) (hero or monster)
- CardEffectAddStatusEffect - give a status effect to someone
- CardEffectAddBattleCard - Add a card to some card pile just for this battle.
- CardEffectHeal - Heal a character(s)
- CardEffectKill - Kill a character(s) by setting their health to 0.
- CardEffectAddTempCardUpgradeToUnits - Apply a CardUpgrade (until the character dies, temporarily duration of battle, or permanently duration of run) to a character(s)
- CardEffectSpawnMonster - Spawns a Character to the monster side of a floor (All monster cards will have this one).
The only other thing is that CardEffects also have various parameters controlling various things like (who is the target, does the card target heroes or monsters, how much damage to deal, filter out to characters with X subtypes, etc.)
CardTraits
You can think of a CardTrait as a "keyword", however it isn't always the case. Some examples of CardTraits are Attuned, Explosive, Consume, and Purge. A good definition of a CardTrait is that it modifies certain behaviours of the card its applied to.
For instance, Consume modifies the behavior of a card it's when played. Normally cards when played go to the discard pile. But if you apply Consume to a card it instead goes to the Consume pile.
As mentioned not all CardTraits are represented by a keyword and not all keywords are CardTraits. A good example is any X-cost card from Monster Train 1 or the card Wyngh's Radiance (x-cost advance apply 2[x] melee weakness). These effects have a CardTrait which scales the CardEffect based on the amount of ember consumed when you play the card.
CardTriggers
CardTriggers contain a set of special CardEffects (or CardTriggerEffects) to play when a certain condition is met. An example would be Slay. A Slay trigger activates if as a result of playing the card the card kills a character. You can tell the card to play additional effects when a trigger is activated.
CardEffects vs CardTriggerEffects?
Like CardEffects, CardTriggerEffects are special effects that fire, but they can only fire as a result of a CardTrigger being activated.
You should rarely need to use these, but generally CardTriggerEffects are used to apply permanent upgrades to cards. like CardEffects they have a TriggerEffect class. Examples:
- CardTriggerEffectBuffSpellDamage - permanently buff (or debuff) this cards magic power
- CardTriggerEffectBuffCharacterDamage - (Only for monster cards). Permanently buff the character's damage (attack stat).
Along with various parameters, such as (how much to buff).
Characters
These represent everything from the Monsters spawned by your cards, to the enemies that appear in waves, to boss characters of a ring, and even Flying Bosses are simply Characters. Anything on the train battling is a Character.
a few things all characters have
- Health
- AttackDamage
- Size
- StartingStatusEffects
- Subtypes
- Unit Ability
- CharacterTriggers
- RoomModifiers
- Grafted Equipment
Most of these are self explanatory your standard HP and attack stats. Size is how much capacity the unit takes, of course! Units can have a set of starting status effects, like Animus of Will's Multistrike 2 from Monster Train 1.
Units can have subtypes. And this is how the game determines what is or isn't a banner unit. Giving a character the subtype "SubtypesData_BannerUnit" makes it a banner unit and you draw it in the Deployment phase.
Unit Abilities
A new feature for monster train 2. In the image above Wealthy Whelp is an example of a Character that has an ability. Unit abilities are just Cards. When you activate an ability its like playing a Card, its card's effects will fire.
To mark a Card as a unit ability there's a special flag is_unit_ability, set it to true to mark it as such. Along with that you can control the cooldown of the ability with cooldown_at_spawn and cooldown_after_activated. But otherwise a unit Ability is specified in terms of a Card with CardEffects that play when the ability is activated.
Why have a unit ability be specified as a Card instead of just simple CardEffects? A great example of why having this be a card is Lord Fenix's slay path. It's unit ability has a Slay CardTrigger attached that when activated gives Lord Fenix a permanent +1 attack buff upgrade
Character Triggers
Much like CardTriggers Characters can have CharacterTriggers attached to them. These are just CardEffects that fire when certain conditions are met. They are represented by the Purple (or in rare cases Blue) circle with an icon below the character.
RoomModifiers
RoomModifiers are simply effects that are applied to the entire room while the monster is out (or while room is in play). From the above image. Good ol' Lead Songbird is a prime example of a Character with a RoomModifier. While Lead Songbird is out on the floor, he modifies the effect of Valor for all other characters on the floor giving them an extra +1 attack per stack of valor. When Lead Songbird is killed the effect wears off immediately.
RoomModifiers can also change behavior of certain actions when performed on the floor. For instance it can change the behavior of spawning monsters, or adjust the damage each stack of a status effect does to a character.
Grafted Equipment
Units can have equipment grafted onto them. As of the MT2 demo the only way to do this is via the Lab experiment event. But you can define a monster who initially has equipment grafted to them by specifying an Equipment card.
Equipment
Equipment cards are simply cards that have an effect 'CardEffectAttachEquipment' Equipment is specified via a CardUpgrade as a parameter to the aforementioned CardEffect. When an Equipment card is played the CardUpgrade gets applied to the character, however when you play a different Equipment the CardUpgrade gets removed.
CardUpgrades
CardUpgrades are the main way to make stat adjustments or ability changes to characters or cards. You will find that most data is specified via a CardUpgrade. Good examples are ChampionUpgrades, Shop Upgrades, Equipment, Rooms. They are all specified via CardUpgrade.
Things you can do with a CardUpgrade
- Adjust Cost, Spell Damage, Attack Damage, Health, or Size of a Spell or Character.
- Apply a Status Effect (persisting through the entire battle, or permanently)
- Apply/Remove a CardTrait to a card
- Apply a new CharacterTrigger or CardTrigger
- Apply a RoomModifier
- Add/Replace a Unit Ability
- Remove a CardUpgrade.
CardUpgrades also allow filtering (via a CardUpgradeMask) to restrict Cards/Characters from receiving the upgrade. A Good example is Stewards Quarters. It gives out Multistrike 1 and +20 Attack, however only for Monsters of the Steward Subtype.
Rooms
The last type of card are rooms. Internally they are called TrainRoomAttachment. Like Equipment, Room cards have a special CardEffect 'CardEffectAttachTrainRoomAttachment' the Room's effect is specified via a CardUpgrade.
The CardUpgrade is applied to targeted Characters in the room, along with any RoomModifiers present in the CardUpgrade.
A good example of a Room is Steward's Quarters. It's CardUpgrade specifies an upgrade to apply (see above) Along with a RoomModifier that says to increase the capacity of the Room by 1 (RoomStateCapacityModifier).