Trigger BEFORE drawing a card?
New decks and cards for Stainless Games' release
Moderator: CCGHQ Admins
20 posts
• Page 2 of 2 • 1, 2
Re: Trigger BEFORE drawing a card?
by Persee » 30 Jun 2011, 13:24
I tried to code dredge. Here's the code i made :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?
- 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>
Re: Trigger BEFORE drawing a card?
by 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.
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.
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...
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>
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>
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?
by 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...
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?
by 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>
Re: Trigger BEFORE drawing a card?
by 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.
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
20 posts
• Page 2 of 2 • 1, 2
Return to Magic: The Gathering - Duels of the Planeswalkers
Who is online
Users browsing this forum: No registered users and 1 guest