Commit 68198b23 authored by mercury233's avatar mercury233 Committed by GitHub

update リペア・ジェネクス・コントローラー (#2570)

parent 37c3a1fc
...@@ -77,89 +77,42 @@ function s.smop(e,tp,eg,ep,ev,re,r,rp) ...@@ -77,89 +77,42 @@ function s.smop(e,tp,eg,ep,ev,re,r,rp)
Duel.Summon(tp,g:GetFirst(),true,nil) Duel.Summon(tp,g:GetFirst(),true,nil)
end end
--splimit --splimit
local e0=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e0:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e0:SetTarget(s.splimit) e1:SetTarget(s.splimit)
e0:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e0,tp)
--splimit2
local e1=e0:Clone()
e1:SetTarget(s.splimit1)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
--synchro level --
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e2:SetProperty(EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetTarget(s.tlmtg)
e2:SetValue(s.tlmval)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
--
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SYNCHRO_MATERIAL_CUSTOM) e3:SetCode(id)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTarget(s.syntg) e3:SetTargetRange(1,0)
e3:SetValue(1) e3:SetReset(RESET_PHASE+PHASE_END)
e3:SetOperation(s.synop) Duel.RegisterEffect(e3,tp)
local e31=Effect.CreateEffect(c)
e31:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e31:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e31:SetReset(RESET_PHASE+PHASE_END)
e31:SetTargetRange(LOCATION_MZONE,0)
e31:SetLabelObject(e3)
Duel.RegisterEffect(e31,tp)
end end
function s.splimit(e,c,sump,sumtype,sumpos,targetp,se) function s.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA) and bit.band(sumtype,SUMMON_TYPE_SYNCHRO)~=SUMMON_TYPE_SYNCHRO return c:IsLocation(LOCATION_EXTRA) and bit.band(sumtype,SUMMON_TYPE_SYNCHRO)~=SUMMON_TYPE_SYNCHRO
end end
function s.splimit1(e,c,sump,sumtype,sumpos,targetp,se) function s.tlmtg(e,c)
return se:IsHasType(EFFECT_TYPE_ACTIONS) and c:IsLocation(LOCATION_EXTRA) return c:IsType(TYPE_TUNER) and not c:IsSetCard(0x2)
end
function s.smcfilter(c,sc)
return c:IsSetCard(0x2) and c:IsType(TYPE_TUNER)
end
function s.synfilter(c,syncard,tuner,f)
return c:IsFaceupEx() and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c,syncard))
end
function s.syncheck(c,g,mg,tp,lv,syncard,minc,maxc)
g:AddCard(c)
local ct=g:GetCount()
local res=s.syngoal(g,tp,lv,syncard,minc,ct)
or (ct<maxc and mg:IsExists(s.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc))
g:RemoveCard(c)
return res
end end
function s.syngoal(g,tp,lv,syncard,minc,ct) function s.tlmval(e,sync)
return ct>=minc and Duel.GetLocationCountFromEx(tp,tp,g,syncard)>0 local tp=e:GetHandlerPlayer()
and g:CheckWithSumEqual(Card.GetSynchroLevel,lv,ct,ct,syncard) if sync:GetControler()==tp then
and aux.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL) return Duel.GetFlagEffect(tp,id+1)==0
and g:IsExists(s.smcfilter,1,nil,syncard)
end
function s.syntg(e,syncard,f,min,max)
local minc=min+1
local maxc=max+1
local c=e:GetHandler()
local tp=syncard:GetControler()
local lv=syncard:GetLevel()
if lv<=c:GetLevel() then return false end
local g=Group.FromCards(c)
local mg=Duel.GetSynchroMaterial(tp):Filter(s.synfilter,c,syncard,c,f)
return mg:IsExists(s.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc)
end
function s.synop(e,tp,eg,ep,ev,re,r,rp,syncard,f,min,max)
local minc=min+1
local maxc=max+1
local c=e:GetHandler()
local lv=syncard:GetLevel()
local g=Group.FromCards(c)
local mg=Duel.GetSynchroMaterial(tp):Filter(s.synfilter,c,syncard,c,f)
for i=1,maxc do
local cg=mg:Filter(s.syncheck,g,g,mg,tp,lv,syncard,minc,maxc)
if cg:GetCount()==0 then break end
local minct=1
if s.syngoal(g,tp,lv,syncard,minc,i) then
minct=0
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local sg=cg:Select(tp,minct,1,nil)
if sg:GetCount()==0 then break end
g:Merge(sg)
end end
Duel.SetSynchroMaterial(g) return false
end end
...@@ -175,8 +175,14 @@ function Auxiliary.SynMixCondition(f1,f2,f3,f4,minct,maxct,gc) ...@@ -175,8 +175,14 @@ function Auxiliary.SynMixCondition(f1,f2,f3,f4,minct,maxct,gc)
if max-exct<maxc then maxc=max-exct end if max-exct<maxc then maxc=max-exct end
if minc>maxc then return false end if minc>maxc then return false end
end end
if smat and not smat:IsCanBeSynchroMaterial(c) then return false end
local tp=c:GetControler() 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 mg
local mgchk=false local mgchk=false
if mg1 then if mg1 then
...@@ -186,7 +192,9 @@ function Auxiliary.SynMixCondition(f1,f2,f3,f4,minct,maxct,gc) ...@@ -186,7 +192,9 @@ function Auxiliary.SynMixCondition(f1,f2,f3,f4,minct,maxct,gc)
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
return 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)
Duel.ResetFlagEffect(tp,8173184+1)
return res
end end
end end
function Auxiliary.SynMixTarget(f1,f2,f3,f4,minct,maxct,gc) function Auxiliary.SynMixTarget(f1,f2,f3,f4,minct,maxct,gc)
...@@ -202,6 +210,9 @@ function Auxiliary.SynMixTarget(f1,f2,f3,f4,minct,maxct,gc) ...@@ -202,6 +210,9 @@ function Auxiliary.SynMixTarget(f1,f2,f3,f4,minct,maxct,gc)
if minc>maxc then return false end if minc>maxc then return false end
end end
::SynMixTargetSelectStart:: ::SynMixTargetSelectStart::
if Duel.IsPlayerAffectedByEffect(tp,8173184) then
Duel.RegisterFlagEffect(tp,8173184+1,0,0,1)
end
local g=Group.CreateGroup() local g=Group.CreateGroup()
local mg local mg
local mgchk=false local mgchk=false
...@@ -215,26 +226,26 @@ function Auxiliary.SynMixTarget(f1,f2,f3,f4,minct,maxct,gc) ...@@ -215,26 +226,26 @@ function Auxiliary.SynMixTarget(f1,f2,f3,f4,minct,maxct,gc)
local c1 local c1
local c2 local c2
local c3 local c3
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):SelectUnselect(g,tp,false,cancel,1,1)
if not c1 then return false 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):SelectUnselect(g,tp,false,cancel,1,1)
if not c2 then return false 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):SelectUnselect(g,tp,false,cancel,1,1)
if not c3 then return false 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)
end end
end end
local g4=Group.CreateGroup()
for i=0,maxc-1 do for i=0,maxc-1 do
local mg2=mg:Clone() local mg2=mg:Clone()
if f4 then if f4 then
...@@ -249,7 +260,7 @@ function Auxiliary.SynMixTarget(f1,f2,f3,f4,minct,maxct,gc) ...@@ -249,7 +260,7 @@ function Auxiliary.SynMixTarget(f1,f2,f3,f4,minct,maxct,gc)
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
if finish then break if finish then break
else return false end else goto SynMixTargetSelectCancel end
end end
if g:IsContains(c4) or g4:IsContains(c4) then goto SynMixTargetSelectStart end if g:IsContains(c4) or g4:IsContains(c4) then goto SynMixTargetSelectStart end
g4:AddCard(c4) g4:AddCard(c4)
...@@ -258,8 +269,12 @@ function Auxiliary.SynMixTarget(f1,f2,f3,f4,minct,maxct,gc) ...@@ -258,8 +269,12 @@ function Auxiliary.SynMixTarget(f1,f2,f3,f4,minct,maxct,gc)
if g:GetCount()>0 then if g:GetCount()>0 then
g:KeepAlive() g:KeepAlive()
e:SetLabelObject(g) e:SetLabelObject(g)
Duel.ResetFlagEffect(tp,8173184+1)
return true return true
else return false end end
::SynMixTargetSelectCancel::
Duel.ResetFlagEffect(tp,8173184+1)
return false
end end
end end
function Auxiliary.SynMixOperation(f1,f2,f3,f4,minct,maxct,gc) function Auxiliary.SynMixOperation(f1,f2,f3,f4,minct,maxct,gc)
...@@ -361,6 +376,8 @@ function Auxiliary.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk) ...@@ -361,6 +376,8 @@ function Auxiliary.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk)
if gc and not gc(g) 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 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 Auxiliary.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL) then return false end
if Duel.IsPlayerAffectedByEffect(tp,8173184)
and not g:IsExists(Auxiliary.Tuner(Card.IsSetCard,0x2),1,nil,syncard) then return false end
if not g:CheckWithSumEqual(Card.GetSynchroLevel,syncard:GetLevel(),g:GetCount(),g:GetCount(),syncard) if not g:CheckWithSumEqual(Card.GetSynchroLevel,syncard:GetLevel(),g:GetCount(),g:GetCount(),syncard)
and (not g:IsExists(Card.IsHasEffect,1,nil,89818984) and (not g:IsExists(Card.IsHasEffect,1,nil,89818984)
or not g:CheckWithSumEqual(Auxiliary.GetSynchroLevelFlowerCardian,syncard:GetLevel(),g:GetCount(),g:GetCount(),syncard)) or not g:CheckWithSumEqual(Auxiliary.GetSynchroLevelFlowerCardian,syncard:GetLevel(),g:GetCount(),g:GetCount(),syncard))
...@@ -2263,6 +2280,7 @@ function Auxiliary.MustMaterialCheck(v,tp,code) ...@@ -2263,6 +2280,7 @@ function Auxiliary.MustMaterialCheck(v,tp,code)
local g=Duel.GetMustMaterial(tp,code) local g=Duel.GetMustMaterial(tp,code)
if not v then if not v then
if code==EFFECT_MUST_BE_XMATERIAL and Duel.IsPlayerAffectedByEffect(tp,67120578) then return false end if code==EFFECT_MUST_BE_XMATERIAL and Duel.IsPlayerAffectedByEffect(tp,67120578) then return false end
if code==EFFECT_MUST_BE_SMATERIAL and Duel.IsPlayerAffectedByEffect(tp,8173184) then return false end
return #g==0 return #g==0
end end
return Duel.CheckMustMaterial(tp,v,code) return Duel.CheckMustMaterial(tp,v,code)
......
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