Commit 41867810 authored by 未闻皂名's avatar 未闻皂名

2024/12/28 可选的融合召唤、仪式召唤添加取消按钮

parent 5c83a7c6
Pipeline #32130 passed with stages
in 7 minutes and 27 seconds
......@@ -375,14 +375,24 @@ function RushDuel.GetFusionSummonData(e, tp, matfilter, spfilter, exfilter, s_ra
return fusionable, list, chkf, gc
end
-- 融合召唤 - 进行融合召唤
function RushDuel.ExecuteFusionSummon(e, tp, list, chkf, gc, mat_move)
function RushDuel.ExecuteFusionSummon(e, tp, list, chkf, gc, mat_move, cancelable)
local sg = Group.CreateGroup()
for _, data in ipairs(list) do
sg:Merge(data[3])
end
::cancel::
local fc = nil
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
local fc = sg:Select(tp, 1, 1, nil):GetFirst()
if cancelable then
local g = RushDuel.SelectGroup(tp, sg, 1, 1)
if not g then
return nil
else
fc = g:GetFirst()
end
else
fc = sg:Select(tp, 1, 1, nil):GetFirst()
end
local options = {}
for _, data in ipairs(list) do
local ce, sg = data[1], data[3]
......@@ -498,11 +508,15 @@ function RushDuel.CanFusionSummon(desc, matfilter, spfilter, exfilter, s_range,
RushDuel.FusionExtraChecker = RushDuel.FusionCheckLocation(e, self_leave, mat_check)
local fusionable, list, chkf, gc = RushDuel.GetFusionSummonData(e, tp, matfilter, spfilter, exfilter, s_range, o_range, include, leave, nil, e)
local fc = nil
::cancel::
if fusionable and Duel.SelectYesNo(tp, desc) then
if break_effect then
Duel.BreakEffect()
end
fc = RushDuel.ExecuteFusionSummon(e, tp, list, chkf, gc, mat_move)
fc = RushDuel.ExecuteFusionSummon(e, tp, list, chkf, gc, mat_move, true)
if not fc then
goto cancel
end
end
RushDuel.FusionExtraChecker = nil
return fc
......
......@@ -177,14 +177,24 @@ function RushDuel.GetRitualSummonData(e, tp, type, matfilter, spfilter, exfilter
return ritualable, list, chkf, gc
end
-- 仪式召唤 - 进行仪式召唤
function RushDuel.ExecuteRitualSummon(e, tp, type, list, chkf, gc, mat_move)
function RushDuel.ExecuteRitualSummon(e, tp, type, list, chkf, gc, mat_move, cancelable)
local sg = Group.CreateGroup()
for _, data in ipairs(list) do
sg:Merge(data[3])
end
::cancel::
local rc = nil
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
local rc = sg:Select(tp, 1, 1, nil):GetFirst()
if cancelable then
local g = RushDuel.SelectGroup(tp, sg, 1, 1)
if not g then
return nil
else
rc = g:GetFirst()
end
else
rc = sg:Select(tp, 1, 1, nil):GetFirst()
end
local options = {}
for _, data in ipairs(list) do
local ce, sg = data[1], data[3]
......@@ -303,11 +313,15 @@ function RushDuel.CanRitualSummon(desc, type, matfilter, spfilter, exfilter, s_r
RushDuel.RitualExtraChecker = RushDuel.RitualCheckLocation(e, self_leave, mat_check)
local ritualable, list, chkf, gc = RushDuel.GetRitualSummonData(e, tp, type, matfilter, spfilter, exfilter, s_range, o_range, include, leave, nil, e)
local rc = nil
::cancel::
if ritualable and Duel.SelectYesNo(tp, desc) then
if break_effect then
Duel.BreakEffect()
end
rc = RushDuel.ExecuteRitualSummon(e, tp, type, list, chkf, gc, mat_move)
rc = RushDuel.ExecuteRitualSummon(e, tp, type, list, chkf, gc, mat_move, true)
if not rc then
goto cancel
end
end
RushDuel.RitualExtraChecker = nil
return rc
......
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