--Sigil Shaman - Moon function c213380.initial_effect(c) aux.AddCodeList(c,213355) --fusion material c:EnableReviveLimit() aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionType,TYPE_RITUAL),1,true) --spsummon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(213380,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCountLimit(1,213380) e1:SetCondition(c213380.spcon) e1:SetTarget(c213380.sptg) e1:SetOperation(c213380.spop) c:RegisterEffect(e1) --negate local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(213380,1)) e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,213381) e2:SetCondition(c213380.discon) e2:SetCost(c213380.discost) e2:SetTarget(c213380.distg) e2:SetOperation(c213380.disop) c:RegisterEffect(e2) --todeck local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(213380,2)) e3:SetCategory(CATEGORY_TODECK) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_GRAVE) e3:SetCountLimit(1,213382) e3:SetCondition(c213380.tdcon) e3:SetTarget(c213380.tdtg) e3:SetOperation(c213380.tdop) c:RegisterEffect(e3) end function c213380.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION) end function c213380.spfilter(c,e,tp) return aux.IsCodeListed(c,213355) and c:IsType(TYPE_RITUAL) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) end function c213380.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c213380.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) end function c213380.spop(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,c213380.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp) local tc=g:GetFirst() if tc then tc:SetMaterial(nil) Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP) tc:CompleteProcedure() end end function c213380.discon(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end return re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev) end function c213380.cfilter(c,g) return c:IsType(TYPE_RITUAL) end function c213380.discost(e,tp,eg,ep,ev,re,r,rp,chk) local lg=e:GetHandler():GetLinkedGroup() if chk==0 then return Duel.CheckReleaseGroup(tp,c213380.cfilter,1,nil,lg) end local g=Duel.SelectReleaseGroup(tp,c213380.cfilter,1,1,nil,lg) Duel.Release(g,REASON_COST) end function c213380.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end function c213380.disop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end end function c213380.tdfilter(c) return c:IsFaceup() and c:IsCode(213355) end function c213380.tdcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(c213380.tdfilter,tp,LOCATION_ONFIELD,0,1,nil) end function c213380.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToDeck() end Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0) end function c213380.tdop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) then Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end end