Challenge Cards?
Posted: 19 Mar 2013, 22:58
I'm looking to build a Birthing Pod deck in-game but I'm not sure about the best way to obtain the card.
The "Into the Pod" Challenge (found in DECK_0018_CH.wad) contains a Birthing Pod with the following effect code:
Which of these two cards is best implemented, in your opinion?
Also, where would you suggest I go to learn the language used in coding these cards? If there are no meaningful changes between DotP 2013 and 2014, I could carry my new knowledge over to create cards in the new game when it comes out.
The "Into the Pod" Challenge (found in DECK_0018_CH.wad) contains a Birthing Pod with the following effect code:
- Code: Select all
<COST type="Mana" cost="{1}{G/P}" />
<COST type="TapSelf" />
<COST type="generic">
<TARGET_DEFINITION id="6">
local filter = Object():GetFilter()
filter:Clear()
filter:AddCardType( CARD_TYPE_CREATURE )
filter:SetPlayer( EffectController() )
filter:SetZone( ZONE_IN_PLAY )
filter:SetHint( HINT_ENEMY, EffectController() )
filter:NotTargetted()
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(6)
</TARGET_DETERMINATION>
<PLAY_TIME_ACTION>
EffectController():ChooseTarget( 6, "CARD_QUERY_CHOOSE_CREATURE_TO_SACRIFICE", EffectDC():Make_Targets(0) )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
EffectDC():Get_Targets(0):LKIShield_CardPtr(0)
EffectController():Sacrifice(target)
end
</RESOLUTION_TIME_ACTION></COST>
<RESOLUTION_TIME_ACTION>
if EffectDC() ~= nil then
local sacrifice = EffectDC():Get_Targets(0):Get_CardPtr(0)
if sacrifice ~= nil then
local Sac_CMC = (sacrifice:GetConvertedManaCost()) + 1
local filter = Object():GetFilter()
local player = EffectController()
player:MarkSearchedLibrary()
filter:Clear()
filter:SetZone( ZONE_LIBRARY )
filter:SetPlayer( player )
filter:AddCardType(CARD_TYPE_CREATURE)
filter:SetConvertedCostValue(Sac_CMC)
filter:NotTargetted()
player:SetTargetCount( 1 )
player:ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_CREATURE_TO_PUT_ONTO_BATTLEFIELD", EffectDC():Make_Targets(1) )
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
if EffectDC() ~= nil then
local target = EffectDC():Get_Targets(1):Get_CardPtr(0)
if target ~= nil then
target:PutIntoPlay( EffectController() )
end
end
</RESOLUTION_TIME_ACTION>
- Code: Select all
<COST type="Mana" cost="{1}{G/P}" />
<COST type="TapSelf" />
<COST type="generic">
<TARGET_DEFINITION id="6">
local filter = Object():GetFilter()
filter:Clear()
filter:AddCardType( CARD_TYPE_CREATURE )
filter:SetPlayer( EffectController() )
filter:SetZone( ZONE_IN_PLAY )
filter:SetHint( HINT_ENEMY, EffectController() )
filter:NotTargetted()
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(6)
</TARGET_DETERMINATION>
<PLAY_TIME_ACTION>
EffectController():ChooseTarget( 6, "CARD_QUERY_CHOOSE_CREATURE_TO_SACRIFICE", EffectDC():Make_Targets(0) )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local cost = target:GetConvertedManaCost()+1
EffectDC():Set_Int( 0, cost )
EffectController():Sacrifice(target)
end
</RESOLUTION_TIME_ACTION></COST>
<RESOLUTION_TIME_ACTION>
local filter = Object():GetFilter()
local player = EffectController()
local cost = EffectDC():Get_Int(0)
-- The first if-then prevents the AI stupidly putting two Meliras into play.
if player:IsAI() ~= 0 and cost == 2 then
filter:Clear()
filter:NotTargetted()
filter:SetZone( ZONE_IN_PLAY )
filter:SetController( player )
filter:AddCardName( "MELIRA_SYLVOK_OUTCAST" )
if filter:CountStopAt(1) ~= 0 then
player:MarkSearchedLibrary()
filter:Clear()
filter:NotTargetted()
filter:AddCardType( CARD_TYPE_CREATURE )
filter:SetConvertedCostValue( cost )
filter:SetZone( ZONE_LIBRARY )
filter:SetPlayer( player )
filter:AddCardName( "MELIRA_SYLVOK_OUTCAST" )
filter:AddExtra( FILTER_EXTRA_FLIP_NAMES )
player:ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_CREATURE_TO_PUT_ONTO_BATTLEFIELD", EffectDC():Make_Targets(1) )
else
player:MarkSearchedLibrary()
filter:Clear()
filter:NotTargetted()
filter:AddCardType( CARD_TYPE_CREATURE )
filter:SetConvertedCostValue( cost )
filter:SetZone( ZONE_LIBRARY )
filter:SetPlayer( player )
player:ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_CREATURE_TO_PUT_ONTO_BATTLEFIELD", EffectDC():Make_Targets(1) )
end
else
player:MarkSearchedLibrary()
filter:Clear()
filter:NotTargetted()
filter:AddCardType( CARD_TYPE_CREATURE )
filter:SetConvertedCostValue( cost )
filter:SetZone( ZONE_LIBRARY )
filter:SetPlayer( player )
player:ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_CREATURE_TO_PUT_ONTO_BATTLEFIELD", EffectDC():Make_Targets(1) )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
if EffectDC() ~= nil then
local target = EffectDC():Get_Targets(1):Get_CardPtr(0)
if target ~= nil then
target:PutIntoPlay( EffectController() )
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
EffectController():ShuffleLibrary()
</RESOLUTION_TIME_ACTION>
Which of these two cards is best implemented, in your opinion?
Also, where would you suggest I go to learn the language used in coding these cards? If there are no meaningful changes between DotP 2013 and 2014, I could carry my new knowledge over to create cards in the new game when it comes out.