GrovyleXShinyCelebi wrote:I wonder, is it possible to make additional costs optional, then test to see if that cost was paid with 2015's engine (i.e.
Dragonlord's Prerogative)?
This answer comes pretty late, but I finished coding
Draconic Roar now, and I had to try some different workarounds in order to find the best one. My final idea has been to code the additional cost as a kicker, while the check for controlling a Dragon is done in a triggered ability that triggers when the spell is played.
Note that Gatherer rulings say that the bonus given by the additional cost should be copied by copies of the spell (kicker will take care of this for us), while the bonus given by controlling a Dragon shouldn't (hence why I added the WasCast check, actually I'm not sure if LinkedDC gets copied by copies of the spell, but this way it's guaranteed to work).
- Draconic Roar code (tested, non-English text omitted) | Open
- Code: Select all
<UTILITY_ABILITY qualifier="Kicker">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[As an additional cost to cast Draconic Roar, you may reveal a Dragon card from your hand.]]></LOCALISED_TEXT>
<COST type="Reveal" definition="0" compartment="1" query_tag="CARD_QUERY_CHOOSE_CARD_TO_REVEAL" item_count="1" amount="1" />
<COST_DEFINITION id="0">
local filter = ClearFilter()
filter:Add(FE_SUBTYPE, OP_IS, CREATURE_TYPE_DRAGON)
</COST_DEFINITION>
<ABILITY_TEXT tag="CARD_QUERY_CHOOSE_CARD_TO_REVEAL" secondary_tag="CARD_QUERY_DO_NOTHING" />
</UTILITY_ABILITY>
<TRIGGERED_ABILITY replacement_effect="1" linked_ability_group="1" active_zone="ZONE_ANY">
<TRIGGER value="SPELL_PLAYED" simple_qualifier="self" />
<RESOLUTION_TIME_ACTION>
if EffectSourceLKI():WasCast() then
local filter = ClearFilter()
filter:Add(FE_SUBTYPE, OP_IS, CREATURE_TYPE_DRAGON)
filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
LinkedDC():Set_Int( 1, filter:CountStopAt(1) )
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<SPELL_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Draconic Roar deals 3 damage to target creature. If you revealed a Dragon card or controlled a Dragon as you cast Draconic Roar, Draconic Roar deals 3 damage to that creature’s controller.]]></LOCALISED_TEXT>
<SFX text="TARGET_FLAME_PLAY" />
<TARGET tag="CARD_QUERY_CHOOSE_CREATURE_DEAL_3_DAMAGE" 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_creature = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target_creature ~= nil then
local controller = nil
if EffectSourceLKI():WasKicked() or LinkedDC():Get_Int(1) == 1 then
controller = target_creature:GetController()
end
EffectSourceLKI():DealDamageTo(3, target_creature)
if controller ~= nil then
EffectSourceLKI():DealDamageTo(3, controller)
end
end
</RESOLUTION_TIME_ACTION>
<AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
</SPELL_ABILITY>
I know this would be incompatible with cards like
Rumbling Aftershocks, but those cards would be impossible to code anyway because WasKicked() is set only upon resolution.
By the way, I'm pretty sure this would work in DotP2014 as well.