Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
P
pre-release-database-cdb
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
MyCard
pre-release-database-cdb
Commits
0bc0fadc
Commit
0bc0fadc
authored
Jan 06, 2025
by
nanahira
Committed by
wind2009
Jan 06, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
械刀婪魔皇断: use SelectWithSumEqual
parent
d20e69ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
36 deletions
+8
-36
script/c101208066.lua
script/c101208066.lua
+8
-36
No files found.
script/c101208066.lua
View file @
0bc0fadc
...
@@ -50,41 +50,13 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
...
@@ -50,41 +50,13 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
end
end
end
end
function
s
.
selgroup
(
g
,
tp
,
ct
)
function
s
.
selgroup_count
(
c
)
if
not
g
:
IsExists
(
Card
.
IsLocation
,
1
,
nil
,
LOCATION_HAND
)
then
if
c
:
IsLocation
(
LOCATION_HAND
)
then
return
g
:
Select
(
tp
,
ct
*
6
,
ct
*
6
,
nil
)
return
6
end
else
if
g
:
FilterCount
(
Card
.
IsLocation
,
nil
,
LOCATION_EXTRA
)
<
6
then
return
1
return
g
:
FilterSelect
(
tp
,
Card
.
IsLocation
,
ct
,
ct
,
nil
,
LOCATION_HAND
)
end
local
rg
=
Group
.
CreateGroup
()
while
true
do
local
cct
=
s
.
getct
(
rg
)
local
finish
=
cct
==
ct
local
sg
=
Group
.
CreateGroup
()
if
not
finish
then
sg
=
g
:
Filter
(
Card
.
IsLocation
,
nil
,
LOCATION_EXTRA
)
local
hct
=
rg
:
FilterCount
(
Card
.
IsLocation
,
nil
,
LOCATION_HAND
)
local
ectn
=
math.ceil
(
rg
:
FilterCount
(
Card
.
IsLocation
,
nil
,
LOCATION_EXTRA
)
/
6
)
if
hct
+
ectn
<
ct
then
sg
=
sg
+
g
:
Filter
(
Card
.
IsLocation
,
nil
,
LOCATION_HAND
)
end
sg
=
sg
-
rg
end
local
tc
=
sg
:
SelectUnselect
(
rg
,
tp
,
finish
,
not
finish
and
#
rg
>
0
,
cct
,
ct
)
if
tc
==
nil
then
if
finish
then
break
else
rg
:
Clear
()
end
else
if
rg
:
IsContains
(
tc
)
then
rg
:
RemoveCard
(
tc
)
else
rg
:
AddCard
(
tc
)
end
end
end
end
return
rg
end
function
s
.
selgroup
(
g
,
tp
,
ct
)
return
g
:
SelectWithSumEqual
(
tp
,
s
.
selgroup_count
,
ct
*
6
,
1
,
#
g
)
end
end
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