--Paracyclisity Meteor Impact, Stagdominator local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_INSECT),3,99,s.lcheck) --direct attack local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DIRECT_ATTACK) e1:SetCondition(s.dircon) c:RegisterEffect(e1) local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE) e5:SetCode(EFFECT_SET_ATTACK_FINAL) e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e5:SetRange(LOCATION_MZONE) e5:SetCondition(s.atkcon) e5:SetValue(2000) c:RegisterEffect(e5) --destroy local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_POSITION) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCondition(aux.LinkSummonedCond) e3:SetTarget(s.postg) e3:SetOperation(s.posop) c:RegisterEffect(e3) --destroy local e4=Effect.CreateEffect(c) e4:Desc(1) e4:SetCategory(CATEGORY_DESTROY) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_TO_GRAVE) e4:SetProperty(EFFECT_FLAG_DDD) e4:SetCondition(s.tdcon) e4:SetCost(s.tdcost) e4:SetTarget(s.tdtg) e4:SetOperation(s.tdop) c:RegisterEffect(e4) end function s.lcheck(g,lg) return g:IsExists(Card.IsLinkType,1,nil,TYPE_LINK) end function s.dircon(e) local tp=e:GetHandlerPlayer() return not Duel.IsExistingMatchingCard(aux.NOT(Card.IsPosition),tp,0,LOCATION_MZONE,1,nil,POS_FACEDOWN_DEFENSE) end function s.atkcon(e) local c=e:GetHandler() return Duel.GetCurrentPhase()>=PHASE_BATTLE_STEP and Duel.GetCurrentPhase()<=PHASE_DAMAGE_CAL and c==Duel.GetAttacker() and Duel.GetAttackTarget()==nil and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 and c:GetEffectCount(EFFECT_DIRECT_ATTACK)==1 end function s.filter(c,tp) return c:IsControler(1-tp) and c:IsCanTurnSetGlitchy(tp) end function s.postg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local g=e:GetHandler():GetLinkedGroup():Filter(s.filter,nil,tp) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,#g,1-tp,LOCATION_MZONE) end function s.posop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToChain() or c:IsFacedown() then return end local g=c:GetLinkedGroup():Filter(s.filter,nil,tp) if #g<=0 then return end Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE) for tc in aux.Next(g) do local e1=Effect.CreateEffect(e:GetHandler()) e1:Desc(2) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCondition(s.limcon) if Duel.GetTurnPlayer()==tp then e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,2) else e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,3) end e1:SetLabel(Duel.GetTurnCount(),tp) tc:RegisterEffect(e1) end end function s.limcon(e) local ct,tp=e:GetLabel() return Duel.GetTurnCount()>ct and Duel.GetTurnPlayer()==1-tp end function s.tdcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_LINK) end function s.cfilter(c) return c:IsSetCard(0x308) and c:IsMonster() and c:IsAbleToGraveAsCost() end function s.tdcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_EXTRA,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_EXTRA,0,1,1,nil) Duel.SendtoGrave(g,REASON_COST) end function s.desfilter(c) return c:IsFaceup() and not c:IsSetCard(0x308) end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) if chk==0 then return #g>0 end Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) if #g<=0 then return end Duel.Destroy(g,REASON_EFFECT) end