--Dustflaw Enforcer function c89217828.initial_effect(c) c:EnableReviveLimit() --Search local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(89217828,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCost(c89217828.cost) e1:SetTarget(c89217828.target) e1:SetOperation(c89217828.operation) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(89217828,0)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetCondition(c89217828.tgcon) e2:SetTarget(c89217828.destg) e2:SetOperation(c89217828.desop) c:RegisterEffect(e2) --Send Replacement local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(89217828,3)) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_TO_GRAVE_REDIRECT_CB) e3:SetProperty(EFFECT_FLAG_UNCOPYABLE) e3:SetCondition(c89217828.repcon) e3:SetOperation(c89217828.repop) c:RegisterEffect(e3) --Effect Immunity while CONT Spell local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD) e4:SetCode(EFFECT_INDESTRUCTABLE_COUNT) e4:SetRange(LOCATION_SZONE) e4:SetTargetRange(LOCATION_MZONE,0) e4:SetTarget(c89217828.indtg) e4:SetValue(c89217828.indct) c:RegisterEffect(e4) end function c89217828.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsDiscardable(REASON_COST) end Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) end function c89217828.filter(c) return c:IsSetCard(0xff15) and c:GetType()==TYPE_SPELL+TYPE_RITUAL and c:IsAbleToHand() end function c89217828.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.IsExistingMatchingCard(c89217828.filter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c89217828.operation(e,tp,eg,ep,ev,re,r,rp,chk) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c89217828.filter,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 function c89217828.tgcon(e,tp,eg,ep,ev,re,r,rp) return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_RITUAL)==SUMMON_TYPE_RITUAL end function c89217828.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsDestructable() end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function c89217828.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end function c89217828.repcon(e) local c=e:GetHandler() return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsReason(REASON_DESTROY) end function c89217828.repop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local e1=Effect.CreateEffect(c) e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT+0x1fc0000) e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS) c:RegisterEffect(e1) end function c89217828.indtg(e,c) return c:IsSetCard(0xff15) end function c89217828.indct(e,re,r,rp) if bit.band(r,REASON_EFFECT)~=0 then return 1 else return 0 end end