Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-THC-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
八宫一月
ygopro-THC-cards
Commits
fbf0f1a5
Commit
fbf0f1a5
authored
Jan 10, 2022
by
oilloillo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化选择顺序,先选融合卡1/2对应的素材都可以
parent
53a54248
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
14 deletions
+31
-14
script/c999013.lua
script/c999013.lua
+31
-14
No files found.
script/c999013.lua
View file @
fbf0f1a5
...
...
@@ -54,6 +54,13 @@ function M.fmatcheck2(c, fc, mg)
and
mg
:
IsExists
(
M
.
gridcheck
,
1
,
nil
,
fc
,
c
)
end
function
M
.
fmatcheck3
(
c
,
fc1
,
fc2
,
mg
)
if
not
mg
or
mg
:
GetCount
()
==
0
then
return
false
end
return
c
:
IsAbleToGrave
()
and
((
M
.
CheckMaterialSingle
(
c
,
fc1
)
and
mg
:
IsExists
(
M
.
gridcheck
,
1
,
nil
,
fc1
,
c
))
or
(
M
.
CheckMaterialSingle
(
c
,
fc2
)
and
mg
:
IsExists
(
M
.
gridcheck
,
1
,
nil
,
fc2
,
c
)))
end
function
M
.
gridcheck
(
c
,
fc
,
c2
)
local
tp
=
fc
:
GetControler
()
return
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
Group
.
FromCards
(
c
,
c2
),
fc
)
>
0
...
...
@@ -109,23 +116,33 @@ function M.lkop(e,tp,eg,ep,ev,re,r,rp,c)
Duel
.
ConfirmCards
(
1
-
tp
,
Group
.
FromCards
(
fc1
,
fc2
))
--
-- 排除原先matg1中的不可用素材
matg1
=
Duel
.
GetMatchingGroup
(
M
.
fmatcheck2
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
,
0
,
nil
,
fc1
,
matg2
)
-- 首次选择
-- 排除原先matg1/matg2中的不可用素材
local
sMatg1
=
Duel
.
GetMatchingGroup
(
M
.
fmatcheck2
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
,
0
,
nil
,
fc1
,
matg2
)
local
sMatg2
=
Duel
.
GetMatchingGroup
(
M
.
fmatcheck2
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
,
0
,
nil
,
fc2
,
matg1
)
-- 对两组素材中共有的卡进行处理
local
same
=
matg1
:
Filter
(
M
.
samefilter
,
nil
,
matg2
)
if
same
:
GetCount
()
==
1
then
same
=
same
:
GetFirst
()
if
matg2
:
GetCount
()
==
1
then
matg1
:
RemoveCard
(
same
)
elseif
matg1
:
GetCount
()
==
1
then
matg2
:
RemoveCard
(
same
)
end
end
local
same
=
sMatg1
:
Filter
(
M
.
samefilter
,
nil
,
sMatg2
)
local
all
=
sMatg1
:
Clone
()
all
:
Merge
(
sMatg2
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_LMATERIAL
)
local
dis1
=
matg1
:
Select
(
tp
,
1
,
1
,
nil
)
local
dis2
=
matg2
:
FilterSelect
(
tp
,
M
.
fmatcheck2
,
1
,
1
,
dis1
:
GetFirst
(),
fc2
,
dis1
)
local
dis1
=
all
:
Select
(
tp
,
1
,
1
,
nil
)
-- 第二次选择
local
mat1
=
dis1
:
GetFirst
()
local
dis2
if
same
:
IsContains
(
mat1
)
then
all
=
matg1
:
Clone
()
all
:
Merge
(
matg2
)
dis2
=
all
:
FilterSelect
(
tp
,
M
.
fmatcheck3
,
1
,
1
,
mat1
,
fc1
,
fc2
,
dis1
)
else
if
sMatg1
:
IsContains
(
mat1
)
then
dis2
=
matg2
:
FilterSelect
(
tp
,
M
.
fmatcheck2
,
1
,
1
,
mat1
,
fc2
,
dis1
)
else
dis2
=
matg1
:
FilterSelect
(
tp
,
M
.
fmatcheck2
,
1
,
1
,
mat1
,
fc1
,
dis1
)
end
end
--
dis1
:
Merge
(
dis2
)
c
:
SetMaterial
(
dis1
)
...
...
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