--灵刻使的镌刻 local m=10904013 local cm=_G["c"..m] function cm.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOGRAVE+CATEGORY_DRAW) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(2,m) e1:SetTarget(cm.target) e1:SetOperation(cm.activate) c:RegisterEffect(e1) local e4=Effect.CreateEffect(c) e4:SetCategory(CATEGORY_TOHAND) e4:SetDescription(aux.Stringid(31423101,0)) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_GRAVE) e4:SetCountLimit(2,m) e4:SetCondition(cm.thcon) e4:SetTarget(cm.thtg) e4:SetOperation(cm.thop) c:RegisterEffect(e4) end function cm.desfilter(c) return c:IsFaceup() and c:IsSetCard(0x237) end function cm.sfilter(c) return c:IsType(TYPE_PENDULUM) and c:IsAbleToGrave() end function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(tp) and cm.desfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(cm.desfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) and Duel.IsExistingMatchingCard(cm.sfilter,tp,LOCATION_DECK,0,1,nil) and Duel.IsPlayerCanDraw(tp,2) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,cm.desfilter,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler()) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function cm.activate(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,cm.sfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoGrave(g,REASON_EFFECT) if not g:GetFirst():IsLocation(LOCATION_GRAVE) then return end Duel.BreakEffect() Duel.Draw(tp,1,REASON_EFFECT) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end end function cm.thcon(e,tp,eg,ep,ev,re,r,rp) local tp=e:GetHandler():GetControler() local tc1=Duel.GetFieldCard(tp,LOCATION_PZONE,0) local tc2=Duel.GetFieldCard(tp,LOCATION_PZONE,1) if not tc1 or not tc2 then return false end return tc1:GetLeftScale()==tc2:GetRightScale() end function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToHand() end Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0) end function cm.thop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SendtoHand(c,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,c) end end