--Secundus dell'Organizzazione Angeli, Leviaqua --Script by XGlitchy30 function c16599464.initial_effect(c) --synchro summon aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_FAIRY),aux.NonTuner(Card.IsSetCard,0x1559),1,1) c:EnableReviveLimit() --target protection local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_SINGLE) e0:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e0:SetRange(LOCATION_MZONE) e0:SetValue(c16599464.efilter) c:RegisterEffect(e0) --tuner spsummon local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetCondition(c16599464.spcon) e1:SetCost(c16599464.spcost) e1:SetTarget(c16599464.sptg) e1:SetOperation(c16599464.spop) c:RegisterEffect(e1) --resource gain -- local e2=Effect.CreateEffect(c) -- e2:SetCategory(CATEGORY_TODECK) -- e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) -- e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) -- e2:SetCode(EVENT_BATTLE_DAMAGE) -- e2:SetRange(LOCATION_MZONE) -- e2:SetCondition(c16599464.damcon) -- e2:SetTarget(c16599464.damtg) -- e2:SetOperation(c16599464.damop) -- c:RegisterEffect(e2) --spsummon local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e3:SetCode(EVENT_REMOVE) e3:SetCountLimit(1,16599464) e3:SetCondition(c16599464.spcon2) e3:SetCost(c16599464.spcost2) e3:SetTarget(c16599464.sptg2) e3:SetOperation(c16599464.spop2) c:RegisterEffect(e3) end --filters function c16599464.mfilter(c,sync) return c:IsLocation(LOCATION_GRAVE) and bit.band(c:GetReason(),0x80008)==0x80008 and c:GetReasonCard()==sync and c:IsAbleToRemoveAsCost() end function c16599464.spfilter(c,e,tp) return c:IsRace(RACE_FAIRY) and c:GetAttack()==0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c16599464.costfilter(c) return c:IsRace(RACE_FAIRY) and c:IsAbleToRemoveAsCost() end function c16599464.spfilter2(c,e,tp) return c:IsSetCard(0x1559) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c16599464.tdfilter(c) return c:IsSetCard(0x1559) and c:IsAbleToDeck() and c:IsFaceup() end --target protection function c16599464.efilter(e,re,rp) return ((re:GetHandler():GetLevel()>0 and re:GetHandler():IsLevelBelow(6)) or (re:GetHandler():GetRank()>0 and re:GetHandler():GetRank()<=6)) and rp==1-e:GetHandlerPlayer() and re:IsActiveType(TYPE_MONSTER) end --tuner spsummon function c16599464.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) end function c16599464.spcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local mat=c:GetMaterial() local matc=mat:GetCount() if chk==0 then return matc>0 and mat:FilterCount(c16599464.mfilter,nil,c)==matc end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=mat:Select(tp,matc,matc,nil) if g:GetCount()==matc then Duel.Remove(g,POS_FACEUP,REASON_COST) end end function c16599464.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c16599464.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function c16599464.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,c16599464.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if g:GetCount()>0 then local tc=g:GetFirst() Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end --resource gain -- function c16599464.damcon(e,tp,eg,ep,ev,re,r,rp) -- local att=Duel.GetAttacker() -- local def=Duel.GetAttackTarget() -- return ep==tp and att and def -- and ((att:GetControler()==tp and att:IsRace(RACE_FAIRY) and att:IsRelateToBattle()) -- or (def:GetControler()==tp and def:IsRace(RACE_FAIRY) and def:IsRelateToBattle())) -- end -- function c16599464.damtg(e,tp,eg,ep,ev,re,r,rp,chk) -- if chk==0 then return Duel.IsExistingMatchingCard(c16599464.tdfilter,tp,LOCATION_REMOVED,0,1,nil) end -- Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_REMOVED) -- end -- function c16599464.damop(e,tp,eg,ep,ev,re,r,rp) -- local c=e:GetHandler() -- local g=Duel.GetMatchingGroup(c16599464.tdfilter,tp,LOCATION_REMOVED,0,nil) -- if g:GetCount()>0 then -- Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) -- local tc=g:Select(tp,1,3,nil) -- Duel.SendtoDeck(tc,nil,2,REASON_EFFECT) -- end -- end --spsummon function c16599464.spcon2(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_COST) and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsRace(RACE_FAIRY) and re:GetHandler():IsType(TYPE_SYNCHRO) end function c16599464.spcost2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c16599464.costfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,c16599464.costfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,e:GetHandler()) if g:GetCount()>0 then Duel.Remove(g,POS_FACEUP,REASON_COST) end end function c16599464.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c16599464.spfilter2,tp,LOCATION_REMOVED,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED) end function c16599464.spop2(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,c16599464.spfilter2,tp,LOCATION_REMOVED,0,1,1,nil,e,tp) if g:GetCount()>0 then local tc=g:GetFirst() if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e1,true) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e2,true) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_UNCOPYABLE) e3:SetCode(EFFECT_CHANGE_LEVEL) e3:SetValue(2) e3:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e3,true) end Duel.SpecialSummonComplete() end end