--Neo Galaxy-Eyes Stardustream Dragon --Scripted by: Unknown --Updated by: Glitchy local s,id,o=GetID() function s.initial_effect(c) --xyz summon c:EnableReviveLimit() aux.AddXyzProcedureLevelFree(c,aux.TRUE,s.xyzcheck,2,2) --negate effects local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,4)) e1:SetCategory(CATEGORY_DISABLE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(aux.XyzSummonedCond) e1:SetTarget(s.negtg) e1:SetOperation(s.negop) c:RegisterEffect(e1) --negate and destroy local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetCode(EVENT_CHAINING) e2:SetCondition(s.discon) e2:SetCost(aux.DetachSelfCost()) e2:SetTarget(s.distg) e2:SetOperation(s.disop) c:RegisterEffect(e2) --banish local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_REMOVE) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_MZONE) e3:SetCost(aux.DetachSelfCost()) e3:SetTarget(s.natg) e3:SetOperation(s.naop) c:RegisterEffect(e3) --material local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(id,3)) e5:SetCategory(CATEGORY_LEAVE_GRAVE) e5:SetCustomCategory(CATEGORY_ATTACH) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e5:SetProperty(EFFECT_FLAG_CARD_TARGET) e5:SetCode(EVENT_SPSUMMON_SUCCESS) e5:SetCondition(s.condition) e5:SetTarget(s.target) e5:SetOperation(s.operation) c:RegisterEffect(e5) end s.xyz_count=2 function s.mfilter1(c,g,xyzc) return c:IsSetCard(0x7b,0x55) and c:IsXyzLevel(xyzc,8) and g:IsExists(s.mfilter2,1,c,xyzc) end function s.mfilter2(c,xyzc) return c:IsSetCard(0xa3) and c:IsXyzLevel(xyzc,8) end function s.xyzcheck(g,tp,xyzc) return g:IsExists(s.mfilter1,1,nil,g,xyzc) end function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local g=Duel.GetMatchingGroup(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler()) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,#g,PLAYER_ALL,LOCATION_ONFIELD) end function s.negop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local g=Duel.GetMatchingGroup(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c) for tc in aux.Next(g) do Duel.Negate(tc,e,RESET_PHASE+PHASE_END) end end function s.discon(e,tp,eg,ep,ev,re,r,rp) if rp~=1-tp or e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) or not Duel.IsChainNegatable(ev) then return false end if re:IsHasCategory(CATEGORY_NEGATE) and Duel.GetChainInfo(ev-1,CHAININFO_TRIGGERING_EFFECT):IsHasType(EFFECT_TYPE_ACTIVATE) then return false end local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY) return (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and ex and tg~=nil and tc+tg:FilterCount(Card.IsOnField,nil)-tg:GetCount()>0 end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToChain(ev) 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.NegateActivation(ev) and re:GetHandler():IsRelateToChain(ev) then Duel.Destroy(eg,REASON_EFFECT) end end function s.natg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chk==0 then return c:IsAbleToRemove() end Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,c:GetControler(),c:GetLocation()) end function s.naop(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if c:IsRelateToChain() and Duel.Remove(c,POS_FACEUP,REASON_EFFECT)~=0 and c:IsBanished() then local fid=e:GetFieldID() c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_IGNORE_IMMUNE,1,fid) local e2=Effect.CreateEffect(c) e2:Desc(2) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetCountLimit(1) e2:SetLabel(fid) e2:SetLabelObject(c) e2:SetCondition(s.spcon) e2:SetOperation(s.spop) Duel.RegisterEffect(e2,tp) end end function s.spcon(e) local fid=e:GetLabel() local c=e:GetLabelObject() if not c or not c:HasFlagEffectLabel(id,fid) then e:Reset() return false end return true end function s.spop(e,tp,eg,ep,ev,re,r,rp) local fid=e:GetLabel() local c=e:GetLabelObject() if c and c:HasFlagEffectLabel(id,fid) and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 then Duel.SpecialSummon(c,1,tp,c:GetControler(),false,false,POS_FACEUP) end end function s.condition(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1 end function s.filter(c) return c:IsType(TYPE_MONSTER) and c:IsCanOverlay() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc) end local c=e:GetHandler() if chk==0 then return c:IsType(TYPE_XYZ) and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,tp) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,#g,tp,0) Duel.SetCustomOperationInfo(0,CATEGORY_ATTACH,g,#g,tp,LOCATION_GRAVE,c) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if c:IsType(TYPE_XYZ) and c:IsRelateToChain() and tc:IsRelateToChain() and not tc:IsImmuneToEffect(e) then Duel.Attach(tc,c) end end