Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
REIKAI
ygopro
Commits
1e1a146e
Commit
1e1a146e
authored
Feb 09, 2019
by
Wind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Auxiliary.ArbitraryPick
parent
5edce42d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
+69
-0
2pick/pick.lua
2pick/pick.lua
+69
-0
No files found.
2pick/pick.lua
View file @
1e1a146e
...
@@ -190,6 +190,75 @@ function Auxiliary.SinglePick(p,list,count,ex_list,ex_count,copy,lv_diff,fixed,p
...
@@ -190,6 +190,75 @@ function Auxiliary.SinglePick(p,list,count,ex_list,ex_count,copy,lv_diff,fixed,p
Duel
.
SendtoDeck
(
g3
,
nil
,
0
,
REASON_RULE
)
Duel
.
SendtoDeck
(
g3
,
nil
,
0
,
REASON_RULE
)
end
end
end
end
function
Auxiliary
.
ArbitraryPick
(
p
,
count
,
list
,
list_count
,
ex_list
,
ex_count
,
copy
,
lv_diff
,
fixed
)
if
not
Duel
.
IsPlayerNeedToPickDeck
(
p
)
then
return
end
local
ag
=
Group
.
CreateGroup
()
local
pg
=
Group
.
CreateGroup
()
local
eg
=
Group
.
CreateGroup
()
local
plist
=
list
[
p
]
local
pick_count
=
0
while
pick_count
<
list_count
do
local
code
=
plist
[
math.random
(
#
plist
)]
local
lv
=
Duel
.
ReadCard
(
code
,
CARDDATA_LEVEL
)
if
not
ag
:
IsExists
(
Card
.
IsCode
,
1
,
nil
,
code
)
and
not
(
lv_diff
and
pg
:
IsExists
(
Card
.
IsLevel
,
1
,
nil
,
lv
))
then
local
card
=
Duel
.
CreateToken
(
p
,
code
)
ag
:
AddCard
(
card
)
pg
:
AddCard
(
card
)
pick_count
=
pick_count
+
1
end
end
if
ex_list
and
ex_count
then
local
ex_plist
=
ex_list
[
p
]
local
ex_pick_count
=
0
while
ex_pick_count
<
ex_count
do
local
code
=
ex_plist
[
math.random
(
#
ex_plist
)]
local
lv
=
Duel
.
ReadCard
(
code
,
CARDDATA_LEVEL
)
if
not
ag
:
IsExists
(
Card
.
IsCode
,
1
,
nil
,
code
)
and
not
(
lv_diff
and
eg
:
IsExists
(
Card
.
IsLevel
,
1
,
nil
,
lv
))
then
local
card
=
Duel
.
CreateToken
(
p
,
code
)
ag
:
AddCard
(
card
)
eg
:
AddCard
(
card
)
ex_pick_count
=
ex_pick_count
+
1
end
end
end
if
fixed
then
for
_
,
code
in
ipairs
(
fixed
)
do
local
card
=
Duel
.
CreateToken
(
p
,
code
)
ag
:
AddCard
(
card
)
end
end
Duel
.
SendtoDeck
(
ag
,
nil
,
0
,
REASON_RULE
)
Duel
.
ResetTimeLimit
(
p
,
90
)
local
tg
=
Group
.
CreateGroup
()
local
rg
=
ag
while
true
do
local
finish
=
tg
:
GetCount
()
==
count
Duel
.
Hint
(
HINT_SELECTMSG
,
p
,
HINTMSG_TODECK
)
local
sc
=
rg
:
SelectUnselect
(
tg
,
p
,
finish
,
false
,
count
,
count
)
if
not
sc
then
break
end
if
tg
:
IsContains
(
sc
)
then
tg
:
RemoveCard
(
sc
)
rg
:
AddCard
(
sc
)
else
tg
:
AddCard
(
sc
)
rg
:
RemoveCard
(
sc
)
end
end
if
tg
:
GetFirst
():
IsLocation
(
LOCATION_DECK
)
then
Duel
.
ConfirmCards
(
p
,
tg
)
end
Duel
.
Exile
(
rg
,
REASON_RULE
)
if
copy
then
local
g3
=
Group
.
CreateGroup
()
for
nc
in
aux
.
Next
(
tg
)
do
local
copy_code
=
nc
:
GetOriginalCode
()
g3
:
AddCard
(
Duel
.
CreateToken
(
p
,
copy_code
))
end
Duel
.
SendtoDeck
(
g3
,
nil
,
0
,
REASON_RULE
)
end
end
function
Auxiliary
.
StartPick
(
e
)
function
Auxiliary
.
StartPick
(
e
)
for
p
=
0
,
1
do
for
p
=
0
,
1
do
if
Duel
.
IsPlayerNeedToPickDeck
(
p
)
then
if
Duel
.
IsPlayerNeedToPickDeck
(
p
)
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment