--Stardust Synchron --by Artorikus --CONVERTED FROM EDOPRO TO KOISHIPRO by: XGlitchy30 local s,id=GetID() function s.initial_effect(c) --synchro summon aux.AddSynchroProcedure(c,s.tfilter,aux.NonTuner(nil),1) c:EnableReviveLimit() --special summon synchrons local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetCost(aux.SSRestrictionCost(s.exceptionfilter,true,nil,id,s.counterfilter,1)) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --add starlight junktion to hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,2)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_BE_MATERIAL) e2:SetCountLimit(1,id+100) e2:SetCondition(s.drcon) e2:SetTarget(s.thtg) e2:SetOperation(s.tgop) c:RegisterEffect(e2) end s.material_setcode=0x1017 function s.tfilter(c) return c:IsSetCard(0x1017) or c:IsHasEffect(CARD_QUICKDRAW_SYNCHRON) end function s.counterfilter(c) return not c:IsSummonLocation(LOCATION_EXTRA) or c:IsSetCard(0xae,0x1017,0x43) end function s.exceptionfilter(c) return not c:IsLocation(LOCATION_EXTRA) or c:IsSetCard(0xae,0x1017,0x43) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) end function s.filter(c,e,tp) return c:IsSetCard(0x1017) and c:IsType(TYPE_TUNER) and c:HasLevel() and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local ct=Duel.GetLocationCount(tp,LOCATION_MZONE) return ct>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if ft<=0 then return end local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil,e,tp) local ct=math.min(ft,g:GetClassCount(Card.GetLevel)) if ct<=0 then return end if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ct=1 end Duel.HintMessage(tp,HINTMSG_SPSUMMON) local sg=g:SelectSubGroup(tp,aux.dlvcheck,false,1,ft) if #sg>0 then Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end function s.drcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO end function s.thfilter1(c) return c:IsCode(1003840) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetFirstMatchingCard(s.thfilter1,tp,LOCATION_DECK,0,nil) if tg then Duel.SendtoHand(tg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tg) end end