Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-pre-data
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
ygopro-pre-data
Commits
19d9367a
Commit
19d9367a
authored
Jun 18, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
workaround
parent
67327a25
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
204 additions
and
0 deletions
+204
-0
script/c100334004.lua
script/c100334004.lua
+102
-0
script/c100334006.lua
script/c100334006.lua
+102
-0
No files found.
script/c100334004.lua
View file @
19d9367a
...
...
@@ -2,6 +2,108 @@
--Micro Coder
--Script by nekrozar
function
c100334004
.
initial_effect
(
c
)
--temp
if
EFFECT_EXTRA_LINK_MATERIAL
==
nil
then
EFFECT_EXTRA_LINK_MATERIAL
=
358
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
function
Auxiliary
.
GetLinkCount
(
c
)
if
c
:
IsType
(
TYPE_LINK
)
and
c
:
GetLink
()
>
1
then
return
1
+
0x10000
*
c
:
GetLink
()
else
return
1
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
,
sg
,
lc
)
local
le
=
{
c
:
IsHasEffect
(
EFFECT_EXTRA_LINK_MATERIAL
)}
for
_
,
te
in
pairs
(
le
)
do
local
f
=
te
:
GetValue
()
if
f
and
not
f
(
te
,
lc
,
sg
)
then
return
false
end
end
return
true
end
function
Auxiliary
.
LCheckMaterialCompatibility
(
sg
,
lc
)
for
tc
in
Auxiliary
.
Next
(
sg
)
do
local
mg
=
sg
:
Filter
(
aux
.
TRUE
,
tc
)
local
res
=
Auxiliary
.
LCheckOtherMaterial
(
tc
,
mg
,
lc
)
mg
:
DeleteGroup
()
if
not
res
then
return
false
end
end
return
true
end
function
Auxiliary
.
LCheckRecursive
(
c
,
tp
,
sg
,
mg
,
lc
,
ct
,
minc
,
maxc
,
gf
)
sg
:
AddCard
(
c
)
ct
=
ct
+
1
local
res
=
Auxiliary
.
LCheckMaterialCompatibility
(
sg
,
lc
)
and
(
Auxiliary
.
LCheckGoal
(
tp
,
sg
,
lc
,
minc
,
ct
,
gf
)
or
ct
<
maxc
and
mg
:
IsExists
(
Auxiliary
.
LCheckRecursive
,
1
,
sg
,
tp
,
sg
,
mg
,
lc
,
ct
,
minc
,
maxc
,
gf
))
sg
:
RemoveCard
(
c
)
ct
=
ct
-
1
return
res
end
function
Auxiliary
.
LCheckGoal
(
tp
,
sg
,
lc
,
minc
,
ct
,
gf
)
return
ct
>=
minc
and
sg
:
CheckWithSumEqual
(
Auxiliary
.
GetLinkCount
,
lc
:
GetLink
(),
ct
,
ct
)
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
sg
,
lc
)
>
0
and
(
not
gf
or
gf
(
sg
))
end
function
Auxiliary
.
LinkCondition
(
f
,
minc
,
maxc
,
gf
)
return
function
(
e
,
c
)
if
c
==
nil
then
return
true
end
if
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsFaceup
()
then
return
false
end
local
tp
=
c
:
GetControler
()
local
mg
=
Auxiliary
.
GetLinkMaterials
(
tp
,
f
,
c
)
local
sg
=
Auxiliary
.
GetMustMaterialGroup
(
tp
,
EFFECT_MUST_BE_LMATERIAL
)
if
sg
:
IsExists
(
Auxiliary
.
MustMaterialCounterFilter
,
1
,
nil
,
mg
)
then
return
false
end
local
ct
=
sg
:
GetCount
()
if
ct
>
maxc
then
return
false
end
return
Auxiliary
.
LCheckGoal
(
tp
,
sg
,
c
,
minc
,
ct
,
gf
)
or
mg
:
IsExists
(
Auxiliary
.
LCheckRecursive
,
1
,
sg
,
tp
,
sg
,
mg
,
c
,
ct
,
minc
,
maxc
,
gf
)
end
end
function
Auxiliary
.
LinkTarget
(
f
,
minc
,
maxc
,
gf
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
c
)
local
mg
=
Auxiliary
.
GetLinkMaterials
(
tp
,
f
,
c
)
local
bg
=
Auxiliary
.
GetMustMaterialGroup
(
tp
,
EFFECT_MUST_BE_LMATERIAL
)
if
#
bg
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_LMATERIAL
)
bg
:
Select
(
tp
,
#
bg
,
#
bg
,
nil
)
end
local
sg
=
Group
.
CreateGroup
()
sg
:
Merge
(
bg
)
local
finish
=
false
while
#
sg
<
maxc
do
finish
=
Auxiliary
.
LCheckGoal
(
tp
,
sg
,
c
,
minc
,
#
sg
,
gf
)
local
cg
=
mg
:
Filter
(
Auxiliary
.
LCheckRecursive
,
sg
,
tp
,
sg
,
mg
,
c
,
#
sg
,
minc
,
maxc
,
gf
)
if
#
cg
==
0
then
break
end
local
cancel
=
not
finish
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_LMATERIAL
)
local
tc
=
cg
:
SelectUnselect
(
sg
,
tp
,
finish
,
cancel
,
minc
,
maxc
)
if
not
tc
then
break
end
if
not
bg
:
IsContains
(
tc
)
then
if
not
sg
:
IsContains
(
tc
)
then
sg
:
AddCard
(
tc
)
if
#
sg
==
maxc
then
finish
=
true
end
else
sg
:
RemoveCard
(
tc
)
end
elseif
#
bg
>
0
and
#
sg
<=#
bg
then
return
false
end
end
if
finish
then
sg
:
KeepAlive
()
e
:
SetLabelObject
(
sg
)
return
true
else
return
false
end
end
end
end
--hand link
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
...
...
script/c100334006.lua
View file @
19d9367a
...
...
@@ -2,6 +2,108 @@
--Code Radiator
--Script by nekrozar
function
c100334006
.
initial_effect
(
c
)
--temp
if
EFFECT_EXTRA_LINK_MATERIAL
==
nil
then
EFFECT_EXTRA_LINK_MATERIAL
=
358
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
function
Auxiliary
.
GetLinkCount
(
c
)
if
c
:
IsType
(
TYPE_LINK
)
and
c
:
GetLink
()
>
1
then
return
1
+
0x10000
*
c
:
GetLink
()
else
return
1
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
,
sg
,
lc
)
local
le
=
{
c
:
IsHasEffect
(
EFFECT_EXTRA_LINK_MATERIAL
)}
for
_
,
te
in
pairs
(
le
)
do
local
f
=
te
:
GetValue
()
if
f
and
not
f
(
te
,
lc
,
sg
)
then
return
false
end
end
return
true
end
function
Auxiliary
.
LCheckMaterialCompatibility
(
sg
,
lc
)
for
tc
in
Auxiliary
.
Next
(
sg
)
do
local
mg
=
sg
:
Filter
(
aux
.
TRUE
,
tc
)
local
res
=
Auxiliary
.
LCheckOtherMaterial
(
tc
,
mg
,
lc
)
mg
:
DeleteGroup
()
if
not
res
then
return
false
end
end
return
true
end
function
Auxiliary
.
LCheckRecursive
(
c
,
tp
,
sg
,
mg
,
lc
,
ct
,
minc
,
maxc
,
gf
)
sg
:
AddCard
(
c
)
ct
=
ct
+
1
local
res
=
Auxiliary
.
LCheckMaterialCompatibility
(
sg
,
lc
)
and
(
Auxiliary
.
LCheckGoal
(
tp
,
sg
,
lc
,
minc
,
ct
,
gf
)
or
ct
<
maxc
and
mg
:
IsExists
(
Auxiliary
.
LCheckRecursive
,
1
,
sg
,
tp
,
sg
,
mg
,
lc
,
ct
,
minc
,
maxc
,
gf
))
sg
:
RemoveCard
(
c
)
ct
=
ct
-
1
return
res
end
function
Auxiliary
.
LCheckGoal
(
tp
,
sg
,
lc
,
minc
,
ct
,
gf
)
return
ct
>=
minc
and
sg
:
CheckWithSumEqual
(
Auxiliary
.
GetLinkCount
,
lc
:
GetLink
(),
ct
,
ct
)
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
sg
,
lc
)
>
0
and
(
not
gf
or
gf
(
sg
))
end
function
Auxiliary
.
LinkCondition
(
f
,
minc
,
maxc
,
gf
)
return
function
(
e
,
c
)
if
c
==
nil
then
return
true
end
if
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsFaceup
()
then
return
false
end
local
tp
=
c
:
GetControler
()
local
mg
=
Auxiliary
.
GetLinkMaterials
(
tp
,
f
,
c
)
local
sg
=
Auxiliary
.
GetMustMaterialGroup
(
tp
,
EFFECT_MUST_BE_LMATERIAL
)
if
sg
:
IsExists
(
Auxiliary
.
MustMaterialCounterFilter
,
1
,
nil
,
mg
)
then
return
false
end
local
ct
=
sg
:
GetCount
()
if
ct
>
maxc
then
return
false
end
return
Auxiliary
.
LCheckGoal
(
tp
,
sg
,
c
,
minc
,
ct
,
gf
)
or
mg
:
IsExists
(
Auxiliary
.
LCheckRecursive
,
1
,
sg
,
tp
,
sg
,
mg
,
c
,
ct
,
minc
,
maxc
,
gf
)
end
end
function
Auxiliary
.
LinkTarget
(
f
,
minc
,
maxc
,
gf
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
c
)
local
mg
=
Auxiliary
.
GetLinkMaterials
(
tp
,
f
,
c
)
local
bg
=
Auxiliary
.
GetMustMaterialGroup
(
tp
,
EFFECT_MUST_BE_LMATERIAL
)
if
#
bg
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_LMATERIAL
)
bg
:
Select
(
tp
,
#
bg
,
#
bg
,
nil
)
end
local
sg
=
Group
.
CreateGroup
()
sg
:
Merge
(
bg
)
local
finish
=
false
while
#
sg
<
maxc
do
finish
=
Auxiliary
.
LCheckGoal
(
tp
,
sg
,
c
,
minc
,
#
sg
,
gf
)
local
cg
=
mg
:
Filter
(
Auxiliary
.
LCheckRecursive
,
sg
,
tp
,
sg
,
mg
,
c
,
#
sg
,
minc
,
maxc
,
gf
)
if
#
cg
==
0
then
break
end
local
cancel
=
not
finish
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_LMATERIAL
)
local
tc
=
cg
:
SelectUnselect
(
sg
,
tp
,
finish
,
cancel
,
minc
,
maxc
)
if
not
tc
then
break
end
if
not
bg
:
IsContains
(
tc
)
then
if
not
sg
:
IsContains
(
tc
)
then
sg
:
AddCard
(
tc
)
if
#
sg
==
maxc
then
finish
=
true
end
else
sg
:
RemoveCard
(
tc
)
end
elseif
#
bg
>
0
and
#
sg
<=#
bg
then
return
false
end
end
if
finish
then
sg
:
KeepAlive
()
e
:
SetLabelObject
(
sg
)
return
true
else
return
false
end
end
end
end
--hand link
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
...
...
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