Commit 53cffffd authored by GuGu's avatar GuGu

Update c999213.lua

parent a6119533
Pipeline #33485 passed with stage
in 8 seconds
...@@ -7,9 +7,10 @@ function M.initial_effect(c) ...@@ -7,9 +7,10 @@ function M.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA) e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(M.sprcon) e1:SetCondition(M.sprcon)
e1:SetTarget(M.sprtg)
e1:SetOperation(M.sprop) e1:SetOperation(M.sprop)
e1:SetValue(SUMMON_TYPE_FUSION) e1:SetValue(SUMMON_TYPE_FUSION)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -30,55 +31,47 @@ end ...@@ -30,55 +31,47 @@ end
function M.ffilter(c) function M.ffilter(c)
return c:IsType(TYPE_DUAL) and c:IsFusionSetCard(0xaa1) return c:IsType(TYPE_DUAL) and c:IsFusionSetCard(0xaa1)
end end
--
function M.spfilter1(c, tp, fc) function M.fselect(g,tp,sc)
local flag = Duel.GetLocationCountFromEx(tp, tp, c, TYPE_FUSION) < 1 return g:GetCount()==3 and Duel.GetLocationCountFromEx(tp,tp,g,sc)>0
return c:IsCode(999202) and c:IsAbleToDeckAsCost() and c:IsCanBeFusionMaterial(fc) and M.gfffcheck(g)
and Duel.IsExistingMatchingCard(M.spfilter2, tp, LOCATION_MZONE+LOCATION_EXTRA, 0, 1, nil, fc, flag, c)
end end
function M.gfffcheck(g)
function M.spfilter2(c, fc, flag, c1) if #g~=3 then return false end
if c == c1 then return false end local g1=g:GetFirst()
flag = flag and Duel.GetLocationCountFromEx(tp, tp, c, TYPE_FUSION) < 1 local g2=g:GetNext()
return (c:IsType(TYPE_DUAL) and c:IsFusionSetCard(0xaa1)) and c:IsCanBeFusionMaterial(fc) and c:IsAbleToDeckAsCost() local g3=g:GetNext()
and Duel.IsExistingMatchingCard(M.spfilter3, tp, LOCATION_MZONE+LOCATION_EXTRA, 0, 1, nil, fc, flag, c1, c) local b1=g1:IsFusionCode(999202) and M.ffilter(g2) and M.ffilter(g3)
local b2=M.ffilter(g1) and g2:IsFusionCode(999202) and M.ffilter(g3)
local b3=M.ffilter(g1) and M.ffilter(g2) and g3:IsFusionCode(999202)
return b1 or b2 or b3
end end
function M.spfilter(c,fc)
function M.spfilter3(c, fc, flag, c1, c2) return c:IsAbleToDeckAsCost() and c:IsCanBeFusionMaterial(fc) and c:IsFaceup()
if c == c1 or c == c2 then return false end
if flag and Duel.GetLocationCountFromEx(tp, tp, c, TYPE_FUSION) < 1 then return false end
return (c:IsType(TYPE_DUAL) and c:IsFusionSetCard(0xaa1)) and c:IsCanBeFusionMaterial(fc) and c:IsAbleToDeckAsCost()
end end
function M.sprcon(e,c)
function M.sprcon(e, c) if c==nil then return true end
if c == nil then return true end local tp=c:GetControler()
local tp = c:GetControler() local rg=Duel.GetMatchingGroup(M.spfilter,tp,LOCATION_MZONE+LOCATION_EXTRA,0,nil)
return Duel.IsExistingMatchingCard(M.spfilter1, tp, LOCATION_MZONE+LOCATION_EXTRA, 0, 1, nil, tp, c) return rg:CheckSubGroup(M.fselect,3,3,tp,c)
end end
function M.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c)
function M.sprop(e,tp,eg,ep,ev,re,r,rp,c) local rg=Duel.GetMatchingGroup(M.spfilter,tp,LOCATION_MZONE+LOCATION_EXTRA,0,nil)
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
local g1 = Duel.SelectMatchingCard(tp, M.spfilter1, tp, LOCATION_MZONE + LOCATION_EXTRA, 0, 1, 1, nil, tp, c)
local c1 = g1:GetFirst()
local flag = Duel.GetLocationCountFromEx(tp, tp, c1, TYPE_FUSION) < 1
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2 = Duel.SelectMatchingCard(tp, M.spfilter2, tp, LOCATION_MZONE+LOCATION_EXTRA, 0, 1, 1, nil, c, flag, c1)
local c2 = g2:GetFirst()
flag = flag and Duel.GetLocationCountFromEx(tp, tp, c2, TYPE_FUSION) < 1
g1:Merge(g2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g3 = Duel.SelectMatchingCard(tp, M.spfilter3, tp, LOCATION_MZONE+LOCATION_EXTRA, 0, 1, 1, nil, c, flag, c1, c2) local sg=rg:SelectSubGroup(tp,M.fselect,true,3,3,tp,c)
g1:Merge(g3) if sg then
sg:KeepAlive()
local tc = g1:GetFirst() e:SetLabelObject(sg)
while tc do return true
if not tc:IsFaceup() then Duel.ConfirmCards(1-tp, tc) end else return false end
tc = g1:GetNext() end
end function M.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.SendtoDeck(g1, nil, 2, REASON_COST) local g=e:GetLabelObject()
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_MATERIAL+REASON_FUSION)
c:SetMaterial(g)
g:DeleteGroup()
end end
--
function M.spfilter4(c, e, tp) function M.spfilter4(c, e, tp)
return c:IsType(TYPE_MONSTER) and (c:IsSetCard(0xaa1) or c:IsType(TYPE_DUAL)) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false) return c:IsType(TYPE_MONSTER) and (c:IsSetCard(0xaa1) or c:IsType(TYPE_DUAL)) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
......
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