Page 1 of 1

Military Intelligence

PostPosted: 26 Jul 2014, 15:47
by volrathxp
Can someone look at my code here for Military Intelligence? I just tried it and it doesn't trigger when I attack with two or more creatures. I'm not really sure why, either, since it looks fine to me.

Thanks!

Code: Select all
<TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever you attack with two or more creatures, draw a card.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que vous attaquez avec deux créatures ou plus, piochez une carte.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que ataques con dos o más criaturas, roba una carta.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn du mit zwei oder mehr Kreaturen angreifst, ziehe eine Karte.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta attacchi con due o più creature, pesca una carta.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたが2体以上のクリーチャーで攻撃するたび、カードを1枚引く。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[당신이 생물 두 개 이상으로 공격할 때마다, 카드 한 장을 뽑는다.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз, когда вы атакуете двумя или более существами, возьмите карту.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que você atacar com duas ou mais criaturas, compre um card.]]></LOCALISED_TEXT>
   <TRIGGER value="ATTACKING" simple_qualifier="self">
    local filter = ClearFilter()
    filter:Add( FE_IS_ATTACKING, true )
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE  )
    if filter:CountStopAt(2) == 2 then
       return true
    end
    return false
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>

       EffectController():DrawCards(1)   

    </RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>

Re: Military Intelligence

PostPosted: 26 Jul 2014, 16:09
by sweetLu
It is checking if itself is attacking :) . Remove simple_qualifier="self" from the trigger tag. You might be able to use controller as the simple qualifier. If not you will have to check who owns the attacking creators in the trigger.

Re: Military Intelligence

PostPosted: 26 Jul 2014, 20:34
by volrathxp
sweetLu wrote:It is checking if itself is attacking :) . Remove simple_qualifier="self" from the trigger tag. You might be able to use controller as the simple qualifier. If not you will have to check who owns the attacking creators in the trigger.
Derp. Yeah that was it. Thanks! :)

Re: Military Intelligence

PostPosted: 26 Jul 2014, 21:40
by volrathxp
Well now it triggers, but it triggers twice.

It's almost as if the CountStopAt() function isn't working or something. I'm not sure.

Re: Military Intelligence

PostPosted: 26 Jul 2014, 22:00
by thefiremind
volrathxp wrote:Well now it triggers, but it triggers twice.
That's because the ATTACKING trigger triggers once for each attacking creature, so if there are 2, it will trigger twice. Use the ATTACKERS_DECLARED trigger, and add a check for FE_CONTROLLER being EffectController in the filter:
Code: Select all
    <TRIGGER value="ATTACKERS_DECLARED">
    local filter = ClearFilter()
    filter:Add( FE_IS_ATTACKING, true )
    filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
    return filter:CountStopAt(2) == 2
    </TRIGGER>

Re: Military Intelligence

PostPosted: 26 Jul 2014, 22:04
by RiiakShiNal
If you use the ATTACKING trigger it will trigger once for each attacking creature. You can use ATTACKERS_DECLARED instead to trigger just once for each attack in which attackers were declared (just make sure you check to make sure it is the controller's turn so it doesn't trigger on the opponent's turn).

Edit: thefiremind beat me to it this time. :lol:

Re: Military Intelligence

PostPosted: 26 Jul 2014, 22:43
by volrathxp
Ahh I see now. Thanks again! I hopefully will be sharing my work soon. XD