Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
[DotP2013] Help with Enter the Infinite
Moderator: CCGHQ Admins
[DotP2013] Help with Enter the Infinite
by 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>
Re: [DotP2013] Help with Enter the Infinite
by 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 > 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>
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: [DotP2013] Help with Enter the Infinite
by BETenner » 11 Mar 2013, 15:42
Thanks! You're the script master!
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 26 guests