--Number S90: Neo Galaxy-Eyes Photon Lord function c249001043.initial_effect(c) --xyz summon aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_LIGHT),8,3,c249001043.ovfilter,aux.Stringid(51543904,0),3,c249001043.xyzop) c:EnableReviveLimit() --negate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(39272762,0)) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(c249001043.negcon) e1:SetTarget(c249001043.negtg) e1:SetOperation(c249001043.negop) c:RegisterEffect(e1) --attack up local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetDescription(aux.Stringid(39272762,1)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCountLimit(1) e2:SetRange(LOCATION_MZONE) e2:SetCost(c249001043.atcost) e2:SetTarget(c249001043.attg) e2:SetOperation(c249001043.atop) c:RegisterEffect(e2) --summon ngepd local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(74892653,2)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_LEAVE_FIELD) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DELAY) e3:SetCondition(c249001043.spcon) e3:SetTarget(c249001043.sptg) e3:SetOperation(c249001043.spop) c:RegisterEffect(e3) Duel.AddCustomActivityCounter(249001043,ACTIVITY_CHAIN,c249001043.chainfilter) end c249001043.xyz_number=90 function c249001043.cfilter(c) return (c:IsSetCard(0x55) or c:IsSetCard(0x7B)) and c:IsDiscardable() end function c249001043.ovfilter(c) return c:IsFaceup() and c:IsCode(8165596) end function c249001043.xyzop(e,tp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c249001043.cfilter,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,c249001043.cfilter,1,1,REASON_COST+REASON_DISCARD) end function c249001043.negcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ) and e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,93717133) and Duel.GetCustomActivityCount(249001043,tp,ACTIVITY_CHAIN)==0 end function c249001043.negtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local g=Duel.GetMatchingGroup(aux.disfilter1,tp,0,LOCATION_MZONE,nil) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount(),0,0) Duel.SetChainLimit(c249001043.chainlm) end function c249001043.chainlm(e,rp,tp) return not e:GetHandler():IsType(TYPE_MONSTER) end function c249001043.negop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) local tc=g:GetFirst() while tc do local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e2) tc=g:GetNext() end end function c249001043.atcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) end function c249001043.atfilter(c) return c:IsPreviousLocation(LOCATION_EXTRA) and c:IsSummonType(SUMMON_TYPE_SPECIAL) end function c249001043.attg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetOverlayCount(tp,0,1)~=0 or Duel.GetMatchingGroupCount(c249001043.atfilter,tp,0,LOCATION_MZONE,nil)>0 end end function c249001043.atop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetOverlayGroup(tp,0,1) local c=e:GetHandler() if c:IsFacedown() or not c:IsRelateToEffect(e) then return end local ct=Duel.GetMatchingGroupCount(c249001043.atfilter,tp,0,LOCATION_MZONE,nil) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(ct*500) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EFFECT_EXTRA_ATTACK) e2:SetValue(ct) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) c:RegisterEffect(e2) Duel.SendtoGrave(g,REASON_EFFECT) end function c249001043.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return (c:IsReason(REASON_BATTLE) or (c:GetReasonPlayer()==1-tp and c:IsReason(REASON_EFFECT))) and c:IsPreviousPosition(POS_FACEUP) and c:GetOverlayGroup():IsExists(Card.IsCode,1,nil,93717133) end function c249001043.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return (c:IsReason(REASON_BATTLE) or (c:GetReasonPlayer()==1-tp and c:IsReason(REASON_EFFECT))) and c:IsPreviousPosition(POS_FACEUP) and c:GetOverlayGroup():IsExists(Card.IsCode,1,nil,93717133) end function c249001043.filter(c,e,tp) return c:IsCode(39272762) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 end function c249001043.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL) and Duel.IsExistingMatchingCard(c249001043.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function c249001043.spop(e,tp,eg,ep,ev,re,r,rp) if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_XMATERIAL) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c249001043.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) local tc=g:GetFirst() if tc then local e1=Effect.CreateEffect(tc) e1:SetDescription(aux.Stringid(39272762,0)) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(c249001043.negcon2) e1:SetTarget(c249001043.negtg) e1:SetOperation(c249001043.negop) e1:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e1) Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP) tc:CompleteProcedure() local tc2=Duel.GetFieldCard(tp,LOCATION_GRAVE,Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)-1) if tc2 then Duel.Overlay(tc,tc2) end end end function c249001043.negcon2(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ) end function c249001043.chainfilter(re,tp,cid) return not (re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsSetCard(0x55) and not re:GetHandler():IsSetCard(0x7B)) end