--Seed of Evil VINE function c500311508.initial_effect(c) c:EnableReviveLimit() --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(c500311508.spcon) c:RegisterEffect(e1) --summon success local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(500311508,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SPSUMMON_SUCCESS) --e2:SetCost(c500311508.spcost) e2:SetCountLimit(1,500311508) e2:SetTarget(c500311508.sptg) e2:SetOperation(c500311508.spop) c:RegisterEffect(e2) --spsummon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(500311508,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetCode(EVENT_TO_GRAVE) e3:SetCountLimit(1,500311509) e3:SetTarget(c500311508.sptg2) e3:SetOperation(c500311508.spop2) c:RegisterEffect(e3) end function c500311508.cfilter(c) return c:IsFacedown() or not c:IsSetCard(0x85a) end function c500311508.spcon(e,c) if c==nil then return true end local tp=c:GetControler() return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>0 and not Duel.IsExistingMatchingCard(c500311508.cfilter,tp,LOCATION_MZONE,0,1,nil) end function c500311508.spfilter(c,e,tp) return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x485a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c500311508.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local g=Duel.GetMatchingGroup(c500311508.spfilter,tp,LOCATION_DECK,0,nil,e,tp) return not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and g:GetClassCount(Card.GetCode)>=2 end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK) end function c500311508.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local g=Duel.GetMatchingGroup(c500311508.spfilter,tp,LOCATION_DECK,0,nil,e,tp) if not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and g:GetClassCount(Card.GetCode)>=2 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg1=g:Select(tp,1,1,nil) g:Remove(Card.IsCode,nil,sg1:GetFirst():GetCode()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg2=g:Select(tp,1,1,nil) sg1:Merge(sg2) local fid=c:GetFieldID() local tc=sg1:GetFirst() while tc do Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) tc:RegisterFlagEffect(500311508,RESET_EVENT+RESETS_STANDARD,0,1,fid) tc=sg1:GetNext() Duel.SpecialSummonComplete() end local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetTargetRange(1,0) e1:SetTarget(c500311508.sumlimit) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) end end function c500311508.sumlimit(e,c,sump,sumtype,sumpos,targetp) return c:IsLocation(LOCATION_EXTRA) and not c:IsSetCard(0x85a) end function c500311508.spfilterx(c,e,tp) return c:IsSetCard(0x85a) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c500311508.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c500311508.spfilterx,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end function c500311508.spop2(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,c500311508.spfilterx,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end