--绝尘的影魔 local m=14060015 local cm=_G["c"..m] cm.fit_monster={14060014} function cm.initial_effect(c) Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK) --activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(m,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK+CATEGORY_TOGRAVE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(cm.target) e1:SetOperation(cm.activate) c:RegisterEffect(e1) --to deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(m,0)) e2:SetCategory(CATEGORY_TODECK) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_TO_GRAVE) e2:SetTarget(cm.rettg) e2:SetOperation(cm.retop) c:RegisterEffect(e2) --search local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(m,1)) e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e3:SetProperty(EFFECT_FLAG_NO_TURN_RESET) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_DECK) e3:SetCountLimit(1) e3:SetCondition(cm.tgcon) e3:SetTarget(cm.thtg) e3:SetOperation(cm.thop) c:RegisterEffect(e3) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD) e4:SetCode(EFFECT_SPSUMMON_PROC_G) e4:SetRange(LOCATION_DECK) e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e4:SetCondition(cm.tgcon) c:RegisterEffect(e4) end function cm.rfilter(c) return c:IsSetCard(0x1406) end function cm.filter1(c,e,tp) if not c:IsSetCard(0x1406) or bit.band(c:GetType(),0x81)~=0x81 or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end return true end function cm.mfilterf(c,tp,mg,rc) if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then Duel.SetSelectedCard(c) return mg:CheckWithSumGreater(Card.GetRitualLevel,rc:GetLevel(),rc) else return false end end function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,0,0) end function cm.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then c:CancelToGrave() if Duel.SendtoDeck(c,nil,2,REASON_EFFECT) and Duel.SelectYesNo(tp,aux.Stringid(m,4)) then local mg=Duel.GetRitualMaterial(tp) local tc1=Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_DECK,0,1,nil,cm.rfilter,e,tp,mg,nil,Card.GetLevel,"Equal",true) local tc2=Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_HAND,0,2,nil) local op=0 if tc1 and tc2 then op=Duel.SelectOption(tp,aux.Stringid(m,3),aux.Stringid(m,2)) elseif tc1 then op=Duel.SelectOption(tp,aux.Stringid(m,3)) else op=Duel.SelectOption(tp,aux.Stringid(m,2))+1 end if op==0 then Duel.BreakEffect() aux.RitualUltimateOperation(cm.rfilter,Card.GetLevel,"Equal",LOCATION_DECK,nil,nil)(e,tp,eg,ep,ev,re,r,rp) else Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,cm.filter1,tp,LOCATION_DECK,0,1,1,nil,e,tp) local tc=g:GetFirst() if tc then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g1=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_HAND,0,2,2,nil) if #g1>0 then tc:SetMaterial(g1) Duel.SendtoGrave(g1,REASON_EFFECT) Duel.BreakEffect() Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP) tc:CompleteProcedure() end end end end end end function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0) end function cm.retop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsAbleToDeck() then Duel.SendtoDeck(c,nil,1,REASON_EFFECT) c:ReverseInDeck() end end function cm.tgcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsFaceup() and not Duel.IsExistingMatchingCard(Card.IsType,c:GetControler(),LOCATION_GRAVE,0,1,nil,TYPE_MONSTER) end function cm.thfilter(c) return c:IsCode(14060014) and c:IsAbleToHand() end function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function cm.thop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,cm.thfilter,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