--灯火之占卜 local m=28327005 local cm=_G["c"..m] function cm.initial_effect(c) aux.AddCodeList(c,28327000) aux.AddRitualProcGreaterCode(c,28327000,LOCATION_HAND+LOCATION_GRAVE) --to hand local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_GRAVE) e1:SetCondition(aux.exccon) e1:SetCost(aux.bfgcost) e1:SetTarget(cm.thtg) e1:SetOperation(cm.thop) c:RegisterEffect(e1) end function cm.thfilter(c) return ((aux.IsCodeListed(c,28327000) and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER)) or c:IsCode(28327000)) 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) 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