--Geneseed CherryMoth local cid,id=GetID() function cid.initial_effect(c) c:EnableReviveLimit() --summon success local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_SUMMON_SUCCESS) e3:SetCountLimit(1,id) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetTarget(cid.tdtg) e3:SetOperation(cid.tdop) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(e4) local e5=e3:Clone() e5:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e5) --destroy replace local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EFFECT_DESTROY_REPLACE) e2:SetRange(LOCATION_GRAVE) e2:SetTarget(cid.reptg) e2:SetValue(cid.repval) e2:SetOperation(cid.repop) c:RegisterEffect(e2) end function cid.thfilter(c) return c:IsSetCard(0x57b) and not c:IsCode(19900027) and c:IsAbleToDeck() end function cid.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cid.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) and Duel.IsPlayerCanDraw(tp,1) end Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,5,tp,LOCATION_HAND) Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function cid.tdop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cid.thfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,5,nil) if #g>0 then Duel.HintSelection(g) if Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 then Duel.Draw(p,d,REASON_EFFECT) end end end function cid.repfilter(c,tp) return c:IsFaceup() and c:IsSetCard(0x57b) and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE) and not c:IsReason(REASON_REPLACE) end function cid.reptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(cid.repfilter,1,nil,tp) end return Duel.SelectEffectYesNo(tp,e:GetHandler(),96) end function cid.repval(e,c) return cid.repfilter(c,e:GetHandlerPlayer()) end function cid.repop(e,tp,eg,ep,ev,re,r,rp) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT) end