It is currently 22 Nov 2019, 20:16
   
Text Size

[DotP2013] Help with Enter the Infinite

Moderators: Xander9009, CCGHQ Admins

[DotP2013] Help with Enter the Infinite

Postby BETenner » 11 Mar 2013, 14:43

I tried to code Enter the Infinite, and my codes are:
Code: Select all
  <SPELL_ABILITY dangerous="1" filter_zone="ZONE_IN_PLAY">
    <RESOLUTION_TIME_ACTION>
      local count = EffectController():Library_Count()
      for i=0,count-1 do
        EffectController():DrawCard()
      end
    </RESOLUTION_TIME_ACTION>
  </SPELL_ABILITY>
  <TRIGGERED_ABILITY auto_skip="1" active_zone="ZONE_ANY">
    <TRIGGER value="DREW_CARD" simple_qualifier="controller">
      return (TriggerPlayer() == EffectController() and TriggerPlayer():Library_Count() == 0)
    </TRIGGER>
    <TARGET_DEFINITION id="0">
      local filter = Object():GetFilter()
      filter:Clear()
      filter:SetPlayer( EffectController() )
      filter:SetZone( ZONE_HAND )
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
      return AtLeastOneTargetFromDefinition(0)
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
      EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_CARD_TO_PUT_ONTO_LIBRARY", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
      if (target ~= nil) then
        target:PutOnTopOfLibrary()
      end
    </RESOLUTION_TIME_ACTION>
    <CONTINUOUS_ACTION layer="8">
      Object():GetPlayer():GetCurrentCharacteristics():Bool_Set( PLAYER_CHARACTERISTIC_NO_HAND_LIMIT, 1 )
    </CONTINUOUS_ACTION>
    <DURATION simple_duration="UntilEOT" />
  </TRIGGERED_ABILITY>
The strange thing is, the "choosing card to put on top of library" action always repeat itself several times (seems random, from 7 to 16 times). How to make the "choosing" action fire only once?
BETenner
 
Posts: 36
Joined: 07 Mar 2013, 14:20
Has thanked: 7 times
Been thanked: 4 times

Re: [DotP2013] Help with Enter the Infinite

Postby thefiremind » 11 Mar 2013, 15:11

Of course it repeats itself several times... you made it as a triggered ability that goes on its own, no matter what you do with this card. It's a lot easier than that:
Code: Select all
  <SPELL_ABILITY dangerous="1" filter_zone="ZONE_IN_PLAY">
    <RESOLUTION_TIME_ACTION>
      local count = EffectController():Library_Count()
      if count &gt; 0 then
        for i=0,count-1 do
          EffectController():DrawCard()
        end
      end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      local filter = Object():GetFilter()
      filter:Clear()
      filter:SetPlayer( EffectController() )
      filter:SetZone( ZONE_HAND )
      filter:NotTargetted()
      EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_CARD_TO_PUT_ONTO_LIBRARY", EffectDC():Make_Targets(0) )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
      if (target ~= nil) then
        target:PutOnTopOfLibrary()
      end
    </RESOLUTION_TIME_ACTION>
    <CONTINUOUS_ACTION layer="8">
      EffectController():GetCurrentCharacteristics():Bool_Set( PLAYER_CHARACTERISTIC_NO_HAND_LIMIT, 1 )
    </CONTINUOUS_ACTION>
    <DURATION>
    return MTG():GetStep() == STEP_UNTAP and EffectController():MyTurn() ~= 0
    </DURATION>
  </SPELL_ABILITY>
I also added NotTargetted() in the filter for the query (when the card doesn't say "target", it's not targetted) and changed the duration to something that should represent "until your next turn" a bit better.
< 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: 717 times

Re: [DotP2013] Help with Enter the Infinite

Postby BETenner » 11 Mar 2013, 15:42

Thanks! You're the script master!
BETenner
 
Posts: 36
Joined: 07 Mar 2013, 14:20
Has thanked: 7 times
Been thanked: 4 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 3 guests


Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 guests (based on users active over the past 10 minutes)
Most users ever online was 553 on 18 Nov 2019, 23:05

Users browsing this forum: No registered users and 3 guests

Login Form