--Overlay-Knight Vizier function c249001203.initial_effect(c) --tohand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(75878039,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetCountLimit(1,2490012031) e1:SetTarget(c249001203.target) e1:SetOperation(c249001203.operation) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(e2) local e3=e1:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) --Overlay local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(19310321,0)) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_GRAVE) e4:SetCountLimit(1,2490012032) e4:SetCost(aux.bfgcost) e4:SetTarget(c249001203.target2) e4:SetOperation(c249001203.operation2) c:RegisterEffect(e4) end function c249001203.filter(c) return c:IsSetCard(0x231) and c:IsAbleToHand() and not c:IsCode(249001203) and c:IsType(TYPE_MONSTER) end function c249001203.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c249001203.filter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c249001203.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c249001203.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 c249001203.filter1(c) return c:IsFaceup() and c:IsType(TYPE_XYZ) end function c249001203.filter2(c) return c:IsSetCard(0x231) and c:IsCanOverlay() end function c249001203.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(c249001203.filter1,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingTarget(c249001203.filter2,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(19310321,1)) local g1=Duel.SelectTarget(tp,c249001203.filter1,tp,LOCATION_MZONE,0,1,1,nil) e:SetLabelObject(g1:GetFirst()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) local g2=Duel.SelectTarget(tp,c249001203.filter2,tp,LOCATION_GRAVE,0,1,2,nil) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g2,2,0,0) end function c249001203.operation2(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) then return end local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,tc,e) if g:GetCount()>0 then Duel.Overlay(tc,g) end end