Commit de65a3cd authored by Huangnan's avatar Huangnan

Merge branch 'master' of git.moenext.com:alstroemeria-silentlove/ygopro-222DIY-cards

parents 83561e90 c0c55baa
Pipeline #33283 passed with stages
in 50 minutes and 22 seconds
--你想要这个…是吧?
function c4201024.initial_effect(c)
--remove
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(4201024,1))
e0:SetCategory(CATEGORY_REMOVE)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e0:SetProperty(EFFECT_FLAG_DELAY)
e0:SetCountLimit(1,4201024)
e0:SetRange(LOCATION_DECK)
e0:SetCode(EVENT_REMOVE)
e0:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHandAsCost() end
Duel.SendtoHand(e:GetHandler(),nil,REASON_COST)
end)
e0:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(function(c,p)return c:IsFacedown() and c:IsControler(p) end,1,nil,1-tp)
end)
e0:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c4201024.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end)
e0:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local c = e:GetHandler()
if c and c:IsSummonable(true,nil) then
Duel.Summon(tp,c,true,nil)
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)<1 and Duel.IsPlayerCanDraw(tp,5) then
Duel.Draw(tp,5,REASON_EFFECT)
end
end
end)
c:RegisterEffect(e0)
--summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LIMIT_SUMMON_PROC)
e1:SetCondition(function(e,c,minc)
if c==nil then return Duel.GetFieldGroup(tp,LOCATION_REMOVED,LOCATION_REMOVED)
:FilterCount(Card.IsFacedown,nil)>0 end
return true
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetFieldGroup(tp,LOCATION_REMOVED,LOCATION_REMOVED)
:Filter(Card.IsFacedown,nil)
c:SetMaterial(g)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_SUMMON+REASON_MATERIAL)
end)
e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_LIMIT_SET_PROC)
e2:SetCondition(function(e,c,minc)
if not c then return true end
return false
end)
c:RegisterEffect(e2)
--summon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_DISABLE_SUMMON)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
c:RegisterEffect(e3)
--summon success
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimitTillChainEnd(function(c) return function(e,rp,tp) return e:GetHandler()==c end end,e:GetHandler()) end)
c:RegisterEffect(e4)
--cannot special summon
local e5=Effect.CreateEffect(c)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_SPSUMMON_CONDITION)
e5:SetValue(aux.FALSE)
c:RegisterEffect(e5)
end
function c4201024.sumfilter(c)
return (c:IsSummonable(true,nil) and c:IsLocation(LOCATION_HAND+LOCATION_MZONE)) or (c:IsLocation(LOCATION_DECK) and c:IsAbleToHandAsCost())
end
......@@ -46,7 +46,8 @@ function cm.initial_effect(c)
return eg:IsExists(function(c,tp) return c:IsControler(tp) end,1,nil,1-c:GetOwner())
end)
e3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(c:GetOwner(),aux.Stringid(m,0)) then
c:SetCardData(1,4202048)
if Duel.SelectYesNo(c:GetOwner(),aux.Stringid(m,1)) then
cm.pickup = eg:Filter(Card.IsAbleToRemove,nil,1-tp,POS_FACEDOWN_DEFENSE)
Duel.SpecialSummonRule(c:GetOwner(),e:GetHandler())
end
......
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