--时穿剑阵·灭神 local m=14000003 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_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_SZONE) e1:SetHintTiming(0,0x1e0) e1:SetCost(cm.cost) e1:SetTarget(cm.target) e1:SetOperation(cm.operation) c:RegisterEffect(e1) --disable and atk down local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_DISABLE) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(0,LOCATION_MZONE) e2:SetCondition(cm.adcon) e2:SetTarget(cm.adtg) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EFFECT_DISABLE_EFFECT) c:RegisterEffect(e3) local e4=e2:Clone() e4:SetCode(EFFECT_SET_ATTACK_FINAL) e4:SetValue(0) c:RegisterEffect(e4) 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) return chrb.CHRB(c) and c:IsAbleToDeckAsCost() end function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler()) Duel.ConfirmCards(1-tp,g) Duel.SendtoDeck(g,nil,2,REASON_COST) end function cm.spfilter(c,e,tp) return chrb.CHRB(c) and c:IsLevel(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(1000) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1000) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_HAND+LOCATION_GRAVE) 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 if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end end end function cm.adcon(e,c) local a=Duel.GetAttacker() local d=Duel.GetAttackTarget() local tp=e:GetHandlerPlayer() return ((a and a:IsControler(tp) and chrb.CHRB(a)) or (d and d:IsControler(tp) and chrb.CHRB(d))) and (Duel.GetCurrentPhase()==PHASE_DAMAGE or Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL) end function cm.adtg(e,c) local a=Duel.GetAttacker() local d=Duel.GetAttackTarget() local tp=e:GetHandlerPlayer() return (a and a:IsControler(tp) and chrb.CHRB(a) and c==a:GetBattleTarget()) or (d and d:IsControler(tp) and chrb.CHRB(d) and c==d:GetBattleTarget()) end