--Grandiosa Dea Draconica del Creato --Scripted by: XGlitchy30 local s,id=GetID() function s.initial_effect(c) aux.AddCodeList(c,id) aux.AddLinkProcedure(c,s.matfilter,3,3) c:EnableReviveLimit() --to extra local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) e1:SetCondition(s.tecon) e1:SetTarget(s.tetg) e1:SetOperation(s.teop) c:RegisterEffect(e1) --SS local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetRange(LOCATION_MZONE) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCountLimit(1,id+100) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --destroy and draw local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,3)) e3:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetTarget(s.ddtg) e3:SetOperation(s.ddop) c:RegisterEffect(e3) end function s.matfilter(c) return c:IsLinkRace(RACE_DRAGON) and c:IsType(TYPE_PENDULUM) end function s.tecon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) end function s.tefilter(c) return c:IsType(TYPE_PENDULUM) and c:IsMonster() and c:IsRace(RACE_DRAGON) and not c:IsForbidden() end function s.tetg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.tefilter,tp,LOCATION_DECK,0,1,nil) end end function s.teop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD) local g=Duel.SelectMatchingCard(tp,s.tefilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoExtraP(g,tp,REASON_EFFECT) end end function s.cfilter(c,lg) return lg:IsContains(c) and c:IsFaceup() and c:IsMonster() and c:IsSetCard(0xb48) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local lg=e:GetHandler():GetLinkedGroup() return eg:IsExists(s.cfilter,1,nil,lg) end function s.desfilter(c,lg,e,tp,zone) return s.cfilter(c,lg) and Duel.IsExistingMatchingCard(s.spfilter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,zone,false) end function s.spfilter1(c,e,tp,tc,zone,zonechk) return c:IsFaceup() and c:IsMonster() and c:IsSetCard(0xb48) and Duel.GetLocationCountFromEx(tp,tp,tc,c,zone)>0 and (not zonechk or c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local lg=e:GetHandler():GetLinkedGroup() local zone=bit.band(e:GetHandler():GetLinkedZone(tp),0x1f) if chk==0 then return zone~=0 and eg:IsExists(s.desfilter,1,nil,lg,e,tp,zone) end local lgfil=eg:Filter(s.desfilter,nil,lg,e,tp,zone) Duel.SetOperationInfo(0,CATEGORY_DESTROY,lgfil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local lg=c:GetLinkedGroup() local zone=bit.band(c:GetLinkedZone(tp),0x1f) if zone==0 then return end local g=eg:FilterSelect(tp,s.desfilter,1,1,nil,lg,e,tp,zone) if #g>0 and Duel.Destroy(g,REASON_EFFECT)>0 then local ct=Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone) if ct<=0 then return end if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end local sg=Duel.SelectMatchingCard(tp,s.spfilter1,tp,LOCATION_EXTRA,0,1,ct,nil,e,tp,nil,zone,true) if #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP,zone)>0 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetDescription(aux.Stringid(id,2)) e1:SetTargetRange(1,0) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) end end end function s.ddfilter(c) return c:IsFaceup() and not c:IsCode(id) end function s.ddtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and s.ddfilter(chkc) end if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingTarget(s.ddfilter,tp,LOCATION_ONFIELD,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,s.ddfilter,tp,LOCATION_ONFIELD,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.ddop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then Duel.Draw(tp,1,REASON_EFFECT) end end