--Vine Onuri's Benevolence function c160002626.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(c160002626.target) e1:SetOperation(c160002626.activate) c:RegisterEffect(e1) local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(160002626,1)) e5:SetType(EFFECT_TYPE_IGNITION) e5:SetProperty(EFFECT_FLAG_CARD_TARGET) e5:SetRange(LOCATION_GRAVE) e5:SetCountLimit(1) e5:SetCost(c160002626.matcost) e5:SetTarget(c160002626.mattg) e5:SetOperation(c160002626.mattop) c:RegisterEffect(e5) end function c160002626.filter(c) return c:IsSetCard(0x285a) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand() end function c160002626.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c160002626.filter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA) end function c160002626.activate(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c160002626.filter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function c160002626.tgfilter(c) return c:IsFaceup() and c:IsSetCard(0x85a) and c:IsType(TYPE_XYZ) end function c160002626.matcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) end function c160002626.mfilter(c) return c:IsSetCard(0x85a) and c:IsType(TYPE_MONSTER) end function c160002626.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(c160002626.tgfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingTarget(c160002626.mfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,c160002626.tgfilter,tp,LOCATION_MZONE,0,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) local g=Duel.SelectTarget(tp,c160002626.mfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0) end function c160002626.mattop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local tc1=g:Filter(Card.IsLocation,nil,LOCATION_MZONE):GetFirst() local g2=g:Filter(Card.IsLocation,nil,LOCATION_GRAVE) if tc1 and tc1:IsFaceup() and not tc1:IsImmuneToEffect(e) and g2:GetCount()>0 then Duel.Overlay(tc1,g2) end end