Commit efd3f899 authored by Tachibana's avatar Tachibana

ndyd

parent 66cbdbd6
Pipeline #4766 passed with stages
in 22 minutes and 5 seconds
...@@ -2,55 +2,55 @@ ...@@ -2,55 +2,55 @@
local m=4212204 local m=4212204
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
iFunc(c).c("RegisterEffect",iFunc(c) iFunc(c).c("RegisterEffect",iFunc(c)
.e("SetCategory",CATEGORY_NEGATE+CATEGORY_DESTROY) .e("SetCategory",CATEGORY_NEGATE+CATEGORY_DESTROY)
.e("SetType",EFFECT_TYPE_QUICK_O) .e("SetType",EFFECT_TYPE_QUICK_O)
.e("SetCode",EVENT_CHAINING) .e("SetCode",EVENT_CHAINING)
.e("SetRange",LOCATION_HAND) .e("SetRange",LOCATION_HAND)
.e("SetCondition",function(e,tp,eg,ep,ev,re,r,rp) .e("SetCondition",function(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainNegatable(ev) end) return ep~=tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainNegatable(ev) end)
.e("SetCost",function(e,tp,eg,ep,ev,re,r,rp,chk) .e("SetCost",function(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() if chk==0 then return c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,1,c)end and Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,1,c)end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,1,1,c) local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,1,1,c)
g:AddCard(c) Duel.SendtoGrave(g,REASON_COST) end) g:AddCard(c) Duel.SendtoGrave(g,REASON_COST) end)
.e("SetTarget",function(e,tp,eg,ep,ev,re,r,rp,chk) .e("SetTarget",function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end end
if Duel.IsExistingMatchingCard(cm.mfilter,tp,LOCATION_MZONE,0,1,nil) then if Duel.IsExistingMatchingCard(cm.mfilter,tp,LOCATION_MZONE,0,1,nil) then
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0)
end end) end end)
.e("SetOperation",function(e,tp,eg,ep,ev,re,r,rp) .e("SetOperation",function(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
if Duel.Destroy(eg,REASON_EFFECT) if Duel.Destroy(eg,REASON_EFFECT)
and Duel.IsExistingMatchingCard(cm.mfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_DECK,0,1,nil) then and Duel.IsExistingMatchingCard(cm.mfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_DECK,0,1,nil) then
if Duel.SelectYesNo(tp,aux.Stringid(m,0)) then if Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local g = Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_DECK,0,1,1,nil) local g = Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
end end) end end)
.Return()) .Return())
end end
function cm.cfilter(c) function cm.cfilter(c)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_SPELL) and c:IsAbleToHand() return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end end
function cm.mfilter(c) function cm.mfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_SPELLCASTER) and c:IsFaceup() return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_SPELLCASTER) and c:IsFaceup()
end end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsType(TYPE_EQUIP) and c:IsType(TYPE_SPELL) and c:IsAbleToGraveAsCost() return c:IsType(TYPE_EQUIP) and c:IsType(TYPE_SPELL) and c:IsAbleToGraveAsCost()
end end
function iFunc(c,x) function iFunc(c,x)
local __this = (aux.GetValueType(c) == "Card" and {(x == nil and {Effect.CreateEffect(c)} or {x})[1]} or {x})[1] local __this = (aux.GetValueType(c) == "Card" and {(x == nil and {Effect.CreateEffect(c)} or {x})[1]} or {x})[1]
local fe = function(name,...) (type(__this[name])=="function" and {__this[name]} or {""})[1](__this,...) return iFunc(c,__this) end local fe = function(name,...) if name =="RegisterEffect" then c:RegisterEffect(__this:Clone()) else (type(__this[name])=="function" and {__this[name]} or {""})[1](__this,...) end return iFunc(c,__this) end
local fc = function(name,...) this = (type(c[name])=="function" and {c[name]} or {""})[1](c,...) return iFunc(c,c) end local fc = function(name,...) this = (type(c[name])=="function" and {c[name]} or {""})[1](c,...) return iFunc(c,c) end
local func ={e = fe,c = fc,g = fc,v = function() return this end,Return = function() return __this:Clone() end} local func ={e = fe,Clone = fe,c = fc,g = fc,v = function() return this end,Return = function() return __this:Clone() end}
return func return func
end end
\ No newline at end of file
...@@ -47,8 +47,8 @@ function cm.costfilter(c) ...@@ -47,8 +47,8 @@ function cm.costfilter(c)
end end
function iFunc(c,x) function iFunc(c,x)
local __this = (aux.GetValueType(c) == "Card" and {(x == nil and {Effect.CreateEffect(c)} or {x})[1]} or {x})[1] local __this = (aux.GetValueType(c) == "Card" and {(x == nil and {Effect.CreateEffect(c)} or {x})[1]} or {x})[1]
local fe = function(name,...) (type(__this[name])=="function" and {__this[name]} or {""})[1](__this,...) return iFunc(c,__this) end local fe = function(name,...) if name =="RegisterEffect" then c:RegisterEffect(__this:Clone()) else (type(__this[name])=="function" and {__this[name]} or {""})[1](__this,...) end return iFunc(c,__this) end
local fc = function(name,...) this = (type(c[name])=="function" and {c[name]} or {""})[1](c,...) return iFunc(c,c) end local fc = function(name,...) this = (type(c[name])=="function" and {c[name]} or {""})[1](c,...) return iFunc(c,c) end
local func ={e = fe,c = fc,g = fc,v = function() return this end,Return = function() return __this:Clone() end} local func ={e = fe,Clone = fe,c = fc,g = fc,v = function() return this end,Return = function() return __this:Clone() end}
return func return func
end end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment