--Kurara, Protector of the Skies local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() aux.AddOrigBigbangType(c) aux.AddBigbangProc(c,s.matfilter1,1,1,s.matfilter2,1) --If this card is Bigbang Summoned: You can equip 1 monster from your Extra Deck to this card, except "Kurara, Protector of the Skies". local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_EQUIP) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCountLimit(1,{id,0}) e1:SetCondition(s.eqcon) e1:SetTarget(s.eqtg) e1:SetOperation(s.eqop) c:RegisterEffect(e1) --When your opponent activates a card or effect that targets a face-up monster(s) you control (Quick Effect): You can banish this card from your field or GY; negate the activation, and if you do, destroy that card. local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetRange(LOCATION_GRAVE+LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.discon) e2:SetCost(aux.bfgcost) e2:SetTarget(s.distg) e2:SetOperation(s.disop) c:RegisterEffect(e2) --Your opponent cannot attack nor activate the effects of monsters that have the same card type (Fusion, Synchro, Xyz, Link, Bigbang or Time Leap) as a monster equipped to this card. local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE) e3:SetRange(LOCATION_MZONE) e3:SetTargetRange(0,LOCATION_MZONE) e3:SetTarget(s.attg) c:RegisterEffect(e3) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD) e4:SetCode(EFFECT_CANNOT_ACTIVATE) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e4:SetRange(LOCATION_MZONE) e4:SetTargetRange(0,1) e4:SetValue(s.actlimit) c:RegisterEffect(e4) end function s.matfilter1(c) return c:IsSummonLocation(LOCATION_EXTRA) and c:IsNeutral() end function s.matfilter2(c) return c:IsType(TYPE_EFFECT) and not c:IsNeutral() end function s.eqcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_BIGBANG) end function s.eqfilter(c,ec) return not c:IsForbidden() end function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_EXTRA) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and c:IsFaceup() and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_MZONE) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local g=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_EXTRA,0,1,1,nil,c) if g:GetCount()>0 then Duel.Equip(tp,g:GetFirst(),c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetValue(s.eqlimit) e1:SetLabelObject(c) g:GetFirst():RegisterEffect(e1) end end end function s.eqlimit(e,c) return c==e:GetLabelObject() end function s.dfilter(c,tp) return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) end function s.discon(e,tp,eg,ep,ev,re,r,rp) if rp==tp or e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) return g and g:IsExists(s.dfilter,1,nil,tp) and Duel.IsChainDisablable(ev) end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) local rc=re:GetHandler() if rc:IsDestructable() and rc:IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end function s.disop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end end function s.atfilter(c,rtype) return c:IsFaceup() and c:GetOriginalType()&rtype>0 end function s.attg(e,c) local tp=e:GetHandlerPlayer() local rtype=bit.band(c:GetType(),TYPE_FUSION|TYPE_SYNCHRO|TYPE_XYZ|TYPE_LINK|TYPE_BIGBANG|TYPE_TIMELEAP) local g=e:GetHandler():GetEquipGroup() local tg=g:Filter(s.atfilter,nil,rtype) return c:GetControler(1-tp) and #tg>0 end function s.actlimit(e,re,rp) local tp=e:GetHandlerPlayer() local rtype=bit.band(re:GetHandler():GetType(),TYPE_FUSION|TYPE_SYNCHRO|TYPE_XYZ|TYPE_LINK|TYPE_BIGBANG|TYPE_TIMELEAP) local g=e:GetHandler():GetEquipGroup() local tg=g:Filter(s.atfilter,nil,rtype) return re:IsActiveType(TYPE_MONSTER) and #tg>0 end