--Stardust Cat Draco function c16000000.initial_effect(c) aux.AddLinkProcedure(c,nil,2) c:EnableReviveLimit() local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(16000000,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1,16000000) e1:SetCondition(c16000000.condition) e1:SetCost(c16000000.cost) e1:SetTarget(c16000000.target) e1:SetOperation(c16000000.operation) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(16000000,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,16000001) e2:SetCondition(c16000000.condition2) e2:SetCost(c16000000.cost2) e2:SetTarget(c16000000.target2) e2:SetOperation(c16000000.operation2) c:RegisterEffect(e2) end function c16000000.condition(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) end function c16000000.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local zone=e:GetHandler():GetLinkedZone() return zone~=0 and Duel.IsExistingMatchingCard(c16000000.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,zone) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE) end function c16000000.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil) end Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) end function c16000000.filter(c,e,tp,zone) return c:IsRace(RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone) end function c16000000.operation(e,tp,eg,ep,ev,re,r,rp) local zone=e:GetHandler():GetLinkedZone() if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if zone==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c16000000.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,zone) local tc=g:GetFirst() if not tc then return end Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone) end function c16000000.condition2(e) return e:GetHandler():IsExtraLinkState() end function c16000000.filter2(c,e,tp) return (c:IsSetCard(0x85a) or c:IsRace(RACE_PLANT) )and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c16000000.cost2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsReleasable,1,nil) end local g=Duel.SelectReleaseGroup(tp,Card.IsReleasable,1,1,nil) Duel.Release(g,REASON_COST) end function c16000000.target2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c16000000.filter2,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_EXTRA) end function c16000000.operation2(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c16000000.filter2,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil,e,tp) local tc=g:GetFirst() if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) tc:RegisterEffect(e1,true) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) tc:RegisterEffect(e2,true) Duel.SpecialSummonComplete() end end