--Abysslym Swift --Original Script by: TaxingCorn117 --Fixed by: XGlitchy30 local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:Desc(0) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCost(s.actreg) c:RegisterEffect(e1) --book of moon an opponents thing local e2=Effect.CreateEffect(c) e2:Desc(1) e2:SetCategory(CATEGORY_POSITION) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_SZONE) e2:SetCost(s.cost) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) --destroy local e3=Effect.CreateEffect(c) e3:Desc(2) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_CARD_TARGET|EFFECT_FLAG_DELAY) e3:SetCode(EVENT_BATTLE_DESTROYING) e3:SetRange(LOCATION_SZONE) e3:SetCondition(s.descon) e3:SetTarget(s.destg) e3:SetOperation(s.desop) c:RegisterEffect(e3) --during ep local e4=Effect.CreateEffect(c) e4:Desc(3) e4:SetCategory(CATEGORY_TOGRAVE) e4:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_TRIGGER_F) e4:SetRange(LOCATION_SZONE) e4:SetCode(EVENT_PHASE|PHASE_END) e4:SetCountLimit(1) e4:SetCondition(s.tgcon) e4:SetTarget(s.tgtg) e4:SetOperation(s.tgop) c:RegisterEffect(e4) end function s.actreg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end if e:IsHasType(EFFECT_TYPE_ACTIVATE) then e:GetHandler():RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_END,EFFECT_FLAG_OATH,1) end end function s.cfilter(c) return c:IsSetCard(ARCHE_ABYSSLYM) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_DECK,0,2,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_DECK,0,2,2,nil) Duel.SendtoGrave(g,REASON_COST) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsCanTurnSetGlitchy() end if chk==0 then return Duel.IsExistingTarget(Card.IsCanTurnSetGlitchy,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectTarget(tp,Card.IsCanTurnSetGlitchy,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetCardOperationInfo(g,CATEGORY_POSITION) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToChain() then Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE) end end --E2 function s.descfilter(c,tp) return c:IsRelateToBattle() and c:IsFaceup() and c:IsSetCard(ARCHE_ABYSSLYM) and c:IsControler(tp) end function s.descon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.descfilter,1,nil,tp) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetCardOperationInfo(g,CATEGORY_DESTROY) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToChain() then Duel.Destroy(tc,REASON_EFFECT) end end --E3 function s.tgcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():HasFlagEffect(id) end function s.tgfilter(c) return c:IsSetCard(ARCHE_ABYSSLYM) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave() end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoGrave(g,REASON_EFFECT) end end