--created by Seth, coded by Lyris --Mextro Darxstorm local s,id,o=GetID() function s.initial_effect(c) c:EnableReviveLimit() aux.AddLinkProcedure(c,s.mfilter,2,2) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:HOPT() e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:HOPT() e2:SetCategory(CATEGORY_DESTROY) e2:SetCondition(s.descon) e2:SetCost(s.descost) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) end function s.mfilter(c) return c:IsSetCard(0xee5) and c:GetMutualLinkedGroupCount()>0 end function s.spcon(e) return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) end function s.filter(c,e,tp,z) return z>0 and c:IsLevelBelow(4) and c:IsSetCard(0xee5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,z) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local z=e:GetHandler():GetLinkedZone(tp) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp,z) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND) end function s.spop(e,tp) local z=e:GetHandler():GetLinkedZone(tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.SpecialSummon(Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp,z),0,tp,tp,false,false,POS_FACEUP,z) end function s.descon() local ph=Duel.GetCurrentPhase() return ph==PHASE_MAIN1 or ph==PHASE_MAIN2 end function s.cfilter(c,g) return c:IsSetCard(0xee5) and c:IsLinkAbove(1) and g:IsContains(c) end function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroup(tp,s.cfilter,1,nil,e:GetHandler():GetLinkedGroup()) end local tc=Duel.SelectReleaseGroup(tp,s.cfilter,1,1,nil,e:GetHandler():GetLinkedGroup()):GetFirst() Duel.Release(tc,REASON_COST) e:SetLabel(tc:GetLink()) end function s.dfilter(c) return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(s.dfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) if chk==0 then return e:IsCostChecked() and #g>0 end Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function s.desop(e,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,s.dfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,math.min(3,e:GetLabel()),nil) Duel.HintSelection(g) Duel.Destroy(g,REASON_EFFECT) end