--Phirana of Gust Vine function c160002345.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(160002345,0)) e1:SetCategory(CATEGORY_DECKDES) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetCountLimit(1,160001234) e1:SetTarget(c160002345.distg) e1:SetOperation(c160002345.disop) c:RegisterEffect(e1) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) local e3=e1:Clone() e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(e3) --spsummon local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(160002345,1)) e4:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e4:SetCode(EVENT_TO_GRAVE) e4:SetCountLimit(1,160001235) e4:SetCondition(c160002345.drcon) e4:SetTarget(c160002345.drtg) e4:SetOperation(c160002345.drop) c:RegisterEffect(e4) end function c160002345.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3) end function c160002345.disop(e,tp,eg,ep,ev,re,r,rp) Duel.DiscardDeck(tp,3,REASON_EFFECT) end function c160002345.drcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_EFFECT) and not e:GetHandler():IsReason(REASON_RETURN) end function c160002345.filter(c) return c:IsSetCard(0x885a) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() end function c160002345.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c160002345.filter(chkc) end if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingTarget(c160002345.filter,tp,LOCATION_GRAVE,0,3,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,c160002345.filter,tp,LOCATION_GRAVE,0,3,3,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,3,0,0) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function c160002345.drop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) if tg:FilterCount(Card.IsRelateToEffect,nil,e)~=3 then return end Duel.SendtoDeck(tg,nil,0,REASON_EFFECT) Duel.ShuffleDeck(tp) local g=Duel.GetOperatedGroup() local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA) if ct==3 then Duel.BreakEffect() Duel.Draw(tp,1,REASON_EFFECT) end end