It is currently 07 Sep 2025, 14:31
   
Text Size

Help With Flickering Ward

Moderator: CCGHQ Admins

Help With Flickering Ward

Postby --Dream-- » 05 Aug 2012, 13:12

I'm trying to code Flickering Ward. Here's what I have so far:

Code: Select all
<?xml version='1.0'?>
<CARD_V2>
  <FILENAME text="FLICKERING_WARD_4875" />
  <CARDNAME text="FLICKERING_WARD" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Flickering Ward]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Flickering Ward]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Flickering Ward]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Flickering Ward]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Flickering Ward]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Flickering Ward]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Flickering Ward]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Flickering Ward]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Flickering Ward]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="4875" />
  <ARTID value="4875" />
  <ARTIST name="Greg Simanson" />
  <CASTING_COST cost="{W}" />
  <TYPE metaname="Enchantment" />
  <SUB_TYPE metaname="Aura" />
  <EXPANSION value="DPG" />
  <RARITY metaname="U" />
  <TRIGGERED_ABILITY auto_skip="1" pre_trigger="1" filter_zone="ZONE_IN_PLAY" active_zone="ZONE_TRANSITION">
     <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[As Iona, Shield of Emeria enters the battlefield, choose a color.]]></LOCALISED_TEXT>
     <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[As Iona, Shield of Emeria enters the battlefield, choose a color.]]></LOCALISED_TEXT>
     <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[As Iona, Shield of Emeria enters the battlefield, choose a color.]]></LOCALISED_TEXT>
     <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[As Iona, Shield of Emeria enters the battlefield, choose a color.]]></LOCALISED_TEXT>
     <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[As Iona, Shield of Emeria enters the battlefield, choose a color.]]></LOCALISED_TEXT>
     <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[As Iona, Shield of Emeria enters the battlefield, choose a color.]]></LOCALISED_TEXT>
     <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[As Iona, Shield of Emeria enters the battlefield, choose a color.]]></LOCALISED_TEXT>
     <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[As Iona, Shield of Emeria enters the battlefield, choose a color.]]></LOCALISED_TEXT>
     <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[As Iona, Shield of Emeria enters the battlefield, choose a color.]]></LOCALISED_TEXT>
    <TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_IN_PLAY" />
    <RESOLUTION_TIME_ACTION>
    EffectController():ChooseColour("CARD_QUERY_CHOOSE_COLOUR", 1) 
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    ObjectDC():Set_Int( 0, GetChosenColour() )
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <STATIC_ABILITY attach_filter="1" filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Enchant creature]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Enchanter: créature]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Encantar criatura.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Kreaturenverzauberung]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Incanta creatura]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[エンチャント(クリーチャー)]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[생물에게 부여]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Зачаровать существо]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Encantar criatura]]></LOCALISED_TEXT>
    <CONTINUOUS_ACTION>
    local attach_filter = Object():AttachmentFilter_Get()
    attach_filter:Clear()
    attach_filter:AddCardType( CARD_TYPE_CREATURE )
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
  <STATIC_ABILITY filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Enchanted creature has protection from the chosen color. This effect doesn’t remove Flickering Ward.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Enchanted creature has protection from the chosen color. This effect doesn’t remove Flickering Ward.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Enchanted creature has protection from the chosen color. This effect doesn’t remove Flickering Ward.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Enchanted creature has protection from the chosen color. This effect doesn’t remove Flickering Ward.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Enchanted creature has protection from the chosen color. This effect doesn’t remove Flickering Ward.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Enchanted creature has protection from the chosen color. This effect doesn’t remove Flickering Ward.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Enchanted creature has protection from the chosen color. This effect doesn’t remove Flickering Ward.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Enchanted creature has protection from the chosen color. This effect doesn’t remove Flickering Ward.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Enchanted creature has protection from the chosen color. This effect doesn’t remove Flickering Ward.]]></LOCALISED_TEXT>
   <CONTINUOUS_ACTION layer="6">
      local chosencolor = ObjectDC():Get_Int( 0 )
      local parent = Object():GetParent()
      if parent ~= nil then
         local filter = Object():GetFilter()
         filter:Clear()
         filter:AddColour( chosencolor )
         parent:Protection()
      end
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
  <ACTIVATED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{W}: Return Flickering Ward to its owner’s hand.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{W}: Return Flickering Ward to its owner’s hand.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{W}: Return Flickering Ward to its owner’s hand.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{W}: Return Flickering Ward to its owner’s hand.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{W}: Return Flickering Ward to its owner’s hand.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{W}: Return Flickering Ward to its owner’s hand.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{W}: Return Flickering Ward to its owner’s hand.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{W}: Return Flickering Ward to its owner’s hand.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{W}: Return Flickering Ward to its owner’s hand.]]></LOCALISED_TEXT>
   <COST type="Mana" cost="{W}" />
    <RESOLUTION_TIME_ACTION>
      Object():PutInHand()
    </RESOLUTION_TIME_ACTION>
    <AI_AVAILABILITY type="in_response_dangerous" />
    <AI_AVAILABILITY step="declare_blockers" blocking_or_blocked="1" />
  </ACTIVATED_ABILITY>
  <SPELL_ABILITY attach_filter="1" dangerous="1" filter_zone="ZONE_IN_PLAY">
    <TARGET_DEFINITION id="0">
    local filter = Object():GetFilter()
    filter:Clear()
    filter:AddCardType( CARD_TYPE_CREATURE )
    filter:SetZone( ZONE_IN_PLAY )
    filter:SetHint( HINT_ALLIED_ONLY, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
    return AtLeastOneTargetFromDefinition(0)
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
    EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_CREATURE_TO_ENCHANT", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target_card = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target_card ~= nil then
          Object():Enchant( target_card )
    end
    </RESOLUTION_TIME_ACTION>
  </SPELL_ABILITY>
  <AI_BASE_SCORE score="600" zone="ZONE_HAND" />
  <AI_BASE_SCORE score="450" type="Parent" zone="ZONE_IN_PLAY" />
  <HELP title="MORE_INFO_TITLE_PROTECTION" body="MORE_INFO_BODY_PROTECTION" zone="ZONE_ANY" />
</CARD_V2>
The creature gets protection from the colour of my choice just fine. The problem is this part "This effect doesn’t remove Flickering Ward.". As soon as I play the enchantment and choose white for the colour it goes immediately to the graveyard. So I guess I need to code an exception?
--Dream--
 
Posts: 65
Joined: 28 Jul 2012, 12:01
Has thanked: 4 times
Been thanked: 0 time

Re: Help With Flickering Ward

Postby RiiakShiNal » 05 Aug 2012, 13:27

Coding in the exception should be easy it should be just like this:
Code: Select all
   <CONTINUOUS_ACTION layer="6">
      local chosencolor = ObjectDC():Get_Int( 0 )
      local parent = Object():GetParent()
      if parent ~= nil then
         local filter = Object():GetFilter()
         filter:Clear()
         filter:AddColour( chosencolor )
         filter:SetCardInstance( Object() )
         filter:AddExtra( FILTER_EXTRA_FLIP_CARD_INSTANCE )
         parent:Protection()
      end
    </CONTINUOUS_ACTION>
Though due to adding the exception it may screw with the protection badge appearance and tip text (I don't know as I haven't tested).
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Help With Flickering Ward

Postby thefiremind » 05 Aug 2012, 13:59

RiiakShiNal wrote:Though due to adding the exception it may screw with the protection badge appearance and tip text (I don't know as I haven't tested).
I think so, too. And we don't even get the "generic protection" badge, but the regeneration badge instead... I hate that visual bug. :(
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 8 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 8 users online :: 0 registered, 0 hidden and 8 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 8 guests

Login Form