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



Come into play tapped unless you pay 2 life
Moderator: CCGHQ Admins
3 posts
• Page 1 of 1
Come into play tapped unless you pay 2 life
by pcastellazzi » 05 Nov 2012, 01:48
I was coding Blood Crypt while i found this little problem. I will start with the solution i am using to show what i want to achieve.
- Code: Select all
<TRIGGERED_ABILITY active_zone="ZONE_TRANSITION" replacement_query="1">
<TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_IN_PLAY">
EffectDC():Set_Int(0, EffectController():GetLifeTotal() > 2 and 1 or 0)
]]>
</TRIGGER>
<PLAY_TIME_ACTION target_choosing="1">
if EffectDC():Get_Int(0) == 1 then
YesNoPrompt("CARD_QUERY_OPTION_PAY_2_LIFE")
end
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
if EffectDC():Get_Int(0) == 1 and Object():GetMultipleChoiceResult() == 0 then
EffectController():LoseLife(2)
else
Object():ComesIntoPlayTapped()
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
- Code: Select all
<TRIGGERED_ABILITY internal="1">
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_IN_PLAY" />
<COST type="Life" points="2" qualifier="conditional" />
<RESOLUTION_TIME_ACTION conditional="else">
Object():ComesIntoPlayTapped()
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
— Ben Kuchera, Mordern Warfare 3 review.
-
pcastellazzi - Posts: 184
- Joined: 25 Apr 2012, 00:40
- Location: Montevideo, Uruguay
- Has thanked: 11 times
- Been thanked: 30 times
Re: Come into play tapped unless you pay 2 life
by thefiremind » 05 Nov 2012, 09:36
My guess is that the "internal" has something to do with it. Have you tried with a "hybrid" between the 2 solutions? Something like:
- Code: Select all
<TRIGGERED_ABILITY active_zone="ZONE_TRANSITION" replacement_query="1">
<TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_IN_PLAY" />
<COST type="Life" points="2" qualifier="conditional" />
<RESOLUTION_TIME_ACTION conditional="else">
Object():ComesIntoPlayTapped()
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: Come into play tapped unless you pay 2 life
by pcastellazzi » 11 Nov 2012, 15:03
I was playing a little bit more with this today. You were right, internal="1" is the problem. After i removed it the conditional cost work as expected, same for the conditional action.
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
— Ben Kuchera, Mordern Warfare 3 review.
-
pcastellazzi - Posts: 184
- Joined: 25 Apr 2012, 00:40
- Location: Montevideo, Uruguay
- Has thanked: 11 times
- Been thanked: 30 times
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 5 guests