Lotus Bloom

This card is the perfect example for the implementation of the suspend ability. The main card effects is equivalent to the Black Lotus card ones which is already implemented.

Let's start by looking at this card code :

<?xml version="1.0" encoding="ISO-8859-1"?>
<card xmlns="http://sourceforge.net/projects/magic-project" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://sourceforge.net/projects/magic-project ../../mpvalidator.xsd"
 name="Lotus Bloom">
 <rules-author-comment>Hoani CROSS</rules-author-comment>
 <init>
  <idcards>artifact</idcards>
 </init>
 <abilities>
  <ability ref="cast-suspend">
   <actions>
    <pay-mana colorless="0"/>
   </actions>
   <actions>
    <repeat value="3"/>
    <add-object object-name="time"/>
   </actions>
  </ability>
  <activated-ability playable="mana-source" name="" zone="play" resolution="auto">
   <cost>
    <action ref="T"/>
    <action ref="sacrifice-this"/>
   </cost>
   <effects>
    <give-mana black="3"/>
   </effects>
  </activated-ability>
  <activated-ability playable="mana-source" name="" zone="play" resolution="auto">
   <cost>
    <action ref="T"/>
    <action ref="sacrifice-this"/>
   </cost>
   <effects>
    <give-mana blue="3"/>
   </effects>
  </activated-ability>
  <activated-ability playable="mana-source" name="" zone="play" resolution="auto">
   <cost>
    <action ref="T"/>
    <action ref="sacrifice-this"/>
   </cost>
   <effects>
    <give-mana green="3"/>
   </effects>
  </activated-ability>
  <activated-ability playable="mana-source" name="" zone="play" resolution="auto">
   <cost>
    <action ref="T"/>
    <action ref="sacrifice-this"/>
   </cost>
   <effects>
    <give-mana red="3"/>
   </effects>
  </activated-ability>
  <activated-ability playable="mana-source" name="" zone="play" resolution="auto">
   <cost>
    <action ref="T"/>
    <action ref="sacrifice-this"/>
   </cost>
   <effects>
    <give-mana white="3"/>
   </effects>
  </activated-ability>
 </abilities>
</card>

The suspend ability is made active by adding one ability to the card : the <cast-suspend> activated ability. It allows the owner of the card to cast it through the suspend ability.

Two actions macros must be provided : the first one is dedicated to the cost of the suspend ability to be cast, the second is dedicated to the addition of the time counters on the removed from the game card. This way, dynamic values can be used for the number of time counters to add (like in some card of the next bloc : Planar Chaos).

<ability ref="cast-suspend">
 <actions>
  <pay-mana colorless="0"/>
 </actions>
 <actions>
  <repeat value="3"/>
  <add-object object-name="time"/>
 </actions>
</ability>