Commit 324bcd93 authored by 聖園ミカ's avatar 聖園ミカ 🐟

Replace c11451904.lua

parent 2a7a3948
...@@ -33,6 +33,25 @@ function cm.initial_effect(c) ...@@ -33,6 +33,25 @@ function cm.initial_effect(c)
ge1:SetOperation(cm.checkop) ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0) Duel.RegisterEffect(ge1,0)
end end
if not PTFL_SUMMONRULE_CHECK then
PTFL_SUMMONRULE_CHECK=true
local summon_set={"Summon","MSet","SpecialSummonRule","SynchroSummon","XyzSummon","XyzSummonByRose","LinkSummon"}
for i,fname in pairs(summon_set) do
local temp_f=Duel[fname]
Duel[fname]=function(p,c,...)
temp_f(p,c,...)
c:RegisterFlagEffect(11451905,RESET_CHAIN,0,1)
end
end
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_ACTIVATING)
ge1:SetOperation(function()
local g=Duel.GetMatchingGroup(function(c) return c:GetFlagEffect(11451905)>0 end,0,0xff,0xff,nil)
for tc in aux.Next(g) do tc:ResetFlagEffect(11451905) end
end)
Duel.RegisterEffect(ge1,0)
end
end end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp) function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(ep,m,RESET_CHAIN,0,1) Duel.RegisterFlagEffect(ep,m,RESET_CHAIN,0,1)
...@@ -93,13 +112,21 @@ function cm.acfilter(c,tp) ...@@ -93,13 +112,21 @@ function cm.acfilter(c,tp)
local code,code2=c:GetCode() local code,code2=c:GetCode()
return c:IsSetCard(0xc976) and c:IsAbleToGraveAsCost() and Duel.GetFlagEffect(0,m+code+0xffffff)==0 and (not code2 or Duel.GetFlagEffect(0,m+code2+0xffffff)==0) --and not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,c:GetCode()) return c:IsSetCard(0xc976) and c:IsAbleToGraveAsCost() and Duel.GetFlagEffect(0,m+code+0xffffff)==0 and (not code2 or Duel.GetFlagEffect(0,m+code2+0xffffff)==0) --and not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,c:GetCode())
end end
function Group.ForEach(group,func,...)
if aux.GetValueType(group)=="Group" and group:GetCount()>0 then
local d_group=group:Clone()
for tc in aux.Next(d_group) do
func(tc,...)
end
end
end
function cm.acop(e,tp,eg,ep,ev,re,r,rp) function cm.acop(e,tp,eg,ep,ev,re,r,rp)
if cm[0] then return end if cm[0] then return end
if e:GetHandler():GetFlagEffect(m)>0 then return end if e:GetHandler():GetFlagEffect(m)>0 then return end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1) e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.acfilter,tp,LOCATION_DECK,0,0,1,nil,tp) local g=Duel.GetMatchingGroup(cm.acfilter,tp,LOCATION_DECK,0,nil,tp):CancelableSelect(tp,1,1,nil)
if #g>0 then if g and #g>0 then
local code,code2=g:GetFirst():GetCode() local code,code2=g:GetFirst():GetCode()
Duel.RegisterFlagEffect(0,m+code+0xffffff,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(0,m+code+0xffffff,RESET_PHASE+PHASE_END,0,1)
if code2 then Duel.RegisterFlagEffect(0,m+code2+0xffffff,RESET_PHASE+PHASE_END,0,1) end if code2 then Duel.RegisterFlagEffect(0,m+code2+0xffffff,RESET_PHASE+PHASE_END,0,1) end
...@@ -113,7 +140,7 @@ function cm.acop(e,tp,eg,ep,ev,re,r,rp) ...@@ -113,7 +140,7 @@ function cm.acop(e,tp,eg,ep,ev,re,r,rp)
end end
Duel.HintSelection(cg) Duel.HintSelection(cg)
cg:KeepAlive() cg:KeepAlive()
cg:ForEach(Card.RegisterFlagEffect,m+1,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1) cg:ForEach(Card.RegisterFlagEffect,m+0xffffff,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
local e1=Effect.CreateEffect(cg:GetFirst()) local e1=Effect.CreateEffect(cg:GetFirst())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVED) e1:SetCode(EVENT_CHAIN_SOLVED)
...@@ -126,16 +153,16 @@ function cm.acop(e,tp,eg,ep,ev,re,r,rp) ...@@ -126,16 +153,16 @@ function cm.acop(e,tp,eg,ep,ev,re,r,rp)
cm[0]=true cm[0]=true
end end
function cm.cfilterx(c) function cm.cfilterx(c)
return c:IsHasEffect(m) and c:GetFlagEffect(m+1)==0 return c:IsHasEffect(m) and c:GetFlagEffect(m+0xffffff)==0
end end
function cm.cfilter(c) function cm.cfilter(c)
return c:IsHasEffect(m) and c:GetFlagEffect(m+1)>0 and c:IsDestructable() return c:IsHasEffect(m) and c:GetFlagEffect(m+0xffffff)>0 and c:IsDestructable()
end end
function cm.desop(e,tp,eg,ep,ev,re,r,rp) function cm.desop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==ev then if e:GetLabel()==ev then
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
local cg=e:GetLabelObject():Filter(cm.cfilter,nil) local cg=e:GetLabelObject():Filter(cm.cfilter,nil)
if re:GetHandler():IsRelateToEffect(re) and re:GetHandler():IsDestructable() then cg:AddCard(re:GetHandler()) end if re:GetHandler():IsRelateToEffect(re) and re:GetHandler():IsDestructable() and re:GetHandler():GetFlagEffect(11451905)==0 then cg:AddCard(re:GetHandler()) end
if #cg>1 then if #cg>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
cg=cg:Select(tp,1,1,nil) cg=cg:Select(tp,1,1,nil)
......
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