-
Notifications
You must be signed in to change notification settings - Fork 5
Custom Enhancers
This tutorial is fairly simple because most of the setup is the same as what we have already covered in:
- Custom Artifacts
- Card Upgrades from earlier card tutorials
Enhancers are the shop upgrades you can purchase from the Merchant of Steel and Merchant of Magic, they are also found in select alcove events in game. Any reward you can attach to a card and improve it's status or gain new abilities is an enhancer.
They are applied to eligible cards in your deck and remain on those cards for the rest of the run.
Some examples of base game enhancers are:
- Strengthstone
- Keepstone
- Dominating Control
Technically, an Enhancer is a Relic that applies a CardUpgrade to a single eligible card. Unlike a normal CardUpgrade, though, Enhancers are limited by the number of upgrade slots available on a card.# Stealthystone
The Enhancer we will create is Stealthystone.
When applied to a monster card, it does two things:
- Reduces the unit's Attack by 5.
- Gives the unit Stealth 5.
For the enhancer we will create it will do two things when applied to a monster card
-
The unit loses 5 attack.
-
The unit gains Stealth 5.
Here is the full definition for the Enhancer.
It is very similar to a Collectable Relic, but the relic's main effect is RelicEffectCardUpgrade.
RelicEffectCardUpgrade acts as a wrapper around the CardUpgrade that defines what the Enhancer does.
{
"$schema": "https://github.com/Monster-Train-2-Modding-Group/Trainworks-Reloaded/releases/latest/download/schema.json",
"relics": [
{
"id": "Stealthystone",
"type": "enhancer",
"names": {
"english": "Stealthystone"
},
"descriptions": {
"english": "Upgrade a unit with [effect0.upgrade.bonusdamage][attack] and [stealth] [effect0.upgrade.status0.power]."
},
"relic_effects": [ "@StealthystoneEnhancer" ],
"icon": "@StealthystoneIcon",
"extensions": [
{
"enhancer": {
"pools": [
"UnitUpgradePoolCommon",
"DraftUpgradePool",
"DraftUpgradePool",
"MalickaDraftUpgradePool",
"MalickaDraftUpgradePool"
],
"rarity": "common"
}
}
]
}
],
"relic_effects": [
{
"id": "StealthystoneEnhancer",
"name": "RelicEffectCardUpgrade",
"param_card_type": "monster",
"param_upgrade": "@StealthystoneUpgrade"
}
],
"upgrades": [
{
"id": "StealthystoneUpgrade",
"titles": {
"english": "Stealthystone"
},
"descriptions": {
"english": "[bonusdamage][attack] and [stealth] [status0.power]."
},
"icon": "@StealthystoneIcon",
"hide_icon_on_card": false,
"bonus_damage": -5,
"filters": [
"ExcludeEelGorgon",
"OnlyAttackingUnits"
],
"status_effect_upgrades": [
{
"status": "stealth",
"count": 5
}
]
}
],
"sprites": [
{
"id": "StealthystoneIcon",
"path": "textures/icons/Stealthystone.png"
}
]
}Here is the main Relic definition:
"relics": [
{
"id": "Stealthystone",
"type": "enhancer",
"names": {
"english": "Stealthystone"
},
"descriptions": {
"english": "Upgrade a unit with [effect0.upgrade.bonusdamage][attack] and [stealth] [effect0.upgrade.status0.power]."
},
"relic_effects": [ "@StealthystoneEnhancer" ],
"icon": "@StealthystoneIcon",
"extensions": [
{
"enhancer": {
"pools": [
"UnitUpgradePoolCommon",
"DraftUpgradePool",
"DraftUpgradePool",
"MalickaDraftUpgradePool",
"MalickaDraftUpgradePool"
],
"rarity": "common"
}
}
]
}
],-
type- This tells the framework to generate an Enhancer relic. This is required for Enhancers. -
extensions-Enhancer-specific properties are defined through theenhancerextension.-
rarity- This sets the Enhancer's rarity.Since Stealthystone is intended to be a basic upgrade, we set it to
common.The rarity also affects the shop cost of the Enhancer.
-
class- Even though it is not explicity set here (this is a clanless enhancer). You can associate an Enhancer with a clan by setting this. -
pools- This is the list of EnhancerPools to add the Enhancer to. This is similar in function with cards and CardPools.-
UnitUpgradePoolCommon- This is the pool used by Merchant of Steels top two shop items. Since the rarity is common we put those here. -
DraftUpgradePool- This is the pool used by Capricious Reflection, we add our enhancer to this pool twice to make it as likely to show up as other common items in the pool. -
MalickaDraftUpgradePoolThis is the pool used by Malicka's Shifting Pyre, again we add the enhancer to this pool to have it as an available choice for that Pyre's effect.
-
-
There are fewer Enhancer pools than card pools, so this section lists them all.
These pools are used for spell card Enhancers.
-
SpellUpgradePoolCommon
Used for the top-left item in the Merchant of Magic. Contains common spell card Enhancers. -
SpellUpgradePoolCostReduction
Used for the top-right item in the Merchant of Magic. Contains uncommon spell card Enhancers that reduce card cost. -
SpellUpgradePoolRare
Used for the bottom two items in the Merchant of Magic. Contains rare spell card Enhancers.
These pools are used for monster card Enhancers.
-
UnitUpgradePoolCommon
Used for the top two items in the Merchant of Steel. Contains common monster card Enhancers. -
UnitUpgradePoolRare
Used for the bottom two items in the Merchant of Steel. Contains rare monster card Enhancers.
Each merchant pool has a Soul Savior equivalent. These pools contain the upgraded + versions of Enhancers from their matching pools.
SoulSavior_SpellUpgradePoolCommonSoulSavior_SpellUpgradePoolCostReductionSoulSavior_SpellUpgradePoolRareSoulSavior_UnitUpgradePoolCommonSoulSavior_UnitUpgradePoolRare
These pools are used by other artifacts, mutators, or Pyres.
-
DraftUpgradePool
Used by Capricious Reflection. -
MalickaDraftUpgradePool
Used by Malicka's Shifting Pyre.
These final pools are more specialized. In most cases, you should avoid modifying them unless you specifically know you need to.
-
Class6CorruptEnhancerPool
Used for Wurmkin's Infused upgrade. This pool makes select Wurmkin clan card drafts start with Infused. -
DominionUpgradePool
Contains Dominating upgrades from the Dominion event. Used by the associated mutator. -
TitanSavageryUpgradePool
Contains Savage upgrades from the Savagery event. Used by the associated mutator.
Almost all enhancer effects will use RelicEffectCardUpgrade
{
"id": "StealthystoneEnhancer",
"name": "RelicEffectCardUpgrade",
"param_card_type": "monster",
"param_upgrade": "@StealthystoneUpgrade"
}-
param_card_type- This determines which cards are eligible when you preview purchasing the enhancer. -
param_upgrade- defines the upgrade the enhancer will apply.
The actual effect of the Enhancer is defined by the upgrade.
{
"id": "StealthystoneUpgrade",
"titles": {
"english": "Stealthystone"
},
"descriptions": {
"english": "[bonusdamage][attack] and [stealth] [status0.power]."
},
"icon": "@StealthystoneIcon",
"hide_icon_on_card": false,
"bonus_damage": -5,
"filters": [
"ExcludeEelGorgon",
"OnlyAttackingUnits"
],
"status_effect_upgrades": [
{
"status": "stealth",
"count": 5
}
]
}Most of this should look familiar from earlier tutorials, but Enhancers require a few important fields we have not encountered until now.
-
titles- Card upgrades can have an associated title.For Enhancers, this is required because it is used in the tooltip that explains the upgrade after it has been applied to a card.
-
descriptions- This is also required for Enhancers.It becomes the tooltip body shown after the Enhancer has been applied to a card.
-
icon/hide_icon_on_card- These fields are required by convention for Enhancer upgrades.Together, they make the upgrade appear as a visible upgrade icon on the card and cause it to take up an upgrade slot.
-
filters- Filters control which cards are eligible for the upgrade.In this example, we use two predefined base game
CardUpgradeMasks:-
ExcludeEelGorgon
Blocks Eel Gorgon from receiving this Enhancer. Eel Gorgon is generally excluded from Enhancers that add status effects. -
OnlyAttackingUnits
Prevents the Enhancer from being applied to units that do not have an attack.
-
To test the Enhancer's behavior, use the Dev Console GUI to access the developer cheat menu.
-
Press
F2to open the menu. -
Select Modify Deck/Artifacts.
-
Select Upgrade Card.
-
Find Stealthystone in the dropdown and apply it to a monster card.
Expected Result:
- The card's Attack should be reduced by 5.
- Stealth 5 should appear on the card in the green upgrade text.
- The Stealthystone upgrade icon should appear on the card.