Page 1 of 1

How to achieve effect"deals 1 damage to 3 different players"

PostPosted: 27 Feb 2012, 08:22
by sumomole
I know how to achieve “deals 1 damage to 3 different creatures”
But how to achieve “deals 1 damage to 3 different players” ?
Code: Select all
    <PLAY_TIME_ACTION>
    local filter = Object():GetFilter()
    local player = Object():GetPlayer()
    filter:Clear()
    filter:SetZone( ZONE_IN_PLAY )
    filter:AddCardType( CARD_TYPE_CREATURE )
    player:SetTargetCount(3)
      for i=0,2 do
          player:SetTargetPrompt( i, "CARD_QUERY_CHOOSE_DEAL_1_DAMAGE" )
      end
    player:ChooseTargets()
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target_array = {}
    for i=0,2 do
      target_array[i] = Object():GetNthTargetCard(i)
    end
    for i=0,2 do
      if target_array[i] ~= nil then
        target_array[i]:DealDamage( 1, Object() )
      end
    end
    </RESOLUTION_TIME_ACTION>

Re: How to achieve effect"deals 1 damage to 3 different play

PostPosted: 05 Mar 2012, 17:32
by Eglin
Have you looked at Inferno Titan? It seems like it should be straightforward to remove the bits that target creatures.

Re: How to achieve effect"deals 1 damage to 3 different play

PostPosted: 05 Mar 2012, 19:04
by thefiremind
Eglin wrote:Have you looked at Inferno Titan? It seems like it should be straightforward to remove the bits that target creatures.
I thought about that, too, and I was about to answer the topic, but Inferno Titan code allows to deal all damage to the same player, while he asked about "3 different players". Anyway, Inferno Titan could be a good start... you could try to save the first 2 targets so that you can exclude them in the following filters, but I don't know if it's possible.

Re: How to achieve effect"deals 1 damage to 3 different play

PostPosted: 09 Mar 2012, 22:02
by nabeshin
I did Inferno Titan(and when I decided to improve its code... awful memories). I will advise to make all without filters, through - GetGlobalIndex, GetPlayerByGlobalIndex and GetNumberOfPlayers + AskMultipleChoiceQuestion