Page 1 of 1

Multi-Mode "Charm" spells

PostPosted: 23 Apr 2011, 03:26
by Shatterhouse
Okay, I seem to have gotten Charms working.

Charms are tricky because they could have different targets depending on which mode you select as the card is played.

Note that the repository already had Funeral Charm, but there was a flaw in that it only chose targets after it resolved, giving opposing players no clue what was about to happen until it was too late to cast a counterspell.

This solution is to trigger an ability as the spell is cast, have the triggered ability choose the targets, and then resolve the spell's effect onto the triggered ability's target. Here's how I handled the two relevant abilities of Fury Charm :

Code: Select all
<SPELL_ABILITY layer="7c" tag="FURY_CHARM_RULE_1" simple_filter="Target">
   <TARGET_DETERMINATION>
      return TargetArtifactOrCreatureBad()
    </TARGET_DETERMINATION>
      <PLAYTIME>
         Object():GetFilter():Clear()
         Object():GetPlayer():BeginNewMultipleChoice( true )
         Object():GetPlayer():AddMultipleChoiceAnswer( "FURY_CHARM_MODAL_1" )
         Object():GetPlayer():AddMultipleChoiceAnswer( "FURY_CHARM_MODAL_2" )
         Object():GetPlayer():AskMultipleChoiceQuestion( "MODAL_TITLE" )
      </PLAYTIME>
      <EFFECT>
        if ((Object():GetMultipleChoiceResult() == 1) and (Object():GetTargetCard() ~= nil)) then
          PlusOnePlusOneToTargetCard()
          Trample()
         end
         if ((Object():GetMultipleChoiceResult() == 0) and (Object():GetTargetCard() ~= nil)) then
         DestroyTargetCard()
         end
      </EFFECT>
      <DURATION>
        return UntilEndOfTurn()
      </DURATION>
    </SPELL_ABILITY>
    <TRIGGERED_ABILITY layer="7c" zone="HAND" auto_skip="1" >
   <TRIGGER value="SPELL_PLAYED">
      return SelfTriggered()   
   </TRIGGER>   
   <PLAYTIME>
        if Object():GetMultipleChoiceResult() == 0 then
            TargetArtifactBad()
            ChooseTargetArtifact()
        end
        if Object():GetMultipleChoiceResult() == 1 then
           TargetCreatureBad()
           ChooseTargetCreature()
        end
   </PLAYTIME>
   <FILTER>
       return TargetCard()
   </FILTER>
   <EFFECT>
<!-- Triggered ability has no real effect -->
   </EFFECT>      
    </TRIGGERED_ABILITY>
It might be cleaner to separate each of the modes into their own triggered abilities that include the MultipleChoiceResult() in their trigger check. But it works okay like this.
The only weird thing is that there will be a slight delay between the targeting and the resolving of the spell, because it's really two things that are resolving.

Re: Multi-Mode "Charm" spells

PostPosted: 23 Apr 2011, 13:17
by spiwy
Cool! Thanks for the Discovery :P After i finish the deck i'm building, Myr Rampaging, I want to try to do a tribal Giant deck and I would like to have some Austere Command in it, so I think this can help much :)

Regards!

Re: Multi-Mode "Charm" spells

PostPosted: 17 May 2011, 11:04
by spiwy
Ok, so i made my first attemp to make a working Austere Command and this is what i did to select the first option:

Code: Select all
<SPELL_ABILITY tag="AUSTERE_COMMAND_RULE_1" layer="0">
         <PLAYTIME>
            Object():GetFilter():Clear()
            Object():GetPlayer():BeginNewMultipleChoice( true )
            Object():GetPlayer():AddMultipleChoiceAnswer( "AUSTERE_COMMAND_OPTION_1" )
            Object():GetPlayer():AddMultipleChoiceAnswer( "AUSTERE_COMMAND_OPTION_2" )
            Object():GetPlayer():AddMultipleChoiceAnswer( "AUSTERE_COMMAND_OPTION_3" )
            Object():GetPlayer():AddMultipleChoiceAnswer( "AUSTERE_COMMAND_OPTION_4" )
            Object():GetPlayer():AskMultipleChoiceQuestion( "AUSTERE_COMMAND_ONE" )
         </PLAYTIME>
         <EFFECT>
            if Object():GetMultipleChoiceResult() == 0 then
               Object():Register_Set(0,1)
            end
            if Object():GetMultipleChoiceResult() == 1 then
               Object():Register_Set(0,2)
            end
            if Object():GetMultipleChoiceResult() == 2 then
               Object():Register_Set(0,3)
            end
            if Object():GetMultipleChoiceResult() == 3 then
               Object():Register_Set(0,4)
            end
         </EFFECT>
      </SPELL_ABILITY>
Anyway, when i started to try it ingame i saw that you can't have more than 3 questions to show ingame so i can't make this card work perfectly... A shame indeed =(