Commit 32a9632a authored by POLYMER's avatar POLYMER

fix

parent bc64d33e
...@@ -11,6 +11,8 @@ function cm.initial_effect(c) ...@@ -11,6 +11,8 @@ function cm.initial_effect(c)
end end
if not apricot_nightfall then if not apricot_nightfall then
apricot_nightfall=true apricot_nightfall=true
dofile("expansions/script/special.lua")
Auxiliary.PreloadUds()
--Debug.Message("Protocol Request Complete. 杏花宵®漏洞解决方案已上线。") --Debug.Message("Protocol Request Complete. 杏花宵®漏洞解决方案已上线。")
end end
--[[function aux.GetMustMaterialGroup(tp,code) --[[function aux.GetMustMaterialGroup(tp,code)
...@@ -22,36 +24,6 @@ end ...@@ -22,36 +24,6 @@ end
end end
return g return g
end--]] end--]]
if not aux.GetMustMaterialGroup then
aux.GetMustMaterialGroup=Duel.GetMustMaterial
end
local release_set={"CheckReleaseGroup","SelectReleaseGroup"}
for i,fname in pairs(release_set) do
local temp_f=Duel[fname]
Duel[fname]=function(...)
local params={...}
local old_minc=params[3]
local typ=type(old_minc)
if #params>2 and typ~="number" then return temp_f(table.unpack(params,2,#params)) end
return temp_f(...)
end
end
local release_set2={"CheckReleaseGroupEx","SelectReleaseGroupEx"}
for i,fname in pairs(release_set) do
local temp_f=Duel[fname]
Duel[fname]=function(...)
local params={...}
local old_minc=params[3]
local typ=type(old_minc)
if #params>2 and typ~="number" then
local tab={table.unpack(params,2,#params)}
table.insert(tab,i+3,REASON_COST)
table.insert(tab,i+4,true)
return temp_f(table.unpack(tab))
end
return temp_f(...)
end
end
local _IsTuner=Card.IsTuner local _IsTuner=Card.IsTuner
function Card.IsTuner(c,...) function Card.IsTuner(c,...)
local ext_params={...} local ext_params={...}
......
...@@ -42,12 +42,12 @@ function cm.con(e,c) ...@@ -42,12 +42,12 @@ function cm.con(e,c)
return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and Duel.IsExistingMatchingCard(cm.resfilter,tp,LOCATION_SZONE,0,1,nil) return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and Duel.IsExistingMatchingCard(cm.resfilter,tp,LOCATION_SZONE,0,1,nil)
end end
function cm.resfilter(c) function cm.resfilter(c)
return c:GetOriginalType()&TYPE_MONSTER ~=0 and c:IsReleasable() and c:IsType(TYPE_TRAP) return c:GetOriginalType()&TYPE_MONSTER~=0 and c:IsReleasable(REASON_SPSUMMON) and c:IsType(TYPE_TRAP)
end end
function cm.op(e,tp) function cm.op(e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.resfilter,tp,LOCATION_SZONE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.resfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_SPSUMMON)
end end
function cm.cfilter(c,e,tp) function cm.cfilter(c,e,tp)
return c:IsReleasable() and Duel.GetMZoneCount(tp,c,tp)>0 return c:IsReleasable() and Duel.GetMZoneCount(tp,c,tp)>0
...@@ -75,7 +75,7 @@ function cm.spop(e,tp) ...@@ -75,7 +75,7 @@ function cm.spop(e,tp)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)>0 then if #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)>0 then
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
end end
......
...@@ -77,7 +77,7 @@ function c49811176.drop(e,tp,eg,ep,ev,re,r,rp) ...@@ -77,7 +77,7 @@ function c49811176.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(p,d,REASON_EFFECT) Duel.Draw(p,d,REASON_EFFECT)
end end
function c49811176.costfilter(c,tp) function c49811176.costfilter(c,tp)
return c:IsType(TYPE_PENDULUM) and c:IsControler(tp) and (c:IsSetCard(0xaa) or c:IsSetCard(0xc4)) return c:IsType(TYPE_PENDULUM) and c:IsControler(tp) and c:IsReleasable() and (c:IsSetCard(0xaa) or c:IsSetCard(0xc4))
end end
function c49811176.ngcost(e,tp,eg,ep,ev,re,r,rp,chk) function c49811176.ngcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c49811176.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil,tp) end if chk==0 then return Duel.IsExistingMatchingCard(c49811176.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil,tp) end
......
...@@ -35,8 +35,8 @@ function c53700005.spfilter(c,tp) ...@@ -35,8 +35,8 @@ function c53700005.spfilter(c,tp)
return c:IsCode(53700001) return c:IsCode(53700001)
end end
function c53700005.sumcost(e,tp,eg,ep,ev,re,r,rp,chk) function c53700005.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,c53700005.spfilter,1,nil,tp) end if chk==0 then return Duel.CheckReleaseGroup(tp,c53700005.spfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,c53700005.spfilter,1,10,nil) local g=Duel.SelectReleaseGroup(tp,c53700005.spfilter,1,10,nil)
local lv=g:GetSum(Card.GetLevel) local lv=g:GetSum(Card.GetLevel)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
e:SetLabel(lv) e:SetLabel(lv)
......
...@@ -57,8 +57,8 @@ function c53700006.cfilter(c,ft,tp) ...@@ -57,8 +57,8 @@ function c53700006.cfilter(c,ft,tp)
end end
function c53700006.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c53700006.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return ft>-1 and Duel.CheckReleaseGroup(REASON_COST,tp,c53700006.cfilter,1,nil,ft,tp) end if chk==0 then return ft>-1 and Duel.CheckReleaseGroup(tp,c53700006.cfilter,1,nil,ft,tp) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,c53700006.cfilter,1,1,nil,ft,tp) local g=Duel.SelectReleaseGroup(tp,c53700006.cfilter,1,1,nil,ft,tp)
e:SetLabel(g:GetFirst():GetLevel()) e:SetLabel(g:GetFirst():GetLevel())
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
......
...@@ -43,7 +43,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -43,7 +43,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
local ct1=Duel.GetMatchingGroupCount(cm.filter1,tp,LOCATION_MZONE,0,tc) local ct1=Duel.GetMatchingGroupCount(cm.filter1,tp,LOCATION_MZONE,0,tc)
local rg=Duel.SelectReleaseGroup(REASON_EFFECT,tp,Card.IsReleasableByEffect,1,ct1,tc) local rg=Duel.SelectReleaseGroup(tp,Card.IsReleasableByEffect,1,ct1,tc)
local lv=rg:GetSum(Card.GetLevel) local lv=rg:GetSum(Card.GetLevel)
local ct2=Duel.Release(rg,REASON_EFFECT) local ct2=Duel.Release(rg,REASON_EFFECT)
if ct2==0 or lv==0 then return end if ct2==0 or lv==0 then return end
......
...@@ -55,8 +55,8 @@ function c53701001.aclimit(e,re,tp) ...@@ -55,8 +55,8 @@ function c53701001.aclimit(e,re,tp)
return re:GetActivateLocation()==LOCATION_GRAVE return re:GetActivateLocation()==LOCATION_GRAVE
end end
function c53701001.immcost(e,tp,eg,ep,ev,re,r,rp,chk) function c53701001.immcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsSetCard,1,e:GetHandler(),0x3530) end if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,e:GetHandler(),0x3530) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsSetCard,1,1,e:GetHandler(),0x3530) local g=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,1,e:GetHandler(),0x3530)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c53701001.immop(e,tp,eg,ep,ev,re,r,rp) function c53701001.immop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -52,11 +52,11 @@ function c53701007.hspcon(e,c) ...@@ -52,11 +52,11 @@ function c53701007.hspcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.CheckReleaseGroup(REASON_SPSUMMON,tp,c53701007.hspfilter,1,nil,ft,tp) return ft>-1 and Duel.CheckReleaseGroup(tp,c53701007.hspfilter,1,nil,ft,tp)
end end
function c53701007.hspop(e,tp,eg,ep,ev,re,r,rp,c) function c53701007.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local tc=Duel.SelectReleaseGroup(REASON_SPSUMMON,tp,c53701007.hspfilter,1,1,nil,ft,tp):GetFirst() local tc=Duel.SelectReleaseGroup(tp,c53701007.hspfilter,1,1,nil,ft,tp):GetFirst()
Duel.Release(tc,REASON_SPSUMMON) Duel.Release(tc,REASON_SPSUMMON)
e:GetLabelObject():SetLabelObject(tc) e:GetLabelObject():SetLabelObject(tc)
end end
......
...@@ -40,9 +40,9 @@ function cm.con(e,tp,eg,ep,ev,re,r,rp) ...@@ -40,9 +40,9 @@ function cm.con(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsReleasable() and Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsSetCard,1,c,0x3530) end if chk==0 then return c:IsReleasable() and Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,c,0x3530) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsSetCard,1,1,c,0x3530) local rg=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,1,c,0x3530)
rg:AddCard(c) rg:AddCard(c)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
......
...@@ -29,8 +29,8 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -29,8 +29,8 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and Duel.IsExistingMatchingCard(Card.IsCode,tp,0,LOCATION_GRAVE,1,nil,re:GetHandler():GetCode()) return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and Duel.IsExistingMatchingCard(Card.IsCode,tp,0,LOCATION_GRAVE,1,nil,re:GetHandler():GetCode())
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsRace,1,nil,RACE_MACHINE) end if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsRace,1,nil,RACE_MACHINE) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsRace,1,1,nil,RACE_MACHINE) local g=Duel.SelectReleaseGroup(tp,Card.IsRace,1,1,nil,RACE_MACHINE)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -2661,22 +2661,24 @@ function cm.CyberNCode2(e,tp,eg,ep,ev,re,r,rp) ...@@ -2661,22 +2661,24 @@ function cm.CyberNCode2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(53702500,15)) Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(53702500,15))
end end
function cm.AllEffectReset(c) function cm.AllEffectReset(c)
if Duel.GetFlagEffect(0,53702700)>0 then return end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE_START+PHASE_DRAW) e1:SetCode(EVENT_ADJUST)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(0xff) e1:SetRange(0xff)
e1:SetOperation(cm.AllEffectRstop) e1:SetOperation(cm.AllEffectRstop)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_DUEL+53702700) --e1:SetCountLimit(1,EFFECT_COUNT_CODE_DUEL+53702700)
c:RegisterEffect(e1) c:RegisterEffect(e1)
Duel.RegisterFlagEffect(0,53702700,0,0,0)
end end
function cm.AllEffectRstop(e,tp,eg,ep,ev,re,r,rp) function cm.AllEffectRstop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(0,53702700)>0 then return end --if Duel.GetFlagEffect(0,53702700)>0 then return end
--Duel.RegisterFlagEffect(0,53702700,0,0,0)
local g=Duel.GetMatchingGroup(function(c)return c:GetFlagEffect(53702700)==0 end,0,0xff,0xff,nil)
if #g==0 then return end
--Debug.Message(99) --Debug.Message(99)
Duel.RegisterFlagEffect(0,53702700,0,0,0)
local g=Duel.GetMatchingGroup(nil,0,0xff,0xff,nil)
local reg=Card.RegisterEffect local reg=Card.RegisterEffect
local rstg=Duel.GetMatchingGroup(function(c)return c.Snnm_Ef_Rst end,0,0xff,0xff,nil) local rstg=Duel.GetMatchingGroup(function(c)return c.Snnm_Ef_Rst and c:GetFlagEffect(53702700)==0 end,0,0xff,0xff,nil)
local rstt={} local rstt={}
for rstc in aux.Next(rstg) do if not cm.IsInTable(rstc:GetOriginalCode(),rstt) then table.insert(rstt,rstc:GetOriginalCode()) end end for rstc in aux.Next(rstg) do if not cm.IsInTable(rstc:GetOriginalCode(),rstt) then table.insert(rstt,rstc:GetOriginalCode()) end end
if cm.IsInTable(53759012,rstt) then if cm.IsInTable(53759012,rstt) then
...@@ -2694,7 +2696,7 @@ function cm.AllEffectRstop(e,tp,eg,ep,ev,re,r,rp) ...@@ -2694,7 +2696,7 @@ function cm.AllEffectRstop(e,tp,eg,ep,ev,re,r,rp)
return c53759012[1](se,le) return c53759012[1](se,le)
end end
end end
local helltaker=Duel.GetMatchingGroup(function(c)return c.AD_Ht end,0,0xff,0xff,nil) local helltaker=Duel.GetMatchingGroup(function(c)return c.AD_Ht and c:GetFlagEffect(53702700)==0 end,0,0xff,0xff,nil)
if #helltaker>0 then if #helltaker>0 then
AD_Helltaker=Effect.SetLabelObject AD_Helltaker=Effect.SetLabelObject
Effect.SetLabelObject=function(se,le) Effect.SetLabelObject=function(se,le)
...@@ -2842,6 +2844,7 @@ function cm.AllEffectRstop(e,tp,eg,ep,ev,re,r,rp) ...@@ -2842,6 +2844,7 @@ function cm.AllEffectRstop(e,tp,eg,ep,ev,re,r,rp)
if cm.IsInTable(53759012,rstt) then Effect.SetLabelObject=c53759012[1] end if cm.IsInTable(53759012,rstt) then Effect.SetLabelObject=c53759012[1] end
if #helltaker>0 then Effect.SetLabelObject=AD_Helltaker end if #helltaker>0 then Effect.SetLabelObject=AD_Helltaker end
Duel.ResetFlagEffect(0,53764007) Duel.ResetFlagEffect(0,53764007)
g:ForEach(Card.RegisterFlagEffect,53702700,0,0,0)
e:Reset() e:Reset()
end end
function cm.reni(c,sdes,scat,styp,spro,scod,sran,sct,sht,scon,scos,stg,sop) function cm.reni(c,sdes,scat,styp,spro,scod,sran,sct,sht,scon,scos,stg,sop)
...@@ -5292,7 +5295,7 @@ function cm.MultipleGroupCheck(c) ...@@ -5292,7 +5295,7 @@ function cm.MultipleGroupCheck(c)
return b return b
end end
ADIMI_SelectReleaseGroup=Duel.SelectReleaseGroup ADIMI_SelectReleaseGroup=Duel.SelectReleaseGroup
Duel.SelectReleaseGroup=function(r,p,f,min,max,ex,...) Duel.SelectReleaseGroup=function(p,f,min,max,ex,...)
local lab=Duel.GetFlagEffectLabel(0,53759000) local lab=Duel.GetFlagEffectLabel(0,53759000)
Duel.SetFlagEffectLabel(0,53759000,lab+1) Duel.SetFlagEffectLabel(0,53759000,lab+1)
local ly=0 local ly=0
...@@ -5306,7 +5309,7 @@ function cm.MultipleGroupCheck(c) ...@@ -5306,7 +5309,7 @@ function cm.MultipleGroupCheck(c)
cm["Card_Prophecy_L_Check_"..ly]=true cm["Card_Prophecy_L_Check_"..ly]=true
ADIMI_GetMatchingGroup(f,p,LOCATION_MZONE,LOCATION_MZONE,ex,...) ADIMI_GetMatchingGroup(f,p,LOCATION_MZONE,LOCATION_MZONE,ex,...)
cm["Card_Prophecy_L_Check_"..ly]=false cm["Card_Prophecy_L_Check_"..ly]=false
local b=ADIMI_SelectReleaseGroup(r,p,f,min,max,ex,...) local b=ADIMI_SelectReleaseGroup(p,f,min,max,ex,...)
cm["Card_Prophecy_Certain_SP_"..ly]=false cm["Card_Prophecy_Certain_SP_"..ly]=false
cm["Card_Prophecy_Certain_ACST_"..ly]=false cm["Card_Prophecy_Certain_ACST_"..ly]=false
cm["Card_Prophecy_Layer_"..ly]=false cm["Card_Prophecy_Layer_"..ly]=false
...@@ -5314,7 +5317,7 @@ function cm.MultipleGroupCheck(c) ...@@ -5314,7 +5317,7 @@ function cm.MultipleGroupCheck(c)
return b return b
end end
ADIMI_SelectReleaseGroupEx=Duel.SelectReleaseGroupEx ADIMI_SelectReleaseGroupEx=Duel.SelectReleaseGroupEx
Duel.SelectReleaseGroupEx=function(r,p,f,min,max,ex,...) Duel.SelectReleaseGroupEx=function(p,f,min,max,r,bool,ex,...)
local lab=Duel.GetFlagEffectLabel(0,53759000) local lab=Duel.GetFlagEffectLabel(0,53759000)
Duel.SetFlagEffectLabel(0,53759000,lab+1) Duel.SetFlagEffectLabel(0,53759000,lab+1)
local ly=0 local ly=0
...@@ -5326,9 +5329,9 @@ function cm.MultipleGroupCheck(c) ...@@ -5326,9 +5329,9 @@ function cm.MultipleGroupCheck(c)
end end
cm["Card_Prophecy_Layer_"..ly]=true cm["Card_Prophecy_Layer_"..ly]=true
cm["Card_Prophecy_L_Check_"..ly]=true cm["Card_Prophecy_L_Check_"..ly]=true
ADIMI_GetMatchingGroup(f,p,LOCATION_MZONE+LOCATION_HAND,LOCATION_MZONE+LOCATION_HAND,ex,...) if bool then ADIMI_GetMatchingGroup(f,p,LOCATION_MZONE+LOCATION_HAND,LOCATION_MZONE+LOCATION_HAND,ex,...) else ADIMI_GetMatchingGroup(f,p,LOCATION_MZONE,LOCATION_MZONE,ex,...) end
cm["Card_Prophecy_L_Check_"..ly]=false cm["Card_Prophecy_L_Check_"..ly]=false
local b=ADIMI_SelectReleaseGroupEx(r,p,f,min,max,ex,...) local b=ADIMI_SelectReleaseGroupEx(p,f,min,max,r,bool,ex,...)
cm["Card_Prophecy_Certain_SP_"..ly]=false cm["Card_Prophecy_Certain_SP_"..ly]=false
cm["Card_Prophecy_Certain_ACST_"..ly]=false cm["Card_Prophecy_Certain_ACST_"..ly]=false
cm["Card_Prophecy_Layer_"..ly]=false cm["Card_Prophecy_Layer_"..ly]=false
......
...@@ -31,10 +31,10 @@ function cm.hspcon(e,c) ...@@ -31,10 +31,10 @@ function cm.hspcon(e,c)
if c==nil then return true end if c==nil then return true end
if c:IsLocation(LOCATION_DECK) and c:IsFacedown() then return end if c:IsLocation(LOCATION_DECK) and c:IsFacedown() then return end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.CheckReleaseGroup(REASON_SPSUMMON,tp,cm.hspfilter,1,nil,tp) return Duel.CheckReleaseGroup(tp,cm.hspfilter,1,nil,tp)
end end
function cm.hspop(e,tp,eg,ep,ev,re,r,rp,c) function cm.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(REASON_SPSUMMON,tp,cm.hspfilter,1,1,nil,tp) local g=Duel.SelectReleaseGroup(tp,cm.hspfilter,1,1,nil,tp)
Duel.Release(g,REASON_SPSUMMON) Duel.Release(g,REASON_SPSUMMON)
end end
function cm.effcon(e,tp,eg,ep,ev,re,r,rp) function cm.effcon(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -54,8 +54,8 @@ function cm.costfilter(c) ...@@ -54,8 +54,8 @@ function cm.costfilter(c)
return c:IsType(TYPE_XYZ) and c:IsRace(RACE_SPELLCASTER) return c:IsType(TYPE_XYZ) and c:IsRace(RACE_SPELLCASTER)
end end
function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,cm.costfilter,1,nil) end if chk==0 then return Duel.CheckReleaseGroup(tp,cm.costfilter,1,nil) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,cm.costfilter,1,1,nil) local g=Duel.SelectReleaseGroup(tp,cm.costfilter,1,1,nil)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -64,8 +64,8 @@ function cm.costfilter(c,tp) ...@@ -64,8 +64,8 @@ function cm.costfilter(c,tp)
and Duel.GetMZoneCount(tp,c,tp)>0 and Duel.GetMZoneCount(tp,c,tp)>0
end end
function cm.spcost2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,cm.costfilter,1,nil,tp) end if chk==0 then return Duel.CheckReleaseGroup(tp,cm.costfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,cm.costfilter,1,1,nil,tp) local g=Duel.SelectReleaseGroup(tp,cm.costfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
......
...@@ -34,9 +34,9 @@ function cm.hkcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -34,9 +34,9 @@ function cm.hkcon(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.hkcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.hkcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsReleasable() and Duel.CheckReleaseGroup(REASON_COST,tp,nil,1,c) end if chk==0 then return c:IsReleasable() and Duel.CheckReleaseGroup(tp,nil,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=Duel.SelectReleaseGroup(REASON_COST,tp,nil,1,1,c) local rg=Duel.SelectReleaseGroup(tp,nil,1,1,c)
rg:AddCard(c) rg:AddCard(c)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
......
...@@ -70,10 +70,10 @@ function cm.spcon(e,c) ...@@ -70,10 +70,10 @@ function cm.spcon(e,c)
local tp=c:GetControler() local tp=c:GetControler()
local att1=c:GetFlagEffectLabel(m) local att1=c:GetFlagEffectLabel(m)
local att2=c:GetFlagEffectLabel(m+50) local att2=c:GetFlagEffectLabel(m+50)
return Duel.CheckReleaseGroup(REASON_SPSUMMON,tp,cm.rfilter,1,nil,tp,c) and ((c:IsControler(c:GetOwner()) and att1 and att1&0x1f==0x1f) or (c:IsControler(1-c:GetOwner()) and att2 and att2&0x1f==0x1f)) return Duel.CheckReleaseGroup(tp,cm.rfilter,1,nil,tp,c) and ((c:IsControler(c:GetOwner()) and att1 and att1&0x1f==0x1f) or (c:IsControler(1-c:GetOwner()) and att2 and att2&0x1f==0x1f))
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c) function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(REASON_SPSUMMON,tp,cm.rfilter,1,1,nil,tp,c) local g=Duel.SelectReleaseGroup(tp,cm.rfilter,1,1,nil,tp,c)
Duel.Release(g,REASON_SPSUMMON) Duel.Release(g,REASON_SPSUMMON)
end end
function cm.op(e,tp,eg,ep,ev,re,r,rp) function cm.op(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -45,8 +45,8 @@ function cm.cfilter(c,tp) ...@@ -45,8 +45,8 @@ function cm.cfilter(c,tp)
return c:IsLinkState() and Duel.GetMZoneCount(tp,c)>0 return c:IsLinkState() and Duel.GetMZoneCount(tp,c)>0
end end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,cm.cfilter,1,nil,tp) end if chk==0 then return Duel.CheckReleaseGroup(tp,cm.cfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,cm.cfilter,1,1,nil,tp) local g=Duel.SelectReleaseGroup(tp,cm.cfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -98,10 +98,10 @@ end ...@@ -98,10 +98,10 @@ end
function cm.spcon(e,c) function cm.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.CheckReleaseGroup(REASON_SPSUMMON,tp,cm.rfilter,1,nil,tp,c) and Duel.GetTurnCount()>9 return Duel.CheckReleaseGroup(tp,cm.rfilter,1,nil,tp,c) and Duel.GetTurnCount()>9
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c) function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(REASON_SPSUMMON,tp,cm.rfilter,1,1,nil,tp,c) local g=Duel.SelectReleaseGroup(tp,cm.rfilter,1,1,nil,tp,c)
Duel.Release(g,REASON_SPSUMMON) Duel.Release(g,REASON_SPSUMMON)
end end
function cm.imfilter(c) function cm.imfilter(c)
......
...@@ -24,9 +24,9 @@ end ...@@ -24,9 +24,9 @@ end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local res=c:IsLocation(LOCATION_MZONE) local res=c:IsLocation(LOCATION_MZONE)
if chk==0 then return c:IsReleasable() and Duel.CheckReleaseGroup(REASON_COST,tp,cm.cfilter,1,c,res) end if chk==0 then return c:IsReleasable() and Duel.CheckReleaseGroup(tp,cm.cfilter,1,c,res) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=Duel.SelectReleaseGroup(REASON_COST,tp,cm.cfilter,1,1,c,res) local rg=Duel.SelectReleaseGroup(tp,cm.cfilter,1,1,c,res)
rg:AddCard(c) rg:AddCard(c)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
......
...@@ -132,8 +132,8 @@ function cm.costfilter(c,tp) ...@@ -132,8 +132,8 @@ function cm.costfilter(c,tp)
return c:IsType(TYPE_PENDULUM) and c:IsAttribute(ATTRIBUTE_DARK) and (c:IsControler(tp) or c:IsFaceup()) return c:IsType(TYPE_PENDULUM) and c:IsAttribute(ATTRIBUTE_DARK) and (c:IsControler(tp) or c:IsFaceup())
end end
function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,cm.costfilter,1,nil,tp) end if chk==0 then return Duel.CheckReleaseGroup(tp,cm.costfilter,1,nil,tp) end
local sg=Duel.SelectReleaseGroup(REASON_COST,tp,cm.costfilter,1,1,nil,tp) local sg=Duel.SelectReleaseGroup(tp,cm.costfilter,1,1,nil,tp)
Duel.Release(sg,REASON_COST) Duel.Release(sg,REASON_COST)
end end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
...@@ -37,8 +37,8 @@ function cm.initial_effect(c) ...@@ -37,8 +37,8 @@ function cm.initial_effect(c)
end end
function cm.actcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.actcost(e,tp,eg,ep,ev,re,r,rp,chk)
if not e:GetHandler():IsStatus(STATUS_SET_TURN) then return true end if not e:GetHandler():IsStatus(STATUS_SET_TURN) then return true end
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsSetCard,2,nil,0x5532) end if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,2,nil,0x5532) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsSetCard,2,2,nil,0x5532) local g=Duel.SelectReleaseGroup(tp,Card.IsSetCard,2,2,nil,0x5532)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.acttg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -21,8 +21,8 @@ function cm.initial_effect(c) ...@@ -21,8 +21,8 @@ function cm.initial_effect(c)
e3:SetOperation(cm.srop) e3:SetOperation(cm.srop)
end end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsSummonType,1,nil,SUMMON_TYPE_NORMAL) end if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSummonType,1,nil,SUMMON_TYPE_NORMAL) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsSummonType,1,1,nil,SUMMON_TYPE_NORMAL) local g=Duel.SelectReleaseGroup(tp,Card.IsSummonType,1,1,nil,SUMMON_TYPE_NORMAL)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
......
...@@ -45,9 +45,9 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -45,9 +45,9 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
if e:GetLabel()~=100 then return false end if e:GetLabel()~=100 then return false end
e:SetLabel(0) e:SetLabel(0)
return (Duel.IsPlayerCanDraw(tp,1) or Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,nil)) and Duel.CheckReleaseGroup(REASON_COST,tp,cm.filter,1,nil,tp) return (Duel.IsPlayerCanDraw(tp,1) or Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,nil)) and Duel.CheckReleaseGroup(tp,cm.filter,1,nil,tp)
end end
local rg=Duel.SelectReleaseGroup(REASON_COST,tp,cm.filter,1,1,nil,tp) local rg=Duel.SelectReleaseGroup(tp,cm.filter,1,1,nil,tp)
e:SetLabel(SNNM.multi_summon_count(rg)) e:SetLabel(SNNM.multi_summon_count(rg))
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
......
...@@ -45,7 +45,7 @@ function cm.immval(e,te) ...@@ -45,7 +45,7 @@ function cm.immval(e,te)
if not c:IsLocation(LOCATION_FZONE) then return false end if not c:IsLocation(LOCATION_FZONE) then return false end
local tp=c:GetControler() local tp=c:GetControler()
local eset={c:IsHasEffect(m+50)} local eset={c:IsHasEffect(m+50)}
local res=te:GetOwner()~=e:GetOwner() and Duel.CheckReleaseGroup(REASON_EFFECT,tp,nil,1,nil) local res=te:GetOwner()~=e:GetOwner() and Duel.CheckReleaseGroup(tp,nil,1,nil)
local ctns=false local ctns=false
if not te:IsHasType(EFFECT_TYPE_ACTIONS) then if not te:IsHasType(EFFECT_TYPE_ACTIONS) then
for _,se in pairs(eset) do for _,se in pairs(eset) do
...@@ -70,7 +70,7 @@ function cm.immval(e,te) ...@@ -70,7 +70,7 @@ function cm.immval(e,te)
end end
function cm.imcop(e,tp,eg,ep,ev,re,r,rp) function cm.imcop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
local g=Duel.SelectReleaseGroup(REASON_EFFECT,tp,nil,1,1,nil) local g=Duel.SelectReleaseGroup(tp,nil,1,1,nil)
Duel.Release(g,REASON_EFFECT) Duel.Release(g,REASON_EFFECT)
e:Reset() e:Reset()
end end
......
...@@ -46,8 +46,8 @@ end ...@@ -46,8 +46,8 @@ end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) local b1=Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) local b2=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
if chk==0 then return (b1 or b2) and Duel.CheckReleaseGroup(REASON_COST,tp,cm.cfilter,1,nil,tp,b1) end if chk==0 then return (b1 or b2) and Duel.CheckReleaseGroup(tp,cm.cfilter,1,nil,tp,b1) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,cm.cfilter,1,1,nil,tp,b1) local g=Duel.SelectReleaseGroup(tp,cm.cfilter,1,1,nil,tp,b1)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
local b3=b2 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 local b3=b2 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local off=1 local off=1
......
...@@ -66,12 +66,12 @@ function cm.spfilter(c,e,tp) ...@@ -66,12 +66,12 @@ function cm.spfilter(c,e,tp)
return c:IsCode(m+1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(m+1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_EFFECT,tp,cm.relfilter,1,nil,tp) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.CheckReleaseGroup(tp,cm.relfilter,1,nil,tp) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function cm.activate2(e,tp,eg,ep,ev,re,r,rp) function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.SelectReleaseGroup(REASON_EFFECT,tp,cm.relfilter,1,1,nil,tp) local rg=Duel.SelectReleaseGroup(tp,cm.relfilter,1,1,nil,tp)
if rg:GetCount()==0 then return end if rg:GetCount()==0 then return end
if Duel.Release(rg,REASON_EFFECT)==0 then return end if Duel.Release(rg,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
...@@ -63,12 +63,12 @@ function cm.spfilter(c,e,tp) ...@@ -63,12 +63,12 @@ function cm.spfilter(c,e,tp)
return c:IsCode(m+1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(m+1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_EFFECT,tp,cm.relfilter,1,nil,tp) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.CheckReleaseGroup(tp,cm.relfilter,1,nil,tp) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function cm.activate2(e,tp,eg,ep,ev,re,r,rp) function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.SelectReleaseGroup(REASON_EFFECT,tp,cm.relfilter,1,1,nil,tp) local rg=Duel.SelectReleaseGroup(tp,cm.relfilter,1,1,nil,tp)
if rg:GetCount()==0 then return end if rg:GetCount()==0 then return end
if Duel.Release(rg,REASON_EFFECT)==0 then return end if Duel.Release(rg,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
...@@ -73,12 +73,12 @@ function cm.spfilter(c,e,tp) ...@@ -73,12 +73,12 @@ function cm.spfilter(c,e,tp)
return c:IsCode(m+1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(m+1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_EFFECT,tp,cm.relfilter,1,nil,tp) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.CheckReleaseGroup(tp,cm.relfilter,1,nil,tp) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function cm.activate2(e,tp,eg,ep,ev,re,r,rp) function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.SelectReleaseGroup(REASON_EFFECT,tp,cm.relfilter,1,1,nil,tp) local rg=Duel.SelectReleaseGroup(tp,cm.relfilter,1,1,nil,tp)
if rg:GetCount()==0 then return end if rg:GetCount()==0 then return end
if Duel.Release(rg,REASON_EFFECT)==0 then return end if Duel.Release(rg,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
...@@ -94,12 +94,12 @@ function cm.spfilter(c,e,tp) ...@@ -94,12 +94,12 @@ function cm.spfilter(c,e,tp)
return c:IsCode(m+8) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) return c:IsCode(m+8) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_EFFECT,tp,cm.relfilter,1,nil,tp) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.CheckReleaseGroup(tp,cm.relfilter,1,nil,tp) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function cm.activate2(e,tp,eg,ep,ev,re,r,rp) function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.SelectReleaseGroup(REASON_EFFECT,tp,cm.relfilter,1,1,nil,tp) local rg=Duel.SelectReleaseGroup(tp,cm.relfilter,1,1,nil,tp)
if rg:GetCount()==0 then return end if rg:GetCount()==0 then return end
if Duel.Release(rg,REASON_EFFECT)==0 then return end if Duel.Release(rg,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
...@@ -89,8 +89,8 @@ function cm.descon(e) ...@@ -89,8 +89,8 @@ function cm.descon(e)
return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown() return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsType,1,nil,TYPE_NORMAL) end if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsType,1,nil,TYPE_NORMAL) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsType,1,1,nil,TYPE_NORMAL) local g=Duel.SelectReleaseGroup(tp,Card.IsType,1,1,nil,TYPE_NORMAL)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
...@@ -86,8 +86,8 @@ function cm.descon(e) ...@@ -86,8 +86,8 @@ function cm.descon(e)
return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown() return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsType,1,nil,TYPE_NORMAL) end if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsType,1,nil,TYPE_NORMAL) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsType,1,1,nil,TYPE_NORMAL) local g=Duel.SelectReleaseGroup(tp,Card.IsType,1,1,nil,TYPE_NORMAL)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
...@@ -78,8 +78,8 @@ function cm.descon(e) ...@@ -78,8 +78,8 @@ function cm.descon(e)
return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown() return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsType,1,nil,TYPE_NORMAL) end if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsType,1,nil,TYPE_NORMAL) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsType,1,1,nil,TYPE_NORMAL) local g=Duel.SelectReleaseGroup(tp,Card.IsType,1,1,nil,TYPE_NORMAL)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.cfilter(c) function cm.cfilter(c)
......
...@@ -89,8 +89,8 @@ function cm.descon(e) ...@@ -89,8 +89,8 @@ function cm.descon(e)
return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown() return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsType,1,nil,TYPE_NORMAL) end if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsType,1,nil,TYPE_NORMAL) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsType,1,1,nil,TYPE_NORMAL) local g=Duel.SelectReleaseGroup(tp,Card.IsType,1,1,nil,TYPE_NORMAL)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
...@@ -67,8 +67,8 @@ function cm.descon(e) ...@@ -67,8 +67,8 @@ function cm.descon(e)
return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown() return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsType,1,nil,TYPE_NORMAL) end if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsType,1,nil,TYPE_NORMAL) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsType,1,1,nil,TYPE_NORMAL) local g=Duel.SelectReleaseGroup(tp,Card.IsType,1,1,nil,TYPE_NORMAL)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.thfilter(c) function cm.thfilter(c)
......
...@@ -65,8 +65,8 @@ function cm.descon(e) ...@@ -65,8 +65,8 @@ function cm.descon(e)
return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown() return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsType,1,nil,TYPE_NORMAL) end if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsType,1,nil,TYPE_NORMAL) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsType,1,1,nil,TYPE_NORMAL) local g=Duel.SelectReleaseGroup(tp,Card.IsType,1,1,nil,TYPE_NORMAL)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.cfilter(c) function cm.cfilter(c)
......
...@@ -78,7 +78,7 @@ function s.initial_effect(c) ...@@ -78,7 +78,7 @@ function s.initial_effect(c)
else return _SelectUnselect(cg,sg,sp,finish,cancel,...) end else return _SelectUnselect(cg,sg,sp,finish,cancel,...) end
end end
local originalDuelFunctions={} local originalDuelFunctions={}
local DuelFunctionsName={"SelectMatchingCard","SelectTarget","SelectTribute","SelectFusionMaterial","SelectSynchroMaterial","SelectTunerMaterial","SelectXyzMaterial"} local DuelFunctionsName={"SelectMatchingCard","SelectTarget","SelectTribute","SelectFusionMaterial","SelectSynchroMaterial","SelectTunerMaterial","SelectXyzMaterial","SelectReleaseGroup","SelectReleaseGroupEx"}
for _,funcName in ipairs(DuelFunctionsName) do for _,funcName in ipairs(DuelFunctionsName) do
originalDuelFunctions[funcName]=Duel[funcName] originalDuelFunctions[funcName]=Duel[funcName]
Duel[funcName]=function(sp,...) Duel[funcName]=function(sp,...)
...@@ -90,19 +90,6 @@ function s.initial_effect(c) ...@@ -90,19 +90,6 @@ function s.initial_effect(c)
else return originalDuelFunctions[funcName](sp,...) end else return originalDuelFunctions[funcName](sp,...) end
end end
end end
local originalDuelFunctions2={}
local DuelFunctionsName2={"SelectReleaseGroup","SelectReleaseGroupEx"}
for _,funcName in ipairs(DuelFunctionsName2) do
originalDuelFunctions2[funcName]=Duel[funcName]
Duel[funcName]=function(r,sp,...)
if Duel.IsPlayerAffectedByEffect(sp,id) and s.chain_solving then
local g=originalDuelFunctions2[funcName](r,sp,...)
local tg=Group.__add(g,g)
if tg:IsExists(f,1,nil) then table.insert(s.trigger,sp) end
return g
else return originalDuelFunctions2[funcName](r,sp,...) end
end
end
local originalGroupFunctions={} local originalGroupFunctions={}
local GroupFunctionsName={"FilterSelect","Select","RandomSelect","SelectWithSumEqual","SelectWithSumGreater",""} local GroupFunctionsName={"FilterSelect","Select","RandomSelect","SelectWithSumEqual","SelectWithSumGreater",""}
for _,funcName in ipairs(GroupFunctionsName) do for _,funcName in ipairs(GroupFunctionsName) do
......
...@@ -32,8 +32,8 @@ function cm.filter(c) ...@@ -32,8 +32,8 @@ function cm.filter(c)
return c:IsFaceup() and c:IsType(TYPE_RITUAL) and c:IsSummonType(SUMMON_TYPE_RITUAL) and c:GetFlagEffect(m)>0 return c:IsFaceup() and c:IsType(TYPE_RITUAL) and c:IsSummonType(SUMMON_TYPE_RITUAL) and c:GetFlagEffect(m)>0
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,cm.filter,1,nil) end if chk==0 then return Duel.CheckReleaseGroup(tp,cm.filter,1,nil) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,cm.filter,1,1,nil) local g=Duel.SelectReleaseGroup(tp,cm.filter,1,1,nil)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -41,10 +41,10 @@ function cm.hspfilter(c,tp,sc) ...@@ -41,10 +41,10 @@ function cm.hspfilter(c,tp,sc)
end end
function cm.hspcon(e,c) function cm.hspcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.CheckReleaseGroup(REASON_SPSUMMON,c:GetControler(),cm.hspfilter,1,nil,c:GetControler(),c) return Duel.CheckReleaseGroup(c:GetControler(),cm.hspfilter,1,nil,c:GetControler(),c)
end end
function cm.hspop(e,tp,eg,ep,ev,re,r,rp,c) function cm.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(REASON_SPSUMMON,tp,cm.hspfilter,1,1,nil,tp,c) local g=Duel.SelectReleaseGroup(tp,cm.hspfilter,1,1,nil,tp,c)
c:SetMaterial(g) c:SetMaterial(g)
Duel.Release(g,REASON_SPSUMMON) Duel.Release(g,REASON_SPSUMMON)
end end
......
...@@ -42,11 +42,11 @@ end ...@@ -42,11 +42,11 @@ end
function cm.spccon(e,c) function cm.spccon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.CheckReleaseGroup(REASON_SPSUMMON,tp,cm.cfilter,1,nil,tp) return Duel.CheckReleaseGroup(tp,cm.cfilter,1,nil,tp)
end end
function cm.spcop(e,tp,eg,ep,ev,re,r,rp,c) function cm.spcop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(REASON_SPSUMMON,tp,cm.cfilter,1,1,nil,tp) local g=Duel.SelectReleaseGroup(tp,cm.cfilter,1,1,nil,tp)
Duel.Release(g,REASON_SPSUMMON) Duel.Release(g,REASON_SPSUMMON)
end end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
...@@ -45,8 +45,8 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -45,8 +45,8 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsRace,1,c,RACE_ZOMBIE) end if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsRace,1,c,RACE_ZOMBIE) end
local rg=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsRace,1,1,c,RACE_ZOMBIE) local rg=Duel.SelectReleaseGroup(tp,Card.IsRace,1,1,c,RACE_ZOMBIE)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
function cm.tgfilter(c) function cm.tgfilter(c)
......
...@@ -46,8 +46,8 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -46,8 +46,8 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsRace,1,c,RACE_ZOMBIE) end if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsRace,1,c,RACE_ZOMBIE) end
local rg=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsRace,1,1,c,RACE_ZOMBIE) local rg=Duel.SelectReleaseGroup(tp,Card.IsRace,1,1,c,RACE_ZOMBIE)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
function cm.srfilter(c) function cm.srfilter(c)
......
...@@ -44,8 +44,8 @@ function cm.cfilter(c) ...@@ -44,8 +44,8 @@ function cm.cfilter(c)
return not c:IsStatus(STATUS_BATTLE_DESTROYED) return not c:IsStatus(STATUS_BATTLE_DESTROYED)
end end
function cm.rmcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,cm.cfilter,1,e:GetHandler()) end if chk==0 then return Duel.CheckReleaseGroup(tp,cm.cfilter,1,e:GetHandler()) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,cm.cfilter,1,1,e:GetHandler()) local g=Duel.SelectReleaseGroup(tp,cm.cfilter,1,1,e:GetHandler())
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.rmfilter(c) function cm.rmfilter(c)
......
...@@ -75,9 +75,9 @@ function cm.cfilter(c) ...@@ -75,9 +75,9 @@ function cm.cfilter(c)
return not c:IsStatus(STATUS_BATTLE_DESTROYED) return not c:IsStatus(STATUS_BATTLE_DESTROYED)
end end
function cm.rmcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) and Duel.CheckReleaseGroup(REASON_COST,tp,cm.cfilter,1,e:GetHandler()) end if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) and Duel.CheckReleaseGroup(tp,cm.cfilter,1,e:GetHandler()) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
local g=Duel.SelectReleaseGroup(REASON_COST,tp,cm.cfilter,1,1,e:GetHandler()) local g=Duel.SelectReleaseGroup(tp,cm.cfilter,1,1,e:GetHandler())
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -13,17 +13,24 @@ function Auxiliary.PreloadUds() ...@@ -13,17 +13,24 @@ function Auxiliary.PreloadUds()
return require_list[str] return require_list[str]
end end
local release_set={"CheckReleaseGroup","SelectReleaseGroup"} local release_set={"CheckReleaseGroup","SelectReleaseGroup"}
local release_set2={"CheckReleaseGroupEx","SelectReleaseGroupEx"}
for i,fname in pairs(release_set) do for i,fname in pairs(release_set) do
local temp_f=Duel[fname] local temp_f=Duel[fname]
Duel[fname]=function(...) Duel[fname]=function(...)
local params={...} local params={...}
local old_minc=params[3] local old_minc=params[3]
local typ=type(old_minc) local typ=type(old_minc)
if #params>2 and typ~="number" then return temp_f(table.unpack(params,2,#params)) end if #params>2 and typ~="number" then
if params[1]==REASON_COST then
return temp_f(table.unpack(params,2,#params))
else
local fname2=release_set2[i]
return Duel[fname2](table.unpack(params,2,i+3),params[1],false,table.unpack(params,i+4,#params))
end
end
return temp_f(...) return temp_f(...)
end end
end end
local release_set2={"CheckReleaseGroupEx","SelectReleaseGroupEx"}
for i,fname in pairs(release_set) do for i,fname in pairs(release_set) do
local temp_f=Duel[fname] local temp_f=Duel[fname]
Duel[fname]=function(...) Duel[fname]=function(...)
...@@ -35,6 +42,11 @@ function Auxiliary.PreloadUds() ...@@ -35,6 +42,11 @@ function Auxiliary.PreloadUds()
table.insert(tab,i+3,REASON_COST) table.insert(tab,i+3,REASON_COST)
table.insert(tab,i+4,true) table.insert(tab,i+4,true)
return temp_f(table.unpack(tab)) return temp_f(table.unpack(tab))
elseif #params>=i+3 and type(params[i+3])~="bool" then
local tab=params
table.insert(tab,i+3,REASON_COST)
table.insert(tab,i+4,true)
return temp_f(table.unpack(tab))
end end
return temp_f(...) return temp_f(...)
end end
......
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