Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk



Leyline of Vitality
Moderator: CCGHQ Admins
Leyline of Vitality
by zanemerrick » 17 Apr 2011, 20:53
Hi all. This forum seems to be a little dead lately and I was hoping for some help from more experienced coders than myself. If you're still here, please help
OK, so I've been working on Leyline of Vitality for a little while now and after some trial and error, I seem to have come to a dead end
Everything works perfectly as listed below, except part of the first ability: "If Leyline of Vitality is in your opening hand, you may begin with it on the battlefield."
I can get the game to ask if I want to start with it on the battlefield (it all works great), but the problem comes when I draw it later in the game, say 3rd or 4th turn in. It still asks if you want to start the game with it in play (therefore getting a free Leyline no matter at which point in the game you're in. Here's what I have:

OK, so I've been working on Leyline of Vitality for a little while now and after some trial and error, I seem to have come to a dead end

I can get the game to ask if I want to start with it on the battlefield (it all works great), but the problem comes when I draw it later in the game, say 3rd or 4th turn in. It still asks if you want to start the game with it in play (therefore getting a free Leyline no matter at which point in the game you're in. Here's what I have:
- Code: Select all
<TRIGGERED_ABILITY layer="0" tag="LEYLINE_OF_VITALITY_RULE_1" zone="hand" forced_skip="1">
<TRIGGER value="BEGINNING_OF_STEP"> if (MTG():GetStep() == STEP_MAIN_1 and Object():Register_Get( 1 ) < 1 and Player() == Object():GetPlayer()) then return true else return false end </TRIGGER>
<PLAYTIME> Object():Register_Set( 1, 1 ) Object():GetFilter():Clear() Object():GetFilter():SetPlayer( Object():GetPlayer() ) Object():GetPlayer():BeginNewMultipleChoice( true ) Object():GetPlayer():AddMultipleChoiceAnswer( "YES" ) Object():GetPlayer():AddMultipleChoiceAnswer( "NO" ) Object():GetPlayer():AskMultipleChoiceQuestion( "LEYLINE_OF_VITALITY_Q" ) </PLAYTIME>
<EFFECT> Object():Register_Set( 1, 1 ) if Object():GetMultipleChoiceResult() == 0 then Object():PutIntoPlay( Object():GetPlayer() ) end </EFFECT>
</TRIGGERED_ABILITY>
- zanemerrick
- Posts: 6
- Joined: 12 Apr 2011, 08:10
- Has thanked: 0 time
- Been thanked: 0 time
1 post
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 21 guests