--created by LeonDuvall, coded by Lyris --Corentin, Magitate Tempestas local s,id,o=GetID() function s.initial_effect(c) aux.AddDoubleSidedProc(c,SIDE_REVERSE,131792004) aux.AddReverseSideProc(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_TURN_SET) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xd16)) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e2:SetValue(aux.TargetBoolFunction(Effect.IsActiveType,TYPE_SPELL+TYPE_TRAP)) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_CHAINING) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCategory(CATEGORY_DISABLE+CATEGORY_TODECK) e3:SetCondition(s.discon) e3:SetCost(s.discost) e3:SetTarget(s.distg) e3:SetOperation(s.disop) c:RegisterEffect(e3) end function s.filter(c,tp) return c:IsFaceup() and c:IsSetCard(0xd16) and c:IsControler(tp) and c:IsOnField() end function s.discon(e,tp,eg,ep,ev,re,r,rp) if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) return rp==1-tp and g and g:IsExists(s.filter,1,nil,tp) and Duel.IsChainDisablable(ev) end function s.cfilter(c) return c:IsSetCard(0x1d16) and c:IsAbleToRemoveAsCost() end function s.discost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Remove(Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_GRAVE,0,1,1,nil),POS_FACEUP,REASON_EFFECT) end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) if re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_TODECK,eg,1,0,0) end end function s.disop(e,tp,eg,ep,ev,re) local rc=re:GetHandler() if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then rc:CancelToGrave() Duel.SendtoDeck(rc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end end