Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk
Rhox and Thorn Elemental
Moderator: CCGHQ Admins
1 post
• Page 1 of 1
Rhox and Thorn Elemental
by thefiremind » 28 Sep 2012, 08:29
Just as a tip (mostly for those who didn't see the expansion challenges yet), I'm going to show you the code used for Rhox and Thorn Elemental:
EDIT: Just tried, and it's not true! Those creatures can be blocked by any number of other creatures in that challenge... maybe not in the winning solution, but that would not be a good reason to let the card ask the same question over and over. The right trigger condition should be just:
- Code: Select all
<TRIGGERED_ABILITY forced_skip="1" filter_zone="ZONE_IN_PLAY">
<TRIGGER value="BLOCKING">
return SecondaryObject() == Object()
</TRIGGER>
<RESOLUTION_TIME_ACTION>
Object():GetPlayer():BeginNewMultipleChoice()
Object():GetPlayer():AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_COMBAT_DAMAGE_TO_PLAYER" )
Object():GetPlayer():AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_COMBAT_DAMAGE_TO_CREATURES" )
Object():GetPlayer():AskMultipleChoiceQuestion( "CARD_QUERY_MC_CHOOSE_DAMAGE_CREATURE_OR_PLAYER" )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local decision = Object():GetMultipleChoiceResult()
if decision == 0 then
ObjectDC():Set_Int(0, 1)
elseif decision == 1 then
ObjectDC():Set_Int(0, 0)
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY internal="1" pre_trigger="1">
<TRIGGER value="CREATURE_DEALS_COMBAT_DAMAGE_TO_CREATURE" simple_qualifier="self" />
<RESOLUTION_TIME_ACTION>
if ObjectDC():Get_Int(0) == 1 then
Damage():SetReceivingPlayer( SecondaryObject():GetPlayer() )
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
EDIT: Just tried, and it's not true! Those creatures can be blocked by any number of other creatures in that challenge... maybe not in the winning solution, but that would not be a good reason to let the card ask the same question over and over. The right trigger condition should be just:
- Code: Select all
<TRIGGER value="WAS_BLOCKED" simple_qualifier="self" />
< 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
1 post
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 11 guests