Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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
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
MyCard
ygopro-2pick
Commits
f3b12c40
Commit
f3b12c40
authored
Jan 14, 2018
by
wind2009
Committed by
GitHub
Jan 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add pickcheck
parent
396b87f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
4 deletions
+30
-4
2pick/pick.lua
2pick/pick.lua
+30
-4
No files found.
2pick/pick.lua
View file @
f3b12c40
...
...
@@ -76,21 +76,47 @@ function Auxiliary.SaveDeck()
Duel
.
SavePickDeck
(
p
,
g
)
end
end
function
Group
.
CheckGroup
(
g
,
card_id
)
return
g
:
IsExists
(
Card
.
IsCode
,
1
,
nil
,
card_id
)
end
function
Auxiliary
.
SinglePick
(
p
,
list
,
count
,
ex_list
,
ex_count
,
copy
)
if
not
Duel
.
IsPlayerNeedToPickDeck
(
p
)
then
return
end
local
g1
=
Group
.
CreateGroup
()
local
g2
=
Group
.
CreateGroup
()
local
ag
=
Group
.
CreateGroup
()
local
plist
=
list
[
p
]
for
_
,
g
in
ipairs
({
g1
,
g2
})
do
for
i
=
1
,
count
do
--for i=1,count do
-- local code=plist[math.random(#plist)]
-- g:AddCard(Duel.CreateToken(p,code))
--end
local
pick_count
=
0
while
pick_count
<
count
do
local
code
=
plist
[
math.random
(
#
plist
)]
g
:
AddCard
(
Duel
.
CreateToken
(
p
,
code
))
if
not
ag
:
CheckGroup
(
code
)
then
local
card
=
Duel
.
CreateToken
(
p
,
code
)
g
:
AddCard
(
card
)
ag
:
AddCard
(
card
)
pick_count
=
pick_count
+
1
end
end
if
ex_list
and
ex_count
then
--for i=1,ex_count do
-- local code=ex_plist[math.random(#ex_plist)]
-- g:AddCard(Duel.CreateToken(p,code))
--end
local
ex_plist
=
ex_list
[
p
]
for
i
=
1
,
ex_count
do
local
ex_pick_count
=
0
while
ex_pick_count
<
ex_count
do
local
code
=
ex_plist
[
math.random
(
#
ex_plist
)]
g
:
AddCard
(
Duel
.
CreateToken
(
p
,
code
))
if
not
ag
:
CheckGroup
(
code
)
then
local
card
=
Duel
.
CreateToken
(
p
,
code
)
g
:
AddCard
(
card
)
ag
:
AddCard
(
card
)
ex_pick_count
=
ex_pick_count
+
1
end
end
end
Duel
.
SendtoDeck
(
g
,
nil
,
0
,
REASON_RULE
)
...
...
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