--Arcane Lattice Barrier function c249001062.initial_effect(c) aux.AddCodeList(c,249001056) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCondition(c249001062.condition) e1:SetTarget(c249001062.target) e1:SetOperation(c249001062.activate) c:RegisterEffect(e1) --set local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetRange(LOCATION_GRAVE) e2:SetCondition(c249001062.setcon) e2:SetTarget(c249001062.settg) e2:SetOperation(c249001062.setop) c:RegisterEffect(e2) end function c249001062.condition(e,tp,eg,ep,ev,re,r,rp) return tp~=Duel.GetTurnPlayer() end function c249001062.filter(c) return c:IsAttackPos() end function c249001062.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c249001062.filter,tp,0,LOCATION_MZONE,1,nil) end local g=Duel.GetMatchingGroup(c249001062.filter,tp,0,LOCATION_MZONE,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) end function c249001062.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(c249001062.filter,tp,0,LOCATION_MZONE,nil) if g:GetCount()>0 then Duel.Destroy(g,REASON_EFFECT) end end function c249001062.cfilter(c,tp) return c:IsCode(249001056) and c:GetControler()==tp end function c249001062.setcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(c249001062.cfilter,1,nil,tp) end function c249001062.settg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsSSetable() end Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) end function c249001062.setop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsSSetable() then Duel.SSet(tp,c) Duel.ConfirmCards(1-tp,c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT+0x47e0000) e1:SetValue(LOCATION_DECKSHF) c:RegisterEffect(e1) end end