Commit 7417c217 authored by Tachibana's avatar Tachibana

ybb

parent b4f59cc1
...@@ -1520,3 +1520,11 @@ function cm.MRSYakuSPop(e,tp,eg,ep,ev,re,r,rp) ...@@ -1520,3 +1520,11 @@ function cm.MRSYakuSPop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(c,SUMMON_VALUE_SELF,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(c,SUMMON_VALUE_SELF,tp,tp,false,false,POS_FACEUP)
end end
end end
function cm.IsInTable(value, tbl)
for k,v in ipairs(tbl) do
if v == value then
return true
end
end
return false
end
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
local m=53716001 local m=53716001
local cm=_G["c"..m] local cm=_G["c"..m]
cm.name="断片折光 幻想匿国" cm.name="断片折光 幻想匿国"
...@@ -17,7 +18,6 @@ function cm.initial_effect(c) ...@@ -17,7 +18,6 @@ function cm.initial_effect(c)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,m) e1:SetCountLimit(1,m)
e1:SetCost(cm.cost) e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op) e1:SetOperation(cm.op)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
...@@ -43,73 +43,39 @@ function cm.initial_effect(c) ...@@ -43,73 +43,39 @@ function cm.initial_effect(c)
e7:SetOperation(cm.spop) e7:SetOperation(cm.spop)
c:RegisterEffect(e7) c:RegisterEffect(e7)
end end
function cm.costfilter(c) function cm.fselect(g,ft,res)
return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable() local sel=g:IsExists(function(c)return c:IsLocation(LOCATION_SZONE) and c:GetSequence()~=5 and c:IsFaceup()end,1,nil) or ft>0
end return sel and ((res and g:IsExists(function(c)return bit.band(c:GetType(),0x20002)==0x20002 and c:IsSetCard(0x353b)end,1,nil) and #g~=2) or (not res and #g==3))
function cm.costfilter2(c)
return bit.band(c:GetType(),0x20002)==0x20002 and c:IsSetCard(0x353b) and c:IsReleasable()
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 b1=Duel.GetTurnPlayer()==1-tp and Duel.GetCurrentPhase()==PHASE_END and Duel.IsExistingMatchingCard(cm.costfilter2,tp,LOCATION_ONFIELD,0,1,nil) local costg=Duel.GetMatchingGroup(function(c)return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()end,tp,LOCATION_ONFIELD,0,nil)
local b2=Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_ONFIELD,0,3,nil) local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if chk==0 then return b1 or b2 end local res=Duel.GetTurnPlayer()==1-tp and Duel.GetCurrentPhase()==PHASE_END
if chk==0 then return costg:CheckSubGroup(cm.fselect,1,3,ft,res) and not e:GetHandler():IsForbidden() end
Duel.ConfirmCards(1-tp,e:GetHandler()) Duel.ConfirmCards(1-tp,e:GetHandler())
local opt=0 Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
if b1 and b2 then opt=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2)) local g=costg:SelectSubGroup(tp,cm.fselect,false,1,3,ft,res)
elseif b1 and not b2 then opt=0 local cg=g:Filter(Card.IsFacedown,nil)
elseif not b1 and b2 then opt=1 end if #cg>0 then Duel.ConfirmCards(1-tp,cg) end
if opt==0 then local list={}
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) for tc in aux.Next(g) do if tc:IsLocation(LOCATION_SZONE) and tc:IsFacedown() and tc:GetSequence()~=5 then table.insert(list,tc:GetSequence()) end end
local g=Duel.SelectMatchingCard(tp,cm.costfilter2,tp,LOCATION_ONFIELD,0,1,1,nil) if #list>0 then
local cg=g:Filter(Card.IsFacedown,nil) table.insert(list,5)
if #cg>0 then Duel.ConfirmCards(1-tp,cg) end e:SetLabel(table.unpack(list))
local tc=g:GetFirst() else e:SetLabel(5) end
if tc:IsLocation(LOCATION_SZONE) and tc:IsFacedown() and tc:GetSequence()<5 then Duel.Release(g,REASON_EFFECT)
local list={}
table.insert(list,tc:GetSequence())
table.insert(list,5)
e:SetLabel(table.unpack(list))
else e:SetLabel(5) end
Duel.Release(g,REASON_EFFECT)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_ONFIELD,0,3,3,nil)
local cg=g:Filter(Card.IsFacedown,nil)
if #cg>0 then Duel.ConfirmCards(1-tp,cg) end
local list={}
for tc in aux.Next(g) do
if tc:IsLocation(LOCATION_SZONE) and tc:IsFacedown() and tc:GetSequence()<5 then table.insert(list,tc:GetSequence()) end
end
if #list>0 then
table.insert(list,5)
e:SetLabel(table.unpack(list))
else e:SetLabel(5) end
Duel.Release(g,REASON_EFFECT)
end
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function cm.offilter(c,list)
return c:GetSequence()<5 and bit.band(table.unpack(list),c:GetSequence())==0
end end
function cm.op(e,tp,eg,ep,ev,re,r,rp) function cm.op(e,tp,eg,ep,ev,re,r,rp)
local list={e:GetLabel()} local list={e:GetLabel()}
local zg=Duel.GetMatchingGroup(cm.offilter,tp,LOCATION_SZONE,0,nil,list)
if #zg>0 then
for tc in aux.Next(zg) do
table.insert(list,tc:GetSequence())
end
end
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and #list<6 then local chkl=0
local filter=0 for cl=0,4 do if Duel.CheckLocation(tp,LOCATION_SZONE,cl) and not SNNM.IsInTable(cl,list) then chkl=1 end end
for i=1,#list do if not c:IsRelateToEffect(e) or chkl==0 then return end
filter=filter|1<<(list[i]+8) local filter=0
end for i=1,#list do filter=filter|1<<(list[i]+8) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local flag=Duel.SelectDisableField(tp,1,LOCATION_SZONE,0,filter) local flag=Duel.SelectDisableField(tp,1,LOCATION_SZONE,0,filter)
rsop.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true,2^(math.log(flag,2)-8)) if flag and rsop.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true,2^(math.log(flag,2)-8)) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
......
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
local m=53716004 local m=53716004
local cm=_G["c"..m] local cm=_G["c"..m]
cm.name="沉默于断片的处决" cm.name="沉默于断片的处决"
...@@ -27,7 +28,7 @@ function cm.initial_effect(c) ...@@ -27,7 +28,7 @@ function cm.initial_effect(c)
e2:SetCode(EVENT_RELEASE) e2:SetCode(EVENT_RELEASE)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCountLimit(1,m+50) e2:SetCountLimit(1,m+50)
e2:SetCondition(cm.condition) e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)end)
e2:SetTarget(cm.target) e2:SetTarget(cm.target)
e2:SetOperation(cm.operation) e2:SetOperation(cm.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -43,25 +44,24 @@ function cm.initial_effect(c) ...@@ -43,25 +44,24 @@ function cm.initial_effect(c)
e6:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e6:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e6) c:RegisterEffect(e6)
end end
function cm.costfilter2(c) function cm.fselect(g,ft)
return bit.band(c:GetType(),0x20002)==0x20002 and c:IsSetCard(0x353b) and c:IsReleasable() return g:IsExists(function(c)return c:IsLocation(LOCATION_SZONE) and c:GetSequence()~=5 and c:IsFaceup()end,1,nil) or ft>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)
local mg=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE,0,nil,0x353b) local costg=Duel.GetMatchingGroup(function(c)return bit.band(c:GetType(),0x20002)==0x20002 and c:IsSetCard(0x353b) and c:IsReleasable()end,tp,LOCATION_ONFIELD,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter2,tp,LOCATION_ONFIELD,0,1,nil) end local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if chk==0 then return costg:CheckSubGroup(cm.fselect,1,1,ft) and not e:GetHandler():IsForbidden() end
Duel.ConfirmCards(1-tp,e:GetHandler()) Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter2,tp,LOCATION_ONFIELD,0,1,1,nil) local tc=costg:SelectSubGroup(tp,cm.fselect,false,1,1,ft):GetFirst()
local cg=g:Filter(Card.IsFacedown,nil) if tc:IsFacedown() then Duel.ConfirmCards(1-tp,tc) end
if #cg>0 then Duel.ConfirmCards(1-tp,cg) end if tc:IsLocation(LOCATION_SZONE) and tc:GetSequence()~=5 then
local tc=g:GetFirst()
if tc:IsLocation(LOCATION_SZONE) then
local list={} local list={}
table.insert(list,tc:GetSequence()) table.insert(list,tc:GetSequence())
table.insert(list,5) table.insert(list,5)
e:SetLabel(table.unpack(list)) e:SetLabel(table.unpack(list))
else e:SetLabel(5) end else e:SetLabel(5) end
Duel.Release(g,REASON_EFFECT) Duel.Release(tc,REASON_EFFECT)
end end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
...@@ -70,40 +70,30 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -70,40 +70,30 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
end 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.offilter(c,list)
return c:GetSequence()<5 and bit.band(table.unpack(list),c:GetSequence())==0
end
function cm.op(e,tp,eg,ep,ev,re,r,rp) function cm.op(e,tp,eg,ep,ev,re,r,rp)
local list={e:GetLabel()} local list={e:GetLabel()}
local zg=Duel.GetMatchingGroup(cm.offilter,tp,LOCATION_SZONE,0,nil,list)
if #zg>0 then
for tc in aux.Next(zg) do
table.insert(list,tc:GetSequence())
end
end
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and #list<6 then local chkl=0
local filter=0 for cl=0,4 do if Duel.CheckLocation(tp,LOCATION_SZONE,cl) and not SNNM.IsInTable(cl,list) then chkl=1 end end
for i=1,#list do if not c:IsRelateToEffect(e) or chkl==0 then return end
filter=filter|1<<(list[i]+8) local filter=0
end for i=1,#list do filter=filter|1<<(list[i]+8) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local flag=Duel.SelectField(tp,1,LOCATION_SZONE,0,filter) local flag=Duel.SelectDisableField(tp,1,LOCATION_SZONE,0,filter)
if rsop.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true,2^(math.log(flag,2)-8)) then if flag and rsop.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true,2^(math.log(flag,2)-8)) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET) e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS) e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local mg=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE,0,nil,0x353b) local mg=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE,0,nil,0x353b)
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,nil,mg) local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,nil,mg)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil) local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),nil,mg) Duel.SynchroSummon(tp,sg:GetFirst(),nil,mg)
end
end end
end end
end end
...@@ -113,9 +103,6 @@ function cm.indtg(e,c) ...@@ -113,9 +103,6 @@ function cm.indtg(e,c)
if not ct1 or not ct2 then return false end if not ct1 or not ct2 then return false end
return math.abs(ct1-ct2)==0 and c:GetSequence()<5 return math.abs(ct1-ct2)==0 and c:GetSequence()<5
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function cm.setfilter(c) function cm.setfilter(c)
return c:IsSetCard(0x353b) and bit.band(c:GetType(),0x20004)==0x20004 and c:IsSSetable() return c:IsSetCard(0x353b) and bit.band(c:GetType(),0x20004)==0x20004 and c:IsSSetable()
end end
......
...@@ -39,7 +39,7 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -39,7 +39,7 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(cm.setfilter,tp,LOCATION_SZONE,0,1,nil) if chk==0 then return Duel.IsExistingTarget(cm.setfilter,tp,LOCATION_SZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_SZONE-LOCATION_FZONE,PLAYER_NONE,0)>0 end and Duel.GetLocationCount(tp,LOCATION_SZONE-LOCATION_FZONE,PLAYER_NONE,0)>0 end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2))
local g=Duel.SelectTarget(tp,cm.setfilter,tp,LOCATION_SZONE,0,1,1,nil) local g=Duel.SelectTarget(tp,cm.setfilter,tp,LOCATION_SZONE-LOCATION_FZONE,0,1,1,nil)
end end
function cm.op(e,tp,eg,ep,ev,re,r,rp) function cm.op(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
......
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
local m=53716010 local m=53716010
local cm=_G["c"..m] local cm=_G["c"..m]
cm.name="断片折光 幻想炉心" cm.name="断片折光 幻想炉心"
...@@ -17,7 +18,6 @@ function cm.initial_effect(c) ...@@ -17,7 +18,6 @@ function cm.initial_effect(c)
e1:SetRange(LOCATION_EXTRA) e1:SetRange(LOCATION_EXTRA)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCost(cm.cost) e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op) e1:SetOperation(cm.op)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e7=Effect.CreateEffect(c) local e7=Effect.CreateEffect(c)
...@@ -26,87 +26,63 @@ function cm.initial_effect(c) ...@@ -26,87 +26,63 @@ function cm.initial_effect(c)
e7:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e7:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e7:SetCode(EVENT_RELEASE) e7:SetCode(EVENT_RELEASE)
e7:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET) e7:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET)
e7:SetCondition(cm.condition) e7:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)end)
e7:SetTarget(cm.target) e7:SetTarget(cm.target)
e7:SetOperation(cm.operation) e7:SetOperation(cm.operation)
c:RegisterEffect(e7) c:RegisterEffect(e7)
end end
function cm.costfilter(c) function cm.fselect(g,ft)
return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable() return g:IsExists(function(c)return c:IsLocation(LOCATION_SZONE) and c:GetSequence()~=5 and c:IsFaceup()end,1,nil) or ft>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.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_ONFIELD,0,3,nil) end local costg=Duel.GetMatchingGroup(function(c)return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()end,tp,LOCATION_ONFIELD,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if chk==0 then return costg:CheckSubGroup(cm.fselect,3,3,ft) and not e:GetHandler():IsForbidden() end
Duel.ConfirmCards(1-tp,e:GetHandler()) Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_ONFIELD,0,3,3,nil) local g=costg:SelectSubGroup(tp,cm.fselect,false,3,3,ft)
local cg=g:Filter(Card.IsFacedown,nil) local cg=g:Filter(Card.IsFacedown,nil)
if #cg>0 then Duel.ConfirmCards(1-tp,cg) end if #cg>0 then Duel.ConfirmCards(1-tp,cg) end
local list={} local list={}
for tc in aux.Next(g) do for tc in aux.Next(g) do if tc:IsLocation(LOCATION_SZONE) and tc:IsFacedown() and tc:GetSequence()~=5 then table.insert(list,tc:GetSequence()) end end
if tc:IsLocation(LOCATION_SZONE) and tc:IsFacedown() and tc:GetSequence()<5 then table.insert(list,tc:GetSequence()) end
end
if #list>0 then if #list>0 then
table.insert(list,5) table.insert(list,5)
e:SetLabel(table.unpack(list)) e:SetLabel(table.unpack(list))
else e:SetLabel(5) end else e:SetLabel(5) end
Duel.Release(g,REASON_EFFECT) Duel.Release(g,REASON_EFFECT)
end end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function cm.offilter(c,list)
return c:GetSequence()<5 and bit.band(table.unpack(list),c:GetSequence())==0
end
function cm.tgfilter(c)
return c:IsFaceup() and c:IsType(TYPE_TRAP)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp) function cm.op(e,tp,eg,ep,ev,re,r,rp)
local list={e:GetLabel()} local list={e:GetLabel()}
local zg=Duel.GetMatchingGroup(cm.offilter,tp,LOCATION_SZONE,0,nil,list)
if #zg>0 then
for tc in aux.Next(zg) do
table.insert(list,tc:GetSequence())
end
end
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and #list<6 then local chkl=0
local filter=0 for cl=0,4 do if Duel.CheckLocation(tp,LOCATION_SZONE,cl) and not SNNM.IsInTable(cl,list) then chkl=1 end end
for i=1,#list do if not c:IsRelateToEffect(e) or chkl==0 then return end
filter=filter|1<<(list[i]+8) local filter=0
end for i=1,#list do filter=filter|1<<(list[i]+8) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local flag=Duel.SelectField(tp,1,LOCATION_SZONE,0,filter) local flag=Duel.SelectDisableField(tp,1,LOCATION_SZONE,0,filter)
if rsop.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true,2^(math.log(flag,2)-8)) then if flag and rsop.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true,2^(math.log(flag,2)-8)) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET) e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS) e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local g=Duel.GetMatchingGroup(cm.tgfilter,tp,LOCATION_REMOVED,0,nil) local g=Duel.GetMatchingGroup(function(c)return c:IsFaceup() and c:IsType(TYPE_TRAP)end,tp,LOCATION_REMOVED,0,nil)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:Select(tp,1,1,nil) local sg=g:Select(tp,1,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT+REASON_RETURN) Duel.SendtoGrave(sg,REASON_EFFECT+REASON_RETURN)
end
end end
end end
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function cm.filter(c,e) function cm.filter(c,e)
local se=e:GetHandler():GetPreviousSequence() local se=e:GetHandler():GetPreviousSequence()
local seq=c:GetSequence() local seq=c:GetSequence()
if seq==5 then if c:IsLocation(LOCATION_MZONE) then seq=aux.MZoneSequence(c:GetSequence()) end
seq=1 return seq<5 and math.abs(se-math.abs(seq-4))==0
elseif seq==6 then
seq=3
end
seq=math.abs(seq-4)
return seq<5 and math.abs(se-seq)==0
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)
if chkc then return cm.filter(chkc,e) and chkc:IsControler(1-tp) and chkc:IsOnField() end if chkc then return cm.filter(chkc,e) and chkc:IsControler(1-tp) and chkc:IsOnField() end
...@@ -117,7 +93,5 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -117,7 +93,5 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then Duel.SendtoGrave(tc,REASON_EFFECT) end
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end end
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
local m=53716011 local m=53716011
local cm=_G["c"..m] local cm=_G["c"..m]
cm.name="断片折光 幻想魔裔" cm.name="断片折光 幻想魔裔"
...@@ -17,7 +18,6 @@ function cm.initial_effect(c) ...@@ -17,7 +18,6 @@ function cm.initial_effect(c)
e1:SetRange(LOCATION_EXTRA) e1:SetRange(LOCATION_EXTRA)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCost(cm.cost) e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op) e1:SetOperation(cm.op)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e7=Effect.CreateEffect(c) local e7=Effect.CreateEffect(c)
...@@ -26,24 +26,26 @@ function cm.initial_effect(c) ...@@ -26,24 +26,26 @@ function cm.initial_effect(c)
e7:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e7:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e7:SetCode(EVENT_RELEASE) e7:SetCode(EVENT_RELEASE)
e7:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET) e7:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET)
e7:SetCondition(cm.condition) e7:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)end)
e7:SetTarget(cm.target) e7:SetTarget(cm.target)
e7:SetOperation(cm.operation) e7:SetOperation(cm.operation)
c:RegisterEffect(e7) c:RegisterEffect(e7)
end end
function cm.costfilter(c) function cm.fselect(g,ft)
return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable() return g:IsExists(function(c)return c:IsLocation(LOCATION_SZONE) and c:GetSequence()~=5 and c:IsFaceup()end,1,nil) or ft>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.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_ONFIELD,0,3,nil) end local costg=Duel.GetMatchingGroup(function(c)return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()end,tp,LOCATION_ONFIELD,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if chk==0 then return costg:CheckSubGroup(cm.fselect,3,3,ft) and not e:GetHandler():IsForbidden() end
Duel.ConfirmCards(1-tp,e:GetHandler()) Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_ONFIELD,0,3,3,nil) local g=costg:SelectSubGroup(tp,cm.fselect,false,3,3,ft)
local cg=g:Filter(Card.IsFacedown,nil) local cg=g:Filter(Card.IsFacedown,nil)
if #cg>0 then Duel.ConfirmCards(1-tp,cg) end if #cg>0 then Duel.ConfirmCards(1-tp,cg) end
local list={} local list={}
for tc in aux.Next(g) do for tc in aux.Next(g) do
if tc:IsLocation(LOCATION_SZONE) and tc:IsFacedown() and tc:GetSequence()<5 then table.insert(list,tc:GetSequence()) end if tc:IsLocation(LOCATION_SZONE) and tc:IsFacedown() and tc:GetSequence()~=5 then table.insert(list,tc:GetSequence()) end
end end
if #list>0 then if #list>0 then
table.insert(list,5) table.insert(list,5)
...@@ -51,56 +53,35 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -51,56 +53,35 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
else e:SetLabel(5) end else e:SetLabel(5) end
Duel.Release(g,REASON_EFFECT) Duel.Release(g,REASON_EFFECT)
end end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function cm.offilter(c,list)
return c:GetSequence()<5 and bit.band(table.unpack(list),c:GetSequence())==0
end
function cm.op(e,tp,eg,ep,ev,re,r,rp) function cm.op(e,tp,eg,ep,ev,re,r,rp)
local list={e:GetLabel()} local list={e:GetLabel()}
local zg=Duel.GetMatchingGroup(cm.offilter,tp,LOCATION_SZONE,0,nil,list)
if #zg>0 then
for tc in aux.Next(zg) do
table.insert(list,tc:GetSequence())
end
end
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and #list<6 then local chkl=0
local filter=0 for cl=0,4 do if Duel.CheckLocation(tp,LOCATION_SZONE,cl) and not SNNM.IsInTable(cl,list) then chkl=1 end end
for i=1,#list do if not c:IsRelateToEffect(e) or chkl==0 then return end
filter=filter|1<<(list[i]+8) local filter=0
end for i=1,#list do filter=filter|1<<(list[i]+8) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local flag=Duel.SelectField(tp,1,LOCATION_SZONE,0,filter) local flag=Duel.SelectDisableField(tp,1,LOCATION_SZONE,0,filter)
if rsop.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true,2^(math.log(flag,2)-8)) then if flag and rsop.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true,2^(math.log(flag,2)-8)) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET) e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS) e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1) c:RegisterEffect(e1)
if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Recover(tp,1800,REASON_EFFECT) Duel.Recover(tp,1800,REASON_EFFECT)
end
end end
end end
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function cm.filter(c,e) function cm.filter(c,e)
local se=e:GetHandler():GetPreviousSequence() local se=e:GetHandler():GetPreviousSequence()
local seq=c:GetSequence() local seq=c:GetSequence()
if seq==5 then if c:IsLocation(LOCATION_MZONE) then seq=aux.MZoneSequence(c:GetSequence()) end
seq=1 return seq<5 and math.abs(se-math.abs(seq-4))==1
elseif seq==6 then
seq=3
end
seq=math.abs(seq-4)
return seq<5 and math.abs(se-seq)==1
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)
if chkc then return cm.filter(chkc,e) and chkc:IsControler(1-tp) and chkc:IsOnField() end if chkc then return cm.filter(chkc,e) and chkc:IsControler(1-tp) and chkc:IsOnField() end
...@@ -111,7 +92,5 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -111,7 +92,5 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then Duel.SendtoGrave(tc,REASON_EFFECT) end
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end end
...@@ -40,7 +40,7 @@ function cm.cfilter(c) ...@@ -40,7 +40,7 @@ function cm.cfilter(c)
return bit.band(c:GetType(),0x20004)==0x20004 and c:IsAbleToRemoveAsCost() return bit.band(c:GetType(),0x20004)==0x20004 and c:IsAbleToRemoveAsCost()
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.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) and not e:GetHandler():IsLocation(LOCATION_ONFIELD) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler()) local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST) Duel.Remove(g,POS_FACEUP,REASON_COST)
......
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
local m=53716013 local m=53716013
local cm=_G["c"..m] local cm=_G["c"..m]
cm.name="断片折光 幻想牲都" cm.name="断片折光 幻想牲都"
...@@ -17,7 +18,6 @@ function cm.initial_effect(c) ...@@ -17,7 +18,6 @@ function cm.initial_effect(c)
e1:SetRange(LOCATION_EXTRA) e1:SetRange(LOCATION_EXTRA)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCost(cm.cost) e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op) e1:SetOperation(cm.op)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -27,49 +27,37 @@ function cm.initial_effect(c) ...@@ -27,49 +27,37 @@ function cm.initial_effect(c)
e2:SetOperation(cm.disop) e2:SetOperation(cm.disop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.costfilter(c) function cm.fselect(g,ft)
return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable() return g:IsExists(function(c)return c:IsLocation(LOCATION_SZONE) and c:GetSequence()~=5 and c:IsFaceup()end,1,nil) or ft>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.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_ONFIELD,0,2,nil) end local costg=Duel.GetMatchingGroup(function(c)return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()end,tp,LOCATION_ONFIELD,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if chk==0 then return costg:CheckSubGroup(cm.fselect,2,2,ft) and not e:GetHandler():IsForbidden() and e:GetHandler():CheckUniqueOnField(tp) end
Duel.ConfirmCards(1-tp,e:GetHandler()) Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_ONFIELD,0,2,2,nil) local g=costg:SelectSubGroup(tp,cm.fselect,false,2,2,ft)
local cg=g:Filter(Card.IsFacedown,nil) local cg=g:Filter(Card.IsFacedown,nil)
if #cg>0 then Duel.ConfirmCards(1-tp,cg) end if #cg>0 then Duel.ConfirmCards(1-tp,cg) end
local list={} local list={}
for tc in aux.Next(g) do for tc in aux.Next(g) do if tc:IsLocation(LOCATION_SZONE) and tc:IsFacedown() and tc:GetSequence()~=5 then table.insert(list,tc:GetSequence()) end end
if tc:IsLocation(LOCATION_SZONE) and tc:IsFacedown() and tc:GetSequence()<5 then table.insert(list,tc:GetSequence()) end
end
if #list>0 then if #list>0 then
table.insert(list,5) table.insert(list,5)
e:SetLabel(table.unpack(list)) e:SetLabel(table.unpack(list))
else e:SetLabel(5) end else e:SetLabel(5) end
Duel.Release(g,REASON_EFFECT) Duel.Release(g,REASON_EFFECT)
end end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function cm.offilter(c,list)
return c:GetSequence()<5 and bit.band(table.unpack(list),c:GetSequence())==0
end
function cm.op(e,tp,eg,ep,ev,re,r,rp) function cm.op(e,tp,eg,ep,ev,re,r,rp)
local list={e:GetLabel()} local list={e:GetLabel()}
local zg=Duel.GetMatchingGroup(cm.offilter,tp,LOCATION_SZONE,0,nil,list)
if #zg>0 then
for tc in aux.Next(zg) do
table.insert(list,tc:GetSequence())
end
end
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and #list<6 then local chkl=0
local filter=0 for cl=0,4 do if Duel.CheckLocation(tp,LOCATION_SZONE,cl) and not SNNM.IsInTable(cl,list) then chkl=1 end end
for i=1,#list do if not c:IsRelateToEffect(e) or chkl==0 then return end
filter=filter|1<<(list[i]+8) local filter=0
end for i=1,#list do filter=filter|1<<(list[i]+8) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local flag=Duel.SelectField(tp,1,LOCATION_SZONE,0,filter) local flag=Duel.SelectDisableField(tp,1,LOCATION_SZONE,0,filter)
rsop.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true,2^(math.log(flag,2)-8)) if flag and rsop.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true,2^(math.log(flag,2)-8)) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
......
...@@ -40,7 +40,7 @@ function cm.cfilter(c) ...@@ -40,7 +40,7 @@ function cm.cfilter(c)
return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable() return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()
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.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) and not e:GetHandler():IsLocation(LOCATION_ONFIELD) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler()) local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler())
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
......
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