--Ritmi Mistici - Maestro --Script by XGlitchy30 function c76565320.initial_effect(c) c:EnableCounterPermit(0x1555) --spsummon local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,76565320) e1:SetTarget(c76565320.sptg) e1:SetOperation(c76565320.spop) c:RegisterEffect(e1) --search local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCountLimit(1,76165320) e2:SetTarget(c76565320.sctg) e2:SetOperation(c76565320.scop) c:RegisterEffect(e2) local e2x=e2:Clone() e2x:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2x) end --filters function c76565320.cfilter(c,tp) return c:IsFaceup() and c:IsSetCard(0x7555) and ((c:IsLocation(LOCATION_MZONE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>-1) or (not c:IsLocation(LOCATION_MZONE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>-0)) end function c76565320.scfilter(c) return c:IsSetCard(0x7555) and c:IsType(TYPE_SPELL) and c:IsAbleToHand() end --spsummon function c76565320.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(c76565320.cfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler(),tp) end Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_ONFIELD) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function c76565320.spop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(c76565320.cfilter,tp,LOCATION_ONFIELD,0,e:GetHandler(),tp) if g:GetCount()==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local sg=g:Select(tp,1,1,nil) Duel.Destroy(sg,REASON_EFFECT) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end --search function c76565320.sctg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c76565320.scfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c76565320.scop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c76565320.scfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end