It is currently 21 May 2013, 09:05
   
Text Size

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

New decks and cards for Stainless Games' release

Moderator: CCGHQ Admins

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

Postby sumomole » 27 Feb 2012, 08:22

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>
User avatar
sumomole
 
Posts: 213
Joined: 07 Jun 2011, 08:34
Has thanked: 22 times
Been thanked: 78 times

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

Postby Eglin » 05 Mar 2012, 17:32

Have you looked at Inferno Titan? It seems like it should be straightforward to remove the bits that target creatures.
User avatar
Eglin
Programmer
 
Posts: 185
Joined: 01 Mar 2012, 14:44
Has thanked: 35 times
Been thanked: 19 times

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

Postby thefiremind » 05 Mar 2012, 19:04

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.
< DotP2013 (and formerly 2012) modder >
WADs unrecognized by the game? Look here.
Need a basic modding tutorial? Try this.
Want to start coding cards? Try my web generator.
User avatar
thefiremind
Programmer
 
Posts: 1644
Joined: 07 Nov 2011, 10:55
Has thanked: 60 times
Been thanked: 361 times

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

Postby nabeshin » 09 Mar 2012, 22:02

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
User avatar
nabeshin
 
Posts: 207
Joined: 27 Jun 2011, 20:07
Has thanked: 5 times
Been thanked: 30 times


Return to Magic: The Gathering - Duels of the Planeswalkers

Who is online

Users browsing this forum: mkchuk and 5 guests


Who is online

In total there are 6 users online :: 1 registered, 0 hidden and 5 guests (based on users active over the past 10 minutes)
Most users ever online was 177 on 10 Oct 2011, 16:37

Users browsing this forum: mkchuk and 5 guests

Login Form