--created & coded by Swag --The Surprises of the Dreamy Forest local s,id=GetID() function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:Desc(0) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:HOPT() e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRelevantTimings() e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:Desc(1) e2:SetCategory(CATEGORY_TODECK|CATEGORY_DRAW) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:HOPT() e2:SetCondition(aux.exccon) e2:SetCost(aux.bfgcost) e2:SetTarget(s.tdtg) e2:SetOperation(s.tdop) c:RegisterEffect(e2) end function s.confilter(c) return c:IsFaceup() and c:IsSetCard(ARCHE_DREAMY_FOREST) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()==tp and Duel.IsExistingMatchingCard(s.confilter,tp,LOCATION_MZONE,0,1,nil) end function s.thfilter(c) return c:IsSpellTrapOnField() and c:IsAbleToHand() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) and s.thfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,s.thfilter,tp,0,LOCATION_ONFIELD,1,2,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),1-tp,LOCATION_ONFIELD) if e:IsHasType(EFFECT_TYPE_ACTIVATE) then Duel.SetChainLimit(s.limit) end end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetTargetCards() if #tg>0 then Duel.SendtoHand(tg,nil,REASON_EFFECT) end end function s.limit(e,lp,tp) local c=e:GetHandler() local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) return lp==tp or not g:IsContains(c) or not e:IsHasType(EFFECT_TYPE_ACTIVATE) end function s.filter(c,e) return c:IsSetCard(ARCHE_DREAMY_FOREST,ARCHE_DREARY_FOREST) and c:IsAbleToDeck() and c:IsCanBeEffectTarget(e) end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc,e) end local c=e:GetHandler() local exc=nil if chk==0 and e:IsCostChecked() then exc=c end local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_GRAVE,0,exc,e) if chk==0 then return g:CheckSubGroup(aux.dncheck,3,3) and Duel.IsPlayerCanDraw(tp,1) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local sg=g:SelectSubGroup(tp,aux.dncheck,false,3,3) Duel.SetTargetCard(sg) Duel.SetCardOperationInfo(sg,CATEGORY_TODECK) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetTargetCards() if #tg>0 and Duel.ShuffleIntoDeck(tg)>0 then Duel.Draw(tp,1,REASON_EFFECT) end end