Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Nanahira-Cards
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
nanahira
Nanahira-Cards
Commits
2f2b8797
Commit
2f2b8797
authored
Apr 09, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync
parent
75b55cad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
41 deletions
+18
-41
expansions/script/c37564765.lua
expansions/script/c37564765.lua
+18
-41
No files found.
expansions/script/c37564765.lua
View file @
2f2b8797
...
...
@@ -155,7 +155,7 @@ function cm.CheckGroup(g,f,cg,min,max,...)
if
#
sg
>=
min
and
#
sg
<=
max
and
f
(
sg
,
...
)
then
return
true
end
return
g
:
IsExists
(
cm
.
CheckGroupRecursive
,
1
,
sg
,
sg
,
g
,
f
,
min
,
max
,
ext_params
)
end
function
cm
.
SelectGroup
(
tp
,
desc
,
g
,
f
,
cg
,
min
,
max
,
...
)
function
cm
.
SelectGroup
New
(
tp
,
desc
,
cancelable
,
g
,
f
,
cg
,
min
,
max
,
...
)
local
min
=
min
or
1
local
max
=
max
or
#
g
local
ext_params
=
{
...
}
...
...
@@ -164,38 +164,17 @@ function cm.SelectGroup(tp,desc,g,f,cg,min,max,...)
sg
:
Merge
(
cg
)
local
ag
=
g
:
Filter
(
cm
.
CheckGroupRecursive
,
sg
,
sg
,
g
,
f
,
min
,
max
,
ext_params
)
while
#
sg
<
max
and
#
ag
>
0
do
local
seg
=
sg
:
Clone
()
seg
:
Sub
(
cg
)
local
finish
=
(
#
sg
>=
min
and
#
sg
<=
max
and
f
(
sg
,
...
))
local
seg
=
sg
-
cg
local
dmin
=#
seg
local
dmax
=
math.min
(
max
-#
cg
,
#
g
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
desc
)
local
tc
=
ag
:
SelectUnselect
(
seg
,
tp
,
finish
,
finish
,
dmin
,
dmax
)
if
not
tc
then
break
end
if
sg
:
IsContains
(
tc
)
then
sg
:
RemoveCard
(
tc
)
else
sg
:
AddCard
(
tc
)
end
ag
=
g
:
Filter
(
cm
.
CheckGroupRecursive
,
sg
,
sg
,
g
,
f
,
min
,
max
,
ext_params
)
end
return
sg
end
function
cm
.
SelectGroupWithCancel
(
tp
,
desc
,
g
,
f
,
cg
,
min
,
max
,
...
)
local
min
=
min
or
1
local
max
=
max
or
#
g
local
ext_params
=
{
...
}
local
sg
=
Group
.
CreateGroup
()
local
cg
=
cg
or
Group
.
CreateGroup
()
sg
:
Merge
(
cg
)
local
ag
=
g
:
Filter
(
cm
.
CheckGroupRecursive
,
sg
,
sg
,
g
,
f
,
min
,
max
,
ext_params
)
while
#
sg
<
max
and
#
ag
>
0
do
local
finish
=
(
#
sg
>=
min
and
#
sg
<=
max
and
f
(
sg
,
...
))
local
cancel
=
finish
or
#
sg
==
0
local
seg
=
sg
-
cg
local
dmin
=#
seg
local
dmax
=
math.min
(
max
-#
cg
,
#
g
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
desc
)
local
tc
=
ag
:
SelectUnselect
(
seg
,
tp
,
finish
,
cancel
,
dmin
,
dmax
)
local
cancel
=
finish
or
(
cancelable
and
#
seg
==
0
)
local
dmin
=#
sg
local
dmax
=
math.min
(
max
,
#
g
)
local
tc
=
nil
repeat
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
desc
)
tc
=
ag
:
SelectUnselect
(
sg
,
tp
,
finish
,
cancel
,
dmin
,
dmax
)
until
not
tc
or
ag
:
IsContains
(
tc
)
or
seg
:
IsContains
(
tc
)
if
not
tc
then
if
not
finish
then
return
end
break
...
...
@@ -209,6 +188,12 @@ function cm.SelectGroupWithCancel(tp,desc,g,f,cg,min,max,...)
end
return
sg
end
function
cm
.
SelectGroup
(
tp
,
desc
,
g
,
f
,
cg
,
min
,
max
,
...
)
return
cm
.
SelectGroupNew
(
tp
,
desc
,
false
,
g
,
f
,
cg
,
min
,
max
,
...
)
end
function
cm
.
SelectGroupWithCancel
(
tp
,
desc
,
g
,
f
,
cg
,
min
,
max
,
...
)
return
cm
.
SelectGroupNew
(
tp
,
desc
,
true
,
g
,
f
,
cg
,
min
,
max
,
...
)
end
--updated overlay
function
cm
.
OverlayCard
(
c
,
tc
,
xm
,
nchk
)
...
...
@@ -257,15 +242,7 @@ function cm.CheckFieldFilter(g,tp,c,f,...)
end
end
function
cm
.
MustMaterialCheck
(
v
,
tp
,
code
)
if
not
v
then
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
code
)
end
local
t
=
cm
.
GetValueType
(
v
)
if
t
~=
"Card"
and
t
~=
"Group"
then
error
(
"Parameter 1 must be \"
Card
\
" or \"
Group
\
"."
,
2
)
end
local
ce
=
{
Duel
.
IsPlayerAffectedByEffect
(
tp
,
code
)}
for
_
,
te
in
ipairs
(
ce
)
do
if
(
t
==
"Card"
and
v
~=
te
:
GetHandler
())
or
(
t
==
"Group"
and
not
v
:
IsExists
(
te
:
GetHandler
()))
then
return
false
end
end
return
true
return
aux
.
MustMaterialCheck
(
v
,
tp
,
code
)
end
--xyz summon of prim
function
cm
.
AddXyzProcedureRank
(
c
,
rk
,
f
,
minct
,
maxct
,
xm
,
exop
,
...
)
...
...
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