Class CardCostModifierSpell

java.lang.Object
net.demilich.metastone.game.spells.Spell
net.demilich.metastone.game.spells.CardCostModifierSpell
All Implemented Interfaces:
java.io.Serializable, HasDesc<SpellDesc>
Direct Known Subclasses:
ShuffleWithCardCostModifierSpell

public class CardCostModifierSpell
extends Spell
Creates a CardCostModifier specified by SpellArg.CARD_COST_MODIFIER that is hosted by the specified SpellArg.TARGET.

The following example makes the cards in the player's hand cost zero for the rest of the game. When the player draws new cards, those cards still cost zero. The "rest of the game" part is enforced by the SpellArg.TARGET of EntityReference.FRIENDLY_PLAYER, the entity that hosts rest of the game triggers and effects like card cost modification.

     {
         "class": "CardCostModifierSpell",
         "target": "FRIENDLY_PLAYER",
         "cardCostModifier": {
             "class": "CardCostModifier",
             "target": "FRIENDLY_HAND",
             "operation": "SET",
             "value": 0
         }
     }
 
However, this example sets the cost of all cards currently in the player's hand to zero. Later cards that are drawn do not get their cost reduced.
     {
         "class": "CardCostModifierSpell",
         "target": "FRIENDLY_HAND",
         "cardCostModifier": {
             "class": "CardCostModifier",
             "target": "SELF",
             "operation": "SET",
             "value": 0
         }
     }
 
Notice that the target of the CardCostModifierSpell is the entity that hosts the effect, while the SpellArg.CARD_COST_MODIFIER is the actual modifier that should go into play. By using CardCostModifierArg.TARGET of EntityReference.SELF, the hosting entity modifies itself.
See Also:
for a description of the format for a card cost modifier., Serialized Form