a place for all your custom card needs you can post scripts pics and request for card to be made also please donate to the funding for a new server made for custom card duels
 
HomePortalCalendarFAQSearchMemberlistUsergroupsRegisterLog in

Share | .
 

 D.D. Fusion

View previous topic View next topic Go down 
AuthorMessage
cane_63106

avatar


Member Title : D.D. Dragon Kaiser
Posts : 454
Join date : 2013-07-23
Location : St. Louis, MO

PostSubject: D.D. Fusion   Mon Aug 05, 2013 1:40 am



--32083020
function c32083020.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c32083020.target)
e1:SetOperation(c32083020.activate)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetOperation(c32083020.desop)
c:RegisterEffect(e2)
--Destroy2
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCondition(c32083020.descon2)
e3:SetOperation(c32083020.desop2)
c:RegisterEffect(e3)
end
function c32083020.filter1(c,e)
return c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e)
end
function c32083020.filter2(c,e,tp,m)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_DRAGON)and c:IsSetCard(0x7D53) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,PLAYER_NONE,false,false)
and c:CheckFusionMaterial(m)
end
function c32083020.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetMatchingGroup(c32083020.filter1,tp,LOCATION_DECK,0,nil,e)
return Duel.IsExistingMatchingCard(c32083020.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg)
end
e:GetHandler():SetTurnCounter(0)
end
function c32083020.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local mg=Duel.GetMatchingGroup(c32083020.filter1,tp,LOCATION_DECK,0,nil,e)
local sg=Duel.GetMatchingGroup(c32083020.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg)
if sg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
Duel.ConfirmCards(1-tp,tc)
local code=tc:GetCode()
local mat=Duel.SelectFusionMaterial(tp,tc,mg)
local fg=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_EXTRA,0,nil,code)
local tc=fg:GetFirst()
while tc do
tc:SetMaterial(mat)
tc=fg:GetNext()
end
Duel.Remove(mat,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,2)
e1:SetRange(LOCATION_SZONE)
e1:SetOperation(c32083020.proc)
e1:SetLabel(code)
e1:SetLabelObject(e)
c:RegisterEffect(e1)
end
end
function c32083020.procfilter(c,code,e,tp)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)
end
function c32083020.proc(e,tp,eg,ep,ev,re,r,rp)
if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler()
local ct=c:GetTurnCounter()
ct=ct+1
c:SetTurnCounter(ct)
if ct==2 then
local code=e:GetLabel()
local tc=Duel.GetFirstMatchingCard(c32083020.procfilter,tp,LOCATION_EXTRA,0,nil,code,e,tp)
if not tc then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then
Duel.SendtoGrave(tc,REASON_EFFECT)
tc:CompleteProcedure()
else
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
c:SetCardTarget(tc)
end
end
end
function c32083020.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
if tc and tc:IsLocation(LOCATION_MZONE) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
function c32083020.descon2(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
return tc and eg:IsContains(tc) and tc:IsReason(REASON_DESTROY)
end
function c32083020.desop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
Back to top Go down
View user profile http:// https://www.youtube.com/user/cane63106/videos
 

D.D. Fusion

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
» Absolute Zero and Re-fusion
» Non-fusion area and Super polymerization
» Macro cosmos+Future Fusion
» Dark Fusion / Mirror Force question
» Fusion Gate question

Permissions in this forum:You cannot reply to topics in this forum
Mackpro :: MackPro :: Custom Cards-