--Supernova-Eyes Ultimate Bigbang Dragon local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() aux.AddOrigBigbangType(c) aux.AddBigbangProc(c,s.matfilter1,1,1,s.matfilter2,1,1,s.matfilter3,1,1) --Must be Bigbang Summoned. local e0=Effect.CreateEffect(c) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetType(EFFECT_TYPE_SINGLE) e0:SetCode(EFFECT_SPSUMMON_CONDITION) e0:SetValue(s.bblimit) c:RegisterEffect(e0) --When a card or effect is activated (Quick Effect): You can negate the activation, and if you do, destroy all cards your opponent controls. local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,{id,0}) e1:SetCondition(s.ngcon) e1:SetTarget(s.ngtg) e1:SetOperation(s.ngop) c:RegisterEffect(e1) --If this Bigbang Summoned card in your possesion is destroyed by battle or card effect: Destroy all cards on the field, and if you do, Special Summon 1 "Supernova-Eyes Bigbang Dragon" from your GY. local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetCode(EVENT_DESTROYED) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end function s.matfilter1(c) return c:IsNeutral() and c:IsType(TYPE_BIGBANG) end function s.matfilter2(c) return c:IsPositive() and c:IsType(TYPE_BIGBANG) end function s.matfilter3(c) return c:IsNegative() and c:IsType(TYPE_BIGBANG) end function s.ngcon(e,tp,eg,ep,ev,re,r,rp) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) end function s.ngtg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local rg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil) if chk==0 then return #rg>0 end Duel.SetOperationInfo(0,CATEGORY_DESTROY,rg,#rg,0,0) Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) end function s.ngop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsRelateToEffect(re) then Duel.SendtoGrave(eg,REASON_EFFECT) end local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil) Duel.Destroy(g,REASON_EFFECT) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) c=e:GetHandler() return c:IsSummonType(SUMMON_TYPE_BIGBANG) and (r&REASON_EFFECT+REASON_BATTLE)~=0 and c:IsPreviousControler(tp) end function s.spfilter(c,e,tp) return c:IsCanBeSpecialSummoned(e,0,tp,true,false) and c:IsCode(id-100000000) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local rg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) if chk==0 then return true end --Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and #rg>0 end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_DESTROY,rg,#rg,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local rg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) if Duel.Destroy(rg,REASON_EFFECT)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP) end end end function s.bblimit(e,se,sp,st) return st&SUMMON_TYPE_BIGBANG==SUMMON_TYPE_BIGBANG end