Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add aux.SelectPDS and fixed related cards #2541

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion c22842126.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function c22842126.thop(e,tp,eg,ep,ev,re,r,rp)
local sg=g:Select(tp,3,3,nil)
Duel.ConfirmCards(1-tp,sg)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND)
local tg=sg:Select(1-tp,1,1,nil)
local tg=aux.SelectPDS(sg,1-tp,1,1,nil)
tg:GetFirst():SetStatus(STATUS_TO_HAND_WITHOUT_CONFIRM,true)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
end
Expand Down
2 changes: 1 addition & 1 deletion c24393683.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function c24393683.activate(e,tp,eg,ep,ev,re,r,rp)
local p=1-tp
if e:GetLabel()==1 then p=tp end
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_ATOHAND)
local tg=sg:Select(p,1,1,nil)
local tg=aux.SelectPDS(sg,p,1,1,nil)
tg:GetFirst():SetStatus(STATUS_TO_HAND_WITHOUT_CONFIRM,true)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
end
Expand Down
4 changes: 1 addition & 3 deletions c43618262.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ function c43618262.cfop(e,tp,eg,ep,ev,re,r,rp)
if g:FilterCount(Card.IsAbleToHand,nil,tp)==0 then return end
Duel.ConfirmDecktop(1-p,5)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
Duel.PreserveSelectDeckSequence(true)
local tc=g:FilterSelect(tp,Card.IsAbleToHand,1,1,nil,tp):GetFirst()
Duel.PreserveSelectDeckSequence(false)
local tc=aux.FilterSelectPDS(g,tp,Card.IsAbleToHand,1,1,nil,tp):GetFirst()
local num=math.floor(3000/100)
local t={}
for i=1,num do
Expand Down
2 changes: 1 addition & 1 deletion c51697825.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function c51697825.activate(e,tp,eg,ep,ev,re,r,rp)
if sg then
Duel.ConfirmCards(1-tp,sg)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND)
local oc=sg:Select(1-tp,1,1,nil):GetFirst()
local oc=aux.SelectPDS(sg,1-tp,1,1,nil):GetFirst()
oc:SetStatus(STATUS_TO_HAND_WITHOUT_CONFIRM,true)
if Duel.SendtoHand(oc,1-tp,REASON_EFFECT)~=0 and oc:IsLocation(LOCATION_HAND) then
sg:RemoveCard(oc)
Expand Down
2 changes: 1 addition & 1 deletion c74191942.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function c74191942.activate(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()<5 then return end
Duel.ConfirmCards(1-tp,g)
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(74191942,1))
local sg=g:Select(1-tp,1,1,nil)
local sg=aux.SelectPDS(g,1-tp,1,1,nil)
sg:GetFirst():SetStatus(STATUS_TO_HAND_WITHOUT_CONFIRM,true)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
g:Sub(sg)
Expand Down
4 changes: 1 addition & 3 deletions c94392192.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ function c94392192.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmDecktop(1-tp,ct)
local g=Duel.GetDecktopGroup(1-tp,ct)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
Duel.PreserveSelectDeckSequence(true)
local sg=g:FilterSelect(tp,c94392192.rmfilter,1,1,nil,tp)
Duel.PreserveSelectDeckSequence(false)
local sg=aux.FilterSelectPDS(g,tp,c94392192.rmfilter,1,1,nil,tp)
if #sg>0 then
Duel.DisableShuffleCheck(true)
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
Expand Down
2 changes: 1 addition & 1 deletion c97926515.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function c97926515.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=g:Select(tp,3,3,nil)
Duel.ConfirmCards(1-tp,sg)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND)
local tg=sg:Select(1-tp,1,1,nil)
local tg=aux.SelectPDS(sg,1-tp,1,1,nil)
tg:GetFirst():SetStatus(STATUS_TO_HAND_WITHOUT_CONFIRM,true)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
end
Expand Down
2 changes: 1 addition & 1 deletion c98301564.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function c98301564.regop(e,tp,eg,ep,ev,re,r,rp)
local sg=g:Select(tp,3,3,nil)
Duel.ConfirmCards(1-tp,sg)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND)
local tg=sg:Select(1-tp,1,1,nil)
local tg=aux.SelectPDS(sg,1-tp,1,1,nil)
tg:GetFirst():SetStatus(STATUS_TO_HAND_WITHOUT_CONFIRM,true)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
end
Expand Down
23 changes: 23 additions & 0 deletions utility.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1603,3 +1603,26 @@ end
function Auxiliary.BanishRedirectCondition(e)
return e:GetHandler():IsFaceup()
end
-- Group.Select with Duel.PreserveSelectDeckSequence enabled
function Auxiliary.SelectPDS(g,...)
if #g==0 then return Group.CreateGroup() end
Duel.PreserveSelectDeckSequence(true)
local sg=g:Select(...)
Duel.PreserveSelectDeckSequence(false)
return sg
end
-- Group.FilterSelect with Duel.PreserveSelectDeckSequence enabled
function Auxiliary.FilterSelectPDS(g,...)
if #g==0 then return Group.CreateGroup() end
Duel.PreserveSelectDeckSequence(true)
local sg=g:FilterSelect(...)
Duel.PreserveSelectDeckSequence(false)
return sg
end
-- Duel.SelectMatchingCard with Duel.PreserveSelectDeckSequence enabled
function Auxiliary.SelectMatchingCardPDS(...)
Duel.PreserveSelectDeckSequence(true)
local sg=Duel.SelectMatchingCard(...)
Duel.PreserveSelectDeckSequence(false)
return sg
end