--Goghi, Sakura Maiden of Rose VINE function c16000958.initial_effect(c) --tohand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(16000958,0)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_HAND) e2:SetCountLimit(1,16000958) e2:SetCost(c16000958.thcost) e2:SetTarget(c16000958.thtg) e2:SetOperation(c16000958.thop) c:RegisterEffect(e2) --spsummon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(16000958,2)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_POSITION) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_SUMMON_SUCCESS) e3:SetCountLimit(1,16000959) e3:SetTarget(c16000958.sumtg) e3:SetOperation(c16000958.sumop) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e4) local e5=e3:Clone() e5:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(e5) --leave field local e6=Effect.CreateEffect(c) e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e6:SetCode(EVENT_LEAVE_FIELD) e6:SetOperation(c16000958.leave) c:RegisterEffect(e6) e3:SetLabelObject(e6) end function c16000958.thcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsDiscardable() end Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) end function c16000958.thfilter(c) return c:IsSetCard(0x685a) and not c:IsCode(16000958) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end function c16000958.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c16000958.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c16000958.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c16000958.thfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function c16000958.filter(c,e,tp) return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x85a) and c:IsLevelBelow(3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) end function c16000958.sumtg(e,tp,eg,ep,ev,re,r,rp,chk) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if e:GetHandler():GetSequence()<5 then ft=ft+1 end if chk==0 then return ft>1 and not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.IsExistingMatchingCard(c16000958.filter,tp,LOCATION_HAND,0,2,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND) end function c16000958.sumop(e,tp,eg,ep,ev,re,r,rp) if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end local c=e:GetHandler() local g=Duel.GetMatchingGroup(c16000958.filter,tp,LOCATION_HAND,0,nil,e,tp) if g:GetCount()>=2 then local fid=e:GetHandler():GetFieldID() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,2,2,nil) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) local tc=sg:GetFirst() while tc do local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+0x1fe0000) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT+0x1fe0000) tc:RegisterEffect(e2) if c:IsRelateToEffect(e) then c:SetCardTarget(tc) e:GetLabelObject():SetLabelObject(tc) c:CreateRelation(tc,RESET_EVENT+0x5020000) tc:CreateRelation(c,RESET_EVENT+0x5fe0000) tc:RegisterFlagEffect(16000958,RESET_EVENT+0x1fe0000,0,1,fid) tc=sg:GetNext() end end end end function c16000958.leave(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=e:GetLabelObject() if tc and c:IsRelateToCard(tc) and tc:IsRelateToCard(c) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end end