--时穿剑阵·诛仙 local m=14000002 local cm=_G["c"..m] cm.named_with_Chronoblade=1 xpcall(function() require("expansions/script/c14000001") end,function() require("script/c14000001") end) function cm.initial_effect(c) --Activate local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetCode(EVENT_FREE_CHAIN) e0:SetTarget(cm.tg) c:RegisterEffect(e0) --damage local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(m,0)) e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_FZONE) e1:SetHintTiming(0,0x1e0) e1:SetCost(cm.cost) e1:SetTarget(cm.target) e1:SetOperation(cm.operation) c:RegisterEffect(e1) --act limit local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_CHAINING) e2:SetRange(LOCATION_FZONE) e2:SetOperation(cm.chainop) c:RegisterEffect(e2) end function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end if e:IsHasType(EFFECT_TYPE_ACTIVATE) then Duel.SetChainLimit(aux.FALSE) end end function cm.cfilter(c,tp) return chrb.CHRB(c) and c:IsAbleToDeckAsCost() and (c:IsControler(tp) or c:IsFaceup()) end function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler(),tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler(),tp) local tc=g:GetFirst() if tc:IsFacedown() then Duel.ConfirmCards(1-tp,g) end local cg=tc:GetColumnGroup():Filter(Card.IsControler,nil,1-tp) cg:KeepAlive() e:SetLabelObject(cg) Duel.SendtoDeck(g,nil,2,REASON_COST) end function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local cg=e:GetLabelObject():Filter(Card.IsOnField,nil) Duel.SetTargetCard(cg) Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(1000) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1000) Duel.SetOperationInfo(0,CATEGORY_DESTROY,cg,cg:GetCount(),0,0) end function cm.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) if Duel.Damage(p,d,REASON_EFFECT)~=0 then local cg=e:GetLabelObject():Filter(Card.IsRelateToEffect,nil,e) if cg:GetCount()>0 then Duel.BreakEffect() Duel.Destroy(cg,REASON_EFFECT) end end end function cm.chainop(e,tp,eg,ep,ev,re,r,rp) if chrb.CHRB(re:GetHandler()) then Duel.SetChainLimit(cm.chainlm) end end function cm.chainlm(e,rp,tp) return tp==rp end