Commit 0cd8b458 authored by POLYMER's avatar POLYMER

fix

parent ac2fe2cd
...@@ -37,7 +37,7 @@ function cm.initial_effect(c) ...@@ -37,7 +37,7 @@ function cm.initial_effect(c)
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD) e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_ADD_CODE) e5:SetCode(EFFECT_ADD_CODE)
e5:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD) e5:SetTargetRange(0,LOCATION_ONFIELD)
e5:SetCondition(function(e) return e:GetHandler():GetSequence()<5 end) e5:SetCondition(function(e) return e:GetHandler():GetSequence()<5 end)
e5:SetTarget(function(e,c) return aux.GetColumn(c) and math.abs(aux.GetColumn(c)-aux.GetColumn(e:GetHandler()))==1 end) e5:SetTarget(function(e,c) return aux.GetColumn(c) and math.abs(aux.GetColumn(c)-aux.GetColumn(e:GetHandler()))==1 end)
e5:SetValue(11451631) e5:SetValue(11451631)
...@@ -167,6 +167,29 @@ function cm.thfilter(c) ...@@ -167,6 +167,29 @@ function cm.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x979) return c:IsAbleToHand() and c:IsSetCard(0x979)
end end
function cm.actop(e,tp,eg,ep,ev,re,r,rp) function cm.actop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
if Duel.GetCurrentPhase()==PHASE_STANDBY then
e1:SetLabel(Duel.GetTurnCount())
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2)
else
e1:SetLabel(0)
e1:SetReset(RESET_PHASE+PHASE_STANDBY)
end
e1:SetCondition(cm.descon2)
e1:SetTarget(cm.destg2)
e1:SetOperation(cm.desop2)
Duel.RegisterEffect(e1,tp)
end
function cm.descon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel()
end
function cm.destg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
end
function cm.desop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
if #g>0 then if #g>0 then
......
...@@ -36,7 +36,9 @@ local e4=Effect.CreateEffect(c) ...@@ -36,7 +36,9 @@ local e4=Effect.CreateEffect(c)
e4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) e4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local ct1=Duel.GetCustomActivityCount(13000750,1-tp,ACTIVITY_CHAIN) local ct1=Duel.GetCustomActivityCount(13000750,1-tp,ACTIVITY_CHAIN)
local ct2=Duel.GetCustomActivityCount(13000750,tp,ACTIVITY_CHAIN) local ct2=Duel.GetCustomActivityCount(13000750,tp,ACTIVITY_CHAIN)
return (ct1+ct2)>=3 and e:GetHandler():IsFaceup() end) local a=2-Duel.GetMatchingGroupCount(nil,tp,LOCATION_HAND,0,e:GetHandler())
local b=2-Duel.GetMatchingGroupCount(nil,1-tp,LOCATION_HAND,0,e:GetHandler())
return (ct1+ct2)>=3 and e:GetHandler():IsFaceup() and Duel.IsPlayerCanDraw(tp,ct) and (a>0 or b>0) end)
e4:SetOperation(cm.disop) e4:SetOperation(cm.disop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
if not cm.global_check then if not cm.global_check then
......
...@@ -143,7 +143,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -143,7 +143,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if ft>=1 then if ft>=1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local spcg=Group.CreateGroup() local spcg=Group.CreateGroup()
if ft<=Duel.GetLocationCount(tp,LOCATION_MZONE) then if ft>=spg:GetCount() then
spcg=spg spcg=spg
else else
spcg=spg:Select(tp,ft,ft,nil) spcg=spg:Select(tp,ft,ft,nil)
......
...@@ -129,7 +129,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -129,7 +129,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if ft>=1 then if ft>=1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local spcg=Group.CreateGroup() local spcg=Group.CreateGroup()
if ft<=Duel.GetLocationCount(tp,LOCATION_MZONE) then if ft>=spg:GetCount() then
spcg=spg spcg=spg
else else
spcg=spg:Select(tp,ft,ft,nil) spcg=spg:Select(tp,ft,ft,nil)
......
...@@ -76,7 +76,6 @@ function cm.tnop(e,tp,eg,ep,ev,re,r,rp) ...@@ -76,7 +76,6 @@ function cm.tnop(e,tp,eg,ep,ev,re,r,rp)
e3:SetCode(EVENT_CHAINING) e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_NO_TURN_RESET) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_NO_TURN_RESET)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD) e3:SetReset(RESET_EVENT+RESETS_STANDARD)
e3:SetCondition(cm.discon) e3:SetCondition(cm.discon)
e3:SetTarget(cm.distg) e3:SetTarget(cm.distg)
...@@ -144,7 +143,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -144,7 +143,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if ft>=1 then if ft>=1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local spcg=Group.CreateGroup() local spcg=Group.CreateGroup()
if ft<=Duel.GetLocationCount(tp,LOCATION_MZONE) then if ft>=spg:GetCount() then
spcg=spg spcg=spg
else else
spcg=spg:Select(tp,ft,ft,nil) spcg=spg:Select(tp,ft,ft,nil)
......
...@@ -135,7 +135,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -135,7 +135,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if ft>=1 then if ft>=1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local spcg=Group.CreateGroup() local spcg=Group.CreateGroup()
if ft<=Duel.GetLocationCount(tp,LOCATION_MZONE) then if ft>=spg:GetCount() then
spcg=spg spcg=spg
else else
spcg=spg:Select(tp,ft,ft,nil) spcg=spg:Select(tp,ft,ft,nil)
......
...@@ -3,26 +3,47 @@ local cm=_G["c"..m] ...@@ -3,26 +3,47 @@ local cm=_G["c"..m]
cm.name="麦卡恩的秩序" cm.name="麦卡恩的秩序"
function cm.initial_effect(c) function cm.initial_effect(c)
aux.AddCodeList(c,15005130) aux.AddCodeList(c,15005130)
--synchro summon
aux.AddSynchroMixProcedure(c,aux.Tuner(nil),aux.Tuner(nil),nil,aux.NonTuner(cm.sfilter),1,99)
c:EnableReviveLimit() c:EnableReviveLimit()
--self
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE) e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(15005141) e0:SetCode(15005141)
e0:SetRange(LOCATION_EXTRA) e0:SetRange(LOCATION_EXTRA)
e0:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE) e0:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE)
c:RegisterEffect(e0) c:RegisterEffect(e0)
--synchro summon --Hand Synchro
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(1164) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SYNCHRO_MATERIAL_CUSTOM)
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:SetCondition(cm.syncon)
e1:SetCondition(cm.SynMixCondition(aux.Tuner(nil),aux.Tuner(nil),nil,aux.NonTuner(cm.sfilter),1,99,gc)) e1:SetTarget(cm.syntg)
e1:SetTarget(cm.SynMixTarget(aux.Tuner(nil),aux.Tuner(nil),nil,aux.NonTuner(cm.sfilter),1,99,gc)) e1:SetValue(1)
e1:SetOperation(cm.SynMixOperation(aux.Tuner(nil),aux.Tuner(nil),nil,aux.NonTuner(cm.sfilter),1,99,gc)) e1:SetOperation(cm.synop)
e1:SetValue(SUMMON_TYPE_SYNCHRO) local e2=Effect.CreateEffect(c)
c:RegisterEffect(e1) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e2:SetRange(LOCATION_EXTRA)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetTarget(cm.mattg)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
--Hand Synchro
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e3:SetCondition(cm.syncon)
e3:SetCode(EFFECT_HAND_SYNCHRO)
e3:SetTargetRange(0,1)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e4:SetRange(LOCATION_EXTRA)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e4:SetTarget(cm.mattg)
e4:SetLabelObject(e3)
c:RegisterEffect(e4)
--add ind --add ind
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
...@@ -61,216 +82,77 @@ end ...@@ -61,216 +82,77 @@ end
function cm.sfilter(c) function cm.sfilter(c)
return c:IsRace(RACE_MACHINE) return c:IsRace(RACE_MACHINE)
end end
function cm.GetSynMaterials(tp,syncard) function cm.mattg(e,c)
local mg=Duel.GetSynchroMaterial(tp):Filter(aux.SynMaterialFilter,nil,syncard) return c:IsType(TYPE_TUNER)
if mg then
local mg2=Duel.GetMatchingGroup(aux.SynMaterialFilter,tp,LOCATION_HAND,0,nil,syncard)
if mg2:GetCount()>0 then mg:Merge(mg2) end
end
return mg
end end
function cm.SynMixCondition(f1,f2,f3,f4,minc,maxc,gc) function cm.synfilter(c,syncard,tuner,f)
return function(e,c,smat,mg1,min,max) return c:IsFaceupEx() and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c,syncard)) and (c:IsFaceup() or (c:IsLocation(LOCATION_HAND) and c:IsRace(RACE_MACHINE)))
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
if smat and not smat:IsCanBeSynchroMaterial(c) then return false end
local tp=c:GetControler()
local mg
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=cm.GetSynMaterials(tp,c)
end
if smat~=nil then mg:AddCard(smat) end
return mg:IsExists(cm.SynMixFilter1,1,nil,f1,f2,f3,f4,minc,maxc,c,mg,smat,gc,mgchk)
end
end
function cm.SynMixTarget(f1,f2,f3,f4,minc,maxc,gc)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,smat,mg1,min,max)
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
::SynMixTargetSelectStart::
local g=Group.CreateGroup()
local mg
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=cm.GetSynMaterials(tp,c)
end
if smat~=nil then mg:AddCard(smat) end
local c1
local c2
local c3
local cancel=Duel.IsSummonCancelable()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
c1=mg:Filter(cm.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
g:AddCard(c1)
if f2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
c2=mg:Filter(cm.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 g:IsContains(c2) then goto SynMixTargetSelectStart end
g:AddCard(c2)
if f3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
c3=mg:Filter(cm.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 g:IsContains(c3) then goto SynMixTargetSelectStart end
g:AddCard(c3)
end
end
local g4=Group.CreateGroup()
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
local cg=mg2:Filter(cm.SynMixCheckRecursive,g4,tp,g4,mg2,i,minc,maxc,c,g,smat,gc,mgchk)
if cg:GetCount()==0 then break end
local finish=cm.SynMixCheckGoal(tp,g4,minc,i,c,g,smat,gc,mgchk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local c4=cg:SelectUnselect(g+g4,tp,finish,cancel,minc,maxc)
if not c4 then
if finish then break
else return false end
end
if g:IsContains(c4) or g4:IsContains(c4) then goto SynMixTargetSelectStart end
g4:AddCard(c4)
end
g:Merge(g4)
if g:GetCount()>0 then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
end end
function cm.SynMixOperation(f1,f2,f3,f4,minct,maxc,gc) function cm.syncheck(c,g,mg,tp,lv,syncard,minc,maxc)
return function(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max) g:AddCard(c)
local g=e:GetLabelObject() local ct=g:GetCount()
c:SetMaterial(g) local res=cm.syngoal(g,tp,lv,syncard,minc,ct)
if g:IsExists(Card.IsLocation,1,nil,LOCATION_HAND) then or (ct<maxc and mg:IsExists(cm.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc))
for tc in aux.Next(g) do g:RemoveCard(c)
if tc:IsLocation(LOCATION_HAND) then return res
Duel.ConfirmCards(1-tp,tc)
end
end
Duel.SendtoDeck(g,nil,2,REASON_MATERIAL+REASON_SYNCHRO)
else
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
end
g:DeleteGroup()
end
end
function cm.SynMixFilter1(c,f1,f2,f3,f4,minc,maxc,syncard,mg,smat,gc,mgchk)
return (not f1 or f1(c,syncard)) and mg:IsExists(cm.SynMixFilter2,1,c,f2,f3,f4,minc,maxc,syncard,mg,smat,c,gc,mgchk)
end
function cm.SynMixFilter2(c,f2,f3,f4,minc,maxc,syncard,mg,smat,c1,gc,mgchk)
if f2 then
return f2(c,syncard,c1)
and (mg:IsExists(cm.SynMixFilter3,1,Group.FromCards(c1,c),f3,f4,minc,maxc,syncard,mg,smat,c1,c,gc,mgchk)
or minc==0 and cm.SynMixFilter4(c,nil,1,1,syncard,mg,smat,c1,nil,nil,gc,mgchk))
else
return mg:IsExists(cm.SynMixFilter4,1,c1,f4,minc,maxc,syncard,mg,smat,c1,nil,nil,gc,mgchk)
end
end end
function cm.SynMixFilter3(c,f3,f4,minc,maxc,syncard,mg,smat,c1,c2,gc,mgchk) function cm.syngoal(g,tp,lv,syncard,minc,ct)
if f3 then return ct>=minc
return f3(c,syncard,c1,c2) and g:CheckWithSumEqual(Card.GetSynchroLevel,lv,ct,ct,syncard)
and (mg:IsExists(cm.SynMixFilter4,1,Group.FromCards(c1,c2,c),f4,minc,maxc,syncard,mg,smat,c1,c2,c,gc,mgchk) and Duel.GetLocationCountFromEx(tp,tp,g,syncard)>0
or minc==0 and cm.SynMixFilter4(c,nil,1,1,syncard,mg,smat,c1,c2,nil,gc,mgchk)) and aux.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL)
else and (g:FilterCount(Card.IsLocation,nil,LOCATION_HAND)==0 or (syncard:IsHasEffect(15005141) and g:FilterCount(Card.IsLocation,nil,LOCATION_HAND)<=1))
return mg:IsExists(cm.SynMixFilter4,1,Group.FromCards(c1,c2),f4,minc,maxc,syncard,mg,smat,c1,c2,nil,gc,mgchk)
end
end end
function cm.SynMixFilter4(c,f4,minc,maxc,syncard,mg1,smat,c1,c2,c3,gc,mgchk) function cm.syncon(e)
if f4 and not f4(c,syncard,c1,c2,c3) then return false end return true
local sg=Group.FromCards(c1,c)
sg:AddCard(c1)
if c2 then sg:AddCard(c2) end
if c3 then sg:AddCard(c3) end
local mg=mg1:Clone()
if f4 then
mg=mg:Filter(f4,sg,syncard,c1,c2,c3)
else
mg:Sub(sg)
end
return cm.SynMixCheck(mg,sg,minc-1,maxc-1,syncard,smat,gc,mgchk)
end end
function cm.SynMixCheck(mg,sg1,minc,maxc,syncard,smat,gc,mgchk) function cm.syntg(e,syncard,f,min,max)
local minc=min+1
local maxc=max+1
local c=e:GetHandler()
local tp=syncard:GetControler() local tp=syncard:GetControler()
local sg=Group.CreateGroup() local lv=syncard:GetLevel()
if minc<=0 and cm.SynMixCheckGoal(tp,sg1,0,0,syncard,sg,smat,gc,mgchk) then return true end if lv<=c:GetLevel() then return false end
if maxc==0 then return false end local g=Group.FromCards(c)
return mg:IsExists(cm.SynMixCheckRecursive,1,nil,tp,sg,mg,0,minc,maxc,syncard,sg1,smat,gc,mgchk) local mg=Duel.GetSynchroMaterial(tp):Filter(cm.synfilter,c,syncard,c,f)
local exg=Duel.GetMatchingGroup(cm.synfilter,tp,LOCATION_HAND,0,c,syncard,c,f)
mg:Merge(exg)
return mg:IsExists(cm.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc)
end end
function cm.SynMixCheckRecursive(c,tp,sg,mg,ct,minc,maxc,syncard,sg1,smat,gc,mgchk) function cm.synop(e,tp,eg,ep,ev,re,r,rp,syncard,f,min,max)
sg:AddCard(c) local minc=min+1
ct=ct+1 local maxc=max+1
local res=cm.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk) local c=e:GetHandler()
or (ct<maxc and mg:IsExists(cm.SynMixCheckRecursive,1,sg,tp,sg,mg,ct,minc,maxc,syncard,sg1,smat,gc,mgchk)) local lv=syncard:GetLevel()
sg:RemoveCard(c) local g=Group.FromCards(c)
ct=ct-1 local mg=Duel.GetSynchroMaterial(tp):Filter(cm.synfilter,c,syncard,c,f)
return res local exg=Duel.GetMatchingGroup(cm.synfilter,tp,LOCATION_HAND,0,c,syncard,c,f)
end mg:Merge(exg)
function cm.MekhaneFilter(c) for i=1,maxc do
return c:IsLocation(LOCATION_HAND) and not c:IsRace(RACE_MACHINE) local cg=mg:Filter(cm.syncheck,g,g,mg,tp,lv,syncard,minc,maxc)
end if cg:GetCount()==0 then break end
function cm.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk) local minct=1
if ct<minc then return false end if cm.syngoal(g,tp,lv,syncard,minc,i) then
local g=sg:Clone() minct=0
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 aux.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 g:FilterCount(Card.IsLocation,nil,LOCATION_HAND)<=1 and not g:IsExists(cm.MekhaneFilter,1,nil))
and (not g:IsExists(Card.IsHasEffect,1,nil,89818984)
or not g:CheckWithSumEqual(aux.GetSynchroLevelFlowerCardian,syncard:GetLevel(),g:GetCount(),g:GetCount(),syncard))
then return false end
local hg=g:Filter(aux.SynMixHandFilter,nil,tp,syncard)
local hct=hg:GetCount()
if hct>0 and not mgchk then
for c in aux.Next(g) do
local he,hf,hmin,hmax=c:GetHandSynchro()
if he then
if hf and hg:IsExists(aux.SynLimitFilter,1,c,hf,he,syncard) then return false end
if (hmin and hct<hmin) or (hmax and hct>hmax) then return false end
end
end 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
for c in aux.Next(g) do if g:IsExists(Card.IsLocation,1,nil,LOCATION_HAND) then
local le,lf,lloc,lmin,lmax=c:GetTunerLimit() for tc in aux.Next(g) do
if le then if tc:IsLocation(LOCATION_HAND) then Duel.ConfirmCards(1-tp,tc) end
local lct=g:GetCount()-1 local e1=Effect.CreateEffect(c)
if lloc then e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE)
local llct=g:FilterCount(Card.IsLocation,c,lloc) e1:SetType(EFFECT_TYPE_SINGLE)
if llct~=lct then return false end e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
end e1:SetValue(LOCATION_DECK)
if lf and g:IsExists(aux.SynLimitFilter,1,c,lf,le,syncard) then return false end e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
if (lmin and lct<lmin) or (lmax and lct>lmax) then return false end tc:RegisterEffect(e1,true)
end end
end end
return true Duel.SetSynchroMaterial(g)
end end
function cm.valcheck(e,c) function cm.valcheck(e,c)
local g=c:GetMaterial() local g=c:GetMaterial()
...@@ -317,7 +199,7 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -317,7 +199,7 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp)
e3:SetTargetRange(0xff,0) e3:SetTargetRange(0xff,0)
e3:SetTarget(cm.etarget) e3:SetTarget(cm.etarget)
e3:SetValue(cm.efilter) e3:SetValue(cm.efilter)
e3:SetReset(RESET_EVENT+RESET_CHAIN) e3:SetReset(RESET_CHAIN)
e3:SetLabel(tp) e3:SetLabel(tp)
e3:SetLabelObject(re) e3:SetLabelObject(re)
Duel.RegisterEffect(e3,tp) Duel.RegisterEffect(e3,tp)
...@@ -375,7 +257,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -375,7 +257,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if ft>=1 then if ft>=1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local spcg=Group.CreateGroup() local spcg=Group.CreateGroup()
if ft<=Duel.GetLocationCount(tp,LOCATION_MZONE) then if ft>=spg:GetCount() then
spcg=spg spcg=spg
else else
spcg=spg:Select(tp,ft,ft,nil) spcg=spg:Select(tp,ft,ft,nil)
......
...@@ -76,7 +76,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -76,7 +76,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if ft>=1 then if ft>=1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local spcg=Group.CreateGroup() local spcg=Group.CreateGroup()
if ft<=Duel.GetLocationCount(tp,LOCATION_MZONE) then if ft>=spg:GetCount() then
spcg=spg spcg=spg
else else
spcg=spg:Select(tp,ft,ft,nil) spcg=spg:Select(tp,ft,ft,nil)
......
...@@ -127,13 +127,13 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -127,13 +127,13 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp,c) local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp,c)
return e:GetHandler():IsReleasable() and Duel.IsPlayerCanSpecialSummon(tp) and g:CheckSubGroup(cm.spgcheck) and not Duel.IsPlayerAffectedByEffect(tp,63060238) and not Duel.IsPlayerAffectedByEffect(tp,97148796) return e:GetHandler():IsReleasable(REASON_EFFECT) and Duel.IsPlayerCanSpecialSummon(tp) and g:CheckSubGroup(cm.spgcheck) and not Duel.IsPlayerAffectedByEffect(tp,63060238) and not Duel.IsPlayerAffectedByEffect(tp,97148796)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not (c:IsRelateToEffect(e) and c:IsReleasable()) then return end if not (c:IsRelateToEffect(e) and c:IsReleasable(REASON_EFFECT)) then return end
if Duel.Release(c,REASON_EFFECT)~=0 and Duel.IsPlayerCanSpecialSummon(tp) then if Duel.Release(c,REASON_EFFECT)~=0 and Duel.IsPlayerCanSpecialSummon(tp) then
local ct=1 local ct=1
local dcount=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0) local dcount=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
...@@ -160,7 +160,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -160,7 +160,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if ft>=1 then if ft>=1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local spcg=Group.CreateGroup() local spcg=Group.CreateGroup()
if ft<=Duel.GetLocationCount(tp,LOCATION_MZONE) then if ft>=spg:GetCount() then
spcg=spg spcg=spg
else else
spcg=spg:Select(tp,ft,ft,nil) spcg=spg:Select(tp,ft,ft,nil)
......
...@@ -5,6 +5,7 @@ function c28355662.initial_effect(c) ...@@ -5,6 +5,7 @@ function c28355662.initial_effect(c)
e0:SetType(EFFECT_TYPE_SINGLE) e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_TRAP_ACT_IN_HAND) e0:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e0:SetCondition(c28355662.excondition) e0:SetCondition(c28355662.excondition)
e0:SetCost(c28355662.excost)
e0:SetDescription(aux.Stringid(28355662,2)) e0:SetDescription(aux.Stringid(28355662,2))
c:RegisterEffect(e0) c:RegisterEffect(e0)
--Activate --Activate
...@@ -31,14 +32,15 @@ end ...@@ -31,14 +32,15 @@ end
function c28355662.excondition(e,tp,eg,ep,ev,re,r,rp) function c28355662.excondition(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetLP(tp)<=3000 and Duel.CheckLPCost(tp,2500)) or (Duel.GetLP(tp)>3000 and Duel.CheckLPCost(tp,4000)) return (Duel.GetLP(tp)<=3000 and Duel.CheckLPCost(tp,2500)) or (Duel.GetLP(tp)>3000 and Duel.CheckLPCost(tp,4000))
end end
function c28355662.excost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,2000)
end
function c28355662.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c28355662.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.CheckLPCost(tp,2000) local b1=Duel.CheckLPCost(tp,2000)
local b2=Duel.GetLP(tp)<=3000 and Duel.CheckLPCost(tp,500) local b2=Duel.GetLP(tp)<=3000 and Duel.CheckLPCost(tp,500)
local b3=Duel.IsPlayerAffectedByEffect(tp,28368431) local b3=Duel.IsPlayerAffectedByEffect(tp,28368431)
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
if e:GetHandler():IsStatus(STATUS_ACT_FROM_HAND) then
Duel.PayLPCost(tp,2000)
end
if b3 or not b1 or (b2 and Duel.SelectYesNo(tp,aux.Stringid(28355662,0))) then if b3 or not b1 or (b2 and Duel.SelectYesNo(tp,aux.Stringid(28355662,0))) then
Duel.PayLPCost(tp,500) Duel.PayLPCost(tp,500)
else else
......
...@@ -91,7 +91,7 @@ function c28368431.costchange(e,re,rp,val) ...@@ -91,7 +91,7 @@ function c28368431.costchange(e,re,rp,val)
end end
end end
function c28368431.condition(e,tp,eg,ep,ev,re,r,rp) function c28368431.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<=3000 return Duel.GetLP(e:GetHandlerPlayer())<=3000
end end
function c28368431.rccon(e,tp,eg,ep,ev,re,r,rp) function c28368431.rccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,28368431)>0 return Duel.GetFlagEffect(tp,28368431)>0
......
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