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
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-scripts
Commits
3360bf34
Commit
3360bf34
authored
Dec 17, 2015
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
281fa4cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
41 deletions
+70
-41
utility.lua
utility.lua
+70
-41
No files found.
utility.lua
View file @
3360bf34
...
@@ -371,6 +371,9 @@ function Auxiliary.AddFusionProcCode2(c,code1,code2,sub,insf)
...
@@ -371,6 +371,9 @@ function Auxiliary.AddFusionProcCode2(c,code1,code2,sub,insf)
e1
:
SetOperation
(
Auxiliary
.
FOperationCode2
(
code1
,
code2
,
sub
,
insf
))
e1
:
SetOperation
(
Auxiliary
.
FOperationCode2
(
code1
,
code2
,
sub
,
insf
))
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
function
Auxiliary
.
FConditionFilter12
(
c
,
code
,
sub
)
return
c
:
IsFusionCode
(
code
)
or
(
sub
and
c
:
IsHasEffect
(
EFFECT_FUSION_SUBSTITUTE
))
end
function
Auxiliary
.
FConditionFilter21
(
c
,
code1
,
code2
)
function
Auxiliary
.
FConditionFilter21
(
c
,
code1
,
code2
)
return
c
:
IsFusionCode
(
code1
)
or
c
:
IsFusionCode
(
code2
)
return
c
:
IsFusionCode
(
code1
)
or
c
:
IsFusionCode
(
code2
)
end
end
...
@@ -383,60 +386,86 @@ function Auxiliary.FConditionCode2(code1,code2,sub,insf)
...
@@ -383,60 +386,86 @@ function Auxiliary.FConditionCode2(code1,code2,sub,insf)
--chkf: check field, default:PLAYER_NONE
--chkf: check field, default:PLAYER_NONE
return
function
(
e
,
g
,
gc
,
chkf
)
return
function
(
e
,
g
,
gc
,
chkf
)
if
g
==
nil
then
return
insf
end
if
g
==
nil
then
return
insf
end
local
mg
=
g
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
())
local
mg
=
g
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
gc
,
e
:
GetHandler
())
if
gc
then
if
gc
then
if
not
gc
:
IsCanBeFusionMaterial
(
e
:
GetHandler
())
then
return
false
end
if
not
gc
:
IsCanBeFusionMaterial
(
e
:
GetHandler
())
then
return
false
end
if
gc
:
IsHasEffect
(
EFFECT_FUSION_SUBSTITUTE
)
then
local
b1
=
0
local
b2
=
0
local
bw
=
0
return
mg
:
IsExists
(
Auxiliary
.
FConditionFilter21
,
1
,
gc
,
code1
,
code2
)
if
gc
:
IsFusionCode
(
code1
)
then
b1
=
1
end
elseif
gc
:
IsFusionCode
(
code1
)
then
if
gc
:
IsFusionCode
(
code2
)
then
b2
=
1
end
return
mg
:
IsExists
(
Card
.
IsFusionCode
,
1
,
gc
,
code2
)
if
sub
and
gc
:
IsHasEffect
(
EFFECT_FUSION_SUBSTITUTE
)
then
bw
=
1
end
elseif
gc
:
IsFusionCode
(
code2
)
then
if
b1
+
b2
+
bw
==
0
then
return
false
end
return
mg
:
IsExists
(
Card
.
IsFusionCode
,
1
,
gc
,
code1
)
if
b1
+
b2
+
bw
==
1
then
b1
=
b1
*
2
b2
=
b2
*
2
bw
=
bw
*
2
end
if
chkf
~=
PLAYER_NONE
and
Auxiliary
.
FConditionCheckF
(
gc
,
chkf
)
then
mg
=
mg
:
Filter
(
Auxiliary
.
FConditionCheckF
,
nil
,
chkf
)
end
if
b1
==
2
then
return
mg
:
IsExists
(
Auxiliary
.
FConditionFilter12
,
1
,
nil
,
code2
,
sub
)
elseif
b2
==
2
then
return
mg
:
IsExists
(
Auxiliary
.
FConditionFilter12
,
1
,
nil
,
code1
,
sub
)
elseif
bw
==
2
then
return
mg
:
IsExists
(
Auxiliary
.
FConditionFilter21
,
1
,
nil
,
code1
,
code2
)
else
else
return
false
return
mg
:
IsExists
(
Auxiliary
.
FConditionFilter22
,
1
,
nil
,
code1
,
code2
,
sub
)
end
end
end
end
local
b1
=
0
local
b2
=
0
local
b
s
=
0
local
b1
=
0
local
b2
=
0
local
b
w
=
0
local
fs
=
false
local
fs
=
chkf
==
PLAYER_NONE
local
tc
=
mg
:
GetFirst
()
local
tc
=
mg
:
GetFirst
()
while
tc
do
while
tc
do
if
tc
:
IsFusionCode
(
code1
)
then
b1
=
1
if
Auxiliary
.
FConditionCheckF
(
tc
,
chkf
)
then
fs
=
true
end
local
c1
=
0
local
c2
=
0
local
cw
=
0
elseif
tc
:
IsFusionCode
(
code2
)
then
b2
=
1
if
Auxiliary
.
FConditionCheckF
(
tc
,
chkf
)
then
fs
=
true
end
if
tc
:
IsFusionCode
(
code1
)
then
c1
=
1
end
elseif
sub
and
tc
:
IsHasEffect
(
EFFECT_FUSION_SUBSTITUTE
)
then
bs
=
1
if
Auxiliary
.
FConditionCheckF
(
tc
,
chkf
)
then
fs
=
true
end
if
tc
:
IsFusionCode
(
code2
)
then
c2
=
1
end
if
sub
and
tc
:
IsHasEffect
(
EFFECT_FUSION_SUBSTITUTE
)
then
cw
=
1
end
if
c1
+
c2
+
cw
>
0
then
if
Auxiliary
.
FConditionCheckF
(
tc
,
chkf
)
then
fs
=
true
end
if
c1
+
c2
+
cw
>
1
then
b1
=
b1
+
c1
b2
=
b2
+
c2
bw
=
bw
+
cw
elseif
c1
+
c2
+
cw
==
1
then
b1
=
b1
+
c1
*
2
b2
=
b2
+
c2
*
2
bw
=
bw
+
cw
*
2
end
end
end
tc
=
mg
:
GetNext
()
tc
=
mg
:
GetNext
()
end
end
return
b1
+
b2
+
bs
>=
2
and
(
fs
or
chkf
==
PLAYER_NONE
)
local
c1
=
0
local
c2
=
0
if
b1
==
1
then
c1
=
c1
+
1
elseif
b1
>
1
then
c2
=
c2
+
1
end
if
b2
==
1
then
c1
=
c1
+
1
elseif
b2
>
1
then
c2
=
c2
+
1
end
if
bw
==
1
then
c1
=
c1
+
1
elseif
bw
>
1
then
c2
=
c2
+
1
end
return
c2
>
0
and
c1
+
c2
>
1
and
fs
end
end
end
end
function
Auxiliary
.
FOperationCode2
(
code1
,
code2
,
sub
,
insf
)
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
,
gc
,
e
:
GetHandler
())
local
tc
=
gc
local
g1
=
nil
if
gc
then
if
gc
then
local
g1
=
nil
if
chkf
~=
PLAYER_NONE
and
Auxiliary
.
FConditionCheckF
(
gc
,
chkf
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
g
=
g
:
Filter
(
Auxiliary
.
FConditionCheckF
,
nil
,
chkf
)
if
gc
:
IsHasEffect
(
EFFECT_FUSION_SUBSTITUTE
)
then
g1
=
g
:
FilterSelect
(
tp
,
Auxiliary
.
FConditionFilter21
,
1
,
1
,
gc
,
code1
,
code2
)
elseif
gc
:
IsFusionCode
(
code1
)
then
g1
=
g
:
FilterSelect
(
tp
,
Card
.
IsFusionCode
,
1
,
1
,
gc
,
code2
)
else
g1
=
g
:
FilterSelect
(
tp
,
Card
.
IsFusionCode
,
1
,
1
,
gc
,
code1
)
end
end
Duel
.
SetFusionMaterial
(
g1
)
else
return
local
sg
=
g
:
Filter
(
Auxiliary
.
FConditionFilter22
,
nil
,
code1
,
code2
,
sub
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
if
chkf
~=
PLAYER_NONE
then
g1
=
sg
:
FilterSelect
(
tp
,
Auxiliary
.
FConditionCheckF
,
1
,
1
,
nil
,
chkf
)
else
g1
=
sg
:
Select
(
tp
,
1
,
1
,
nil
)
end
tc
=
g1
:
GetFirst
()
g
:
RemoveCard
(
tc
)
end
end
local
sg
=
g
:
Filter
(
Auxiliary
.
FConditionFilter22
,
nil
,
code1
,
code2
,
sub
)
local
b1
=
0
local
b2
=
0
local
bw
=
0
local
g1
=
nil
if
tc
:
IsFusionCode
(
code1
)
then
b1
=
1
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
if
tc
:
IsFusionCode
(
code2
)
then
b2
=
1
end
if
chkf
~=
PLAYER_NONE
then
g1
=
sg
:
FilterSelect
(
tp
,
Auxiliary
.
FConditionCheckF
,
1
,
1
,
nil
,
chkf
)
if
sub
and
tc
:
IsHasEffect
(
EFFECT_FUSION_SUBSTITUTE
)
then
bw
=
1
end
else
g1
=
sg
:
Select
(
tp
,
1
,
1
,
nil
)
end
if
b1
+
b2
+
bw
==
1
then
b1
=
b1
*
2
b2
=
b2
*
2
bw
=
bw
*
2
end
if
g1
:
GetFirst
():
IsHasEffect
(
EFFECT_FUSION_SUBSTITUTE
)
then
local
g2
=
nil
sg
:
Remove
(
Card
.
IsHasEffect
,
nil
,
EFFECT_FUSION_SUBSTITUTE
)
else
sg
:
Remove
(
Card
.
IsFusionCode
,
nil
,
g1
:
GetFirst
():
GetCode
())
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
local
g2
=
sg
:
Select
(
tp
,
1
,
1
,
nil
)
if
b1
==
2
then
g1
:
Merge
(
g2
)
g2
=
g
:
FilterSelect
(
tp
,
Auxiliary
.
FConditionFilter12
,
1
,
1
,
nil
,
code2
,
sub
)
Duel
.
SetFusionMaterial
(
g1
)
elseif
b2
==
2
then
g2
=
g
:
FilterSelect
(
tp
,
Auxiliary
.
FConditionFilter12
,
1
,
1
,
nil
,
code1
,
sub
)
elseif
bw
==
2
then
g2
=
g
:
FilterSelect
(
tp
,
Auxiliary
.
FConditionFilter21
,
1
,
1
,
nil
,
code1
,
code2
)
else
g2
=
g
:
FilterSelect
(
tp
,
Auxiliary
.
FConditionFilter22
,
1
,
1
,
nil
,
code1
,
code2
,
sub
)
end
if
g1
then
g2
:
Merge
(
g1
)
end
Duel
.
SetFusionMaterial
(
g2
)
end
end
end
end
--Fusion monster, name + name + name
--Fusion monster, name + name + name
...
@@ -989,7 +1018,7 @@ end
...
@@ -989,7 +1018,7 @@ end
function
Auxiliary
.
FConditionFilterFFR
(
c
,
f1
,
f2
,
mg
,
minc
,
chkf
)
function
Auxiliary
.
FConditionFilterFFR
(
c
,
f1
,
f2
,
mg
,
minc
,
chkf
)
if
not
f1
(
c
)
then
return
false
end
if
not
f1
(
c
)
then
return
false
end
if
chkf
==
PLAYER_NONE
or
aux
.
FConditionCheckF
(
c
,
chkf
)
then
if
chkf
==
PLAYER_NONE
or
aux
.
FConditionCheckF
(
c
,
chkf
)
then
return
mg
:
IsExists
(
f2
,
minc
,
c
)
return
m
inc
<=
0
or
m
g
:
IsExists
(
f2
,
minc
,
c
)
else
else
local
mg2
=
mg
:
Filter
(
f2
,
c
)
local
mg2
=
mg
:
Filter
(
f2
,
c
)
return
mg2
:
GetCount
()
>=
minc
and
mg2
:
IsExists
(
aux
.
FConditionCheckF
,
1
,
nil
,
chkf
)
return
mg2
:
GetCount
()
>=
minc
and
mg2
:
IsExists
(
aux
.
FConditionCheckF
,
1
,
nil
,
chkf
)
...
@@ -1036,7 +1065,7 @@ function Auxiliary.FOperationFunFunRep(f1,f2,minc,maxc,insf)
...
@@ -1036,7 +1065,7 @@ function Auxiliary.FOperationFunFunRep(f1,f2,minc,maxc,insf)
minct
=
minct
-
1
minct
=
minct
-
1
maxct
=
maxct
-
1
maxct
=
maxct
-
1
if
not
f2
(
sg
:
GetFirst
())
then
if
not
f2
(
sg
:
GetFirst
())
then
if
maxct
>
0
and
(
minct
>
0
or
Duel
.
SelectYesNo
(
tp
,
93
))
then
if
m
g1
:
GetCount
()
>
0
and
m
axct
>
0
and
(
minct
>
0
or
Duel
.
SelectYesNo
(
tp
,
93
))
then
if
minct
<=
0
then
minct
=
1
end
if
minct
<=
0
then
minct
=
1
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
local
sg
=
mg1
:
FilterSelect
(
tp
,
f2
,
minct
,
maxct
,
nil
)
local
sg
=
mg1
:
FilterSelect
(
tp
,
f2
,
minct
,
maxct
,
nil
)
...
@@ -1061,7 +1090,7 @@ function Auxiliary.FOperationFunFunRep(f1,f2,minc,maxc,insf)
...
@@ -1061,7 +1090,7 @@ function Auxiliary.FOperationFunFunRep(f1,f2,minc,maxc,insf)
mg1
:
Sub
(
sg
)
mg1
:
Sub
(
sg
)
minct
=
minct
-
1
minct
=
minct
-
1
maxct
=
maxct
-
1
maxct
=
maxct
-
1
if
maxct
>
0
and
(
minct
>
0
or
Duel
.
SelectYesNo
(
tp
,
93
))
then
if
m
g1
:
GetCount
()
>
0
and
m
axct
>
0
and
(
minct
>
0
or
Duel
.
SelectYesNo
(
tp
,
93
))
then
if
minct
<=
0
then
minct
=
1
end
if
minct
<=
0
then
minct
=
1
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
local
sg
=
mg1
:
FilterSelect
(
tp
,
f2
,
minct
,
maxct
,
nil
)
local
sg
=
mg1
:
FilterSelect
(
tp
,
f2
,
minct
,
maxct
,
nil
)
...
@@ -1080,7 +1109,7 @@ function Auxiliary.FOperationFunFunRep(f1,f2,minc,maxc,insf)
...
@@ -1080,7 +1109,7 @@ function Auxiliary.FOperationFunFunRep(f1,f2,minc,maxc,insf)
minct
=
minct
-
1
minct
=
minct
-
1
maxct
=
maxct
-
1
maxct
=
maxct
-
1
end
end
if
maxct
>
0
and
(
minct
>
0
or
Duel
.
SelectYesNo
(
tp
,
93
))
then
if
m
g
:
GetCount
()
>
0
and
m
axct
>
0
and
(
minct
>
0
or
Duel
.
SelectYesNo
(
tp
,
93
))
then
if
minct
<=
0
then
minct
=
1
end
if
minct
<=
0
then
minct
=
1
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
local
sg
=
mg
:
Select
(
tp
,
minct
,
maxct
,
nil
)
local
sg
=
mg
:
Select
(
tp
,
minct
,
maxct
,
nil
)
...
@@ -1105,7 +1134,7 @@ function Auxiliary.FOperationFunFunRep(f1,f2,minc,maxc,insf)
...
@@ -1105,7 +1134,7 @@ function Auxiliary.FOperationFunFunRep(f1,f2,minc,maxc,insf)
minct
=
minct
-
1
minct
=
minct
-
1
maxct
=
maxct
-
1
maxct
=
maxct
-
1
end
end
if
maxct
>
0
and
(
minct
>
0
or
Duel
.
SelectYesNo
(
tp
,
93
))
then
if
m
g
:
GetCount
()
>
0
and
m
axct
>
0
and
(
minct
>
0
or
Duel
.
SelectYesNo
(
tp
,
93
))
then
if
minct
<=
0
then
minct
=
1
end
if
minct
<=
0
then
minct
=
1
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
local
sg
=
mg
:
Select
(
tp
,
minct
,
maxct
,
nil
)
local
sg
=
mg
:
Select
(
tp
,
minct
,
maxct
,
nil
)
...
...
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