It is currently 16 Apr 2024, 13:28
   
Text Size

Help with "Thought Reflection" [draw 2 cards instead of 1]

Moderator: CCGHQ Admins

Help with "Thought Reflection" [draw 2 cards instead of 1]

Postby Zambooo » 24 Mar 2014, 21:17

Hello everyone, I was trying to code the card "Thought Reflection" (http://magiccards.info/shm/en/53.html) [for DotP 2013!] but I have no idea of how doing that following the "rule" specified:
Thought Reflection doesn't cause you to draw cards. Rather, it causes card-drawing effects to have you draw more cards. It also causes the draw action during your draw step to have you draw two cards.
Here it is where I am atm
Code: Select all
<?xml version='1.0'?>
<CARD_V2>
  <FILENAME text="THOUGHT_REFLECTION_146728" />
  <CARDNAME text="THOUGHT_REFLECTION" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Thought Reflection]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Riflesso di Pensiero]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Gedankenspiegelung]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Réverbération de pensée]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Reflejo del pensamiento]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[思考の反射]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Thought Reflection]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Отражение Мысли]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Reflexo de Pensamento]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="146728" />
  <ARTID value="A146728" />
  <ARTIST name="Terese Nielsen &amp; Ron Spencer" />
  <CASTING_COST cost="{U}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Knowledge fills the mind of a fool and opens the mind of the sage.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[La sapienza riempie la mente del folle e apre quella del saggio.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Wissen füllt den Verstand eines Dummkopfs und öffnet den eines Weisen.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Le savoir emplit l'esprit de l'imbécile et ouvre celui du sage.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[El conocimiento llena la mente de un tonto y abre la mente de un sabio.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[知識は愚か者の精神を満たし、賢者の精神を開く。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Knowledge fills the mind of a fool and opens the mind of the sage.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Знание заполняет разум глупца и расширяет горизонты умного.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[O conhecimento preenche a mente de um tolo e abre a mente de um sábio.]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Enchantment" />
  <EXPANSION value="DPG" />
  <RARITY metaname="R" />
  <TRIGGERED_ABILITY internal="1" pre_trigger="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[If you would draw a card, draw two cards instead.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Se stai per pescare una carta, pesca invece due carte.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Falls du eine Karte ziehen würdest, ziehe stattdessen zwei Karten.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Si vous deviez piocher une carte, piochez deux cartes à la place.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Si fueras a robar una carta, en vez de eso, roba dos cartas.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたがカードを1枚引く場合、代わりにカードを2枚引く。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[If you would draw a card, draw two cards instead.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Если вы должны взять карту, возьмите две карты вместо этого.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Se você for comprar um card, em vez disso, compre dois cards.]]></LOCALISED_TEXT>
   <TRIGGER value="DREW_CARD" simple_qualifier="controller">
    if TriggerPlayer() == EffectController() then
      override = 1
       return true
    end
   return false
    </TRIGGER>
   <RESOLUTION_TIME_ACTION>
      EffectDC():SetAmount( 2 )
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <AI_BASE_SCORE score="1200" zone="ZONE_IN_PLAY" />
</CARD_V2>
I kinda have no idea on how am I supposed to code it rigth, but I already tried different methods with no success..
Maybe some of you may hel me :D
User avatar
Zambooo
 
Posts: 242
Joined: 01 Jul 2012, 21:33
Has thanked: 19 times
Been thanked: 17 times

Re: Help with "Thought Reflection" [draw 2 cards instead of

Postby thefiremind » 24 Mar 2014, 21:28

Substitute
Code: Select all
EffectDC():SetAmount( 2 )
with
Code: Select all
for i=0,1 do
   EffectController():DrawCard()
end
I don't know why the rulings have been phrased like that: all you do is substitute each card draw with 2 card draws. Of course the substitution needs to stop there, otherwise you would have an infinite loop, but the engine takes care of that automatically (what happens in internal triggers doesn't cause other triggers to fire).
< 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

Re: Help with "Thought Reflection" [draw 2 cards instead of

Postby Zambooo » 24 Mar 2014, 21:38

I already tried a solution like that, but when I have two of them in play, for some reasons I draw 5 cards instead of 4 during my draw step..

The effects of multiple Thought Reflections are cumulative. For example, if you have three Thought Reflections on the battlefield, you'll draw eight times the original number of cards.
Edit: now with your solution I draw two more cards and not two instead of one #-o and without the cycle I still draw 5 cards instead of 4 with two Thought Reflection in play.. how is that possible? :/
User avatar
Zambooo
 
Posts: 242
Joined: 01 Jul 2012, 21:33
Has thanked: 19 times
Been thanked: 17 times

Re: Help with "Thought Reflection" [draw 2 cards instead of

Postby thefiremind » 24 Mar 2014, 23:10

Zambooo wrote:Edit: now with your solution I draw two more cards and not two instead of one #-o and without the cycle I still draw 5 cards instead of 4 with two Thought Reflection in play.. how is that possible? :/
It's possible that I don't remember how to properly override in DotP2013 anymore... for that reason I went and checked my Laboratory Maniac. It doesn't have the internal tag... maybe it wasn't needed for overrides? I really can't remember. Anyway, here's how my Laboratory Maniac would look like when substituting his effect with what you need:
Code: Select all
  <TRIGGERED_ABILITY pre_trigger="1" priority="1">
    -- Localised text omitted
    <TRIGGER value="DREW_CARD" simple_qualifier="controller">
    if override == false then
       override = true
       return true
    end
    return false
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    for i=0,1 do
       EffectController():DrawCard()
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
If this doesn't work either, then I'm out of options and you'll need to get an answer from someone who remembers DotP2013 better than me.
< 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

Re: Help with "Thought Reflection" [draw 2 cards instead of

Postby Zambooo » 24 Mar 2014, 23:36

As far as I know the "internal" tag is intented for not "animate" the trigger, but let it happen automatically, so that you can't put on pile spells while the ability is resolving.. (and in that case would save the player a lot of time watching the enchantment trigger)
Anyways thanks, I will test it soon :)
User avatar
Zambooo
 
Posts: 242
Joined: 01 Jul 2012, 21:33
Has thanked: 19 times
Been thanked: 17 times

Re: Help with "Thought Reflection" [draw 2 cards instead of

Postby RiiakShiNal » 24 Mar 2014, 23:47

Zambooo wrote:As far as I know the "internal" tag is intented for not "animate" the trigger, but let it happen automatically, so that you can't put on pile spells while the ability is resolving.. (and in that case would save the player a lot of time watching the enchantment trigger)
The internal tag is primarily intended to prevent an ability from being responded to or seen, but there are also some other side effects to it that can make it necessary for some abilities while other abilities won't work right with it. I don't think anyone has gone through to try and determine all of its effects on an ability and actually listed them out. Also I don't really remember instances that required it or where its presence screwed things up so I can't really point you in the right direction.

You can also prevent responding to an ability and eliminate the pause by using forced_skip="1". It can be used in places that internal="1" can't be used, but forced_skip will show a brief activation animation (still virtually no wait, but it gives an indication of what triggered). Though it is not a replacement for internal as there are places where internal is needed and forced_skip just won't work.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 496 times

Re: Help with "Thought Reflection" [draw 2 cards instead of

Postby Zambooo » 25 Mar 2014, 00:04

Tested. With the trigger from Laboratory Maniac the card works perfectly (at least with 2 of them on the field) even with the internal tag. Thanks to everyone =D>
User avatar
Zambooo
 
Posts: 242
Joined: 01 Jul 2012, 21:33
Has thanked: 19 times
Been thanked: 17 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 19 guests


Who is online

In total there are 19 users online :: 0 registered, 0 hidden and 19 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 19 guests

Login Form