--Necro Gelatyna Oscura --Scripted by: XGlitchy30 local s,id=GetID() function s.initial_effect(c) --SS Proc local e1=Effect.CreateEffect(c) e1:Desc(0) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetCondition(s.sprcon) e1:SetTarget(s.sprtg) e1:SetOperation(s.sprop) c:RegisterEffect(e1) end function s.sprfilter(c,tp) return c:IsCode(id-1) and c:IsAbleToRemoveAsCost() end function s.sprcon(e,c) if c==nil then return true end local tp=c:GetControler() local rg=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_GRAVE,0,nil,ATTRIBUTE_WIND) return aux.SelectUnselectGroup(rg,e,tp,1,1,aux.ChkfMMZ(1),0) end function s.sprtg(e,tp,eg,ep,ev,re,r,rp,c) local rg=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_GRAVE,0,nil,ATTRIBUTE_WIND) local g=aux.SelectUnselectGroup(rg,e,tp,1,1,aux.ChkfMMZ(1),1,tp,HINTMSG_REMOVE,nil,nil,true) if #g>0 then g:KeepAlive() e:SetLabelObject(g) return true end return false end function s.sprop(e,tp,eg,ep,ev,re,r,rp,c) local g=e:GetLabelObject() if not g then return end Duel.Remove(g,POS_FACEUP,REASON_COST) local e1=Effect.CreateEffect(e:GetHandler()) e1:Desc(1) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCustomCategory(CATEGORY_LVCHANGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE-RESET_TOFIELD) e:GetHandler():RegisterEffect(e1) g:DeleteGroup() end function s.spcostfilter(c) return c:IsMonster() and c:IsSetCard(0x296) and c:IsAbleToRemoveAsCost() end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.spcostfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local tg=Duel.SelectMatchingCard(tp,s.spcostfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.Remove(tg,POS_FACEUP,REASON_COST) end function s.spfilter(c,e,tp) return c:IsSetCard(0x296) and c:IsMonster() and c:IsLevel(3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetCustomOperationInfo(0,CATEGORY_LVCHANGE,e:GetHandler(),1,0,0,{3}) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 and c:IsRelateToEffect(e) and c:IsFaceup() and c:HasLevel() then Duel.BreakEffect() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_LEVEL) e1:SetValue(3) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE) c:RegisterEffect(e1) end end