--Samid, Seed of Fiber Vine local cid,id=GetID() function cid.initial_effect(c) --ATK & DEF local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetTarget(cid.tg1) e1:SetValue(500) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetTarget(cid.tg2) e2:SetValue(-400) c:RegisterEffect(e2) --tohand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_GRAVE) e3:SetCountLimit(1,id) e3:SetCost(cid.thcost) e3:SetTarget(cid.thtg) e3:SetOperation(cid.thop) c:RegisterEffect(e3) end function cid.tg1(e,c) return c:IsSetCard(0x57b) end function cid.tg2(e,c) return not c:IsSetCard(0x57b) end function cid.thcost(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 cid.thfilter(c) return c:IsSetCard(0x57b) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end function cid.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not e:GetHandler():IsLocation(LOCATION_DECK) and Duel.IsExistingMatchingCard(cid.cfilter,tp,LOCATION_DECK,0,3,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK) end function cid.thop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(cid.thfilter,tp,LOCATION_DECK,0,nil) if g:GetClassCount(Card.GetCode)>=3 then local rg=Group.CreateGroup() for i=1,3 do Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) local tc=g:Select(tp,1,1,nil):GetFirst() if tc then rg:AddCard(tc) g:Remove(Card.IsCode,nil,tc:GetCode()) end end Duel.ConfirmCards(1-tp,rg) Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND) local tg=rg:Select(1-tp,1,1,nil):GetFirst() Duel.SendtoHand(tg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tg) end end