--Peashy --Coded by Concordia local cid,id=GetID() function c68709380.initial_effect(c) --search local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,68709380) e1:SetCost(cid.srcost) e1:SetTarget(cid.srtg) e1:SetOperation(cid.srop) c:RegisterEffect(e1) --effect gain local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_BE_MATERIAL) e2:SetProperty(EFFECT_FLAG_EVENT_PLAYER) e2:SetCountLimit(1,68719380) e2:SetCondition(cid.effcon) e2:SetOperation(cid.effop) c:RegisterEffect(e2) end function cid.filter(c) return c:IsSetCard(0xf08) and c:IsDiscardable() end function cid.srfilter(c) return c:IsSetCard(0xf08) and c:IsType(TYPE_MONSTER) and not c:IsCode(68709380) and c:IsAbleToHand() end function cid.srcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.IsExistingMatchingCard(cid.filter,tp,LOCATION_HAND,0,1,c) and c:IsDiscardable() end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) local g=Duel.SelectMatchingCard(tp,cid.filter,tp,LOCATION_HAND,0,1,1,c) g:AddCard(c) Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD) end function cid.srtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cid.srfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function cid.srop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,cid.srfilter,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 cid.effcon(e,tp,eg,ep,ev,re,r,rp) return bit.band(r,REASON_LINK)~=0 and e:GetHandler():GetReasonCard():IsSetCard(0xf09) end function cid.effop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local rc=c:GetReasonCard() --Back to Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TODECK) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetCost(cid.tdcost) e1:SetCondition(cid.tdcon) e1:SetTarget(cid.tdtg) e1:SetOperation(cid.tdop) rc:RegisterEffect(e1,true) if not rc:IsType(TYPE_EFFECT) then local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_ADD_TYPE) e2:SetValue(TYPE_EFFECT) e2:SetReset(RESET_EVENT+RESETS_STANDARD) rc:RegisterEffect(e2,true) end rc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2)) end function cid.dfilter(c) return c:IsSetCard(0xf08) and c:IsDiscardable() end function cid.tdcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cid.dfilter,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,cid.dfilter,1,1,REASON_COST+REASON_DISCARD) end function cid.tdcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()~=tp end function cid.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsAbleToDeck() end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,0,0) end function cid.tdop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SendtoDeck(tc,nil,2,REASON_EFFECT) end end