Commit ee38fa38 authored by POLYMER's avatar POLYMER

fix

parent 58237d5a
No preview for this file type
...@@ -50,6 +50,7 @@ end ...@@ -50,6 +50,7 @@ end
function s.tgfi2ter(c,tp) function s.tgfi2ter(c,tp)
return c:IsPreviousLocation(0x06) and c:IsLocation(0x10) return c:IsPreviousLocation(0x06) and c:IsLocation(0x10)
and c:IsPreviousControler(tp) and c:GetReasonPlayer()==1-tp and c:IsPreviousControler(tp) and c:GetReasonPlayer()==1-tp
and c:GetOriginalType()&TYPE_MONSTER>0
end end
function s.tsfi1ter(c,e,tp,tc) function s.tsfi1ter(c,e,tp,tc)
return s.tgfi2ter(c,tp) and c:IsCanBeEffectTarget(e) return s.tgfi2ter(c,tp) and c:IsCanBeEffectTarget(e)
......
...@@ -65,6 +65,7 @@ end ...@@ -65,6 +65,7 @@ end
function s.tgfi2ter(c,tp) function s.tgfi2ter(c,tp)
return c:IsPreviousLocation(0x14) and c:IsLocation(0x20) return c:IsPreviousLocation(0x14) and c:IsLocation(0x20)
and c:IsPreviousControler(tp) and c:GetReasonPlayer()==1-tp and c:IsPreviousControler(tp) and c:GetReasonPlayer()==1-tp
and c:GetOriginalType()&TYPE_MONSTER>0
end end
function s.tsfi1ter(c,e,tp,tc) function s.tsfi1ter(c,e,tp,tc)
return s.tgfi2ter(c,tp) and c:IsCanBeEffectTarget(e) return s.tgfi2ter(c,tp) and c:IsCanBeEffectTarget(e)
......
...@@ -24,7 +24,7 @@ function cm.matfilter(c) ...@@ -24,7 +24,7 @@ function cm.matfilter(c)
end end
function cm.syntg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.syntg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,e:GetHandler(),nil,g) end if chk==0 then return #g>0 and Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,e:GetHandler(),nil,g) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function cm.synop(e,tp,eg,ep,ev,re,r,rp) function cm.synop(e,tp,eg,ep,ev,re,r,rp)
...@@ -38,7 +38,7 @@ function cm.synop(e,tp,eg,ep,ev,re,r,rp) ...@@ -38,7 +38,7 @@ function cm.synop(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.xyztg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,1,e:GetHandler(),g) end if chk==0 then return #g>0 and Duel.IsExistingMatchingCard(Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,1,e:GetHandler(),g) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function cm.xyzop(e,tp,eg,ep,ev,re,r,rp) function cm.xyzop(e,tp,eg,ep,ev,re,r,rp)
...@@ -51,7 +51,7 @@ function cm.xyzop(e,tp,eg,ep,ev,re,r,rp) ...@@ -51,7 +51,7 @@ function cm.xyzop(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.linktg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.linktg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsLinkSummonable,tp,LOCATION_EXTRA,0,1,e:GetHandler(),g) end if chk==0 then return #g>0 and Duel.IsExistingMatchingCard(Card.IsLinkSummonable,tp,LOCATION_EXTRA,0,1,e:GetHandler(),g) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function cm.linkop(e,tp,eg,ep,ev,re,r,rp) function cm.linkop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -51,7 +51,8 @@ function c4058.initial_effect(c) ...@@ -51,7 +51,8 @@ function c4058.initial_effect(c)
e12:SetRange(LOCATION_ONFIELD) e12:SetRange(LOCATION_ONFIELD)
e12:SetTargetRange(1,0) e12:SetTargetRange(1,0)
e12:SetValue(3) e12:SetValue(3)
e12:SetTarget(aux.TargetBoolFunction(Card.IsRace,0x8000)) e12:SetCondition(c4058.addsumcon)
e12:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_REPTILE))
c:RegisterEffect(e12) c:RegisterEffect(e12)
--oath effects --oath effects
local e13=Effect.CreateEffect(c) local e13=Effect.CreateEffect(c)
...@@ -183,6 +184,10 @@ function c4058.initial_effect(c) ...@@ -183,6 +184,10 @@ function c4058.initial_effect(c)
ge3:SetCode(EVENT_MSET) ge3:SetCode(EVENT_MSET)
Duel.RegisterEffect(ge3,0) Duel.RegisterEffect(ge3,0)
end end
Duel.AddCustomActivityCounter(4058,ACTIVITY_NORMALSUMMON,c4058.counterfilter)
end
function c4058.counterfilter(c)
return c:IsRace(RACE_REPTILE) and c:IsFaceup()
end end
--special summon rule --special summon rule
...@@ -244,6 +249,10 @@ function c4058.efilter(e,te) ...@@ -244,6 +249,10 @@ function c4058.efilter(e,te)
return te:GetOwner()~=e:GetOwner() return te:GetOwner()~=e:GetOwner()
end end
function c4058.addsumcon(e)
return Duel.GetCustomActivityCount(4058,e:GetHandlerPlayer(),ACTIVITY_NORMALSUMMON)==0
end
--summon limit --summon limit
function c4058.splimit(e,c,sump,sumtype,sumpos,targetp,se) function c4058.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_REPTILE) return not c:IsRace(RACE_REPTILE)
......
...@@ -6,6 +6,7 @@ function cm.initial_effect(c) ...@@ -6,6 +6,7 @@ function cm.initial_effect(c)
e1:SetCode(EVENT_CUSTOM+m) e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon) e1:SetCondition(cm.spcon)
--e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop) e1:SetOperation(cm.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -28,6 +29,92 @@ function cm.initial_effect(c) ...@@ -28,6 +29,92 @@ function cm.initial_effect(c)
ge2:SetOperation(cm.chkop) ge2:SetOperation(cm.chkop)
Duel.RegisterEffect(ge2,0) Duel.RegisterEffect(ge2,0)
end end
if not cm.NecroceanCheck then
cm.NecroceanCheck=true
local ne1=Effect.CreateEffect(c)
ne1:SetType(EFFECT_TYPE_SINGLE)
ne1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
ne1:SetCondition(cm.syncon)
ne1:SetCode(EFFECT_HAND_SYNCHRO)
ne1:SetTargetRange(0,1)
local ne2=Effect.CreateEffect(c)
ne2:SetType(EFFECT_TYPE_SINGLE)
ne2:SetCode(EFFECT_SYNCHRO_MATERIAL_CUSTOM)
ne2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
ne2:SetCondition(cm.syncon)
ne2:SetTarget(cm.syntg)
ne2:SetValue(1)
ne2:SetOperation(cm.synop)
local ne3=Effect.CreateEffect(c)
ne3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
ne3:SetTargetRange(LOCATION_ONFIELD+LOCATION_HAND+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_GRAVE)
ne3:SetTarget(cm.eftg)
ne3:SetLabelObject(ne1)
Duel.RegisterEffect(ne3,tp)
local ne4=ne3:Clone()
ne4:SetLabelObject(ne2)
Duel.RegisterEffect(ne4,tp)
end
end
function cm.eftg(e,c)
return Duel.GetFlagEffect(0,m+53752000)+Duel.GetFlagEffect(1,m+53752000)>0
end
function cm.synfilter(c,syncard,tuner,f)
return c:IsFaceupEx() and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c,syncard))
end
function cm.syncheck(c,g,mg,tp,lv,syncard,minc,maxc)
g:AddCard(c)
local ct=g:GetCount()
local res=cm.syngoal(g,tp,lv,syncard,minc,ct)
or (ct<maxc and mg:IsExists(cm.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc))
g:RemoveCard(c)
return res
end
function cm.syngoal(g,tp,lv,syncard,minc,ct)
return ct>=minc
and g:CheckWithSumEqual(Card.GetSynchroLevel,lv,ct,ct,syncard)
and Duel.GetLocationCountFromEx(tp,tp,g,syncard)>0
and g:FilterCount(Card.IsLocation,nil,LOCATION_HAND)<=1
and aux.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL)
end
function cm.syncon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
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 lv=syncard:GetLevel()
if lv<=c:GetLevel() then return false end
local g=Group.FromCards(c)
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
function cm.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(cm.synfilter,c,syncard,c,f)
local exg=Duel.GetMatchingGroup(cm.synfilter,tp,LOCATION_HAND,0,c,syncard,c,f)
mg:Merge(exg)
for i=1,maxc do
local cg=mg:Filter(cm.syncheck,g,g,mg,tp,lv,syncard,minc,maxc)
if cg:GetCount()==0 then break end
local minct=1
if cm.syngoal(g,tp,lv,syncard,minc,i) then
minct=0
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local sg=cg:Select(tp,minct,99,nil)
if sg:GetCount()==0 then break end
g:Merge(sg)
end
Duel.SetSynchroMaterial(g)
end end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp) function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--local tp=e:GetHandlerPlayer() --local tp=e:GetHandlerPlayer()
...@@ -38,20 +125,29 @@ function cm.chkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -38,20 +125,29 @@ function cm.chkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+m,e,r,rp,ep,ev) Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+m,e,r,rp,ep,ev)
end end
function cm.filter(c,tp) function cm.filter(c,tp)
local ocheck=false
if c:GetOriginalCode()==53752002 or (c:GetOriginalCode()>=53752008 and c:GetOriginalCode()<=53752013) then
Duel.RegisterFlagEffect(tp,m+53752000,0,0,1)
if c:IsSynchroSummonable(nil) then ocheck=true end
end
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER) local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER)
return c:IsSynchroSummonable(nil,mg) return c:IsSynchroSummonable(nil,mg) or ocheck==true
end end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp) function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(0,m) local num=Duel.GetFlagEffect(0,m)
local g=Duel.GetDecktopGroup(tp,num) local g=Duel.GetDecktopGroup(tp,num)
--Debug.Message(tp) --Debug.Message(Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp))
--Debug.Message(g:IsExists(Card.IsAbleToHand,1,nil)) --Debug.Message(g:GetCount()>=num)
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp) and g:GetCount()>=num and g:IsExists(Card.IsAbleToHand,1,nil) and Duel.GetMZoneCount(tp)>0 --Debug.Message(Duel.GetMZoneCount(tp)>0)
local gc=false
if Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp) then gc=true end
if Duel.GetFlagEffect(tp,m+53752000)~=0 then Duel.ResetFlagEffect(tp,m+53752000) end
return gc and g:GetCount()>=num and g:IsExists(Card.IsAbleToHand,1,nil) and Duel.GetMZoneCount(tp)>0
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()
local tp=e:GetHandlerPlayer() --local tp=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(0,m) local num=Duel.GetFlagEffect(0,m)
if Duel.GetMZoneCount(tp)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then if Duel.GetMZoneCount(tp)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.ConfirmDecktop(tp,num) Duel.ConfirmDecktop(tp,num)
...@@ -63,11 +159,26 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -63,11 +159,26 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SendtoHand(sg,nil,REASON_EFFECT)~=0 then if Duel.SendtoHand(sg,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
local ssg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_EXTRA,0,nil) local ssg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_EXTRA,0,nil,tp)
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER) local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER)
local spg=ssg:Select(tp,1,1,nil) local spc=ssg:Select(tp,1,1,nil):GetFirst()
if Duel.GetMZoneCount(tp,c)>0 then if Duel.GetMZoneCount(tp,c)>0 then
Duel.SynchroSummon(tp,spg:GetFirst(),nil,mg) local b1=false
local b2=false
Duel.RegisterFlagEffect(tp,m+53752000,0,0,1)
if spc:GetOriginalCode()==53752002 or (spc:GetOriginalCode()>=53752008 and spc:GetOriginalCode()<=53752013) and spc:IsSynchroSummonable(nil) then b1=true end
Duel.ResetFlagEffect(tp,m+53752000)
if spc:IsSynchroSummonable(nil,mg) then b2=true end
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(60002404,1)},
{b2,aux.Stringid(60002404,2)})
if op==1 then
Duel.RegisterFlagEffect(tp,m+53752000,0,0,1)
Duel.SynchroSummon(tp,spc,nil)
Duel.ResetFlagEffect(tp,m+53752000)
elseif op==2 then
Duel.SynchroSummon(tp,spc,nil,mg)
end
end end
end end
else else
......
...@@ -6,6 +6,7 @@ function cm.initial_effect(c) ...@@ -6,6 +6,7 @@ function cm.initial_effect(c)
e1:SetCode(EVENT_CUSTOM+m) e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon) e1:SetCondition(cm.spcon)
--e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop) e1:SetOperation(cm.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -28,6 +29,92 @@ function cm.initial_effect(c) ...@@ -28,6 +29,92 @@ function cm.initial_effect(c)
ge2:SetOperation(cm.chkop) ge2:SetOperation(cm.chkop)
Duel.RegisterEffect(ge2,0) Duel.RegisterEffect(ge2,0)
end end
if not cm.NecroceanCheck then
cm.NecroceanCheck=true
local ne1=Effect.CreateEffect(c)
ne1:SetType(EFFECT_TYPE_SINGLE)
ne1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
ne1:SetCondition(cm.syncon)
ne1:SetCode(EFFECT_HAND_SYNCHRO)
ne1:SetTargetRange(0,1)
local ne2=Effect.CreateEffect(c)
ne2:SetType(EFFECT_TYPE_SINGLE)
ne2:SetCode(EFFECT_SYNCHRO_MATERIAL_CUSTOM)
ne2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
ne2:SetCondition(cm.syncon)
ne2:SetTarget(cm.syntg)
ne2:SetValue(1)
ne2:SetOperation(cm.synop)
local ne3=Effect.CreateEffect(c)
ne3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
ne3:SetTargetRange(LOCATION_ONFIELD+LOCATION_HAND+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_GRAVE)
ne3:SetTarget(cm.eftg)
ne3:SetLabelObject(ne1)
Duel.RegisterEffect(ne3,tp)
local ne4=ne3:Clone()
ne4:SetLabelObject(ne2)
Duel.RegisterEffect(ne4,tp)
end
end
function cm.eftg(e,c)
return Duel.GetFlagEffect(0,m+53752000)+Duel.GetFlagEffect(1,m+53752000)>0
end
function cm.synfilter(c,syncard,tuner,f)
return c:IsFaceupEx() and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c,syncard))
end
function cm.syncheck(c,g,mg,tp,lv,syncard,minc,maxc)
g:AddCard(c)
local ct=g:GetCount()
local res=cm.syngoal(g,tp,lv,syncard,minc,ct)
or (ct<maxc and mg:IsExists(cm.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc))
g:RemoveCard(c)
return res
end
function cm.syngoal(g,tp,lv,syncard,minc,ct)
return ct>=minc
and g:CheckWithSumEqual(Card.GetSynchroLevel,lv,ct,ct,syncard)
and Duel.GetLocationCountFromEx(tp,tp,g,syncard)>0
and g:FilterCount(Card.IsLocation,nil,LOCATION_HAND)<=1
and aux.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL)
end
function cm.syncon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
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 lv=syncard:GetLevel()
if lv<=c:GetLevel() then return false end
local g=Group.FromCards(c)
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
function cm.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(cm.synfilter,c,syncard,c,f)
local exg=Duel.GetMatchingGroup(cm.synfilter,tp,LOCATION_HAND,0,c,syncard,c,f)
mg:Merge(exg)
for i=1,maxc do
local cg=mg:Filter(cm.syncheck,g,g,mg,tp,lv,syncard,minc,maxc)
if cg:GetCount()==0 then break end
local minct=1
if cm.syngoal(g,tp,lv,syncard,minc,i) then
minct=0
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local sg=cg:Select(tp,minct,99,nil)
if sg:GetCount()==0 then break end
g:Merge(sg)
end
Duel.SetSynchroMaterial(g)
end end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp) function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--local tp=e:GetHandlerPlayer() --local tp=e:GetHandlerPlayer()
...@@ -38,20 +125,29 @@ function cm.chkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -38,20 +125,29 @@ function cm.chkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+m,e,r,rp,ep,ev) Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+m,e,r,rp,ep,ev)
end end
function cm.filter(c,tp) function cm.filter(c,tp)
local ocheck=false
if c:GetOriginalCode()==53752002 or (c:GetOriginalCode()>=53752008 and c:GetOriginalCode()<=53752013) then
Duel.RegisterFlagEffect(tp,m+53752000,0,0,1)
if c:IsSynchroSummonable(nil) then ocheck=true end
end
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER) local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER)
return c:IsSynchroSummonable(nil,mg) return c:IsSynchroSummonable(nil,mg) or ocheck==true
end end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp) function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(0,m) local num=Duel.GetFlagEffect(0,m)
local g=Duel.GetDecktopGroup(tp,num) local g=Duel.GetDecktopGroup(tp,num)
--Debug.Message(tp) --Debug.Message(Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp))
--Debug.Message(g:IsExists(Card.IsAbleToHand,1,nil)) --Debug.Message(g:GetCount()>=num)
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp) and g:GetCount()>=num and g:IsExists(Card.IsAbleToHand,1,nil) and Duel.GetMZoneCount(tp)>0 --Debug.Message(Duel.GetMZoneCount(tp)>0)
local gc=false
if Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp) then gc=true end
if Duel.GetFlagEffect(tp,m+53752000)~=0 then Duel.ResetFlagEffect(tp,m+53752000) end
return gc and g:GetCount()>=num and g:IsExists(Card.IsAbleToHand,1,nil) and Duel.GetMZoneCount(tp)>0
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()
local tp=e:GetHandlerPlayer() --local tp=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(0,m) local num=Duel.GetFlagEffect(0,m)
if Duel.GetMZoneCount(tp)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then if Duel.GetMZoneCount(tp)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.ConfirmDecktop(tp,num) Duel.ConfirmDecktop(tp,num)
...@@ -63,11 +159,26 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -63,11 +159,26 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SendtoHand(sg,nil,REASON_EFFECT)~=0 then if Duel.SendtoHand(sg,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
local ssg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_EXTRA,0,nil) local ssg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_EXTRA,0,nil,tp)
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER) local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER)
local spg=ssg:Select(tp,1,1,nil) local spc=ssg:Select(tp,1,1,nil):GetFirst()
if Duel.GetMZoneCount(tp,c)>0 then if Duel.GetMZoneCount(tp,c)>0 then
Duel.SynchroSummon(tp,spg:GetFirst(),nil,mg) local b1=false
local b2=false
Duel.RegisterFlagEffect(tp,m+53752000,0,0,1)
if spc:GetOriginalCode()==53752002 or (spc:GetOriginalCode()>=53752008 and spc:GetOriginalCode()<=53752013) and spc:IsSynchroSummonable(nil) then b1=true end
Duel.ResetFlagEffect(tp,m+53752000)
if spc:IsSynchroSummonable(nil,mg) then b2=true end
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(60002404,1)},
{b2,aux.Stringid(60002404,2)})
if op==1 then
Duel.RegisterFlagEffect(tp,m+53752000,0,0,1)
Duel.SynchroSummon(tp,spc,nil)
Duel.ResetFlagEffect(tp,m+53752000)
elseif op==2 then
Duel.SynchroSummon(tp,spc,nil,mg)
end
end end
end end
else else
......
...@@ -6,6 +6,7 @@ function cm.initial_effect(c) ...@@ -6,6 +6,7 @@ function cm.initial_effect(c)
e1:SetCode(EVENT_CUSTOM+m) e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon) e1:SetCondition(cm.spcon)
--e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop) e1:SetOperation(cm.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -28,6 +29,92 @@ function cm.initial_effect(c) ...@@ -28,6 +29,92 @@ function cm.initial_effect(c)
ge2:SetOperation(cm.chkop) ge2:SetOperation(cm.chkop)
Duel.RegisterEffect(ge2,0) Duel.RegisterEffect(ge2,0)
end end
if not cm.NecroceanCheck then
cm.NecroceanCheck=true
local ne1=Effect.CreateEffect(c)
ne1:SetType(EFFECT_TYPE_SINGLE)
ne1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
ne1:SetCondition(cm.syncon)
ne1:SetCode(EFFECT_HAND_SYNCHRO)
ne1:SetTargetRange(0,1)
local ne2=Effect.CreateEffect(c)
ne2:SetType(EFFECT_TYPE_SINGLE)
ne2:SetCode(EFFECT_SYNCHRO_MATERIAL_CUSTOM)
ne2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
ne2:SetCondition(cm.syncon)
ne2:SetTarget(cm.syntg)
ne2:SetValue(1)
ne2:SetOperation(cm.synop)
local ne3=Effect.CreateEffect(c)
ne3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
ne3:SetTargetRange(LOCATION_ONFIELD+LOCATION_HAND+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_GRAVE)
ne3:SetTarget(cm.eftg)
ne3:SetLabelObject(ne1)
Duel.RegisterEffect(ne3,tp)
local ne4=ne3:Clone()
ne4:SetLabelObject(ne2)
Duel.RegisterEffect(ne4,tp)
end
end
function cm.eftg(e,c)
return Duel.GetFlagEffect(0,m+53752000)+Duel.GetFlagEffect(1,m+53752000)>0
end
function cm.synfilter(c,syncard,tuner,f)
return c:IsFaceupEx() and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c,syncard))
end
function cm.syncheck(c,g,mg,tp,lv,syncard,minc,maxc)
g:AddCard(c)
local ct=g:GetCount()
local res=cm.syngoal(g,tp,lv,syncard,minc,ct)
or (ct<maxc and mg:IsExists(cm.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc))
g:RemoveCard(c)
return res
end
function cm.syngoal(g,tp,lv,syncard,minc,ct)
return ct>=minc
and g:CheckWithSumEqual(Card.GetSynchroLevel,lv,ct,ct,syncard)
and Duel.GetLocationCountFromEx(tp,tp,g,syncard)>0
and g:FilterCount(Card.IsLocation,nil,LOCATION_HAND)<=1
and aux.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL)
end
function cm.syncon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
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 lv=syncard:GetLevel()
if lv<=c:GetLevel() then return false end
local g=Group.FromCards(c)
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
function cm.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(cm.synfilter,c,syncard,c,f)
local exg=Duel.GetMatchingGroup(cm.synfilter,tp,LOCATION_HAND,0,c,syncard,c,f)
mg:Merge(exg)
for i=1,maxc do
local cg=mg:Filter(cm.syncheck,g,g,mg,tp,lv,syncard,minc,maxc)
if cg:GetCount()==0 then break end
local minct=1
if cm.syngoal(g,tp,lv,syncard,minc,i) then
minct=0
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local sg=cg:Select(tp,minct,99,nil)
if sg:GetCount()==0 then break end
g:Merge(sg)
end
Duel.SetSynchroMaterial(g)
end end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp) function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--local tp=e:GetHandlerPlayer() --local tp=e:GetHandlerPlayer()
...@@ -38,20 +125,29 @@ function cm.chkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -38,20 +125,29 @@ function cm.chkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+m,e,r,rp,ep,ev) Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+m,e,r,rp,ep,ev)
end end
function cm.filter(c,tp) function cm.filter(c,tp)
local ocheck=false
if c:GetOriginalCode()==53752002 or (c:GetOriginalCode()>=53752008 and c:GetOriginalCode()<=53752013) then
Duel.RegisterFlagEffect(tp,m+53752000,0,0,1)
if c:IsSynchroSummonable(nil) then ocheck=true end
end
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER) local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER)
return c:IsSynchroSummonable(nil,mg) return c:IsSynchroSummonable(nil,mg) or ocheck==true
end end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp) function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(0,m) local num=Duel.GetFlagEffect(0,m)
local g=Duel.GetDecktopGroup(tp,num) local g=Duel.GetDecktopGroup(tp,num)
--Debug.Message(tp) --Debug.Message(Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp))
--Debug.Message(g:IsExists(Card.IsAbleToHand,1,nil)) --Debug.Message(g:GetCount()>=num)
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp) and g:GetCount()>=num and g:IsExists(Card.IsAbleToHand,1,nil) and Duel.GetMZoneCount(tp)>0 --Debug.Message(Duel.GetMZoneCount(tp)>0)
local gc=false
if Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp) then gc=true end
if Duel.GetFlagEffect(tp,m+53752000)~=0 then Duel.ResetFlagEffect(tp,m+53752000) end
return gc and g:GetCount()>=num and g:IsExists(Card.IsAbleToHand,1,nil) and Duel.GetMZoneCount(tp)>0
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()
local tp=e:GetHandlerPlayer() --local tp=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(0,m) local num=Duel.GetFlagEffect(0,m)
if Duel.GetMZoneCount(tp)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then if Duel.GetMZoneCount(tp)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.ConfirmDecktop(tp,num) Duel.ConfirmDecktop(tp,num)
...@@ -63,11 +159,26 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -63,11 +159,26 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SendtoHand(sg,nil,REASON_EFFECT)~=0 then if Duel.SendtoHand(sg,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
local ssg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_EXTRA,0,nil) local ssg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_EXTRA,0,nil,tp)
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER) local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER)
local spg=ssg:Select(tp,1,1,nil) local spc=ssg:Select(tp,1,1,nil):GetFirst()
if Duel.GetMZoneCount(tp,c)>0 then if Duel.GetMZoneCount(tp,c)>0 then
Duel.SynchroSummon(tp,spg:GetFirst(),nil,mg) local b1=false
local b2=false
Duel.RegisterFlagEffect(tp,m+53752000,0,0,1)
if spc:GetOriginalCode()==53752002 or (spc:GetOriginalCode()>=53752008 and spc:GetOriginalCode()<=53752013) and spc:IsSynchroSummonable(nil) then b1=true end
Duel.ResetFlagEffect(tp,m+53752000)
if spc:IsSynchroSummonable(nil,mg) then b2=true end
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(60002404,1)},
{b2,aux.Stringid(60002404,2)})
if op==1 then
Duel.RegisterFlagEffect(tp,m+53752000,0,0,1)
Duel.SynchroSummon(tp,spc,nil)
Duel.ResetFlagEffect(tp,m+53752000)
elseif op==2 then
Duel.SynchroSummon(tp,spc,nil,mg)
end
end end
end end
else else
......
...@@ -6,6 +6,7 @@ function cm.initial_effect(c) ...@@ -6,6 +6,7 @@ function cm.initial_effect(c)
e1:SetCode(EVENT_CUSTOM+m) e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon) e1:SetCondition(cm.spcon)
--e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop) e1:SetOperation(cm.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -28,6 +29,92 @@ function cm.initial_effect(c) ...@@ -28,6 +29,92 @@ function cm.initial_effect(c)
ge2:SetOperation(cm.chkop) ge2:SetOperation(cm.chkop)
Duel.RegisterEffect(ge2,0) Duel.RegisterEffect(ge2,0)
end end
if not cm.NecroceanCheck then
cm.NecroceanCheck=true
local ne1=Effect.CreateEffect(c)
ne1:SetType(EFFECT_TYPE_SINGLE)
ne1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
ne1:SetCondition(cm.syncon)
ne1:SetCode(EFFECT_HAND_SYNCHRO)
ne1:SetTargetRange(0,1)
local ne2=Effect.CreateEffect(c)
ne2:SetType(EFFECT_TYPE_SINGLE)
ne2:SetCode(EFFECT_SYNCHRO_MATERIAL_CUSTOM)
ne2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
ne2:SetCondition(cm.syncon)
ne2:SetTarget(cm.syntg)
ne2:SetValue(1)
ne2:SetOperation(cm.synop)
local ne3=Effect.CreateEffect(c)
ne3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
ne3:SetTargetRange(LOCATION_ONFIELD+LOCATION_HAND+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_GRAVE)
ne3:SetTarget(cm.eftg)
ne3:SetLabelObject(ne1)
Duel.RegisterEffect(ne3,tp)
local ne4=ne3:Clone()
ne4:SetLabelObject(ne2)
Duel.RegisterEffect(ne4,tp)
end
end
function cm.eftg(e,c)
return Duel.GetFlagEffect(0,m+53752000)+Duel.GetFlagEffect(1,m+53752000)>0
end
function cm.synfilter(c,syncard,tuner,f)
return c:IsFaceupEx() and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c,syncard))
end
function cm.syncheck(c,g,mg,tp,lv,syncard,minc,maxc)
g:AddCard(c)
local ct=g:GetCount()
local res=cm.syngoal(g,tp,lv,syncard,minc,ct)
or (ct<maxc and mg:IsExists(cm.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc))
g:RemoveCard(c)
return res
end
function cm.syngoal(g,tp,lv,syncard,minc,ct)
return ct>=minc
and g:CheckWithSumEqual(Card.GetSynchroLevel,lv,ct,ct,syncard)
and Duel.GetLocationCountFromEx(tp,tp,g,syncard)>0
and g:FilterCount(Card.IsLocation,nil,LOCATION_HAND)<=1
and aux.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL)
end
function cm.syncon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
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 lv=syncard:GetLevel()
if lv<=c:GetLevel() then return false end
local g=Group.FromCards(c)
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
function cm.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(cm.synfilter,c,syncard,c,f)
local exg=Duel.GetMatchingGroup(cm.synfilter,tp,LOCATION_HAND,0,c,syncard,c,f)
mg:Merge(exg)
for i=1,maxc do
local cg=mg:Filter(cm.syncheck,g,g,mg,tp,lv,syncard,minc,maxc)
if cg:GetCount()==0 then break end
local minct=1
if cm.syngoal(g,tp,lv,syncard,minc,i) then
minct=0
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local sg=cg:Select(tp,minct,99,nil)
if sg:GetCount()==0 then break end
g:Merge(sg)
end
Duel.SetSynchroMaterial(g)
end end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp) function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--local tp=e:GetHandlerPlayer() --local tp=e:GetHandlerPlayer()
...@@ -38,20 +125,29 @@ function cm.chkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -38,20 +125,29 @@ function cm.chkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+m,e,r,rp,ep,ev) Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+m,e,r,rp,ep,ev)
end end
function cm.filter(c,tp) function cm.filter(c,tp)
local ocheck=false
if c:GetOriginalCode()==53752002 or (c:GetOriginalCode()>=53752008 and c:GetOriginalCode()<=53752013) then
Duel.RegisterFlagEffect(tp,m+53752000,0,0,1)
if c:IsSynchroSummonable(nil) then ocheck=true end
end
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER) local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER)
return c:IsSynchroSummonable(nil,mg) return c:IsSynchroSummonable(nil,mg) or ocheck==true
end end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp) function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(0,m) local num=Duel.GetFlagEffect(0,m)
local g=Duel.GetDecktopGroup(tp,num) local g=Duel.GetDecktopGroup(tp,num)
--Debug.Message(tp) --Debug.Message(Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp))
--Debug.Message(g:IsExists(Card.IsAbleToHand,1,nil)) --Debug.Message(g:GetCount()>=num)
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp) and g:GetCount()>=num and g:IsExists(Card.IsAbleToHand,1,nil) and Duel.GetMZoneCount(tp)>0 --Debug.Message(Duel.GetMZoneCount(tp)>0)
local gc=false
if Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp) then gc=true end
if Duel.GetFlagEffect(tp,m+53752000)~=0 then Duel.ResetFlagEffect(tp,m+53752000) end
return gc and g:GetCount()>=num and g:IsExists(Card.IsAbleToHand,1,nil) and Duel.GetMZoneCount(tp)>0
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()
local tp=e:GetHandlerPlayer() --local tp=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(0,m) local num=Duel.GetFlagEffect(0,m)
if Duel.GetMZoneCount(tp)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then if Duel.GetMZoneCount(tp)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.ConfirmDecktop(tp,num) Duel.ConfirmDecktop(tp,num)
...@@ -63,11 +159,26 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -63,11 +159,26 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SendtoHand(sg,nil,REASON_EFFECT)~=0 then if Duel.SendtoHand(sg,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
local ssg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_EXTRA,0,nil) local ssg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_EXTRA,0,nil,tp)
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER) local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER)
local spg=ssg:Select(tp,1,1,nil) local spc=ssg:Select(tp,1,1,nil):GetFirst()
if Duel.GetMZoneCount(tp,c)>0 then if Duel.GetMZoneCount(tp,c)>0 then
Duel.SynchroSummon(tp,spg:GetFirst(),nil,mg) local b1=false
local b2=false
Duel.RegisterFlagEffect(tp,m+53752000,0,0,1)
if spc:GetOriginalCode()==53752002 or (spc:GetOriginalCode()>=53752008 and spc:GetOriginalCode()<=53752013) and spc:IsSynchroSummonable(nil) then b1=true end
Duel.ResetFlagEffect(tp,m+53752000)
if spc:IsSynchroSummonable(nil,mg) then b2=true end
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(60002404,1)},
{b2,aux.Stringid(60002404,2)})
if op==1 then
Duel.RegisterFlagEffect(tp,m+53752000,0,0,1)
Duel.SynchroSummon(tp,spc,nil)
Duel.ResetFlagEffect(tp,m+53752000)
elseif op==2 then
Duel.SynchroSummon(tp,spc,nil,mg)
end
end end
end end
else else
......
...@@ -6,6 +6,7 @@ function cm.initial_effect(c) ...@@ -6,6 +6,7 @@ function cm.initial_effect(c)
e1:SetCode(EVENT_CUSTOM+m) e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon) e1:SetCondition(cm.spcon)
--e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop) e1:SetOperation(cm.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -28,6 +29,92 @@ function cm.initial_effect(c) ...@@ -28,6 +29,92 @@ function cm.initial_effect(c)
ge2:SetOperation(cm.chkop) ge2:SetOperation(cm.chkop)
Duel.RegisterEffect(ge2,0) Duel.RegisterEffect(ge2,0)
end end
if not cm.NecroceanCheck then
cm.NecroceanCheck=true
local ne1=Effect.CreateEffect(c)
ne1:SetType(EFFECT_TYPE_SINGLE)
ne1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
ne1:SetCondition(cm.syncon)
ne1:SetCode(EFFECT_HAND_SYNCHRO)
ne1:SetTargetRange(0,1)
local ne2=Effect.CreateEffect(c)
ne2:SetType(EFFECT_TYPE_SINGLE)
ne2:SetCode(EFFECT_SYNCHRO_MATERIAL_CUSTOM)
ne2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
ne2:SetCondition(cm.syncon)
ne2:SetTarget(cm.syntg)
ne2:SetValue(1)
ne2:SetOperation(cm.synop)
local ne3=Effect.CreateEffect(c)
ne3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
ne3:SetTargetRange(LOCATION_ONFIELD+LOCATION_HAND+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_GRAVE)
ne3:SetTarget(cm.eftg)
ne3:SetLabelObject(ne1)
Duel.RegisterEffect(ne3,tp)
local ne4=ne3:Clone()
ne4:SetLabelObject(ne2)
Duel.RegisterEffect(ne4,tp)
end
end
function cm.eftg(e,c)
return Duel.GetFlagEffect(0,m+53752000)+Duel.GetFlagEffect(1,m+53752000)>0
end
function cm.synfilter(c,syncard,tuner,f)
return c:IsFaceupEx() and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c,syncard))
end
function cm.syncheck(c,g,mg,tp,lv,syncard,minc,maxc)
g:AddCard(c)
local ct=g:GetCount()
local res=cm.syngoal(g,tp,lv,syncard,minc,ct)
or (ct<maxc and mg:IsExists(cm.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc))
g:RemoveCard(c)
return res
end
function cm.syngoal(g,tp,lv,syncard,minc,ct)
return ct>=minc
and g:CheckWithSumEqual(Card.GetSynchroLevel,lv,ct,ct,syncard)
and Duel.GetLocationCountFromEx(tp,tp,g,syncard)>0
and g:FilterCount(Card.IsLocation,nil,LOCATION_HAND)<=1
and aux.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL)
end
function cm.syncon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
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 lv=syncard:GetLevel()
if lv<=c:GetLevel() then return false end
local g=Group.FromCards(c)
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
function cm.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(cm.synfilter,c,syncard,c,f)
local exg=Duel.GetMatchingGroup(cm.synfilter,tp,LOCATION_HAND,0,c,syncard,c,f)
mg:Merge(exg)
for i=1,maxc do
local cg=mg:Filter(cm.syncheck,g,g,mg,tp,lv,syncard,minc,maxc)
if cg:GetCount()==0 then break end
local minct=1
if cm.syngoal(g,tp,lv,syncard,minc,i) then
minct=0
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local sg=cg:Select(tp,minct,99,nil)
if sg:GetCount()==0 then break end
g:Merge(sg)
end
Duel.SetSynchroMaterial(g)
end end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp) function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--local tp=e:GetHandlerPlayer() --local tp=e:GetHandlerPlayer()
...@@ -38,20 +125,29 @@ function cm.chkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -38,20 +125,29 @@ function cm.chkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+m,e,r,rp,ep,ev) Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+m,e,r,rp,ep,ev)
end end
function cm.filter(c,tp) function cm.filter(c,tp)
local ocheck=false
if c:GetOriginalCode()==53752002 or (c:GetOriginalCode()>=53752008 and c:GetOriginalCode()<=53752013) then
Duel.RegisterFlagEffect(tp,m+53752000,0,0,1)
if c:IsSynchroSummonable(nil) then ocheck=true end
end
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER) local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER)
return c:IsSynchroSummonable(nil,mg) return c:IsSynchroSummonable(nil,mg) or ocheck==true
end end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp) function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(0,m) local num=Duel.GetFlagEffect(0,m)
local g=Duel.GetDecktopGroup(tp,num) local g=Duel.GetDecktopGroup(tp,num)
--Debug.Message(tp) --Debug.Message(Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp))
--Debug.Message(g:IsExists(Card.IsAbleToHand,1,nil)) --Debug.Message(g:GetCount()>=num)
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp) and g:GetCount()>=num and g:IsExists(Card.IsAbleToHand,1,nil) and Duel.GetMZoneCount(tp)>0 --Debug.Message(Duel.GetMZoneCount(tp)>0)
local gc=false
if Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp) then gc=true end
if Duel.GetFlagEffect(tp,m+53752000)~=0 then Duel.ResetFlagEffect(tp,m+53752000) end
return gc and g:GetCount()>=num and g:IsExists(Card.IsAbleToHand,1,nil) and Duel.GetMZoneCount(tp)>0
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()
local tp=e:GetHandlerPlayer() --local tp=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(0,m) local num=Duel.GetFlagEffect(0,m)
if Duel.GetMZoneCount(tp)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then if Duel.GetMZoneCount(tp)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.ConfirmDecktop(tp,num) Duel.ConfirmDecktop(tp,num)
...@@ -63,11 +159,26 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -63,11 +159,26 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SendtoHand(sg,nil,REASON_EFFECT)~=0 then if Duel.SendtoHand(sg,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
local ssg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_EXTRA,0,nil) local ssg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_EXTRA,0,nil,tp)
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER) local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER)
local spg=ssg:Select(tp,1,1,nil) local spc=ssg:Select(tp,1,1,nil):GetFirst()
if Duel.GetMZoneCount(tp,c)>0 then if Duel.GetMZoneCount(tp,c)>0 then
Duel.SynchroSummon(tp,spg:GetFirst(),nil,mg) local b1=false
local b2=false
Duel.RegisterFlagEffect(tp,m+53752000,0,0,1)
if spc:GetOriginalCode()==53752002 or (spc:GetOriginalCode()>=53752008 and spc:GetOriginalCode()<=53752013) and spc:IsSynchroSummonable(nil) then b1=true end
Duel.ResetFlagEffect(tp,m+53752000)
if spc:IsSynchroSummonable(nil,mg) then b2=true end
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(60002404,1)},
{b2,aux.Stringid(60002404,2)})
if op==1 then
Duel.RegisterFlagEffect(tp,m+53752000,0,0,1)
Duel.SynchroSummon(tp,spc,nil)
Duel.ResetFlagEffect(tp,m+53752000)
elseif op==2 then
Duel.SynchroSummon(tp,spc,nil,mg)
end
end end
end end
else else
......
...@@ -1294,14 +1294,13 @@ ...@@ -1294,14 +1294,13 @@
!setname 0x754 晓之女神 !setname 0x754 晓之女神
!setname 0x755 焰刃 !setname 0x755 焰刃
!setname 0x3755 焰刃之琳 !setname 0x3755 焰刃之琳
!setname 0xe75 火焰纹章
!setname 0x756 封炎 !setname 0x756 封炎
!setname 0x757 梦的 !setname 0x757 梦的
!setname 0x758 纯白义勇队 !setname 0x758 纯白义勇队
!setname 0x75a 神速 !setname 0x75a 神速
!setname 0x75c 罪秽 !setname 0x75c 罪秽
!setname 0x375c 罪秽装束 !setname 0x375c 罪秽装束
!setname 0x75e 忍法帖|非「忍法」 !setname 0x75e 炼金工房
!setname 0x75f 纹章呼唤ㅣ非「纹章」 !setname 0x75f 纹章呼唤ㅣ非「纹章」
!counter 0x1750 寒冷指示物 !counter 0x1750 寒冷指示物
!counter 0x1751 大器指示物 !counter 0x1751 大器指示物
......
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