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
50c969d9
Commit
50c969d9
authored
Dec 03, 2015
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
e83433ba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
36 deletions
+65
-36
utility.lua
utility.lua
+65
-36
No files found.
utility.lua
View file @
50c969d9
...
@@ -416,7 +416,6 @@ function Auxiliary.FOperationCode2(code1,code2,sub,insf)
...
@@ -416,7 +416,6 @@ function Auxiliary.FOperationCode2(code1,code2,sub,insf)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
gc
,
chkf
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
gc
,
chkf
)
local
g
=
eg
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
())
local
g
=
eg
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
())
if
gc
then
if
gc
then
if
not
gc
:
IsCanBeFusionMaterial
(
e
:
GetHandler
())
then
return
end
local
g1
=
nil
local
g1
=
nil
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
if
gc
:
IsHasEffect
(
EFFECT_FUSION_SUBSTITUTE
)
then
if
gc
:
IsHasEffect
(
EFFECT_FUSION_SUBSTITUTE
)
then
...
@@ -514,7 +513,6 @@ function Auxiliary.FOperationCode3(code1,code2,code3,sub,insf)
...
@@ -514,7 +513,6 @@ function Auxiliary.FOperationCode3(code1,code2,code3,sub,insf)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
gc
,
chkf
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
gc
,
chkf
)
local
g
=
eg
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
())
local
g
=
eg
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
())
if
gc
then
if
gc
then
if
not
gc
:
IsCanBeFusionMaterial
(
e
:
GetHandler
())
then
return
end
local
sg
=
g
:
Filter
(
Auxiliary
.
FConditionFilter31
,
gc
,
code1
,
code2
,
code3
)
local
sg
=
g
:
Filter
(
Auxiliary
.
FConditionFilter31
,
gc
,
code1
,
code2
,
code3
)
if
not
gc
:
IsHasEffect
(
EFFECT_FUSION_SUBSTITUTE
)
then
if
not
gc
:
IsHasEffect
(
EFFECT_FUSION_SUBSTITUTE
)
then
sg
:
Remove
(
Card
.
IsCode
,
nil
,
gc
:
GetCode
())
sg
:
Remove
(
Card
.
IsCode
,
nil
,
gc
:
GetCode
())
...
@@ -622,7 +620,6 @@ function Auxiliary.FOperationCode4(code1,code2,code3,code4,sub,insf)
...
@@ -622,7 +620,6 @@ function Auxiliary.FOperationCode4(code1,code2,code3,code4,sub,insf)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
gc
,
chkf
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
gc
,
chkf
)
local
g
=
eg
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
())
local
g
=
eg
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
())
if
gc
then
if
gc
then
if
not
gc
:
IsCanBeFusionMaterial
(
e
:
GetHandler
())
then
return
end
local
sg
=
g
:
Filter
(
Auxiliary
.
FConditionFilter41
,
gc
,
code1
,
code2
,
code3
,
code4
)
local
sg
=
g
:
Filter
(
Auxiliary
.
FConditionFilter41
,
gc
,
code1
,
code2
,
code3
,
code4
)
if
not
gc
:
IsHasEffect
(
EFFECT_FUSION_SUBSTITUTE
)
then
if
not
gc
:
IsHasEffect
(
EFFECT_FUSION_SUBSTITUTE
)
then
sg
:
Remove
(
Card
.
IsCode
,
nil
,
gc
:
GetCode
())
sg
:
Remove
(
Card
.
IsCode
,
nil
,
gc
:
GetCode
())
...
@@ -734,7 +731,6 @@ function Auxiliary.FOperationCodeFun(code,f,cc,sub,insf)
...
@@ -734,7 +731,6 @@ function Auxiliary.FOperationCodeFun(code,f,cc,sub,insf)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
gc
,
chkf
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
gc
,
chkf
)
local
g
=
eg
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
())
local
g
=
eg
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
())
if
gc
then
if
gc
then
if
not
gc
:
IsCanBeFusionMaterial
(
e
:
GetHandler
())
then
return
end
if
(
gc
:
IsCode
(
code
)
or
(
sub
and
gc
:
IsHasEffect
(
EFFECT_FUSION_SUBSTITUTE
)))
and
g
:
IsExists
(
f
,
cc
,
gc
)
then
if
(
gc
:
IsCode
(
code
)
or
(
sub
and
gc
:
IsHasEffect
(
EFFECT_FUSION_SUBSTITUTE
)))
and
g
:
IsExists
(
f
,
cc
,
gc
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
local
g1
=
g
:
FilterSelect
(
tp
,
f
,
cc
,
cc
,
gc
)
local
g1
=
g
:
FilterSelect
(
tp
,
f
,
cc
,
cc
,
gc
)
...
@@ -854,7 +850,6 @@ function Auxiliary.FOperationFun2(f1,f2,insf)
...
@@ -854,7 +850,6 @@ function Auxiliary.FOperationFun2(f1,f2,insf)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
gc
,
chkf
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
gc
,
chkf
)
local
g
=
eg
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
())
local
g
=
eg
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
())
if
gc
then
if
gc
then
if
not
gc
:
IsCanBeFusionMaterial
(
e
:
GetHandler
())
then
return
end
local
sg
=
Group
.
CreateGroup
()
local
sg
=
Group
.
CreateGroup
()
if
f1
(
gc
)
then
sg
:
Merge
(
g
:
Filter
(
f2
,
gc
))
end
if
f1
(
gc
)
then
sg
:
Merge
(
g
:
Filter
(
f2
,
gc
))
end
if
f2
(
gc
)
then
sg
:
Merge
(
g
:
Filter
(
f1
,
gc
))
end
if
f2
(
gc
)
then
sg
:
Merge
(
g
:
Filter
(
f1
,
gc
))
end
...
@@ -923,7 +918,6 @@ function Auxiliary.FOperationCodeRep(code,cc,sub,insf)
...
@@ -923,7 +918,6 @@ function Auxiliary.FOperationCodeRep(code,cc,sub,insf)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
gc
,
chkf
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
gc
,
chkf
)
local
g
=
eg
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
())
local
g
=
eg
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
())
if
gc
then
if
gc
then
if
not
gc
:
IsCanBeFusionMaterial
(
e
:
GetHandler
())
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
local
g1
=
g
:
FilterSelect
(
tp
,
Card
.
IsCode
,
cc
-
1
,
cc
-
1
,
gc
,
code
)
local
g1
=
g
:
FilterSelect
(
tp
,
Card
.
IsCode
,
cc
-
1
,
cc
-
1
,
gc
,
code
)
Duel
.
SetFusionMaterial
(
g1
)
Duel
.
SetFusionMaterial
(
g1
)
...
@@ -973,7 +967,6 @@ function Auxiliary.FOperationFunRep(f,cc,insf)
...
@@ -973,7 +967,6 @@ function Auxiliary.FOperationFunRep(f,cc,insf)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
gc
,
chkf
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
gc
,
chkf
)
local
g
=
eg
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
())
local
g
=
eg
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
())
if
gc
then
if
gc
then
if
not
gc
:
IsCanBeFusionMaterial
(
e
:
GetHandler
())
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
local
g1
=
g
:
FilterSelect
(
tp
,
f
,
cc
-
1
,
cc
-
1
,
gc
)
local
g1
=
g
:
FilterSelect
(
tp
,
f
,
cc
-
1
,
cc
-
1
,
gc
)
Duel
.
SetFusionMaterial
(
g1
)
Duel
.
SetFusionMaterial
(
g1
)
...
@@ -997,13 +990,12 @@ function Auxiliary.FOperationFunRep(f,cc,insf)
...
@@ -997,13 +990,12 @@ function Auxiliary.FOperationFunRep(f,cc,insf)
end
end
end
end
--Fusion monster, name + condition * minc to maxc
--Fusion monster, name + condition * minc to maxc
--may not be perfect for gc
function
Auxiliary
.
AddFusionProcCodeFunRep
(
c
,
code1
,
f
,
minc
,
maxc
,
sub
,
insf
)
function
Auxiliary
.
AddFusionProcCodeFunRep
(
c
,
code
,
f
,
minc
,
maxc
,
sub
,
insf
)
if
c
.
material_count
==
nil
then
if
c
.
material_count
==
nil
then
local
code
=
c
:
GetOriginalCode
()
local
code
=
c
:
GetOriginalCode
()
local
mt
=
_G
[
"c"
..
code
]
local
mt
=
_G
[
"c"
..
code
]
mt
.
material_count
=
1
mt
.
material_count
=
1
mt
.
material
=
{
code
}
mt
.
material
=
{
code
1
}
end
end
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
...
@@ -1017,14 +1009,20 @@ function Auxiliary.FConditionFilterCFR(c,code,sub,f,mg,minc)
...
@@ -1017,14 +1009,20 @@ function Auxiliary.FConditionFilterCFR(c,code,sub,f,mg,minc)
return
(
c
:
IsCode
(
code
)
or
(
sub
and
c
:
IsHasEffect
(
EFFECT_FUSION_SUBSTITUTE
)))
and
mg
:
IsExists
(
f
,
minc
,
c
)
return
(
c
:
IsCode
(
code
)
or
(
sub
and
c
:
IsHasEffect
(
EFFECT_FUSION_SUBSTITUTE
)))
and
mg
:
IsExists
(
f
,
minc
,
c
)
end
end
function
Auxiliary
.
FConditionCodeFunRep
(
code
,
f
,
minc
,
maxc
,
sub
,
insf
)
function
Auxiliary
.
FConditionCodeFunRep
(
code
,
f
,
minc
,
maxc
,
sub
,
insf
)
return
function
(
e
,
eg
,
gc
,
chkf
)
return
function
(
e
,
g
,
gc
,
chkf
)
if
eg
==
nil
then
return
insf
end
if
g
==
nil
then
return
insf
end
local
g
=
eg
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
())
local
mg
=
g
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
())
if
gc
then
return
(
gc
:
IsCode
(
code
)
or
sub
and
gc
:
IsHasEffect
(
EFFECT_FUSION_SUBSTITUTE
))
if
gc
then
and
g
:
IsExists
(
f
,
minc
,
gc
)
if
not
gc
:
IsCanBeFusionMaterial
(
e
:
GetHandler
())
then
return
false
end
if
(
gc
:
IsCode
(
code
)
or
(
sub
and
gc
:
IsHasEffect
(
EFFECT_FUSION_SUBSTITUTE
)))
and
mg
:
IsExists
(
f
,
minc
,
gc
)
then
return
true
elseif
f
(
gc
)
then
mg
:
RemoveCard
(
gc
)
return
mg
:
IsExists
(
aux
.
FConditionFilterCFR
,
1
,
nil
,
code
,
sub
,
f
,
mg
,
minc
-
1
)
else
return
false
end
end
end
local
mg1
=
g
:
Filter
(
aux
.
FConditionFilterCFR
,
nil
,
code
,
sub
,
f
,
g
,
minc
)
local
mg1
=
m
g
:
Filter
(
aux
.
FConditionFilterCFR
,
nil
,
code
,
sub
,
f
,
g
,
minc
)
local
mg2
=
g
:
Filter
(
f
,
nil
)
local
mg2
=
m
g
:
Filter
(
f
,
nil
)
if
chkf
~=
PLAYER_NONE
then
return
mg1
:
GetCount
()
>=
1
if
chkf
~=
PLAYER_NONE
then
return
mg1
:
GetCount
()
>=
1
and
mg1
:
FilterCount
(
Card
.
IsOnField
,
nil
)
+
mg2
:
FilterCount
(
Card
.
IsOnField
,
nil
)
~=
0
and
mg1
:
FilterCount
(
Card
.
IsOnField
,
nil
)
+
mg2
:
FilterCount
(
Card
.
IsOnField
,
nil
)
~=
0
else
return
mg1
:
GetCount
()
>=
1
end
else
return
mg1
:
GetCount
()
>=
1
end
...
@@ -1032,15 +1030,27 @@ function Auxiliary.FConditionCodeFunRep(code,f,minc,maxc,sub,insf)
...
@@ -1032,15 +1030,27 @@ function Auxiliary.FConditionCodeFunRep(code,f,minc,maxc,sub,insf)
end
end
function
Auxiliary
.
FOperationCodeFunRep
(
code
,
f
,
minc
,
maxc
,
sub
,
insf
)
function
Auxiliary
.
FOperationCodeFunRep
(
code
,
f
,
minc
,
maxc
,
sub
,
insf
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
gc
,
chkf
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
gc
,
chkf
)
local
g
=
eg
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
())
if
gc
then
if
gc
then
if
(
gc
:
IsCode
(
code
)
or
(
sub
and
gc
:
IsHasEffect
(
EFFECT_FUSION_SUBSTITUTE
)))
and
g
:
IsExists
(
f
,
minc
,
gc
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
local
g1
=
g
:
FilterSelect
(
tp
,
f
,
minc
,
maxc
,
gc
)
Duel
.
SetFusionMaterial
(
g1
)
else
g
:
RemoveCard
(
gc
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
local
g1
=
g
:
FilterSelect
(
tp
,
aux
.
FConditionFilterCFR
,
1
,
1
,
nil
,
code
,
sub
,
f
,
g
,
minc
-
1
)
if
maxc
-
1
<
1
or
(
minc
-
1
<
1
and
not
Duel
.
SelectYesNo
(
tp
,
93
))
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
local
g1
=
eg
:
FilterSelect
(
tp
,
f
,
minc
,
maxc
,
nil
)
local
g2
=
g
:
FilterSelect
(
tp
,
f
,
minc
-
1
,
maxc
-
1
,
g1
:
GetFirst
())
g1
:
Merge
(
g2
)
Duel
.
SetFusionMaterial
(
g1
)
Duel
.
SetFusionMaterial
(
g1
)
end
return
return
end
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
local
mg1
=
eg
:
FilterSelect
(
tp
,
aux
.
FConditionFilterCFR
,
1
,
1
,
nil
,
code
,
sub
,
f
,
e
g
,
minc
)
local
mg1
=
g
:
FilterSelect
(
tp
,
aux
.
FConditionFilterCFR
,
1
,
1
,
nil
,
code
,
sub
,
f
,
g
,
minc
)
local
g2
=
e
g
:
Filter
(
f
,
mg1
:
GetFirst
())
local
g2
=
g
:
Filter
(
f
,
mg1
:
GetFirst
())
local
offset
=
0
local
offset
=
0
if
chkf
~=
PLAYER_NONE
and
not
mg1
:
GetFirst
():
IsOnField
()
then
if
chkf
~=
PLAYER_NONE
and
not
mg1
:
GetFirst
():
IsOnField
()
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
...
@@ -1048,8 +1058,8 @@ function Auxiliary.FOperationCodeFunRep(code,f,minc,maxc,sub,insf)
...
@@ -1048,8 +1058,8 @@ function Auxiliary.FOperationCodeFunRep(code,f,minc,maxc,sub,insf)
mg1
:
Merge
(
mg3
)
mg1
:
Merge
(
mg3
)
g2
:
Sub
(
mg3
)
g2
:
Sub
(
mg3
)
offset
=-
1
offset
=-
1
if
maxc
-
1
<
1
or
(
minc
-
1
<
1
and
not
Duel
.
SelectYesNo
(
tp
,
93
))
then
return
end
end
end
if
offset
~=
0
and
(
maxc
-
1
<
1
or
minc
-
1
<
1
and
not
Duel
.
SelectYesNo
(
tp
,
93
))
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
local
mg2
=
g2
:
Select
(
tp
,
minc
+
offset
,
maxc
+
offset
,
nil
)
local
mg2
=
g2
:
Select
(
tp
,
minc
+
offset
,
maxc
+
offset
,
nil
)
mg1
:
Merge
(
mg2
)
mg1
:
Merge
(
mg2
)
...
@@ -1057,7 +1067,6 @@ function Auxiliary.FOperationCodeFunRep(code,f,minc,maxc,sub,insf)
...
@@ -1057,7 +1067,6 @@ function Auxiliary.FOperationCodeFunRep(code,f,minc,maxc,sub,insf)
end
end
end
end
--Fusion monster, condition1 + condition2 * minc to maxc
--Fusion monster, condition1 + condition2 * minc to maxc
--may not be perfect for gc
function
Auxiliary
.
AddFusionProcFunFunRep
(
c
,
f1
,
f2
,
minc
,
maxc
,
insf
)
function
Auxiliary
.
AddFusionProcFunFunRep
(
c
,
f1
,
f2
,
minc
,
maxc
,
insf
)
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
...
@@ -1071,12 +1080,20 @@ function Auxiliary.FConditionFilterFFR(c,f1,f2,mg,minc)
...
@@ -1071,12 +1080,20 @@ function Auxiliary.FConditionFilterFFR(c,f1,f2,mg,minc)
return
f1
(
c
)
and
mg
:
IsExists
(
f2
,
minc
,
c
)
return
f1
(
c
)
and
mg
:
IsExists
(
f2
,
minc
,
c
)
end
end
function
Auxiliary
.
FConditionFunFunRep
(
f1
,
f2
,
minc
,
maxc
,
insf
)
function
Auxiliary
.
FConditionFunFunRep
(
f1
,
f2
,
minc
,
maxc
,
insf
)
return
function
(
e
,
eg
,
gc
,
chkf
)
return
function
(
e
,
g
,
gc
,
chkf
)
if
eg
==
nil
then
return
insf
end
if
g
==
nil
then
return
insf
end
local
g
=
eg
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
())
local
mg
=
g
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
())
if
gc
then
return
f1
(
gc
)
and
g
:
IsExists
(
f2
,
minc
,
gc
)
end
if
gc
then
local
mg1
=
g
:
Filter
(
aux
.
FConditionFilterFFR
,
nil
,
f1
,
f2
,
g
,
minc
)
if
not
gc
:
IsCanBeFusionMaterial
(
e
:
GetHandler
())
then
return
false
end
local
mg2
=
g
:
Filter
(
f2
,
nil
)
if
f1
(
gc
)
and
mg
:
IsExists
(
f2
,
minc
,
gc
)
then
return
true
elseif
f2
(
gc
)
then
mg
:
RemoveCard
(
gc
)
return
mg
:
IsExists
(
aux
.
FConditionFilterFFR
,
1
,
gc
,
f1
,
f2
,
mg
,
minc
-
1
)
else
return
false
end
end
local
mg1
=
mg
:
Filter
(
aux
.
FConditionFilterFFR
,
nil
,
f1
,
f2
,
mg
,
minc
)
local
mg2
=
mg
:
Filter
(
f2
,
nil
)
if
chkf
~=
PLAYER_NONE
then
return
mg1
:
GetCount
()
>=
1
if
chkf
~=
PLAYER_NONE
then
return
mg1
:
GetCount
()
>=
1
and
mg1
:
FilterCount
(
Card
.
IsOnField
,
nil
)
+
mg2
:
FilterCount
(
Card
.
IsOnField
,
nil
)
~=
0
and
mg1
:
FilterCount
(
Card
.
IsOnField
,
nil
)
+
mg2
:
FilterCount
(
Card
.
IsOnField
,
nil
)
~=
0
else
return
mg1
:
GetCount
()
>=
1
end
else
return
mg1
:
GetCount
()
>=
1
end
...
@@ -1084,15 +1101,27 @@ function Auxiliary.FConditionFunFunRep(f1,f2,minc,maxc,insf)
...
@@ -1084,15 +1101,27 @@ function Auxiliary.FConditionFunFunRep(f1,f2,minc,maxc,insf)
end
end
function
Auxiliary
.
FOperationFunFunRep
(
f1
,
f2
,
minc
,
maxc
,
insf
)
function
Auxiliary
.
FOperationFunFunRep
(
f1
,
f2
,
minc
,
maxc
,
insf
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
gc
,
chkf
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
gc
,
chkf
)
local
g
=
eg
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
())
if
gc
then
if
gc
then
if
f1
(
gc
)
and
g
:
IsExists
(
f2
,
minc
,
gc
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
local
g1
=
g
:
FilterSelect
(
tp
,
f2
,
minc
,
maxc
,
gc
)
Duel
.
SetFusionMaterial
(
g1
)
else
g
:
RemoveCard
(
gc
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
local
g1
=
g
:
FilterSelect
(
tp
,
aux
.
FConditionFilterFFR
,
1
,
1
,
nil
,
f1
,
f2
,
g
,
minc
-
1
)
if
maxc
-
1
<
1
or
(
minc
-
1
<
1
and
not
Duel
.
SelectYesNo
(
tp
,
93
))
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
local
g1
=
eg
:
FilterSelect
(
tp
,
f2
,
minc
,
maxc
,
nil
)
local
g2
=
g
:
FilterSelect
(
tp
,
f2
,
minc
-
1
,
maxc
-
1
,
g1
:
GetFirst
())
g1
:
Merge
(
g2
)
Duel
.
SetFusionMaterial
(
g1
)
Duel
.
SetFusionMaterial
(
g1
)
end
return
return
end
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
local
mg1
=
eg
:
FilterSelect
(
tp
,
aux
.
FConditionFilterFFR
,
1
,
1
,
nil
,
f1
,
f2
,
e
g
,
minc
)
local
mg1
=
g
:
FilterSelect
(
tp
,
aux
.
FConditionFilterFFR
,
1
,
1
,
nil
,
f1
,
f2
,
g
,
minc
)
local
g2
=
e
g
:
Filter
(
f2
,
mg1
:
GetFirst
())
local
g2
=
g
:
Filter
(
f2
,
mg1
:
GetFirst
())
local
offset
=
0
local
offset
=
0
if
chkf
~=
PLAYER_NONE
and
not
mg1
:
GetFirst
():
IsOnField
()
then
if
chkf
~=
PLAYER_NONE
and
not
mg1
:
GetFirst
():
IsOnField
()
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
...
@@ -1100,8 +1129,8 @@ function Auxiliary.FOperationFunFunRep(f1,f2,minc,maxc,insf)
...
@@ -1100,8 +1129,8 @@ function Auxiliary.FOperationFunFunRep(f1,f2,minc,maxc,insf)
mg1
:
Merge
(
mg3
)
mg1
:
Merge
(
mg3
)
g2
:
Sub
(
mg3
)
g2
:
Sub
(
mg3
)
offset
=-
1
offset
=-
1
if
maxc
-
1
<
1
or
(
minc
-
1
<
1
and
not
Duel
.
SelectYesNo
(
tp
,
93
))
then
return
end
end
end
if
offset
~=
0
and
(
maxc
-
1
<
1
or
minc
-
1
<
1
and
not
Duel
.
SelectYesNo
(
tp
,
93
))
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
local
mg2
=
g2
:
Select
(
tp
,
minc
+
offset
,
maxc
+
offset
,
nil
)
local
mg2
=
g2
:
Select
(
tp
,
minc
+
offset
,
maxc
+
offset
,
nil
)
mg1
:
Merge
(
mg2
)
mg1
:
Merge
(
mg2
)
...
...
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