--Dustflaw Angel function c89217830.initial_effect(c) c:EnableReviveLimit() --Search local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(89217830,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCost(c89217830.cost) e1:SetTarget(c89217830.target) e1:SetOperation(c89217830.operation) c:RegisterEffect(e1) --to hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(89217830,1)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCondition(c89217830.thcon) e2:SetTarget(c89217830.thtg) e2:SetOperation(c89217830.thop) c:RegisterEffect(e2) --Send Replacement local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(89217830,3)) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_TO_GRAVE_REDIRECT_CB) e3:SetProperty(EFFECT_FLAG_UNCOPYABLE) e3:SetCondition(c89217830.repcon) e3:SetOperation(c89217830.repop) c:RegisterEffect(e3) --Act Limit while CONT SPELL local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e4:SetCode(EVENT_CHAINING) e4:SetRange(LOCATION_SZONE) e4:SetOperation(c89217830.chainop) c:RegisterEffect(e4) end function c89217830.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 c89217830.filter(c) return c:IsSetCard(0xff15) and c:GetType()==TYPE_SPELL+TYPE_RITUAL and c:IsAbleToHand() end function c89217830.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.IsExistingMatchingCard(c89217830.filter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c89217830.operation(e,tp,eg,ep,ev,re,r,rp,chk) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c89217830.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 c89217830.thcon(e,tp,eg,ep,ev,re,r,rp) return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_RITUAL)==SUMMON_TYPE_RITUAL end function c89217830.thfilter(c) return c:IsSetCard(0xff15) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end function c89217830.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c89217830.thfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) end function c89217830.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c89217830.thfilter),tp,LOCATION_GRAVE,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function c89217830.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 c89217830.repcon(e) local c=e:GetHandler() return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsReason(REASON_DESTROY) end function c89217830.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 c89217830.chainop(e,tp,eg,ep,ev,re,r,rp) local rc=re:GetHandler() if re:IsHasType(EFFECT_TYPE_ACTIVATE) and rc:IsSetCard(0xff15) and re:IsActiveType(TYPE_RITUAL) then Duel.SetChainLimit(c89217830.chainlm) end end function c89217830.chainlm(e,rp,tp) return tp==rp end