Commit 7417c217 authored by Tachibana's avatar Tachibana

ybb

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