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

2024/5/16 调整魔人扫描器为可以取消

parent d9920d2f
Pipeline #27161 passed with stages
in 7 minutes and 23 seconds
......@@ -134,26 +134,48 @@ end
-- 让玩家选择卡片组的 min ~ max 张卡,可以取消
function RushDuel.SelectGroup(player, group, min, max)
local sg = Group.CreateGroup()
local finish = (#sg >= min and #sg <= max)
local sg = Group.CreateGroup()
local finish = (#sg >= min and #sg <= max)
while #sg < max do
local cg = group:Clone()
cg:Sub(sg)
finish = (#sg >= min and #sg <= max)
if #cg == 0 then break end
local cancel = not finish
local tc = cg:SelectUnselect(sg, player, finish, cancel, min, max)
if not tc then break end
local cg = group:Clone()
cg:Sub(sg)
finish = (#sg >= min and #sg <= max)
if #cg == 0 then
break
end
local cancel = not finish
local tc = cg:SelectUnselect(sg, player, finish, cancel, min, max)
if not tc then
break
end
if not sg:IsContains(tc) then
sg:AddCard(tc)
if #sg == max then finish = true end
if #sg == max then
finish = true
end
else
sg:RemoveCard(tc)
end
end
if finish then
return sg
else
return nil
end
end
if finish then
return sg
else
return nil
end
end
-- 让玩家可以选择卡片组的 min ~ max 张卡
function RushDuel.CanSelectGroup(player, desc, hint, group, min, max)
::cancel::
if Duel.SelectYesNo(player, desc) then
Duel.Hint(HINT_SELECTMSG, player, hint)
local sg = RushDuel.SelectGroup(player, group, min, max)
if sg == nil then
goto cancel
else
return sg
end
else
return nil
end
end
......@@ -33,14 +33,15 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmDecktop(1-tp,4)
local mg=g3:Filter(cm.filter,nil)
local draw=false
if mg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=mg:Select(tp,1,2,nil)
Duel.DisableShuffleCheck()
if Duel.SendtoGrave(sg,REASON_EFFECT)~=0 then
if RD.IsOperatedGroupExists(cm.exfilter,1,nil) then draw=true end
g1:Sub(sg)
g2:Sub(sg)
if mg:GetCount()>0 then
local sg=RD.CanSelectGroup(tp,aux.Stringid(m,1),HINTMSG_TOGRAVE,mg,1,2)
if sg then
Duel.DisableShuffleCheck()
if Duel.SendtoGrave(sg,REASON_EFFECT)~=0 then
draw=RD.IsOperatedGroupExists(cm.exfilter,1,nil)
g1:Sub(sg)
g2:Sub(sg)
end
end
end
Duel.SortDecktop(tp,tp,g1:GetCount())
......
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