It is currently 19 Apr 2024, 07:11
   
Text Size

Need an advice for Nettlevine Blight

Moderator: CCGHQ Admins

Re: Need an advice for Nettlevine Blight

Postby thefiremind » 18 Oct 2012, 18:03

After agreeing about the fact that only 1 Nettlevine Blight "survives", the card would become much shorter if we could search for the last Nettlevine Blight to trigger (the first one to resolve) through filter evaluation, and make only one ability that just moves that one. The other Blights will be dumped in the graveyard and lose the chance to do something. The question is: if I select the last evaluated object, will it always be the Nettlevine Blight that I wanted to leave in play?

EDIT: In case someone is curious to see the implementation of this last idea I had, here it is:
Code: Select all
<?xml version='1.0'?>
<CARD_V2>
  <FILENAME text="NETTLEVINE_BLIGHT_143731" />
  <CARDNAME text="NETTLEVINE_BLIGHT" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Nettlevine Blight]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Avvizzimento di Orticanti]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Nesselrankenfäule]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Flétrissement d’ortilierre]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Ruina de parratejida]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[イラクサヅタ病]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Nettlevine Blight]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Сглаз Оплетающей Крапивы]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Ensoamento com Urtigueira]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="143731" />
  <ARTID value="A143731" />
  <ARTIST name="Michael Sutfin" />
  <CASTING_COST cost="{4}{B}{B}" />
  <TYPE metaname="Enchantment" />
  <SUB_TYPE metaname="Aura" />
  <EXPANSION value="LRW" />
  <RARITY metaname="R" />
  <STATIC_ABILITY attach_filter="1" filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Enchant creature or land]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Incanta creatura o terra]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Kreatur-oder-Land-Verzauberung]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Enchanter : créature ou terrain]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Encantar criatura o tierra.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[エンチャント(クリーチャーか土地)]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Enchant creature or land]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Зачаровать существо или землю]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Encantar criatura ou terreno]]></LOCALISED_TEXT>
    <CONTINUOUS_ACTION>
    local attach_filter = Object():AttachmentFilter_Get()
    attach_filter:Clear()
    attach_filter:AddCardType( CARD_TYPE_CREATURE )
    attach_filter:AddCardType( CARD_TYPE_LAND )
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
  <STATIC_ABILITY filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Enchanted permanent has “At the beginning of your end step, sacrifice this permanent and attach Nettlevine Blight to a creature or land you control.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Il permanente incantato ha “Alla fine del tuo turno, sacrifica questo permanente e assegna l’Avvizzimento di Orticanti a una creatura o a una terra che controlli.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Die verzauberte bleibende Karte hat „Opfere am Ende deines Zuges diese bleibende Karte und lege die Nesselrankenfäule an eine Kreatur oder ein Land an, die bzw. das du kontrollierst”.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Le permanent enchanté a « À la fin de votre tour, sacrifiez ce permanent et attachez le Flétrissement d’ortilierre à une créature ou un terrain que vous contrôlez. »]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[El permanente encantado tiene “Al final de tu turno, sacrifica este permanente y anexa la Ruina de parratejida a una criatura o tierra que controlas”.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[エンチャントされているパーマネントは「あなたのターンの終了時に、このパーマネントを生け贄に捧げ、イラクサヅタ病をあなたがコントロールするクリーチャーか土地につける。」を持つ。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Enchanted permanent has “At the beginning of your end step, sacrifice this permanent and attach Nettlevine Blight to a creature or land you control.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Зачарованный перманент имеет способность “В конце вашего хода пожертвуйте этот перманент и прикрепите Сглаз Оплетающей Крапивы к существу или земле под вашим контролем”.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[A permanente encantada tem “No final de seu turno, sacrifique esta permanente e anexe Ensoamento com Urtigueira a uma criatura ou terreno que você controla.”]]></LOCALISED_TEXT>
    <CONTINUOUS_ACTION layer="6">
    local parent = Object():GetParent()
    if parent ~= nil then
       parent:GetCurrentCharacteristics():GrantAbility(1)
    end
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
  <TRIGGERED_ABILITY resource_id="1" dangerous="1" filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of your end step, sacrifice this permanent and attach Nettlevine Blight to a creature or land you control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Alla fine del tuo turno, sacrifica questo permanente e assegna l’Avvizzimento di Orticanti a una creatura o a una terra che controlli.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Opfere am Ende deines Zuges diese bleibende Karte und lege die Nesselrankenfäule an eine Kreatur oder ein Land an, die bzw. das du kontrollierst.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À la fin de votre tour, sacrifiez ce permanent et attachez le Flétrissement d’ortilierre à une créature ou un terrain que vous contrôlez.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Al final de tu turno, sacrifica este permanente y anexa la Ruina de parratejida a una criatura o tierra que controlas.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたのターンの終了時に、このパーマネントを生け贄に捧げ、イラクサヅタ病をあなたがコントロールするクリーチャーか土地につける。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[At the beginning of your end step, sacrifice this permanent and attach Nettlevine Blight to a creature or land you control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[В конце вашего хода пожертвуйте этот перманент и прикрепите Сглаз Оплетающей Крапивы к существу или земле под вашим контролем.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[No final de seu turno, sacrifique esta permanente e anexe Ensoamento com Urtigueira a uma criatura ou terreno que você controla.]]></LOCALISED_TEXT>
    <TRIGGER value="BEGINNING_OF_STEP" simple_qualifier="controller">
    return ( EffectController():MyTurn() ~= 0 ) and ( MTG():GetStep() == STEP_END_OF_TURN )
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    local controller = EffectController()
    local source = EffectSource()
    if controller ~= nil and source ~= nil then
       local filter = Object():GetFilter()
       filter:Clear()
       filter:AddCardType( CARD_TYPE_CREATURE )
       filter:AddCardType( CARD_TYPE_LAND )
       filter:SetZone( ZONE_IN_PLAY )
       filter:SetController( controller )
       filter:SetCardInstance( source )
       filter:AddExtra( FILTER_EXTRA_FLIP_CARD_INSTANCE )
       filter:NotTargetted()
       filter:SetHint( HINT_ENEMY, controller )
       controller:ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_PERMANENT_TO_ENCHANT", EffectDC():Make_Targets(6) )
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local controller = EffectController()
    local source = EffectSource()
    if controller ~= nil and source ~= nil then
       local filter = Object():GetFilter()
       filter:Clear()
       filter:AddCardName( "NETTLEVINE_BLIGHT" )
       filter:SetZone( ZONE_IN_PLAY )
       filter:SetParent( source )
       filter:NotTargetted()
       local filter_count = filter:EvaluateObjects()
       if filter_count &gt; 0 then
          local blight = filter:GetNthEvaluatedObject(filter_count-1)
          if blight ~= nil then
             source:Sacrifice( controller )
             local target = EffectDC():Get_Targets(6):Get_CardPtr(0)
             if target ~= nil then
                blight:Enchant( target )
             end
          end
       end
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_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:AddCardType( CARD_TYPE_LAND )
    filter:SetZone( ZONE_IN_PLAY )
    filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
    return AtLeastOneTargetFromDefinition(0)
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
    EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_PERMANENT_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="2400" zone="ZONE_HAND" />
</CARD_V2>
I'm still not totally sure if it will behave as intended in each possible scenario, but I'll keep this implementation until someone finds a flaw.
< 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: 721 times

Previous

Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 23 guests


Who is online

In total there are 23 users online :: 0 registered, 0 hidden and 23 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 23 guests

Login Form