--Woodland Storm function c79854545.initial_effect(c) --to deck and draw local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(79854545,0)) e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW) e1:SetType(EFFECT_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetTarget(c79854545.tg) e1:SetOperation(c79854545.op) c:RegisterEffect(e1) --Special Summon from GY local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,79854545) e2:SetCost(c79854545.spcost) e2:SetTarget(c79854545.sptg) e2:SetOperation(c79854545.spop) c:RegisterEffect(e2) end --to deck and draw function c79854545.filter(c) return c:IsRace(RACE_PLANT) and c:IsAbleToDeck() end function c79854545.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c79854545.filter(chkc) end if chk==0 then return true end if Duel.IsExistingTarget(c79854545.filter,tp,LOCATION_GRAVE,0,1,nil) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,c79854545.filter,tp,LOCATION_GRAVE,0,1,3,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end end function c79854545.op(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=1 then return end Duel.SendtoDeck(tg,nil,0,REASON_EFFECT) local g=Duel.GetOperatedGroup() if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA) if ct==1 then Duel.BreakEffect() Duel.Draw(tp,1,REASON_EFFECT) end end --gravespecial function c79854545.spcostfilter(c,tp) return c:IsFaceup() and c:IsRace(RACE_PLANT) and Duel.GetMZoneCount(tp,c,tp)>0 end function c79854545.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroup(tp,c79854545.spcostfilter,1,nil,tp) end local g=Duel.SelectReleaseGroup(tp,c79854545.costfilter,1,1,nil,tp) Duel.Release(g,REASON_COST) end function c79854545.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function c79854545.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT+RESETS_REDIRECT) e1:SetValue(LOCATION_REMOVED) c:RegisterEffect(e1,true) end end