Hey guys! This is another card from my D.D. Dragons deck. Basically like a 'Trade-In' for them. The pic is really old and back from when I was still developing the D.D.s, but don't mind that. The effect specifies the D.D. Dragons though.
The
Dragon's Gift
---32083018
function c32083018.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c32083018.cost)
e1:SetTarget(c32083018.target)
e1:SetOperation(c32083018.activate)
c:RegisterEffect(e1)
end
function c32083018.cfilter(c)
return c:IsDiscardable() and c:IsRace(RACE_DRAGON) and c:IsSetCard(0x7D53)
end
function c32083018.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c32083018.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c32083018.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c32083018.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c32083018.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end