Page 1 of 1

Mishra's Workshop: possible approach (open to enhancements)

PostPosted: 15 Jan 2013, 12:38
by thefiremind
I just thought about a possible way to code Mishra's Workshop. It still has some problems, but I hope it can be an inspiration for enhancements and eventually a bug-free version (not necessarily from me :roll:).

Code: Select all
<?xml version='1.0'?>
<CARD_V2>
  <FILENAME text="MISHRAS_WORKSHOP_202578" />
  <CARDNAME text="MISHRAS_WORKSHOP" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Mishra’s Workshop]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Mishra’s Workshop]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Mishra’s Workshop]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Mishra’s Workshop]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Mishra’s Workshop]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Mishra’s Workshop]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Mishra’s Workshop]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Mishra’s Workshop]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Mishra’s Workshop]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="202578" />
  <ARTID value="A202578" />
  <ARTIST name="Sam Burley" />
  <CASTING_COST cost="" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Though he eventually came to despise Tocasia, Mishra listened well to her lessons on clarity of purpose. Unlike his brother, he focused his mind on a single goal.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Though he eventually came to despise Tocasia, Mishra listened well to her lessons on clarity of purpose. Unlike his brother, he focused his mind on a single goal.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Though he eventually came to despise Tocasia, Mishra listened well to her lessons on clarity of purpose. Unlike his brother, he focused his mind on a single goal.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Though he eventually came to despise Tocasia, Mishra listened well to her lessons on clarity of purpose. Unlike his brother, he focused his mind on a single goal.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Though he eventually came to despise Tocasia, Mishra listened well to her lessons on clarity of purpose. Unlike his brother, he focused his mind on a single goal.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Though he eventually came to despise Tocasia, Mishra listened well to her lessons on clarity of purpose. Unlike his brother, he focused his mind on a single goal.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Though he eventually came to despise Tocasia, Mishra listened well to her lessons on clarity of purpose. Unlike his brother, he focused his mind on a single goal.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Though he eventually came to despise Tocasia, Mishra listened well to her lessons on clarity of purpose. Unlike his brother, he focused his mind on a single goal.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Though he eventually came to despise Tocasia, Mishra listened well to her lessons on clarity of purpose. Unlike his brother, he focused his mind on a single goal.]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Land" />
  <EXPANSION value="ME4" />
  <RARITY metaname="R" />
  <STATIC_ABILITY filter_zone="ZONE_HAND">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{T}: Add {3} to your mana pool. Spend this mana only to cast artifact spells.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{T}: Add {3} to your mana pool. Spend this mana only to cast artifact spells.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{T}: Add {3} to your mana pool. Spend this mana only to cast artifact spells.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{T}: Add {3} to your mana pool. Spend this mana only to cast artifact spells.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{T}: Add {3} to your mana pool. Spend this mana only to cast artifact spells.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{T}: Add {3} to your mana pool. Spend this mana only to cast artifact spells.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{T}: Add {3} to your mana pool. Spend this mana only to cast artifact spells.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{T}: Add {3} to your mana pool. Spend this mana only to cast artifact spells.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{T}: Add {3} to your mana pool. Spend this mana only to cast artifact spells.]]></LOCALISED_TEXT>
    <FILTER>
    return FilteredCard() ~= nil and
    FilteredCard():GetCardType():Test( CARD_TYPE_ARTIFACT ) ~= 0 and
    FilteredCard():GetPlayer() == EffectController() and
    FilteredCard():GetConvertedManaCost() &gt; 2
    </FILTER>
    <CONTINUOUS_ACTION layer="8">
    if FilteredCard() ~= nil and Object():Tapped() == 0 then
       FilteredCard():DecreaseCost( 3 )
    end
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
  <TRIGGERED_ABILITY forced_skip="1">
    <TRIGGER value="SPELL_PLAYED" simple_qualifier="objectyoucontrol">
    return Object():Tapped() == 0 and
    TriggerObject():GetCardType():Test( CARD_TYPE_ARTIFACT ) ~= 0 and
    TriggerObject():GetConvertedManaCost() &gt; 2
    </TRIGGER>
    <PLAY_TIME_ACTION>
    MTG():FireTrigger( TRIGGER_BECAME_TAPPED_FOR_MANA, Object() )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
       EffectSource():Tap()
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <AI_BASE_SCORE score="600" zone="ZONE_IN_PLAY" />
</CARD_V2>
What I'm doing here is to decrease the cost of all artifacts that cost {3} or more as long as Mishra's Workshop is untapped. When an artifact that costs {3} or more is cast, Mishra's Workshop is tapped.
This approach still has problems:
  • If I have only this land, maybe I want to cast an artifact that costs less than {3} with it.
  • With multiple Mishra's Workshops under the same player's control, they would be all tapped no matter what's the cost of the artifact that has been cast.
A possible enhancement could be an invisible token that manages all Mishra's Workshops belonging to a certain player: it decreases the costs according to the number of Workshops and taps only as many Workshops as needed. But then again, if you cast an artifact that costs {4} you probably want to pay with 1 Workshop + any other land, while this approach would always pay it with 2 Workshops.

If anybody comes with a good idea, feel free to experiment.

I attached the new Mishra's Workshop art, used for the MTGO Cube version (much better than the original).