It is currently 26 Apr 2024, 23:56
   
Text Size

Multiple targets

Moderator: CCGHQ Admins

Multiple targets

Postby BlindWillow » 04 Aug 2012, 02:28

When using kevlahnota's code for Grim Lavamancer I noticed the following for the target determination of the exile cost:

Code: Select all
      <TARGET_DETERMINATION>
      local filter = Object():GetFilter()
      filter:Clear()
      filter:SetZone( ZONE_GRAVEYARD )
      filter:SetPlayer( EffectController() )
      filter:NotTargetted()
      local total = (filter:Count())
      if total &gt; 1 then
         return 1
      else
         return 0
      end
      </TARGET_DETERMINATION>
There's actually an "official" way to handle multiple targets from a single definition now, using AtLeastNTargetsFromDefinition(). Using this method the above would become:

Code: Select all
      <TARGET_DEFINITION id="6">
      local filter = Object():GetFilter()
      filter:Clear()
      filter:SetZone( ZONE_GRAVEYARD )
      filter:SetPlayer( EffectController() )
      filter:NotTargetted()
      </TARGET_DEFINITION>
      <TARGET_DETERMINATION>
      return AtLeastNTargetsFromDefinition(6, 2)
      </TARGET_DETERMINATION>
Just thought I would put that out there for reference.
BlindWillow
 
Posts: 213
Joined: 19 Jul 2012, 00:26
Has thanked: 11 times
Been thanked: 46 times

Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 41 guests


Who is online

In total there are 41 users online :: 0 registered, 0 hidden and 41 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 41 guests

Login Form