Re: Card Creation Request Thread
Thanks for the explanation, it was interesting indeed. With the information you gave me I was able to create Molten Primordial. However, I seem to be unable to make the targetted creatures untap. I will post the whole code just incase:
- Code: Select all
<TARGET_DEFINITION id="0">
local filter = Object():GetFilter()
filter:Clear()
filter:SetPlayer( MTG():GetNthStartingPlayer(0) )
filter:AddCardType( CARD_TYPE_CREATURE )
filter:SetZone( ZONE_IN_PLAY )
filter:SetHint( HINT_ENEMY, EffectController() )
</TARGET_DEFINITION>
<TARGET_DEFINITION id="1">
local filter = Object():GetFilter()
filter:Clear()
filter:SetPlayer( MTG():GetNthStartingPlayer(1) )
filter:AddCardType( CARD_TYPE_CREATURE )
filter:SetZone( ZONE_IN_PLAY )
filter:SetHint( HINT_ENEMY, EffectController() )
</TARGET_DEFINITION>
<TARGET_DEFINITION id="2">
local filter = Object():GetFilter()
filter:Clear()
filter:SetPlayer( MTG():GetNthStartingPlayer(2) )
filter:AddCardType( CARD_TYPE_CREATURE )
filter:SetZone( ZONE_IN_PLAY )
filter:SetHint( HINT_ENEMY, EffectController() )
</TARGET_DEFINITION>
<TARGET_DEFINITION id="3">
local filter = Object():GetFilter()
filter:Clear()
filter:SetPlayer( MTG():GetNthStartingPlayer(3) )
filter:AddCardType( CARD_TYPE_CREATURE )
filter:SetZone( ZONE_IN_PLAY )
filter:SetHint( HINT_ENEMY, EffectController() )
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
local filter = Object():GetFilter()
filter:Clear()
filter:AddCardType( CARD_TYPE_CREATURE )
filter:SetZone( ZONE_IN_PLAY )
filter:SetControllersTeam( EffectController():GetTeam() )
filter:AddExtra( FILTER_EXTRA_FLIP_TEAM )
return filter:CountStopAt(1)
</TARGET_DETERMINATION>
<PLAY_TIME_ACTION repeating="1" target_choosing="1">
local n = MTG():GetActionRepCount()
local num_starting_players = MTG():GetNumberOfStartingPlayers()
local player = MTG():GetNthStartingPlayer(n)
if player ~= nil and n < num_starting_players then
if player:GetTeam() ~= EffectController():GetTeam() and player:OutOfTheGame() == 0 then
-- ask the query (target definition is tied directly to the player index)
EffectController():ChooseTarget( n, "CARD_QUERY_CHOOSE_CREATURE_TO_GAIN_CONTROL", EffectDC():Make_Targets(n) )
end
return true
else
return false
end
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
for n=0,MTG():GetNumberOfStartingPlayers()-1 do
local targer = EffectDC():Get_Targets(n) and EffectDC():Get_Targets(n):Get_CardPtr(0)
if target ~= nil then
target:Untap()
end
end
</RESOLUTION_TIME_ACTION>
<CONTINUOUS_ACTION layer="2">
for n=0,MTG():GetNumberOfStartingPlayers()-1 do
local target = EffectDC():Get_Targets(n) and EffectDC():Get_Targets(n):Get_CardPtr(0)
if target ~= nil then
target:SetController( EffectController() )
end
end
</CONTINUOUS_ACTION>
<CONTINUOUS_ACTION layer="6">
for n=0,MTG():GetNumberOfStartingPlayers()-1 do
local target = EffectDC():Get_Targets(n) and EffectDC():Get_Targets(n):Get_CardPtr(0)
if target ~= nil then
local characteristics = target:GetCurrentCharacteristics()
characteristics:Characteristic_Set( CHARACTERISTIC_WORTHLESS, 1 )
end
end
</CONTINUOUS_ACTION>
<CONTINUOUS_ACTION layer="6">
for n=0,MTG():GetNumberOfStartingPlayers()-1 do
local target = EffectDC():Get_Targets(n) and EffectDC():Get_Targets(n):Get_CardPtr(0)
if target ~= nil then
local characteristics = target:GetCurrentCharacteristics()
characteristics:Characteristic_Set( CHARACTERISTIC_HASTE, 1 )
end
end
</CONTINUOUS_ACTION>
<DURATION simple_duration="UntilEOT" />
</TRIGGERED_ABILITY>