How to get upkeep availability working?
Posted: 21 Oct 2015, 02:33
I've got Dwarven Armory to do most of what it's supposed to do, but I can't figure out how have it be activated only during any upkeep stage.
I've yet to find a coded card that even has such a condition to work out how to go about it. I've come across triggered abilities using the STEP_UPKEEP condition but this ability isn't triggered, is it? There's only 1 card I found with an upkeep availability condition that's coded, Infinite Hourglass. I tried using this part of its code (even though it grants the ability to opponents as well and I realise this card is just for the controller) to test the functioning of any upkeep and it rendered the card useless.
So far this is the code I have for the card, it seems to work fine with the exception of the upkeep rule.
I've yet to find a coded card that even has such a condition to work out how to go about it. I've come across triggered abilities using the STEP_UPKEEP condition but this ability isn't triggered, is it? There's only 1 card I found with an upkeep availability condition that's coded, Infinite Hourglass. I tried using this part of its code (even though it grants the ability to opponents as well and I realise this card is just for the controller) to test the functioning of any upkeep and it rendered the card useless.
- Code: Select all
<AVAILABILITY any_player="1" />
<AVAILABILITY>
return MTG():GetStep() == STEP_UPKEEP
</AVAILABILITY>
So far this is the code I have for the card, it seems to work fine with the exception of the upkeep rule.
- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
<FILENAME text="DWARVEN_ARMORY_2618" />
<CARDNAME text="DWARVEN_ARMORY" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Dwarven Armory]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Dwarven Armory]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Dwarven Armory]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Dwarven Armory]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Dwarven Armory]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Dwarven Armory]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Dwarven Armory]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Dwarven Armory]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Dwarven Armory]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="2618" />
<ARTID value="2618" />
<ARTIST name="Richard Thomas" />
<CASTING_COST cost="{2}{R}{R}" />
<TYPE metaname="Enchantment" />
<EXPANSION value="IA" />
<RARITY metaname="R" />
<ACTIVATED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{2}, Sacrifice a land: Put a +2/+2 counter on target creature. Activate this ability only during any upkeep step.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{2}, Sacrifice a land: Put a +2/+2 counter on target creature. Activate this ability only during any upkeep step.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{2}, Sacrifice a land: Put a +2/+2 counter on target creature. Activate this ability only during any upkeep step.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{2}, Sacrifice a land: Put a +2/+2 counter on target creature. Activate this ability only during any upkeep step.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{2}, Sacrifica una terra: Metti un segnalino +2/+2 su una creatura bersaglio. Attiva questa abilità solo durante una qualsiasi sottofase di mantenimento.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{2}, Sacrifice a land: Put a +2/+2 counter on target creature. Activate this ability only during any upkeep step.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{2}, Sacrifice a land: Put a +2/+2 counter on target creature. Activate this ability only during any upkeep step.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{2}, Sacrifice a land: Put a +2/+2 counter on target creature. Activate this ability only during any upkeep step.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{2}, Sacrifice a land: Put a +2/+2 counter on target creature. Activate this ability only during any upkeep step.]]></LOCALISED_TEXT>
<COST mana_cost="{2}" type="Mana" />
<COST type="Sacrifice" definition="0" compartment="1" query_tag="CARD_QUERY_CHOOSE_LAND_TO_SACRIFICE" item_count="1" />
<COST_DEFINITION id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
</COST_DEFINITION>
<TARGET tag="CHOOSE_CREATURE_TO_GET +2_+2" definition="0" compartment="0" count="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
target:AddCounters( MTG():PlusOnePlusOneCounters(), 2)
end
</RESOLUTION_TIME_ACTION>
</ACTIVATED_ABILITY>
</CARD_V2>