Commit 3033fd41 authored by mallu11's avatar mallu11 Committed by GitHub

update PlaceCardsOnDeckTop/Bottom (#2030)

parent 4b2b5a9c
......@@ -2977,10 +2977,10 @@ function Auxiliary.PlaceCardsOnDeckTop(p,g,reason)
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_DECK)
local ct1=og:FilterCount(Card.IsControler,nil,p)
local ct2=og:FilterCount(Card.IsControler,nil,1-p)
if ct1>0 then
if ct1>1 then
Duel.SortDecktop(p,p,ct1)
end
if ct2>0 then
if ct2>1 then
Duel.SortDecktop(p,1-p,ct2)
end
return #og
......@@ -2993,14 +2993,18 @@ function Auxiliary.PlaceCardsOnDeckBottom(p,g,reason)
local ct1=og:FilterCount(Card.IsControler,nil,p)
local ct2=og:FilterCount(Card.IsControler,nil,1-p)
if ct1>0 then
Duel.SortDecktop(p,p,ct1)
if ct1>1 then
Duel.SortDecktop(p,p,ct1)
end
for i=1,ct1 do
local tc=Duel.GetDecktopGroup(p,1):GetFirst()
Duel.MoveSequence(tc,SEQ_DECKBOTTOM)
end
end
if ct2>0 then
Duel.SortDecktop(p,1-p,ct2)
if ct2>1 then
Duel.SortDecktop(p,1-p,ct2)
end
for i=1,ct2 do
local tc=Duel.GetDecktopGroup(1-p,1):GetFirst()
Duel.MoveSequence(tc,SEQ_DECKBOTTOM)
......
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