It is currently 03 Aug 2025, 19:47
   
Text Size

Trigger BEFORE drawing a card?

New decks and cards for Stainless Games' release

Moderator: CCGHQ Admins

Re: Trigger BEFORE drawing a card?

Postby Persee » 30 Jun 2011, 13:24

IceManOnline wrote:I think, the best way to handle it, is with a separate card...

Maybe like a dredge-land (or a completely separate card that's exile at start of match, like the draft-card). It doesn't matter if it is in lib or grave or whatever. Whenever you draw a card, it triggers and let's you target a card which BADGE_DREDGE (not there right now, have to test if I can set new badges). If you target one it dredges, if not you draw your card...
Then the dredge-cards have to trigger for zonechange graveyard->hand and a register to mill cards.
Opinion?
I tried to code dredge. Here's the code i made :

Code: Select all
      <TRIGGERED_ABILITY layer="0"  internal="1" zone="graveyard">
            <TRIGGER value="END_OF_STEP">
                return EveryEndStep()
            </TRIGGER>
            <EFFECT>
            Object():Register_Clear(2)
            </EFFECT>
        </TRIGGERED_ABILITY>


      
      <TRIGGERED_ABILITY tag="LIFE_FROM_THE_LOAM_RULE_2" forced_skip="1" layer="0" pre_trigger="1" zone="graveyard">
            <TRIGGER value="DREW_CARD">
                if TriggerPlayer() == Object():GetOwner() and Object():Register_Get(1) == 0 and Object():Register_Get(2) == 0 then
                   override = true
                   return true
                end
            return false
            </TRIGGER>
             
            <PLAYTIME>
                   ClearFilter()
                   Object():GetFilter():SetPlayer( Object():GetPlayer() )
                   Object():GetPlayer():BeginNewMultipleChoice( true )
                   Object():GetPlayer():AddMultipleChoiceAnswer( "YES" )
                   Object():GetPlayer():AddMultipleChoiceAnswer( "NO" )
                   Object():GetPlayer():AskMultipleChoiceQuestion( "DREDGEQ_TITLE" )
            </PLAYTIME>
             
            <EFFECT>
                if   Object():GetMultipleChoiceResult() == 0 then
               MillCards( Object():GetOwner(), 3 )
               ReturnThisCardToOwnersHand()
                else
               if   Object():GetMultipleChoiceResult() == 1 then
                  Object():Register_Set(1,1)
                  Object():GetPlayer():DrawCard()
                  Object():Register_Clear(1)
                  Object():Register_Set(2,1)
               end
                end
            </EFFECT>
          </TRIGGERED_ABILITY>   
What do you think of it ?
User avatar
Persee
 
Posts: 168
Joined: 02 Jun 2011, 08:33
Has thanked: 42 times
Been thanked: 24 times

Re: Trigger BEFORE drawing a card?

Postby IceManOnline » 30 Jun 2011, 13:59

Did you test it?

What happens, if you have multiple in graveyard and you draw a card?
What happens, if you have multiple in grave and you have to draw multiple cards?
And finally what happens if there are multiple in grave, you draw a card and draw another card afterwards?

If that all works correct, than you coded it better than us ^^

I'll test it tonight too.

-Edit-
Don't even need to test it.
Code: Select all
 <TRIGGERED_ABILITY layer="0"  internal="1" zone="graveyard">
            <TRIGGER value="END_OF_STEP">
                return EveryEndStep()
            </TRIGGER>
            <EFFECT>
            Object():Register_Clear(2)
            </EFFECT>
        </TRIGGERED_ABILITY>
That's gonna be a problem. What happens if you don't want to dredge the first time but draw a second card in the same step and want to dredge then? The above trigger won't work then.
Maybe we can use ABILITY_RESOLVED for resetting the Register, but I don't know if ABILITY_RESOLVED works for TRIGGERED_ABILITY...

-- 2nd Edit --
Without testing it, I think, this should work correctly.
Code: Select all
<TRIGGERED_ABILITY tag="LIFE_FROM_THE_LOAM_RULE_2" forced_skip="1" layer="0" pre_trigger="1" zone="graveyard">
                <TRIGGER value="DREW_CARD">
                    if TriggerPlayer() == Object():GetOwner() and Object():Register_Get(1) == 0 and Object():Register_Get(2) == 0 then
                       override = true
                       return true
                    end
                return false
                </TRIGGER>
                 
                <PLAYTIME>
                       ClearFilter()
                       Object():GetFilter():SetPlayer( Object():GetPlayer() )
                       Object():GetPlayer():BeginNewMultipleChoice( true )
                       Object():GetPlayer():AddMultipleChoiceAnswer( "YES" )
                       Object():GetPlayer():AddMultipleChoiceAnswer( "NO" )
                       Object():GetPlayer():AskMultipleChoiceQuestion( "DREDGEQ_TITLE" )
                </PLAYTIME>
                 
                <EFFECT>
                    if   Object():GetMultipleChoiceResult() == 0 then
                   MillCards( Object():GetOwner(), 3 )
                   ReturnThisCardToOwnersHand()
                    else
                   if   Object():GetMultipleChoiceResult() == 1 then
                      Object():Register_Set(1,1)
                      Object():GetPlayer():DrawCard()
                      Object():Register_Clear(1)
                      Object():Register_Set(2,1)
                   end
                    end
                </EFFECT>
              </TRIGGERED_ABILITY>
<TRIGGERED_ABILITY layer="0"  internal="1" zone="graveyard">
                <TRIGGER value="ABILITY_RESOLVED">
                    return SelfTriggered() and Object():Register_Get(2)==1
                </TRIGGER>
                <EFFECT>
                Object():Register_Clear(2)
                </EFFECT>
            </TRIGGERED_ABILITY>
-- Edit3 --
Does not work correctly. If you draw 3 cards via Ancestral Recall and you only want to dredge on the 3rd card, you don't draw 2 cards and dredge then... You only dredge once...
IceManOnline
 
Posts: 80
Joined: 12 Dec 2010, 19:00
Has thanked: 0 time
Been thanked: 0 time

Re: Trigger BEFORE drawing a card?

Postby IceManOnline » 02 Jul 2011, 11:46

After much testing I think, the best solution is the "dredge-card"... But a card exiled that handles the drawing and targets a card with dredge in the graveyard.
The card in grave does the milling and puttohand, but the drawing is has to be separate from it. Otherwise, you'll always have multiple triggers when you draw a card...
IceManOnline
 
Posts: 80
Joined: 12 Dec 2010, 19:00
Has thanked: 0 time
Been thanked: 0 time

Re: Trigger BEFORE drawing a card?

Postby Persee » 02 Jul 2011, 12:15

I tested a lot of thing, and the code i found crached the game. :?

Code: Select all
   
   <TRIGGERED_ABILITY layer="0"  internal="1" zone="graveyard">
            <TRIGGER value="DREW_CARD">
                return TriggerPlayer() == Object():GetOwner()
            </TRIGGER>
            <EFFECT>
      Object():Register_Clear(2)
            </EFFECT>
        </TRIGGERED_ABILITY>
And there is another problem : when you cast Ancestral Recall, the dredge card trigger for the 3 draws. If you put it in your hand , it trigger for the next 2 draws even if you have another dredge card in your graveyard.
User avatar
Persee
 
Posts: 168
Joined: 02 Jun 2011, 08:33
Has thanked: 42 times
Been thanked: 24 times

Re: Trigger BEFORE drawing a card?

Postby IceManOnline » 02 Jul 2011, 12:43

Exactly. Because of that, I think we need a separate card for the "do you want to dredge" trigger stuff. That card targets all possible dredge cards and you choose one. The dredge card triggers, mills and puts itself to your hand. Dredge finished...
Have to try, if that works, but I don't find a better solution to prevent multitriggering for the draws.
IceManOnline
 
Posts: 80
Joined: 12 Dec 2010, 19:00
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to Magic: The Gathering - Duels of the Planeswalkers

Who is online

Users browsing this forum: No registered users and 4 guests

Main Menu

User Menu

Our Partners


Who is online

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

Login Form