--Tortoise of Gust Vine function c50031102.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_HAND) e1:SetCondition(c50031102.spcon) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(50031102,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetTarget(c50031102.sptg) e2:SetOperation(c50031102.spop) c:RegisterEffect(e2) local e6=Effect.CreateEffect(c) e6:SetDescription(aux.Stringid(50031102,1)) e6:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW) e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e6:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e6:SetCode(EVENT_TO_GRAVE) e6:SetCondition(c50031102.tdcon) e6:SetTarget(c50031102.tdtg) e6:SetOperation(c50031102.tdop) c:RegisterEffect(e6) end function c50031102.ssfilter(c) return c:IsFaceup() and c:IsSetCard(0x885a) and c:GetCode()~=50031102 end function c50031102.spcon(e,c) if c==nil then return true end return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c50031102.ssfilter,c:GetControler(),LOCATION_MZONE,0,1,nil) end function c50031102.filter(c,e,tp) return c:GetLevel()==3 and c:IsAttribute(ATTRIBUTE_WIND) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c50031102.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c50031102.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) end function c50031102.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c50031102.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp) local tc=g:GetFirst() if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+0x1fe0000) tc:RegisterEffect(e1,true) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT+0x1fe0000) tc:RegisterEffect(e2,true) local e3=Effect.CreateEffect(e:GetHandler()) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL) e3:SetProperty(EFFECT_FLAG_UNCOPYABLE) e3:SetValue(1) e3:SetReset(RESET_EVENT+0x1fe0000) tc:RegisterEffect(e3,true) Duel.SpecialSummonComplete() end end function c50031102.tdcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_EFFECT) and not e:GetHandler():IsReason(REASON_RETURN) end function c50031102.costfilter(c) return c:IsAttribute(ATTRIBUTE_WIND) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() end function c50031102.filter(c) return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x885a) and c:IsAbleToDeck() end function c50031102.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingMatchingCard(c50031102.filter,tp,LOCATION_HAND,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function c50031102.tdop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) or not Duel.IsPlayerCanDraw(tp) then return end local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0) if ct==0 then return end if ct>2 then ct=2 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,c50031102.filter,tp,LOCATION_HAND,0,1,ct,nil) if g:GetCount()>0 then Duel.ConfirmCards(1-tp,g) Duel.SendtoDeck(g,nil,2,REASON_EFFECT) Duel.ShuffleDeck(tp) Duel.BreakEffect() Duel.Draw(tp,g:GetCount(),REASON_EFFECT) end end