Commit 325de7ec authored by 水濑真白's avatar 水濑真白

Resolved merge conflicts for selected blocks in scripts

parents ea1027fe dd228c7c
Pipeline #42852 passed with stage
in 45 seconds
...@@ -3,14 +3,23 @@ local s,id,o=GetID() ...@@ -3,14 +3,23 @@ local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--fusion material --fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
--fusion if aux.AddFusionProcShaddoll then
local e0=Effect.CreateEffect(c) --old function
e0:SetType(EFFECT_TYPE_SINGLE) local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_FUSION_MATERIAL) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCondition(s.FShaddollCondition) e0:SetCode(EFFECT_FUSION_MATERIAL)
e0:SetOperation(s.FShaddollOperation) e0:SetCondition(s.FShaddollCondition)
c:RegisterEffect(e0) e0:SetOperation(s.FShaddollOperation)
c:RegisterEffect(e0)
else
--new function
aux.AddFusionProcMix(c,false,true,
function (mc) return mc:IsFusionSetCard(0x9d) end,
function (mc) return aux.FShaddollFilter2(mc,ATTRIBUTE_DARK) end,
function (mc) return aux.FShaddollFilter2(mc,ATTRIBUTE_EARTH) end
)
end
--spsummon condition --spsummon condition
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
......
...@@ -29,13 +29,19 @@ function c45675980.initial_effect(c) ...@@ -29,13 +29,19 @@ function c45675980.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c45675980.syncheck(g,tp,syncard) function c45675980.syncheck(g,tp,syncard)
return g:IsExists(Card.IsRace,1,nil,RACE_DRAGON) and syncard:IsSynchroSummonable(nil,g,#g-1,#g-1) and aux.SynMixHandCheck(g,tp,syncard) return g:IsExists(Card.IsRace,1,nil,RACE_DRAGON)
and aux.SynMixHandCheck(g,tp,syncard) and syncard:IsSynchroSummonable(nil,g,#g-1,#g-1)
end end
function c45675980.spfilter(c,tp,mg) function c45675980.spfilter(c,tp,mg)
return mg:CheckSubGroup(c45675980.syncheck,2,#mg,tp,c) if not c:IsType(TYPE_SYNCHRO) then return false end
aux.GCheckAdditional=aux.SynGroupCheckLevelAddition(c)
local res=mg:CheckSubGroup(c45675980.syncheck,2,#mg,tp,c)
aux.GCheckAdditional=nil
return res
end end
function c45675980.sctg(e,tp,eg,ep,ev,re,r,rp,chk) function c45675980.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
if not Duel.IsPlayerCanSpecialSummon(tp) then return false end
local mg=Duel.GetSynchroMaterial(tp) local mg=Duel.GetSynchroMaterial(tp)
if mg:IsExists(Card.GetHandSynchro,1,nil) then if mg:IsExists(Card.GetHandSynchro,1,nil) then
local mg2=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,nil) local mg2=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,nil)
......
...@@ -2,6 +2,16 @@ ...@@ -2,6 +2,16 @@
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
aux.AddCodeList(c,94820406,72043279) aux.AddCodeList(c,94820406,72043279)
--- fusion effect
local e0=FusionSpell.CreateSummonEffect(c,{
fusfilter=s.fusfilter,
pre_select_mat_location=LOCATION_MZONE|LOCATION_GRAVE|LOCATION_REMOVED,
mat_operation_code_map={
{ [LOCATION_DECK]=FusionSpell.FUSION_OPERATION_GRAVE },
{ [0xff]=FusionSpell.FUSION_OPERATION_SHUFFLE }
},
sumtype=SUMMON_VALUE_DARK_FUSION
})
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
...@@ -9,32 +19,19 @@ function s.initial_effect(c) ...@@ -9,32 +19,19 @@ function s.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_FUSION_SUMMON) e1:SetProperty(EFFECT_FLAG_FUSION_SUMMON)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetLabelObject(e0)
e1:SetOperation(s.operation) e1:SetOperation(s.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
s.fusion_effect=true
function s.filter1(c,e) function s.fusfilter(c)
return (c:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) or c:IsFaceup()) and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() return c.dark_calling==true
and not c:IsImmuneToEffect(e)
end
function s.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c.dark_calling and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_VALUE_DARK_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local chkf=tp local fusion_effect=e:GetLabelObject()
local mg=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e)
local b0=Duel.GetFlagEffect(tp,id)==0 or not e:IsCostChecked() local b0=Duel.GetFlagEffect(tp,id)==0 or not e:IsCostChecked()
local b1=b0 and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,nil,chkf) local b1=b0 and fusion_effect:GetTarget()(e,tp,eg,ep,ev,re,r,rp,0)
if b0 and not b1 then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
b1=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
local b2=Duel.IsExistingMatchingCard(s.thfilter2,tp,LOCATION_DECK,0,1,nil) local b2=Duel.IsExistingMatchingCard(s.thfilter2,tp,LOCATION_DECK,0,1,nil)
and (Duel.GetFlagEffect(tp,id+o)==0 or not e:IsCostChecked()) and (Duel.GetFlagEffect(tp,id+o)==0 or not e:IsCostChecked())
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
...@@ -76,56 +73,16 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -76,56 +73,16 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
s.thop(e,tp,eg,ep,ev,re,r,rp) s.thop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.fsop(e,tp,eg,ep,ev,re,r,rp) function s.fsop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp local fusion_effect=e:GetLabelObject()
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.filter1),tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e) fusion_effect:GetOperation()(e,tp,eg,ep,ev,re,r,rp)
local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg,nil,chkf)
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
::cancel::
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or (ce and not Duel.SelectYesNo(tp,ce:GetDescription()))) then
local mat=Duel.SelectFusionMaterial(tp,tc,mg,nil,chkf)
if #mat==0 then goto cancel end
tc:SetMaterial(mat)
if mat:IsExists(Card.IsFacedown,1,nil) then
local cg=mat:Filter(Card.IsFacedown,nil)
Duel.ConfirmCards(1-tp,cg)
end
if mat:Filter(s.cfilter,nil):GetCount()>0 then
local cg=mat:Filter(s.cfilter,nil)
Duel.HintSelection(cg)
end
Duel.SendtoDeck(mat,nil,SEQ_DECKSHUFFLE,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_VALUE_DARK_FUSION,tp,tp,false,false,POS_FACEUP)
elseif ce~=nil then
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
if #mat2==0 then goto cancel end
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2,SUMMON_VALUE_DARK_FUSION)
end
tc:CompleteProcedure()
end
end
function s.cfilter(c)
return c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) or (c:IsLocation(LOCATION_MZONE) and c:IsFaceup())
end end
function s.thfilter2(c) function s.thfilter2(c)
return c:IsCode(94820406,72043279) and c:IsAbleToHand() return c:IsCode(94820406,72043279) and c:IsAbleToHand()
end end
function s.thop(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter2,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.thfilter2,tp,LOCATION_DECK,0,1,1,nil)
......
...@@ -4,6 +4,12 @@ function s.initial_effect(c) ...@@ -4,6 +4,12 @@ function s.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--material --material
aux.AddSynchroMixProcedure(c,aux.FilterBoolFunction(Card.IsCode,82044279),nil,nil,aux.Tuner(nil),1,99,s.syncheck) aux.AddSynchroMixProcedure(c,aux.FilterBoolFunction(Card.IsCode,82044279),nil,nil,aux.Tuner(nil),1,99,s.syncheck)
--double tuner check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_MATERIAL_CHECK)
e0:SetValue(s.valcheck)
c:RegisterEffect(e0)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
...@@ -36,6 +42,17 @@ function s.initial_effect(c) ...@@ -36,6 +42,17 @@ function s.initial_effect(c)
e3:SetOperation(s.spop) e3:SetOperation(s.spop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function s.valcheck(e,c)
local g=c:GetMaterial()
if g:IsExists(Card.IsType,2,nil,TYPE_TUNER) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(21142671)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function s.mfilter2(c,mg,syncard) function s.mfilter2(c,mg,syncard)
return c:IsCode(82044279) and (mg:IsExists(Card.IsType,1,c,TYPE_SYNCHRO) or #mg-1>=2) and not mg:IsExists(s.chkfilter,1,c,syncard) return c:IsCode(82044279) and (mg:IsExists(Card.IsType,1,c,TYPE_SYNCHRO) or #mg-1>=2) and not mg:IsExists(s.chkfilter,1,c,syncard)
end end
......
...@@ -3,8 +3,14 @@ local s,id,o=GetID() ...@@ -3,8 +3,14 @@ local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--fusion material --fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
--fusion -- using new function
aux.AddFusionProcShaddoll(c,ATTRIBUTE_WIND) if aux.AddFusionProcShaddoll then
--old function
aux.AddFusionProcShaddoll(c,ATTRIBUTE_WIND)
else
--new function
aux.AddFusionProcFun2(c,function (mc) return mc:IsFusionSetCard(0x9d) end, function (mc) return aux.FShaddollFilter2(mc,ATTRIBUTE_WIND) end, true)
end
--cannot spsummon --cannot spsummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
......
...@@ -58,16 +58,17 @@ end ...@@ -58,16 +58,17 @@ end
---@param minc integer ---@param minc integer
---@param maxc? integer ---@param maxc? integer
function Auxiliary.AddSynchroProcedure(c,f1,f2,minc,maxc) function Auxiliary.AddSynchroProcedure(c,f1,f2,minc,maxc)
if maxc==nil then maxc=99 end if maxc==nil then maxc=c:GetLevel()-1 end
local maxct=math.min(maxc,c:GetLevel()-1)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(1164) e1:SetDescription(1164)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA) e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(Auxiliary.SynCondition(f1,f2,minc,maxc)) e1:SetCondition(Auxiliary.SynCondition(f1,f2,minc,maxct))
e1:SetTarget(Auxiliary.SynTarget(f1,f2,minc,maxc)) e1:SetTarget(Auxiliary.SynTarget(f1,f2,minc,maxct))
e1:SetOperation(Auxiliary.SynOperation(f1,f2,minc,maxc)) e1:SetOperation(Auxiliary.SynOperation(f1,f2,minc,maxct))
e1:SetValue(SUMMON_TYPE_SYNCHRO) e1:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
...@@ -109,7 +110,7 @@ function Auxiliary.SynTarget(f1,f2,minct,maxct) ...@@ -109,7 +110,7 @@ function Auxiliary.SynTarget(f1,f2,minct,maxct)
else return false end else return false end
end end
end end
function Auxiliary.SynOperation(f1,f2,minct,maxc) function Auxiliary.SynOperation(f1,f2,minct,maxct)
return function(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max) return function(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max)
local g=e:GetLabelObject() local g=e:GetLabelObject()
c:SetMaterial(g) c:SetMaterial(g)
...@@ -132,15 +133,22 @@ end ...@@ -132,15 +133,22 @@ end
---@param maxc integer ---@param maxc integer
---@param gc? function ---@param gc? function
function Auxiliary.AddSynchroMixProcedure(c,f1,f2,f3,f4,minc,maxc,gc) function Auxiliary.AddSynchroMixProcedure(c,f1,f2,f3,f4,minc,maxc,gc)
local maxct=maxc
if maxct>c:GetLevel() then
maxct=c:GetLevel()
if f1 then maxct=maxct-1 end
if f2 then maxct=maxct-1 end
if f3 then maxct=maxct-1 end
end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(1164) e1:SetDescription(1164)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA) e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(Auxiliary.SynMixCondition(f1,f2,f3,f4,minc,maxc,gc)) e1:SetCondition(Auxiliary.SynMixCondition(f1,f2,f3,f4,minc,maxct,gc))
e1:SetTarget(Auxiliary.SynMixTarget(f1,f2,f3,f4,minc,maxc,gc)) e1:SetTarget(Auxiliary.SynMixTarget(f1,f2,f3,f4,minc,maxct,gc))
e1:SetOperation(Auxiliary.SynMixOperation(f1,f2,f3,f4,minc,maxc,gc)) e1:SetOperation(Auxiliary.SynMixOperation(f1,f2,f3,f4,minc,maxct,gc))
e1:SetValue(SUMMON_TYPE_SYNCHRO) e1:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
...@@ -153,6 +161,15 @@ end ...@@ -153,6 +161,15 @@ end
function Auxiliary.GetSynchroLevelFlowerCardian(c) function Auxiliary.GetSynchroLevelFlowerCardian(c)
return 2 return 2
end end
function Auxiliary.GetMinSynchroLevel(c,syncard)
local lv=c:GetSynchroLevel(syncard)
local minlv=c:GetLevel()
while lv&MAX_PARAMETER>0 do
minlv=math.min(minlv,lv&MAX_PARAMETER)
lv=lv>>16
end
return minlv
end
function Auxiliary.GetSynMaterials(tp,syncard) function Auxiliary.GetSynMaterials(tp,syncard)
local mg=Duel.GetSynchroMaterial(tp):Filter(Auxiliary.SynMaterialFilter,nil,syncard) local mg=Duel.GetSynchroMaterial(tp):Filter(Auxiliary.SynMaterialFilter,nil,syncard)
if mg:IsExists(Card.GetHandSynchro,1,nil) then if mg:IsExists(Card.GetHandSynchro,1,nil) then
...@@ -185,14 +202,22 @@ function Auxiliary.SynMixCondition(f1,f2,f3,f4,minct,maxct,gc) ...@@ -185,14 +202,22 @@ function Auxiliary.SynMixCondition(f1,f2,f3,f4,minct,maxct,gc)
end end
local mg local mg
local mgchk=false local mgchk=false
local goalchk=false
if mg1 then if mg1 then
mg=mg1:Filter(Card.IsCanBeSynchroMaterial,nil,c)
mgchk=true mgchk=true
if min and min==max and #mg1==min+1 then
goalchk=Auxiliary.SynMixCheckGoal(tp,mg1,0,0,c,Group.CreateGroup(),smat,gc,mgchk,goalchk)
if not goalchk then
Duel.ResetFlagEffect(tp,8173184+1)
return false
end
end
mg=mg1:Filter(Card.IsCanBeSynchroMaterial,nil,c)
else else
mg=Auxiliary.GetSynMaterials(tp,c) mg=Auxiliary.GetSynMaterials(tp,c)
end end
if smat~=nil then mg:AddCard(smat) end if smat~=nil then mg:AddCard(smat) end
local res=mg:IsExists(Auxiliary.SynMixFilter1,1,nil,f1,f2,f3,f4,minc,maxc,c,mg,smat,gc,mgchk) local res=mg:IsExists(Auxiliary.SynMixFilter1,1,nil,f1,f2,f3,f4,minc,maxc,c,mg,smat,gc,mgchk,goalchk)
Duel.ResetFlagEffect(tp,8173184+1) Duel.ResetFlagEffect(tp,8173184+1)
return res return res
end end
...@@ -216,6 +241,7 @@ function Auxiliary.SynMixTarget(f1,f2,f3,f4,minct,maxct,gc) ...@@ -216,6 +241,7 @@ function Auxiliary.SynMixTarget(f1,f2,f3,f4,minct,maxct,gc)
local g=Group.CreateGroup() local g=Group.CreateGroup()
local mg local mg
local mgchk=false local mgchk=false
local goalchk=false
if mg1 then if mg1 then
mg=mg1:Filter(Card.IsCanBeSynchroMaterial,nil,c) mg=mg1:Filter(Card.IsCanBeSynchroMaterial,nil,c)
mgchk=true mgchk=true
...@@ -229,18 +255,18 @@ function Auxiliary.SynMixTarget(f1,f2,f3,f4,minct,maxct,gc) ...@@ -229,18 +255,18 @@ function Auxiliary.SynMixTarget(f1,f2,f3,f4,minct,maxct,gc)
local g4=Group.CreateGroup() local g4=Group.CreateGroup()
local cancel=Duel.IsSummonCancelable() local cancel=Duel.IsSummonCancelable()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
c1=mg:Filter(Auxiliary.SynMixFilter1,nil,f1,f2,f3,f4,minc,maxc,c,mg,smat,gc,mgchk):SelectUnselect(g,tp,false,cancel,1,1) c1=mg:Filter(Auxiliary.SynMixFilter1,nil,f1,f2,f3,f4,minc,maxc,c,mg,smat,gc,mgchk,goalchk):SelectUnselect(g,tp,false,cancel,1,1)
if not c1 then goto SynMixTargetSelectCancel end if not c1 then goto SynMixTargetSelectCancel end
g:AddCard(c1) g:AddCard(c1)
if f2 then if f2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
c2=mg:Filter(Auxiliary.SynMixFilter2,g,f2,f3,f4,minc,maxc,c,mg,smat,c1,gc,mgchk):SelectUnselect(g,tp,false,cancel,1,1) c2=mg:Filter(Auxiliary.SynMixFilter2,g,f2,f3,f4,minc,maxc,c,mg,smat,c1,gc,mgchk,goalchk):SelectUnselect(g,tp,false,cancel,1,1)
if not c2 then goto SynMixTargetSelectCancel end if not c2 then goto SynMixTargetSelectCancel end
if g:IsContains(c2) then goto SynMixTargetSelectStart end if g:IsContains(c2) then goto SynMixTargetSelectStart end
g:AddCard(c2) g:AddCard(c2)
if f3 then if f3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
c3=mg:Filter(Auxiliary.SynMixFilter3,g,f3,f4,minc,maxc,c,mg,smat,c1,c2,gc,mgchk):SelectUnselect(g,tp,false,cancel,1,1) c3=mg:Filter(Auxiliary.SynMixFilter3,g,f3,f4,minc,maxc,c,mg,smat,c1,c2,gc,mgchk,goalchk):SelectUnselect(g,tp,false,cancel,1,1)
if not c3 then goto SynMixTargetSelectCancel end if not c3 then goto SynMixTargetSelectCancel end
if g:IsContains(c3) then goto SynMixTargetSelectStart end if g:IsContains(c3) then goto SynMixTargetSelectStart end
g:AddCard(c3) g:AddCard(c3)
...@@ -253,9 +279,10 @@ function Auxiliary.SynMixTarget(f1,f2,f3,f4,minct,maxct,gc) ...@@ -253,9 +279,10 @@ function Auxiliary.SynMixTarget(f1,f2,f3,f4,minct,maxct,gc)
else else
mg2:Sub(g) mg2:Sub(g)
end end
local cg=mg2:Filter(Auxiliary.SynMixCheckRecursive,g4,tp,g4,mg2,i,minc,maxc,c,g,smat,gc,mgchk) local fulltraversal=mg:IsExists(Card.IsHasEffect,1,nil,89818984)
local cg=mg2:Filter(Auxiliary.SynMixCheckRecursive,g4,tp,g4,mg2,i,minc,maxc,c,g,smat,gc,mgchk,goalchk,fulltraversal)
if cg:GetCount()==0 then break end if cg:GetCount()==0 then break end
local finish=Auxiliary.SynMixCheckGoal(tp,g4,minc,i,c,g,smat,gc,mgchk) local finish=Auxiliary.SynMixCheckGoal(tp,g4,minc,i,c,g,smat,gc,mgchk,goalchk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local c4=cg:SelectUnselect(g+g4,tp,finish,cancel,minc,maxc) local c4=cg:SelectUnselect(g+g4,tp,finish,cancel,minc,maxc)
if not c4 then if not c4 then
...@@ -285,28 +312,28 @@ function Auxiliary.SynMixOperation(f1,f2,f3,f4,minct,maxct,gc) ...@@ -285,28 +312,28 @@ function Auxiliary.SynMixOperation(f1,f2,f3,f4,minct,maxct,gc)
g:DeleteGroup() g:DeleteGroup()
end end
end end
function Auxiliary.SynMixFilter1(c,f1,f2,f3,f4,minc,maxc,syncard,mg,smat,gc,mgchk) function Auxiliary.SynMixFilter1(c,f1,f2,f3,f4,minc,maxc,syncard,mg,smat,gc,mgchk,goalchk)
return (not f1 or f1(c,syncard)) and mg:IsExists(Auxiliary.SynMixFilter2,1,c,f2,f3,f4,minc,maxc,syncard,mg,smat,c,gc,mgchk) return (not f1 or f1(c,syncard)) and mg:IsExists(Auxiliary.SynMixFilter2,1,c,f2,f3,f4,minc,maxc,syncard,mg,smat,c,gc,mgchk,goalchk)
end end
function Auxiliary.SynMixFilter2(c,f2,f3,f4,minc,maxc,syncard,mg,smat,c1,gc,mgchk) function Auxiliary.SynMixFilter2(c,f2,f3,f4,minc,maxc,syncard,mg,smat,c1,gc,mgchk,goalchk)
if f2 then if f2 then
return f2(c,syncard,c1) 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) and (mg:IsExists(Auxiliary.SynMixFilter3,1,Group.FromCards(c1,c),f3,f4,minc,maxc,syncard,mg,smat,c1,c,gc,mgchk,goalchk)
or minc==0 and Auxiliary.SynMixFilter4(c,nil,1,1,syncard,mg,smat,c1,nil,nil,gc,mgchk)) or minc==0 and Auxiliary.SynMixFilter4(c,nil,1,1,syncard,mg,smat,c1,nil,nil,gc,mgchk,goalchk))
else else
return mg:IsExists(Auxiliary.SynMixFilter4,1,c1,f4,minc,maxc,syncard,mg,smat,c1,nil,nil,gc,mgchk) return mg:IsExists(Auxiliary.SynMixFilter4,1,c1,f4,minc,maxc,syncard,mg,smat,c1,nil,nil,gc,mgchk,goalchk)
end end
end end
function Auxiliary.SynMixFilter3(c,f3,f4,minc,maxc,syncard,mg,smat,c1,c2,gc,mgchk) function Auxiliary.SynMixFilter3(c,f3,f4,minc,maxc,syncard,mg,smat,c1,c2,gc,mgchk,goalchk)
if f3 then if f3 then
return f3(c,syncard,c1,c2) return f3(c,syncard,c1,c2)
and (mg:IsExists(Auxiliary.SynMixFilter4,1,Group.FromCards(c1,c2,c),f4,minc,maxc,syncard,mg,smat,c1,c2,c,gc,mgchk) and (mg:IsExists(Auxiliary.SynMixFilter4,1,Group.FromCards(c1,c2,c),f4,minc,maxc,syncard,mg,smat,c1,c2,c,gc,mgchk,goalchk)
or minc==0 and Auxiliary.SynMixFilter4(c,nil,1,1,syncard,mg,smat,c1,c2,nil,gc,mgchk)) or minc==0 and Auxiliary.SynMixFilter4(c,nil,1,1,syncard,mg,smat,c1,c2,nil,gc,mgchk,goalchk))
else else
return mg:IsExists(Auxiliary.SynMixFilter4,1,Group.FromCards(c1,c2),f4,minc,maxc,syncard,mg,smat,c1,c2,nil,gc,mgchk) return mg:IsExists(Auxiliary.SynMixFilter4,1,Group.FromCards(c1,c2),f4,minc,maxc,syncard,mg,smat,c1,c2,nil,gc,mgchk,goalchk)
end end
end end
function Auxiliary.SynMixFilter4(c,f4,minc,maxc,syncard,mg1,smat,c1,c2,c3,gc,mgchk) function Auxiliary.SynMixFilter4(c,f4,minc,maxc,syncard,mg1,smat,c1,c2,c3,gc,mgchk,goalchk)
if f4 and not f4(c,syncard,c1,c2,c3) then return false end if f4 and not f4(c,syncard,c1,c2,c3) then return false end
local sg=Group.FromCards(c1,c) local sg=Group.FromCards(c1,c)
sg:AddCard(c1) sg:AddCard(c1)
...@@ -318,24 +345,33 @@ function Auxiliary.SynMixFilter4(c,f4,minc,maxc,syncard,mg1,smat,c1,c2,c3,gc,mgc ...@@ -318,24 +345,33 @@ function Auxiliary.SynMixFilter4(c,f4,minc,maxc,syncard,mg1,smat,c1,c2,c3,gc,mgc
else else
mg:Sub(sg) mg:Sub(sg)
end end
return Auxiliary.SynMixCheck(mg,sg,minc-1,maxc-1,syncard,smat,gc,mgchk) return Auxiliary.SynMixCheck(mg,sg,minc-1,maxc-1,syncard,mg1,smat,gc,mgchk,goalchk)
end end
function Auxiliary.SynMixCheck(mg,sg1,minc,maxc,syncard,smat,gc,mgchk) function Auxiliary.SynMixCheck(mg,sg1,minc,maxc,syncard,mg1,smat,gc,mgchk,goalchk)
local tp=syncard:GetControler() local tp=syncard:GetControler()
local sg=Group.CreateGroup() local sg=Group.CreateGroup()
if minc<=0 and Auxiliary.SynMixCheckGoal(tp,sg1,0,0,syncard,sg,smat,gc,mgchk) then return true end if minc<=0 and Auxiliary.SynMixCheckGoal(tp,sg1,0,0,syncard,sg,smat,gc,mgchk,goalchk) then return true end
if maxc==0 then return false end if maxc==0 then return false end
return mg:IsExists(Auxiliary.SynMixCheckRecursive,1,nil,tp,sg,mg,0,minc,maxc,syncard,sg1,smat,gc,mgchk) local fulltraversal=#mg<=5 or mg1:IsExists(Card.IsHasEffect,1,nil,89818984)
return mg:IsExists(Auxiliary.SynMixCheckRecursive,1,nil,tp,sg,mg,0,minc,maxc,syncard,sg1,smat,gc,mgchk,goalchk,fulltraversal)
end end
function Auxiliary.SynMixCheckRecursive(c,tp,sg,mg,ct,minc,maxc,syncard,sg1,smat,gc,mgchk) function Auxiliary.SynMixCheckRecursive(c,tp,sg,mg,ct,minc,maxc,syncard,sg1,smat,gc,mgchk,goalchk,fulltraversal)
sg:AddCard(c) sg:AddCard(c)
ct=ct+1 ct=ct+1
local res=Auxiliary.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk) local res=Auxiliary.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk,goalchk)
or (ct<maxc and mg:IsExists(Auxiliary.SynMixCheckRecursive,1,sg,tp,sg,mg,ct,minc,maxc,syncard,sg1,smat,gc,mgchk)) if not res and ct<maxc
and (fulltraversal or not Auxiliary.SynMixCheckPrune(sg,sg1,syncard)) then
res=mg:IsExists(Auxiliary.SynMixCheckRecursive,1,sg,tp,sg,mg,ct,minc,maxc,syncard,sg1,smat,gc,mgchk,goalchk,fulltraversal)
end
sg:RemoveCard(c) sg:RemoveCard(c)
ct=ct-1 ct=ct-1
return res return res
end end
function Auxiliary.SynMixCheckPrune(sg,sg1,syncard)
local g=sg+sg1
local sumlv=g:GetSum(Auxiliary.GetMinSynchroLevel,syncard)
return sumlv>=syncard:GetLevel()
end
-- the material is in hand and don't has extra synchro material effect itself -- the material is in hand and don't has extra synchro material effect itself
-- that mean some other tuner added it as material -- that mean some other tuner added it as material
function Auxiliary.SynMixHandFilter(c,tp,syncard) function Auxiliary.SynMixHandFilter(c,tp,syncard)
...@@ -368,10 +404,10 @@ function Auxiliary.SynMixHandCheck(g,tp,syncard) ...@@ -368,10 +404,10 @@ function Auxiliary.SynMixHandCheck(g,tp,syncard)
end end
return true return true
end end
function Auxiliary.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk) function Auxiliary.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk,goalchk)
if goalchk then return true end
if ct<minc then return false end if ct<minc then return false end
local g=sg:Clone() local g=sg+sg1
g:Merge(sg1)
if Duel.GetLocationCountFromEx(tp,tp,g,syncard)<=0 then return false end if Duel.GetLocationCountFromEx(tp,tp,g,syncard)<=0 then return false end
if gc and not gc(g,syncard,tp) then return false end if gc and not gc(g,syncard,tp) then return false end
if smat and not g:IsContains(smat) then return false end if smat and not g:IsContains(smat) then return false end
...@@ -414,6 +450,12 @@ function Auxiliary.TuneMagicianCheckAdditionalX(ecode) ...@@ -414,6 +450,12 @@ function Auxiliary.TuneMagicianCheckAdditionalX(ecode)
return not g:IsExists(Auxiliary.TuneMagicianCheckX,1,nil,g,ecode) return not g:IsExists(Auxiliary.TuneMagicianCheckX,1,nil,g,ecode)
end end
end end
function Auxiliary.SynGroupCheckLevelAddition(syncard)
return function(g)
local sumlv=g:GetSum(Auxiliary.GetMinSynchroLevel,syncard)
return sumlv<=syncard:GetLevel()
end
end
--Xyz Summon --Xyz Summon
function Auxiliary.XyzAlterFilter(c,alterf,xyzc,e,tp,alterop) function Auxiliary.XyzAlterFilter(c,alterf,xyzc,e,tp,alterop)
......
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