--Paracyclisity Swordmaster, X-Anguish local s,id=GetID() function s.initial_effect(c) --ss once c:SetSPSummonOnce(id) --xyz summon aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x308),2) c:EnableReviveLimit() --pos local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_POSITION) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_CUSTOM+id) e1:SetRange(LOCATION_MZONE) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) local e1x=Effect.CreateEffect(c) e1x:SetType(EFFECT_TYPE_SINGLE) e1x:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE) e1x:SetCode(id) c:RegisterEffect(e1x) aux.RegisterMergedDelayedEventGlitchy(c,id,EVENT_SPSUMMON_SUCCESS,s.filter) --destroy local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetOperation(s.desop) c:RegisterEffect(e3) --send local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,2)) e2:SetCategory(CATEGORY_TOGRAVE) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetHintTiming(0,RELEVANT_TIMINGS) e2:SetCost(s.negcost) e2:SetTarget(s.negtg) e2:SetOperation(s.negop) e2:SetCountLimit(1) c:RegisterEffect(e2) end function s.lkfilter(c) return c:IsFaceup() and c:IsHasEffect(id) end function s.filter(c) local g=Duel.GetMatchingGroup(s.lkfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil) for tc in aux.Next(g) do local lg=tc:GetLinkedGroup() if lg and lg:IsContains(c) then return true end end return false end function s.egfilter(c,tp) return c:IsCanTurnSetGlitchy(tp) and c:GetSummonPlayer()==1-tp end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local g=eg:Filter(s.egfilter,nil,tp) if chk==0 then return #g>0 end Duel.SetTargetCard(g) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,#g,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetTargetCards() if #g<=0 then return end Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local rct if Duel.GetTurnPlayer()==tp then rct=1 else rct=2 end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION) e1:SetTargetRange(0,LOCATION_MZONE) e1:SetTarget(aux.TargetBoolFunction(Card.IsPosition,POS_FACEDOWN_DEFENSE)) e1:SetCondition(s.limcon) e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,rct) e1:SetLabel(Duel.GetTurnCount(),tp) Duel.RegisterEffect(e1,tp) Duel.RegisterHint(1-tp,id,PHASE_END+RESET_SELF_TURN,rct,id,3) end function s.limcon(e) local ct,tp=e:GetLabel() return Duel.GetTurnCount()>ct and Duel.GetTurnPlayer()==1-tp end function s.cfilter(c) return c:IsSetCard(0x308) and c:IsDiscardable() end function s.negcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,s.cfilter,1,1,REASON_COST+REASON_DISCARD,nil) end function s.tgfilter(c) return c:IsFacedown() and c:IsAbleToGrave() end function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(s.tgfilter,tp,0,LOCATION_MZONE,nil) if chk==0 then return #g>0 end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,1-tp,LOCATION_MZONE) end function s.negop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,0,LOCATION_MZONE,1,1,nil) if g:GetCount()>0 then Duel.HintSelection(g) Duel.SendtoGrave(g,nil,REASON_EFFECT) end end