Commit 8c90aa11 authored by 八宫一月's avatar 八宫一月

Update c101207039.lua

parent b7a44012
--クリスタルクリアウィング・オーバー・シンクロ・ドラゴン
local s,id,o=GetID()
function s.initial_effect(c)
--synchro summon
local e0=Effect.CreateEffect(c)
e0:SetDescription(1164)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(s.SynMixCondition(nil,nil,nil,aux.Tuner(nil),1,99,gc))
e0:SetTarget(s.SynMixTarget(nil,nil,nil,aux.Tuner(nil),1,99,gc))
e0:SetOperation(s.SynMixOperation(nil,nil,nil,aux.Tuner(nil),1,99,gc))
e0:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e0)
c:EnableReviveLimit()
--material
aux.AddSynchroMixProcedure(c,aux.FilterBoolFunction(Card.IsCode,82044279),nil,nil,aux.Tuner(nil),1,99,s.syncheck)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......@@ -45,134 +36,19 @@ function s.initial_effect(c)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end
function s.SynMaterialFilter(c,syncard)
return c:IsFaceupEx() and c:IsCanBeSynchroMaterial(syncard)
end
function s.GetSynMaterials(tp,syncard)
local mg=Duel.GetSynchroMaterial(tp):Filter(s.SynMaterialFilter,nil,syncard)
if mg:IsExists(Card.GetHandSynchro,1,nil) then
local mg2=Duel.GetMatchingGroup(Card.IsCanBeSynchroMaterial,tp,LOCATION_HAND,0,nil,syncard)
if mg2:GetCount()>0 then mg:Merge(mg2) end
function s.mgcheck(c,mg)
local rg=mg-c
if c:IsCode(82044279) then
return (rg:IsExists(Card.IsType,1,nil,TYPE_SYNCHRO) or #rg>=2) and not rg:IsExists(s.chkfilter,1,nil)
else
return false
end
return mg
end
function s.SynMixCondition(f1,f2,f3,f4,minct,maxct,gc)
return function(e,c,smat,mg1,min,max)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local minc=minct
local maxc=maxct
if min then
local exct=0
if min-exct>minc then minc=min-exct end
if max-exct<maxc then maxc=max-exct end
if minc>maxc then return false end
end
local tp=c:GetControler()
if Duel.IsPlayerAffectedByEffect(tp,8173184) then
Duel.RegisterFlagEffect(tp,8173184+1,0,0,1)
end
if smat and not smat:IsCanBeSynchroMaterial(c) then
Duel.ResetFlagEffect(tp,8173184+1)
return false
end
local mg
local mgchk=false
if mg1 then
mg=mg1:Filter(Card.IsCanBeSynchroMaterial,nil,c)
mgchk=true
else
mg=s.GetSynMaterials(tp,c)
end
if smat~=nil then mg:AddCard(smat) end
local res=mg:IsExists(s.SynMixFilter1,1,nil,minc,maxc,c,mg,smat,gc,mgchk)
Duel.ResetFlagEffect(tp,8173184+1)
return res
end
end
function s.SynMixTarget(f1,f2,f3,f4,minct,maxct,gc)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,smat,mg1,min,max)
local minc=minct
local maxc=maxct
if min then
local exct=0
if min-exct>minc then minc=min-exct end
if max-exct<maxc then maxc=max-exct end
if minc>maxc then return false end
end
::SynMixTargetSelectStart::
if Duel.IsPlayerAffectedByEffect(tp,8173184) then
Duel.RegisterFlagEffect(tp,8173184+1,0,0,1)
end
local g=Group.CreateGroup()
local mg
local mgchk=false
if mg1 then
mg=mg1:Filter(Card.IsCanBeSynchroMaterial,nil,c)
mgchk=true
else
mg=s.GetSynMaterials(tp,c)
end
if smat~=nil then mg:AddCard(smat) end
local c1
local g4=Group.CreateGroup()
local cancel=Duel.IsSummonCancelable()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
c1=mg:Filter(s.SynMixFilter1,nil,minc,maxc,c,mg,smat,gc,mgchk):SelectUnselect(g,tp,false,cancel,1,1)
if not c1 then goto SynMixTargetSelectCancel end
g:AddCard(c1)
for i=0,maxc-1 do
local mg2=mg:Clone()
if f4 then
mg2=mg2:Filter(f4,g,c,c1,c2,c3)
else
mg2:Sub(g)
end
g4=mg2:SelectSubGroup(tp,s.gcheck,true,1,99,tp,c1,gc,c1:GetLevel())
break
end
g:Merge(g4)
if g4:GetCount()>0 then
g:KeepAlive()
e:SetLabelObject(g)
Duel.ResetFlagEffect(tp,8173184+1)
return true
end
::SynMixTargetSelectCancel::
Duel.ResetFlagEffect(tp,8173184+1)
return false
end
end
function s.SynMixOperation(f1,f2,f3,f4,minct,maxct,gc)
return function(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max)
local g=e:GetLabelObject()
c:SetMaterial(g)
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
g:DeleteGroup()
end
function s.chkfilter(c)
return not c:IsTuner(c)
end
function s.SynMixFilter1(c,minc,maxc,syncard,mg,smat,gc,mgchk)
if not c:IsCode(82044279) then return false end
if c:IsLevel(12) then return false end
local sg=mg
local g=Group.CreateGroup()
g:AddCard(c)
sg:Sub(g)
return sg:CheckSubGroup(s.gcheck,1,99,tp,c,gc,c:GetLevel())
end
function s.gcheck(g,tp,sc,gc,lv)
if not (g:GetSum(Card.GetLevel)==12-lv) then return false end
return (g:GetCount()==1 and bit.band(g:GetFirst():GetType(),TYPE_SYNCHRO+TYPE_TUNER)==TYPE_SYNCHRO+TYPE_TUNER
or g:GetCount()>=2 and g:GetCount()==g:FilterCount(Card.IsType,nil,TYPE_TUNER)) and (not gc or (sc==gc or g:IsContains(gs)))
end
function s.SynMixFilter2(c,minc,maxc,syncard,mg,smat,c1,gc,mgchk)
if f2 then
return f2(c,syncard,c1)
and (mg:IsExists(Auxiliary.SynMixFilter3,1,Group.FromCards(c1,c),f3,f4,minc,maxc,syncard,mg,smat,c1,c,gc,mgchk)
or minc==0 and Auxiliary.SynMixFilter4(c,nil,1,1,syncard,mg,smat,c1,nil,nil,gc,mgchk))
else
return mg:IsExists(Auxiliary.SynMixFilter4,1,c1,f4,minc,maxc,syncard,mg,smat,c1,nil,nil,gc,mgchk)
end
function s.syncheck(g)
return g:IsExists(s.mgcheck,1,nil,g)
end
function s.negcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
......
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