Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-scripts
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-scripts
Commits
2612ab25
You need to sign in or sign up before continuing.
Commit
2612ab25
authored
Feb 17, 2019
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revert #1129
it may cause strange problems
parent
3ccec12f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
29 deletions
+5
-29
utility.lua
utility.lua
+5
-29
No files found.
utility.lua
View file @
2612ab25
...
...
@@ -2008,32 +2008,10 @@ function Auxiliary.GetMultiLinkedZone(tp)
end
return
multi_linked_zone
end
function
Auxiliary
.
GetGroupKey
(
g
)
local
v
=
0
for
c
in
Auxiliary
.
Next
(
g
)
do
math.randomseed
(
c
:
GetFieldID
()
+
1
)
v
=
v
+
math.random
()
end
return
v
+#
g
end
function
Auxiliary
.
LookupSubGroupCache
(
cache
,
sg
)
local
res
=
cache
[
Auxiliary
.
GetGroupKey
(
sg
)]
return
res
,(
res
==
1
)
end
function
Auxiliary
.
StoreSubGroupCache
(
cache
,
sg
,
res
)
cache
[
Auxiliary
.
GetGroupKey
(
sg
)]
=
(
res
and
1
or
0
)
end
function
Auxiliary
.
CheckGroupRecursive
(
c
,
sg
,
g
,
cache
,
f
,
min
,
max
,
ext_params
)
function
Auxiliary
.
CheckGroupRecursive
(
c
,
sg
,
g
,
f
,
min
,
max
,
ext_params
)
sg
:
AddCard
(
c
)
local
res
=
false
local
found
,
data
=
Auxiliary
.
LookupSubGroupCache
(
cache
,
sg
)
if
found
then
res
=
data
else
res
=
(
#
sg
>=
min
and
#
sg
<=
max
and
f
(
sg
,
table.unpack
(
ext_params
)))
or
(
#
sg
<
max
and
g
:
IsExists
(
Auxiliary
.
CheckGroupRecursive
,
1
,
sg
,
sg
,
g
,
cache
,
f
,
min
,
max
,
ext_params
))
Auxiliary
.
StoreSubGroupCache
(
cache
,
sg
,
res
)
end
local
res
=
(
#
sg
>=
min
and
#
sg
<=
max
and
f
(
sg
,
table.unpack
(
ext_params
)))
or
(
#
sg
<
max
and
g
:
IsExists
(
Auxiliary
.
CheckGroupRecursive
,
1
,
sg
,
sg
,
g
,
f
,
min
,
max
,
ext_params
))
sg
:
RemoveCard
(
c
)
return
res
end
...
...
@@ -2045,8 +2023,7 @@ function Group.CheckSubGroup(g,f,min,max,...)
local
sg
=
Duel
.
GrabSelectedCard
()
if
#
sg
>
max
or
#
(
g
+
sg
)
<
min
or
#
sg
==
max
and
not
f
(
sg
,
...
)
then
return
false
end
if
#
sg
>=
min
and
#
sg
<=
max
and
f
(
sg
,
...
)
then
return
true
end
local
cache
=
{}
return
g
:
IsExists
(
Auxiliary
.
CheckGroupRecursive
,
1
,
sg
,
sg
,
g
,
cache
,
f
,
min
,
max
,
ext_params
)
return
g
:
IsExists
(
Auxiliary
.
CheckGroupRecursive
,
1
,
sg
,
sg
,
g
,
f
,
min
,
max
,
ext_params
)
end
function
Group
.
SelectSubGroup
(
g
,
tp
,
f
,
cancelable
,
min
,
max
,
...
)
local
min
=
min
or
1
...
...
@@ -2060,9 +2037,8 @@ function Group.SelectSubGroup(g,tp,f,cancelable,min,max,...)
end
sg
:
Merge
(
fg
)
local
finish
=
(
#
sg
>=
min
and
#
sg
<=
max
and
f
(
sg
,
...
))
local
cache
=
{}
while
#
sg
<
max
do
local
cg
=
g
:
Filter
(
Auxiliary
.
CheckGroupRecursive
,
sg
,
sg
,
g
,
cache
,
f
,
min
,
max
,
ext_params
)
local
cg
=
g
:
Filter
(
Auxiliary
.
CheckGroupRecursive
,
sg
,
sg
,
g
,
f
,
min
,
max
,
ext_params
)
finish
=
(
#
sg
>=
min
and
#
sg
<=
max
and
f
(
sg
,
...
))
if
#
cg
==
0
then
break
end
local
cancel
=
not
finish
and
cancelable
...
...
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