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
10ec6b07
Commit
10ec6b07
authored
Jun 15, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update & fix
parent
bfb1c8bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
utility.lua
utility.lua
+15
-8
No files found.
utility.lua
View file @
10ec6b07
...
@@ -1825,23 +1825,30 @@ function Auxiliary.AddLinkProcedure(c,f,min,max,gf)
...
@@ -1825,23 +1825,30 @@ function Auxiliary.AddLinkProcedure(c,f,min,max,gf)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
function
Auxiliary
.
LConditionFilter
(
c
,
f
,
lc
)
function
Auxiliary
.
LConditionFilter
(
c
,
f
,
lc
)
if
c
:
IsLocation
(
LOCATION_HAND
)
and
not
c
:
IsHasEffect
(
EFFECT_EXTRA_LINK_MATERIAL
)
then
return
false
end
return
c
:
IsFaceup
()
and
c
:
IsCanBeLinkMaterial
(
lc
)
and
(
not
f
or
f
(
c
))
if
c
:
IsLocation
(
LOCATION_MZONE
)
and
not
c
:
IsFaceup
()
then
return
false
end
end
return
c
:
IsCanBeLinkMaterial
(
lc
)
and
(
not
f
or
f
(
c
))
function
Auxiliary
.
LExtraFilter
(
c
,
f
,
lc
)
if
c
:
IsLocation
(
LOCATION_ONFIELD
)
and
not
c
:
IsFaceup
()
then
return
false
end
return
c
:
IsHasEffect
(
EFFECT_EXTRA_LINK_MATERIAL
)
and
c
:
IsCanBeLinkMaterial
(
lc
)
and
(
not
f
or
f
(
c
))
end
end
function
Auxiliary
.
GetLinkCount
(
c
)
function
Auxiliary
.
GetLinkCount
(
c
)
if
c
:
IsType
(
TYPE_LINK
)
and
c
:
GetLink
()
>
1
then
if
c
:
IsType
(
TYPE_LINK
)
and
c
:
GetLink
()
>
1
then
return
1
+
0x10000
*
c
:
GetLink
()
return
1
+
0x10000
*
c
:
GetLink
()
else
return
1
end
else
return
1
end
end
end
function
Auxiliary
.
GetLinkMaterials
(
tp
,
f
,
lc
)
local
mg
=
Duel
.
GetMatchingGroup
(
Auxiliary
.
LConditionFilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
,
f
,
lc
)
local
mg2
=
Duel
.
GetMatchingGroup
(
Auxiliary
.
LExtraFilter
,
tp
,
LOCATION_HAND
+
LOCATION_SZONE
,
LOCATION_ONFIELD
,
nil
,
f
,
lc
)
if
mg2
:
GetCount
()
>
0
then
mg
:
Merge
(
mg2
)
end
return
mg
end
function
Auxiliary
.
LCheckOtherMaterial
(
c
,
mg
,
lc
)
function
Auxiliary
.
LCheckOtherMaterial
(
c
,
mg
,
lc
)
local
le
=
{
c
:
IsHasEffect
(
EFFECT_EXTRA_LINK_MATERIAL
)}
local
le
=
{
c
:
IsHasEffect
(
EFFECT_EXTRA_LINK_MATERIAL
)}
if
not
le
then
return
true
end
for
_
,
te
in
pairs
(
le
)
do
for
_
,
te
in
pairs
(
le
)
do
local
f
=
te
:
GetValue
()
local
f
=
te
:
GetValue
()
if
f
(
nil
,
lc
,
mg
)
then
return
tru
e
end
if
f
and
not
f
(
te
,
lc
,
mg
)
then
return
fals
e
end
end
end
return
fals
e
return
tru
e
end
end
function
Auxiliary
.
LCheckMaterialCompatibility
(
sg
,
lc
)
function
Auxiliary
.
LCheckMaterialCompatibility
(
sg
,
lc
)
for
tc
in
Auxiliary
.
Next
(
sg
)
do
for
tc
in
Auxiliary
.
Next
(
sg
)
do
...
@@ -1869,7 +1876,7 @@ function Auxiliary.LinkCondition(f,minc,maxc,gf)
...
@@ -1869,7 +1876,7 @@ function Auxiliary.LinkCondition(f,minc,maxc,gf)
if
c
==
nil
then
return
true
end
if
c
==
nil
then
return
true
end
if
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsFaceup
()
then
return
false
end
if
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsFaceup
()
then
return
false
end
local
tp
=
c
:
GetControler
()
local
tp
=
c
:
GetControler
()
local
mg
=
Duel
.
GetMatchingGroup
(
Auxiliary
.
LConditionFilter
,
tp
,
LOCATION_MZONE
+
LOCATION_HAND
,
0
,
nil
,
f
,
c
)
local
mg
=
Auxiliary
.
GetLinkMaterials
(
tp
,
f
,
c
)
local
sg
=
Auxiliary
.
GetMustMaterialGroup
(
tp
,
EFFECT_MUST_BE_LMATERIAL
)
local
sg
=
Auxiliary
.
GetMustMaterialGroup
(
tp
,
EFFECT_MUST_BE_LMATERIAL
)
if
sg
:
IsExists
(
Auxiliary
.
MustMaterialCounterFilter
,
1
,
nil
,
mg
)
then
return
false
end
if
sg
:
IsExists
(
Auxiliary
.
MustMaterialCounterFilter
,
1
,
nil
,
mg
)
then
return
false
end
local
ct
=
sg
:
GetCount
()
local
ct
=
sg
:
GetCount
()
...
@@ -1880,7 +1887,7 @@ function Auxiliary.LinkCondition(f,minc,maxc,gf)
...
@@ -1880,7 +1887,7 @@ function Auxiliary.LinkCondition(f,minc,maxc,gf)
end
end
function
Auxiliary
.
LinkTarget
(
f
,
minc
,
maxc
,
gf
)
function
Auxiliary
.
LinkTarget
(
f
,
minc
,
maxc
,
gf
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
c
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
c
)
local
mg
=
Duel
.
GetMatchingGroup
(
Auxiliary
.
LConditionFilter
,
tp
,
LOCATION_MZONE
+
LOCATION_HAND
,
0
,
nil
,
f
,
c
)
local
mg
=
Auxiliary
.
GetLinkMaterials
(
tp
,
f
,
c
)
local
bg
=
Auxiliary
.
GetMustMaterialGroup
(
tp
,
EFFECT_MUST_BE_LMATERIAL
)
local
bg
=
Auxiliary
.
GetMustMaterialGroup
(
tp
,
EFFECT_MUST_BE_LMATERIAL
)
if
#
bg
>
0
then
if
#
bg
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_LMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_LMATERIAL
)
...
...
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