It is currently 31 Jul 2025, 11:11
   
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
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 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: 195
Joined: 01 Mar 2012, 14:44
Has thanked: 39 times
Been thanked: 22 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.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 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: 31 times


Return to Magic: The Gathering - Duels of the Planeswalkers

Who is online

Users browsing this forum: No registered users and 1 guest

cron

Main Menu

User Menu

Our Partners


Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 1 guest

Login Form