Commit 896bc750 authored by Uytrewq's avatar Uytrewq Committed by GitHub

fix (#2216)

parent 22cf56fa
......@@ -16,12 +16,6 @@ function c16825874.initial_effect(c)
e2:SetCondition(c16825874.ccon)
e2:SetOperation(c16825874.cop)
c:RegisterEffect(e2)
--hand synchro for double tuner
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_HAND_SYNCHRO)
c:RegisterEffect(e3)
end
function c16825874.ccon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_SYNCHRO
......
......@@ -55,9 +55,15 @@ end
function c30983281.excostfilter(c,tp)
return c:IsAbleToRemoveAsCost() and c:IsHasEffect(84012625,tp)
end
function c30983281.synfilter(c,tp,g)
return c:IsSynchroSummonable(nil,g,#g-1,#g-1) and aux.SynMixHandCheck(g,tp,c)
end
function c30983281.syncheck(g,tp,exc)
return Duel.IsExistingMatchingCard(c30983281.synfilter,tp,LOCATION_EXTRA,0,1,exc,tp,g)
end
function c30983281.spcheck(c,tp,rc,mg,opchk)
return Duel.GetLocationCountFromEx(tp,tp,rc,c)>0
and (opchk or Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,c,nil,mg))
and (opchk or mg:CheckSubGroup(c30983281.syncheck,2,#mg,tp,c))
end
function c30983281.scfilter(c,e,tp,rc,chkrel,chknotrel,tgchk,opchk)
if not (c:IsCode(44508094) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false)) then return false end
......@@ -74,7 +80,6 @@ function c30983281.scfilter(c,e,tp,rc,chkrel,chknotrel,tgchk,opchk)
end
end
function c30983281.sccost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
local c=e:GetHandler()
local ect1=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]
local ect2=aux.ExtraDeckSummonCountLimit and Duel.IsPlayerAffectedByEffect(tp,92345028)
......@@ -106,10 +111,7 @@ function c30983281.sccost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c30983281.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==100 then
e:SetLabel(0)
return true
end
if e:IsCostChecked() then return true end
local c=e:GetHandler()
local ect1=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]
local ect2=aux.ExtraDeckSummonCountLimit and Duel.IsPlayerAffectedByEffect(tp,92345028)
......@@ -119,7 +121,6 @@ function c30983281.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL)
and Duel.IsExistingMatchingCard(c30983281.scfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,nil,nil,true)
end
e:SetLabel(0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c30983281.scop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -48,29 +48,38 @@ end
function c34813545.mfilter(c)
return c:IsSetCard(0x2a) and c:IsType(TYPE_MONSTER)
end
function c34813545.cfilter(c,syn)
return syn:IsSynchroSummonable(c)
function c34813545.syncheck(g,tp,syncard)
return g:IsExists(c34813545.mfilter,1,nil) and syncard:IsSynchroSummonable(nil,g,#g-1,#g-1) and aux.SynMixHandCheck(g,tp,syncard)
end
function c34813545.scfilter(c,mg)
return mg:IsExists(c34813545.cfilter,1,nil,c)
function c34813545.scfilter(c,tp,mg)
return mg:CheckSubGroup(c34813545.syncheck,2,#mg,tp,c)
end
function c34813545.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetMatchingGroup(c34813545.mfilter,tp,LOCATION_MZONE,0,nil)
return Duel.IsExistingMatchingCard(c34813545.scfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
local mg=Duel.GetSynchroMaterial(tp)
if mg:IsExists(Card.GetHandSynchro,1,nil) then
local mg2=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,nil)
if mg2:GetCount()>0 then mg:Merge(mg2) end
end
return Duel.IsExistingMatchingCard(c34813545.scfilter,tp,LOCATION_EXTRA,0,1,nil,tp,mg)
end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c34813545.scop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(c34813545.mfilter,tp,LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(c34813545.scfilter,tp,LOCATION_EXTRA,0,nil,mg)
local mg=Duel.GetSynchroMaterial(tp)
if mg:IsExists(Card.GetHandSynchro,1,nil) then
local mg2=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,nil)
if mg2:GetCount()>0 then mg:Merge(mg2) end
end
local g=Duel.GetMatchingGroup(c34813545.scfilter,tp,LOCATION_EXTRA,0,nil,tp,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local tg=mg:FilterSelect(tp,c34813545.cfilter,1,1,nil,sg:GetFirst())
Duel.SynchroSummon(tp,sg:GetFirst(),tg:GetFirst())
local tg=mg:SelectSubGroup(tp,c34813545.syncheck,false,2,#mg,tp,sc)
Duel.SynchroSummon(tp,sc,nil,tg,#tg-1,#tg-1)
end
end
function c34813545.filter1(c,e)
......
......@@ -29,42 +29,37 @@ function c45675980.initial_effect(c)
e2:SetTarget(c45675980.rmtg)
c:RegisterEffect(e2)
end
function c45675980.mfilter(c)
return c:IsRace(RACE_DRAGON)
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)
end
function c45675980.mfilter2(c)
return c:IsHasEffect(EFFECT_HAND_SYNCHRO) and c:IsType(TYPE_MONSTER)
end
function c45675980.cfilter(c,syn)
local b1=true
if c:IsHasEffect(EFFECT_HAND_SYNCHRO) then
b1=Duel.CheckTunerMaterial(syn,c,nil,c45675980.mfilter,1,99)
end
return b1 and syn:IsSynchroSummonable(c)
end
function c45675980.spfilter(c,mg)
return mg:IsExists(c45675980.cfilter,1,nil,c)
function c45675980.spfilter(c,tp,mg)
return mg:CheckSubGroup(c45675980.syncheck,2,#mg,tp,c)
end
function c45675980.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetMatchingGroup(c45675980.mfilter,tp,LOCATION_MZONE,0,nil)
local exg=Duel.GetMatchingGroup(c45675980.mfilter2,tp,LOCATION_MZONE,0,nil)
mg:Merge(exg)
return Duel.IsExistingMatchingCard(c45675980.spfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
local mg=Duel.GetSynchroMaterial(tp)
if mg:IsExists(Card.GetHandSynchro,1,nil) then
local mg2=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,nil)
if mg2:GetCount()>0 then mg:Merge(mg2) end
end
return Duel.IsExistingMatchingCard(c45675980.spfilter,tp,LOCATION_EXTRA,0,1,nil,tp,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c45675980.scop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(c45675980.mfilter,tp,LOCATION_MZONE,0,nil)
local exg=Duel.GetMatchingGroup(c45675980.mfilter2,tp,LOCATION_MZONE,0,nil)
mg:Merge(exg)
local g=Duel.GetMatchingGroup(c45675980.spfilter,tp,LOCATION_EXTRA,0,nil,mg)
if #g>0 then
local mg=Duel.GetSynchroMaterial(tp)
if mg:IsExists(Card.GetHandSynchro,1,nil) then
local mg2=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,nil)
if mg2:GetCount()>0 then mg:Merge(mg2) end
end
local g=Duel.GetMatchingGroup(c45675980.spfilter,tp,LOCATION_EXTRA,0,nil,tp,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local tg=mg:FilterSelect(tp,c45675980.cfilter,1,1,nil,sg:GetFirst())
Duel.SynchroSummon(tp,sg:GetFirst(),tg:GetFirst())
local tg=mg:SelectSubGroup(tp,c45675980.syncheck,false,2,#mg,tp,sc)
Duel.SynchroSummon(tp,sc,nil,tg,#tg-1,#tg-1)
end
end
function c45675980.rmcon(e)
......
......@@ -32,18 +32,11 @@ end
function c77783947.mfilter(c)
return c:IsSetCard(0x9e) and c:IsType(TYPE_MONSTER)
end
function c77783947.mfilter2(c)
return c:IsHasEffect(EFFECT_HAND_SYNCHRO) and c:IsType(TYPE_MONSTER)
function c77783947.syncheck(g,tp,syncard)
return g:IsExists(c77783947.mfilter,1,nil) and syncard:IsSynchroSummonable(nil,g,#g-1,#g-1) and aux.SynMixHandCheck(g,tp,syncard)
end
function c77783947.cfilter(c,syn)
local b1=true
if c:IsHasEffect(EFFECT_HAND_SYNCHRO) then
b1=Duel.CheckTunerMaterial(syn,c,nil,c77783947.mfilter,1,99)
end
return b1 and syn:IsSynchroSummonable(c)
end
function c77783947.spfilter(c,mg)
return mg:IsExists(c77783947.cfilter,1,nil,c)
function c77783947.spfilter(c,tp,mg)
return mg:CheckSubGroup(c77783947.syncheck,2,#mg,tp,c)
end
function c77783947.sccost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
......@@ -51,23 +44,28 @@ function c77783947.sccost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c77783947.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetMatchingGroup(c77783947.mfilter,tp,LOCATION_MZONE,0,nil)
local exg=Duel.GetMatchingGroup(c77783947.mfilter2,tp,LOCATION_MZONE,0,nil)
mg:Merge(exg)
return Duel.IsExistingMatchingCard(c77783947.spfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
local mg=Duel.GetSynchroMaterial(tp)
if mg:IsExists(Card.GetHandSynchro,1,nil) then
local mg2=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,nil)
if mg2:GetCount()>0 then mg:Merge(mg2) end
end
return Duel.IsExistingMatchingCard(c77783947.spfilter,tp,LOCATION_EXTRA,0,1,nil,tp,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c77783947.scop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(c77783947.mfilter,tp,LOCATION_MZONE,0,nil)
local exg=Duel.GetMatchingGroup(c77783947.mfilter2,tp,LOCATION_MZONE,0,nil)
mg:Merge(exg)
local g=Duel.GetMatchingGroup(c77783947.spfilter,tp,LOCATION_EXTRA,0,nil,mg)
local mg=Duel.GetSynchroMaterial(tp)
if mg:IsExists(Card.GetHandSynchro,1,nil) then
local mg2=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,nil)
if mg2:GetCount()>0 then mg:Merge(mg2) end
end
local g=Duel.GetMatchingGroup(c77783947.spfilter,tp,LOCATION_EXTRA,0,nil,tp,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local tg=mg:FilterSelect(tp,c77783947.cfilter,1,1,nil,sg:GetFirst())
Duel.SynchroSummon(tp,sg:GetFirst(),tg:GetFirst())
local tg=mg:SelectSubGroup(tp,c77783947.syncheck,false,2,#mg,tp,sc)
Duel.SynchroSummon(tp,sc,nil,tg,#tg-1,#tg-1)
end
end
......@@ -62,27 +62,36 @@ end
function c85704698.mfilter(c)
return c:IsSetCard(0x2016) and c:IsType(TYPE_TUNER)
end
function c85704698.cfilter(c,syn)
return syn:IsSynchroSummonable(c)
function c85704698.syncheck(g,tp,syncard)
return g:IsExists(c85704698.mfilter,1,nil) and syncard:IsSynchroSummonable(nil,g,#g-1,#g-1) and aux.SynMixHandCheck(g,tp,syncard)
end
function c85704698.spfilter(c,mg)
return c:IsAttribute(ATTRIBUTE_WIND) and mg:IsExists(c85704698.cfilter,1,nil,c)
function c85704698.spfilter(c,tp,mg)
return c:IsAttribute(ATTRIBUTE_WIND) and mg:CheckSubGroup(c85704698.syncheck,2,#mg,tp,c)
end
function c85704698.syntg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetMatchingGroup(c85704698.mfilter,tp,LOCATION_MZONE,0,nil)
return Duel.IsExistingMatchingCard(c85704698.spfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
local mg=Duel.GetSynchroMaterial(tp)
if mg:IsExists(Card.GetHandSynchro,1,nil) then
local mg2=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,nil)
if mg2:GetCount()>0 then mg:Merge(mg2) end
end
return Duel.IsExistingMatchingCard(c85704698.spfilter,tp,LOCATION_EXTRA,0,1,nil,tp,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c85704698.synop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(c85704698.mfilter,tp,LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(c85704698.spfilter,tp,LOCATION_EXTRA,0,nil,mg)
local mg=Duel.GetSynchroMaterial(tp)
if mg:IsExists(Card.GetHandSynchro,1,nil) then
local mg2=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,nil)
if mg2:GetCount()>0 then mg:Merge(mg2) end
end
local g=Duel.GetMatchingGroup(c85704698.spfilter,tp,LOCATION_EXTRA,0,nil,tp,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local tg=mg:FilterSelect(tp,c85704698.cfilter,1,1,nil,sg:GetFirst())
Duel.SynchroSummon(tp,sg:GetFirst(),tg:GetFirst())
local tg=mg:SelectSubGroup(tp,c85704698.syncheck,false,2,#mg,tp,sc)
Duel.SynchroSummon(tp,sc,nil,tg,#tg-1,#tg-1)
end
end
......@@ -168,8 +168,11 @@ function Auxiliary.SynMixCondition(f1,f2,f3,f4,minct,maxct,gc)
local minc=minct
local maxc=maxct
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
local exct=0
if f2 then exct=exct+1 end
if f3 then exct=exct+1 end
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
if smat and not smat:IsCanBeSynchroMaterial(c) then return false end
......@@ -191,8 +194,11 @@ function Auxiliary.SynMixTarget(f1,f2,f3,f4,minct,maxct,gc)
local minc=minct
local maxc=maxct
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
local exct=0
if f2 then exct=exct+1 end
if f3 then exct=exct+1 end
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::
......@@ -330,21 +336,10 @@ function Auxiliary.SynMixHandFilter(c,tp,syncard)
end
return true
end
function Auxiliary.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk)
if ct<minc then return false end
local g=sg:Clone()
g:Merge(sg1)
if Duel.GetLocationCountFromEx(tp,tp,g,syncard)<=0 then return false end
if gc and not gc(g) then return false end
if smat and not g:IsContains(smat) then return false end
if not Auxiliary.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL) then return false end
if not g:CheckWithSumEqual(Card.GetSynchroLevel,syncard:GetLevel(),g:GetCount(),g:GetCount(),syncard)
and (not g:IsExists(Card.IsHasEffect,1,nil,89818984)
or not g:CheckWithSumEqual(Auxiliary.GetSynchroLevelFlowerCardian,syncard:GetLevel(),g:GetCount(),g:GetCount(),syncard))
then return false end
function Auxiliary.SynMixHandCheck(g,tp,syncard)
local hg=g:Filter(Auxiliary.SynMixHandFilter,nil,tp,syncard)
local hct=hg:GetCount()
if hct>0 and not mgchk then
if hct>0 then
local found=false
for c in Auxiliary.Next(g) do
local he,hf,hmin,hmax=c:GetHandSynchro()
......@@ -356,6 +351,21 @@ function Auxiliary.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk)
end
if not found then return false end
end
return true
end
function Auxiliary.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk)
if ct<minc then return false end
local g=sg:Clone()
g:Merge(sg1)
if Duel.GetLocationCountFromEx(tp,tp,g,syncard)<=0 then return false end
if gc and not gc(g) then return false end
if smat and not g:IsContains(smat) then return false end
if not Auxiliary.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL) then return false end
if not g:CheckWithSumEqual(Card.GetSynchroLevel,syncard:GetLevel(),g:GetCount(),g:GetCount(),syncard)
and (not g:IsExists(Card.IsHasEffect,1,nil,89818984)
or not g:CheckWithSumEqual(Auxiliary.GetSynchroLevelFlowerCardian,syncard:GetLevel(),g:GetCount(),g:GetCount(),syncard))
then return false end
if not (mgchk or Auxiliary.SynMixHandCheck(g,tp,syncard)) then return false end
for c in Auxiliary.Next(g) do
local le,lf,lloc,lmin,lmax=c:GetTunerLimit()
if le then
......
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