Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-222DIY-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
Soulgamer
ygopro-222DIY-cards
Commits
a6a72417
Commit
a6a72417
authored
Sep 02, 2021
by
Tachibana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndyd
parent
21a6e952
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
748 additions
and
748 deletions
+748
-748
expansions/script/c12011029.lua
expansions/script/c12011029.lua
+6
-6
expansions/script/c4212211.lua
expansions/script/c4212211.lua
+60
-60
expansions/script/c4231001.lua
expansions/script/c4231001.lua
+64
-64
expansions/script/c4231002.lua
expansions/script/c4231002.lua
+64
-64
expansions/script/c4231003.lua
expansions/script/c4231003.lua
+59
-59
expansions/script/c4231004.lua
expansions/script/c4231004.lua
+68
-68
expansions/script/c4231005.lua
expansions/script/c4231005.lua
+73
-73
expansions/script/c4231006.lua
expansions/script/c4231006.lua
+83
-83
expansions/script/c4231007.lua
expansions/script/c4231007.lua
+81
-81
expansions/script/c4231008.lua
expansions/script/c4231008.lua
+57
-57
expansions/script/c4231009.lua
expansions/script/c4231009.lua
+133
-133
No files found.
expansions/script/c12011029.lua
View file @
a6a72417
...
@@ -12,9 +12,9 @@ function c12011029.initial_effect(c)
...
@@ -12,9 +12,9 @@ function c12011029.initial_effect(c)
.
e
(
"SetCondition"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetCondition"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_XYZ
)
end
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_XYZ
)
end
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c12011029
.
cfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
end
)
return
Duel
.
IsExistingMatchingCard
(
c12011029
.
cfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
end
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c12011029
.
cfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c12011029
.
cfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Overlay
(
e
:
GetHandler
(),
g
)
end
if
g
:
GetCount
()
>
0
then
Duel
.
Overlay
(
e
:
GetHandler
(),
g
)
end
end
)
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
...
@@ -32,13 +32,13 @@ function c12011029.initial_effect(c)
...
@@ -32,13 +32,13 @@ function c12011029.initial_effect(c)
if
g
:
GetCount
()
>
0
and
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
~=
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
if
g
:
GetCount
()
>
0
and
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
~=
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
if
Duel
.
SelectYesNo
(
tp
,
504
)
then
if
Duel
.
SelectYesNo
(
tp
,
504
)
then
Duel
.
SendtoGrave
(
Duel
.
SelectMatchingCard
(
tp
,
function
(
c
)
return
c
:
GetLevel
()
==
3
and
c
:
IsAbleToGrave
()
and
c12011029
.
cfilter
(
c
)
end
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
),
REASON_EFFECT
)
Duel
.
SendtoGrave
(
Duel
.
SelectMatchingCard
(
tp
,
function
(
c
)
return
c
:
GetLevel
()
==
3
and
c
:
IsAbleToGrave
()
and
c12011029
.
cfilter
(
c
)
end
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
),
REASON_EFFECT
)
end
end
end
end
)
end
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetCategory"
,
CATEGORY_SPECIAL_SUMMON
)
.
e
(
"SetCategory"
,
CATEGORY_SPECIAL_SUMMON
)
.
e
(
"SetType"
,
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
.
e
(
"SetType"
,
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetCode"
,
EVENT_DESTROYED
)
.
e
(
"SetCode"
,
EVENT_DESTROYED
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_DELAY
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_DELAY
)
.
e
(
"SetCost"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
.
e
(
"SetCost"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
CheckRemoveOverlayCard
(
tp
,
1
,
REASON_COST
)
end
return
e
:
GetHandler
():
CheckRemoveOverlayCard
(
tp
,
1
,
REASON_COST
)
end
...
@@ -63,8 +63,8 @@ function c12011029.mcfilter(c)
...
@@ -63,8 +63,8 @@ function c12011029.mcfilter(c)
end
end
function
iFunc
(
c
,
x
)
function
iFunc
(
c
,
x
)
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
fe
=
function
(
name
,
...
)
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
return
iFunc
(
c
,
__this
)
end
local
fe
=
function
(
name
,
...
)
if
name
==
"RegisterEffect"
then
c
:
RegisterEffect
(
__this
:
Clone
())
else
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
end
return
iFunc
(
c
,
__this
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
func
=
{
e
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
local
func
=
{
e
=
fe
,
Clone
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
return
func
return
func
end
end
expansions/script/c4212211.lua
View file @
a6a72417
...
@@ -2,66 +2,66 @@
...
@@ -2,66 +2,66 @@
local
m
=
4212211
local
m
=
4212211
local
cm
=
_G
[
"c"
..
m
]
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
function
cm
.
initial_effect
(
c
)
--xyz summon
--xyz summon
aux
.
AddXyzProcedure
(
c
,
function
(
c
)
return
c
:
IsRace
(
RACE_MACHINE
)
and
c
:
IsAttribute
(
ATTRIBUTE_DARK
)
and
c
:
GetBaseAttack
()
<=
1000
end
,
3
,
3
)
aux
.
AddXyzProcedure
(
c
,
function
(
c
)
return
c
:
IsRace
(
RACE_MACHINE
)
and
c
:
IsAttribute
(
ATTRIBUTE_DARK
)
and
c
:
GetBaseAttack
()
<=
1000
end
,
3
,
3
)
c
:
EnableReviveLimit
()
c
:
EnableReviveLimit
()
iFunc
(
c
).
c
(
"RegisterEffect"
,
iFunc
(
c
)
iFunc
(
c
).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
)
.
e
(
"SetCode"
,
EFFECT_SPSUMMON_CONDITION
)
.
e
(
"SetCode"
,
EFFECT_SPSUMMON_CONDITION
)
.
e
(
"SetValue"
,
aux
.
xyzlimit
)
.
e
(
"SetValue"
,
aux
.
xyzlimit
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetType"
,
EFFECT_TYPE_FIELD
)
.
e
(
"SetType"
,
EFFECT_TYPE_FIELD
)
.
e
(
"SetRange"
,
LOCATION_ONFIELD
)
.
e
(
"SetRange"
,
LOCATION_ONFIELD
)
.
e
(
"SetTarget"
,
function
(
e
,
c
)
return
c
~=
e
:
GetHandler
()
and
c
:
IsType
(
TYPE_EFFECT
)
end
)
.
e
(
"SetTarget"
,
function
(
e
,
c
)
return
c
~=
e
:
GetHandler
()
and
c
:
IsType
(
TYPE_EFFECT
)
end
)
.
e
(
"SetTargetRange"
,
LOCATION_MZONE
,
LOCATION_MZONE
)
.
e
(
"SetTargetRange"
,
LOCATION_MZONE
,
LOCATION_MZONE
)
.
e
(
"SetCode"
,
EFFECT_DISABLE
)
.
e
(
"SetCode"
,
EFFECT_DISABLE
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetType"
,
EFFECT_TYPE_FIELD
)
.
e
(
"SetType"
,
EFFECT_TYPE_FIELD
)
.
e
(
"SetCode"
,
EFFECT_CANNOT_DISEFFECT
)
.
e
(
"SetCode"
,
EFFECT_CANNOT_DISEFFECT
)
.
e
(
"SetRange"
,
LOCATION_ONFIELD
)
.
e
(
"SetRange"
,
LOCATION_ONFIELD
)
.
e
(
"SetValue"
,
function
(
e
,
ct
)
.
e
(
"SetValue"
,
function
(
e
,
ct
)
local
p
=
e
:
GetHandler
():
GetControler
()
local
p
=
e
:
GetHandler
():
GetControler
()
local
te
,
tp
,
loc
=
Duel
.
GetChainInfo
(
ct
,
CHAININFO_TRIGGERING_EFFECT
,
CHAININFO_TRIGGERING_PLAYER
,
CHAININFO_TRIGGERING_LOCATION
)
local
te
,
tp
,
loc
=
Duel
.
GetChainInfo
(
ct
,
CHAININFO_TRIGGERING_EFFECT
,
CHAININFO_TRIGGERING_PLAYER
,
CHAININFO_TRIGGERING_LOCATION
)
return
te
:
GetHandler
():
IsType
(
TYPE_EFFECT
)
and
bit
.
band
(
loc
,
LOCATION_MZONE
)
~=
0
return
te
:
GetHandler
():
IsType
(
TYPE_EFFECT
)
and
bit
.
band
(
loc
,
LOCATION_MZONE
)
~=
0
end
)
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetType"
,
EFFECT_TYPE_QUICK_F
)
.
e
(
"SetType"
,
EFFECT_TYPE_QUICK_F
)
.
e
(
"SetCode"
,
EVENT_CHAINING
)
.
e
(
"SetCode"
,
EVENT_CHAINING
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetCondition"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetCondition"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetActivateLocation
()
==
LOCATION_GRAVE
end
)
return
re
:
GetActivateLocation
()
==
LOCATION_GRAVE
end
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
)
if
chk
==
0
then
return
true
end
end
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
Duel
.
Overlay
(
e
:
GetHandler
(),
re
:
GetHandler
())
Duel
.
Overlay
(
e
:
GetHandler
(),
re
:
GetHandler
())
end
)
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetDescription"
,
aux
.
Stringid
(
m
,
2
))
.
e
(
"SetDescription"
,
aux
.
Stringid
(
m
,
2
))
.
e
(
"SetCategory"
,
CATEGORY_DESTROY
)
.
e
(
"SetCategory"
,
CATEGORY_DESTROY
)
.
e
(
"SetType"
,
EFFECT_TYPE_QUICK_O
)
.
e
(
"SetType"
,
EFFECT_TYPE_QUICK_O
)
.
e
(
"SetCode"
,
EVENT_FREE_CHAIN
)
.
e
(
"SetCode"
,
EVENT_FREE_CHAIN
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetCost"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
.
e
(
"SetCost"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
CheckRemoveOverlayCard
(
tp
,
3
,
REASON_COST
)
end
if
chk
==
0
then
return
e
:
GetHandler
():
CheckRemoveOverlayCard
(
tp
,
3
,
REASON_COST
)
end
e
:
GetHandler
():
RemoveOverlayCard
(
tp
,
3
,
3
,
REASON_COST
)
end
)
e
:
GetHandler
():
RemoveOverlayCard
(
tp
,
3
,
3
,
REASON_COST
)
end
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
aux
.
TRUE
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
e
:
GetHandler
())
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
aux
.
TRUE
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
e
:
GetHandler
())
end
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
TRUE
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
TRUE
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
g
:
GetCount
(),
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
g
:
GetCount
(),
0
,
0
)
Duel
.
SetChainLimit
(
aux
.
FALSE
)
end
)
Duel
.
SetChainLimit
(
aux
.
FALSE
)
end
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
TRUE
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
TRUE
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
g
:
GetCount
()
>
0
then
if
g
:
GetCount
()
>
0
then
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
end
)
end
end
)
.
Return
())
.
Return
())
end
end
function
iFunc
(
c
,
x
)
function
iFunc
(
c
,
x
)
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
fe
=
function
(
name
,
...
)
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
return
iFunc
(
c
,
__this
)
end
local
fe
=
function
(
name
,
...
)
if
name
==
"RegisterEffect"
then
c
:
RegisterEffect
(
__this
:
Clone
())
else
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
end
return
iFunc
(
c
,
__this
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
func
=
{
e
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
local
func
=
{
e
=
fe
,
Clon
e
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
return
func
return
func
end
end
\ No newline at end of file
expansions/script/c4231001.lua
View file @
a6a72417
...
@@ -2,79 +2,79 @@
...
@@ -2,79 +2,79 @@
local
m
=
4231001
local
m
=
4231001
local
cm
=
_G
[
"c"
..
m
]
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
function
cm
.
initial_effect
(
c
)
iFunc
(
c
).
c
(
"RegisterEffect"
,
iFunc
(
c
)
iFunc
(
c
).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetCategory"
,
CATEGORY_TOGRAVE
+
CATEGORY_TOHAND
)
.
e
(
"SetCategory"
,
CATEGORY_TOGRAVE
+
CATEGORY_TOHAND
)
.
e
(
"SetType"
,
EFFECT_TYPE_QUICK_O
)
.
e
(
"SetType"
,
EFFECT_TYPE_QUICK_O
)
.
e
(
"SetCode"
,
EVENT_FREE_CHAIN
)
.
e
(
"SetCode"
,
EVENT_FREE_CHAIN
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetCost"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
--return to hand as cost
.
e
(
"SetCost"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
--return to hand as cost
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToHandAsCost
()
end
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToHandAsCost
()
end
Duel
.
SendtoHand
(
e
:
GetHandler
(),
nil
,
REASON_COST
)
Duel
.
SendtoHand
(
e
:
GetHandler
(),
nil
,
REASON_COST
)
end
)
end
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
--if normal spellcaster is onfield
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
--if normal spellcaster is onfield
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
1
)
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
1
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
cfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
4231007
)
end
and
Duel
.
IsExistingMatchingCard
(
cm
.
cfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
4231007
)
end
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
if
Duel
.
IsExistingMatchingCard
(
cm
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
then
if
Duel
.
IsExistingMatchingCard
(
cm
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
0
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
0
,
LOCATION_DECK
)
end
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
0
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
0
,
LOCATION_DECK
)
end
)
end
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
--choose if add to hand
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
--choose if add to hand
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
4231007
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
4231007
)
if
Duel
.
IsExistingMatchingCard
(
cm
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
then
if
Duel
.
IsExistingMatchingCard
(
cm
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
and
g
:
GetFirst
():
IsAbleToHand
()
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
and
g
:
GetFirst
():
IsAbleToHand
()
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
else
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
else
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
end
else
else
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
end
end
)
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetCategory"
,
CATEGORY_SPECIAL_SUMMON
)
.
e
(
"SetCategory"
,
CATEGORY_SPECIAL_SUMMON
)
.
e
(
"SetType"
,
EFFECT_TYPE_IGNITION
)
.
e
(
"SetType"
,
EFFECT_TYPE_IGNITION
)
.
e
(
"SetRange"
,
LOCATION_HAND
)
.
e
(
"SetRange"
,
LOCATION_HAND
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CARD_TARGET
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CARD_TARGET
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
2
)
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
2
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsCode
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
4231006
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsCode
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
4231006
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsCode
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
4231006
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsCode
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
4231006
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_HAND
)
end
)
end
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsCode
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
4231006
)
and
e
:
GetHandler
():
IsLocation
(
LOCATION_HAND
)
then
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsCode
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
4231006
)
and
e
:
GetHandler
():
IsLocation
(
LOCATION_HAND
)
then
if
Duel
.
SpecialSummon
(
e
:
GetHandler
(),
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
if
Duel
.
SpecialSummon
(
e
:
GetHandler
(),
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
local
tc
=
Duel
.
GetFirstTarget
()
local
tc
=
Duel
.
GetFirstTarget
()
Duel
.
Equip
(
tp
,
tc
,
e
:
GetHandler
())
Duel
.
Equip
(
tp
,
tc
,
e
:
GetHandler
())
end
end
end
end
end
)
end
)
.
Return
())
.
Return
())
end
end
function
cm
.
cfilter
(
c
,
code
)
function
cm
.
cfilter
(
c
,
code
)
return
c
:
IsCode
(
code
)
and
(
c
:
IsAbleToGrave
()
or
(
c
:
IsAbleToHand
()
and
Duel
.
IsExistingMatchingCard
(
cm
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)))
return
c
:
IsCode
(
code
)
and
(
c
:
IsAbleToGrave
()
or
(
c
:
IsAbleToHand
()
and
Duel
.
IsExistingMatchingCard
(
cm
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)))
end
end
function
cm
.
mfilter
(
c
)
function
cm
.
mfilter
(
c
)
return
c
:
IsType
(
TYPE_NORMAL
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsFaceup
()
return
c
:
IsType
(
TYPE_NORMAL
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsFaceup
()
end
end
function
iCount
(
name
,
tp
,
m
,
id
)
function
iCount
(
name
,
tp
,
m
,
id
)
return
((
name
==
"get"
or
name
==
"set"
)
return
((
name
==
"get"
or
name
==
"set"
)
and
{(
name
==
"get"
and
{(
name
==
"get"
and
{
tonumber
(((
Duel
.
GetFlagEffect
(
tp
,
m
)
==
nil
)
and
{
0
}
or
{
Duel
.
GetFlagEffect
(
tp
,
m
)})[
1
])}
and
{
tonumber
(((
Duel
.
GetFlagEffect
(
tp
,
m
)
==
nil
)
and
{
0
}
or
{
Duel
.
GetFlagEffect
(
tp
,
m
)})[
1
])}
or
{
Debug
.
Message
(
""
,
"请使用Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)"
)
})[
1
]}
or
{
Debug
.
Message
(
""
,
"请使用Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)"
)
})[
1
]}
or
{(
bit
.
band
(
iCount
(
"get"
,
tp
,
m
,
id
),
math.pow
(
2
,
id
-
1
))
==
0
and
{
true
}
or
{
false
})[
1
]})[
1
]
or
{(
bit
.
band
(
iCount
(
"get"
,
tp
,
m
,
id
),
math.pow
(
2
,
id
-
1
))
==
0
and
{
true
}
or
{
false
})[
1
]})[
1
]
end
end
function
iFunc
(
c
,
x
)
function
iFunc
(
c
,
x
)
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
fe
=
function
(
name
,
...
)
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
return
iFunc
(
c
,
__this
)
end
local
fe
=
function
(
name
,
...
)
if
name
==
"RegisterEffect"
then
c
:
RegisterEffect
(
__this
:
Clone
())
else
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
end
return
iFunc
(
c
,
__this
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
func
=
{
e
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
local
func
=
{
e
=
fe
,
Clon
e
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
return
func
return
func
end
end
\ No newline at end of file
expansions/script/c4231002.lua
View file @
a6a72417
...
@@ -2,79 +2,79 @@
...
@@ -2,79 +2,79 @@
local
m
=
4231002
local
m
=
4231002
local
cm
=
_G
[
"c"
..
m
]
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
function
cm
.
initial_effect
(
c
)
iFunc
(
c
).
c
(
"RegisterEffect"
,
iFunc
(
c
)
iFunc
(
c
).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetCategory"
,
CATEGORY_TOGRAVE
+
CATEGORY_TOHAND
)
.
e
(
"SetCategory"
,
CATEGORY_TOGRAVE
+
CATEGORY_TOHAND
)
.
e
(
"SetType"
,
EFFECT_TYPE_QUICK_O
)
.
e
(
"SetType"
,
EFFECT_TYPE_QUICK_O
)
.
e
(
"SetCode"
,
EVENT_FREE_CHAIN
)
.
e
(
"SetCode"
,
EVENT_FREE_CHAIN
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetCost"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
--return to hand as cost
.
e
(
"SetCost"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
--return to hand as cost
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToHandAsCost
()
end
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToHandAsCost
()
end
Duel
.
SendtoHand
(
e
:
GetHandler
(),
nil
,
REASON_COST
)
Duel
.
SendtoHand
(
e
:
GetHandler
(),
nil
,
REASON_COST
)
end
)
end
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
--if normal spellcaster is onfield
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
--if normal spellcaster is onfield
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
1
)
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
1
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
cfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
4231006
)
end
and
Duel
.
IsExistingMatchingCard
(
cm
.
cfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
4231006
)
end
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
if
Duel
.
IsExistingMatchingCard
(
cm
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
then
if
Duel
.
IsExistingMatchingCard
(
cm
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
0
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
0
,
LOCATION_DECK
)
end
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
0
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
0
,
LOCATION_DECK
)
end
)
end
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
--choose if add to hand
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
--choose if add to hand
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
4231006
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
4231006
)
if
Duel
.
IsExistingMatchingCard
(
cm
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
then
if
Duel
.
IsExistingMatchingCard
(
cm
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
and
g
:
GetFirst
():
IsAbleToHand
()
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
and
g
:
GetFirst
():
IsAbleToHand
()
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
else
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
else
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
end
else
else
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
end
end
)
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetCategory"
,
CATEGORY_SPECIAL_SUMMON
)
.
e
(
"SetCategory"
,
CATEGORY_SPECIAL_SUMMON
)
.
e
(
"SetType"
,
EFFECT_TYPE_IGNITION
)
.
e
(
"SetType"
,
EFFECT_TYPE_IGNITION
)
.
e
(
"SetRange"
,
LOCATION_HAND
)
.
e
(
"SetRange"
,
LOCATION_HAND
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CARD_TARGET
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CARD_TARGET
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
2
)
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
2
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsCode
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
4231007
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsCode
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
4231007
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsCode
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
4231007
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsCode
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
4231007
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_HAND
)
end
)
end
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsCode
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
4231007
)
and
e
:
GetHandler
():
IsLocation
(
LOCATION_HAND
)
then
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsCode
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
4231007
)
and
e
:
GetHandler
():
IsLocation
(
LOCATION_HAND
)
then
if
Duel
.
SpecialSummon
(
e
:
GetHandler
(),
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
if
Duel
.
SpecialSummon
(
e
:
GetHandler
(),
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
local
tc
=
Duel
.
GetFirstTarget
()
local
tc
=
Duel
.
GetFirstTarget
()
Duel
.
Equip
(
tp
,
tc
,
e
:
GetHandler
())
Duel
.
Equip
(
tp
,
tc
,
e
:
GetHandler
())
end
end
end
end
end
)
end
)
.
Return
())
.
Return
())
end
end
function
cm
.
cfilter
(
c
,
code
)
function
cm
.
cfilter
(
c
,
code
)
return
c
:
IsCode
(
code
)
and
(
c
:
IsAbleToGrave
()
or
(
c
:
IsAbleToHand
()
and
Duel
.
IsExistingMatchingCard
(
cm
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)))
return
c
:
IsCode
(
code
)
and
(
c
:
IsAbleToGrave
()
or
(
c
:
IsAbleToHand
()
and
Duel
.
IsExistingMatchingCard
(
cm
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)))
end
end
function
cm
.
mfilter
(
c
)
function
cm
.
mfilter
(
c
)
return
c
:
IsType
(
TYPE_NORMAL
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsFaceup
()
return
c
:
IsType
(
TYPE_NORMAL
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsFaceup
()
end
end
function
iCount
(
name
,
tp
,
m
,
id
)
function
iCount
(
name
,
tp
,
m
,
id
)
return
((
name
==
"get"
or
name
==
"set"
)
return
((
name
==
"get"
or
name
==
"set"
)
and
{(
name
==
"get"
and
{(
name
==
"get"
and
{
tonumber
(((
Duel
.
GetFlagEffect
(
tp
,
m
)
==
nil
)
and
{
0
}
or
{
Duel
.
GetFlagEffect
(
tp
,
m
)})[
1
])}
and
{
tonumber
(((
Duel
.
GetFlagEffect
(
tp
,
m
)
==
nil
)
and
{
0
}
or
{
Duel
.
GetFlagEffect
(
tp
,
m
)})[
1
])}
or
{
Debug
.
Message
(
""
,
"请使用Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)"
)
})[
1
]}
or
{
Debug
.
Message
(
""
,
"请使用Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)"
)
})[
1
]}
or
{(
bit
.
band
(
iCount
(
"get"
,
tp
,
m
,
id
),
math.pow
(
2
,
id
-
1
))
==
0
and
{
true
}
or
{
false
})[
1
]})[
1
]
or
{(
bit
.
band
(
iCount
(
"get"
,
tp
,
m
,
id
),
math.pow
(
2
,
id
-
1
))
==
0
and
{
true
}
or
{
false
})[
1
]})[
1
]
end
end
function
iFunc
(
c
,
x
)
function
iFunc
(
c
,
x
)
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
fe
=
function
(
name
,
...
)
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
return
iFunc
(
c
,
__this
)
end
local
fe
=
function
(
name
,
...
)
if
name
==
"RegisterEffect"
then
c
:
RegisterEffect
(
__this
:
Clone
())
else
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
end
return
iFunc
(
c
,
__this
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
func
=
{
e
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
local
func
=
{
e
=
fe
,
Clon
e
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
return
func
return
func
end
end
\ No newline at end of file
expansions/script/c4231003.lua
View file @
a6a72417
...
@@ -2,78 +2,78 @@
...
@@ -2,78 +2,78 @@
local
m
=
4231003
local
m
=
4231003
local
cm
=
_G
[
"c"
..
m
]
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
function
cm
.
initial_effect
(
c
)
iFunc
(
c
).
c
(
"RegisterEffect"
,
iFunc
(
c
)
iFunc
(
c
).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetCategory"
,
CATEGORY_SPECIAL_SUMMON
)
.
e
(
"SetCategory"
,
CATEGORY_SPECIAL_SUMMON
)
.
e
(
"SetType"
,
EFFECT_TYPE_IGNITION
)
.
e
(
"SetType"
,
EFFECT_TYPE_IGNITION
)
.
e
(
"SetRange"
,
LOCATION_HAND
)
.
e
(
"SetRange"
,
LOCATION_HAND
)
.
e
(
"SetCost"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
.
e
(
"SetCost"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
costfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
costfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
DiscardHand
(
tp
,
cm
.
costfilter
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
Duel
.
DiscardHand
(
tp
,
cm
.
costfilter
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
end
)
end
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
1
)
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
1
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
end
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
end
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_HAND
)
end
)
end
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsLocation
(
LOCATION_HAND
)
then
if
e
:
GetHandler
():
IsLocation
(
LOCATION_HAND
)
then
if
Duel
.
SpecialSummon
(
e
:
GetHandler
(),
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
~=
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
then
if
Duel
.
SpecialSummon
(
e
:
GetHandler
(),
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
~=
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
end
end
end
end
end
)
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetCategory"
,
CATEGORY_SPECIAL_SUMMON
)
.
e
(
"SetCategory"
,
CATEGORY_SPECIAL_SUMMON
)
.
e
(
"SetType"
,
EFFECT_TYPE_IGNITION
)
.
e
(
"SetType"
,
EFFECT_TYPE_IGNITION
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CARD_TARGET
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CARD_TARGET
)
.
e
(
"SetCost"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
.
e
(
"SetCost"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckReleaseGroup
(
tp
,
cm
.
relfilter
,
1
,
nil
,
tp
)
end
if
chk
==
0
then
return
Duel
.
CheckReleaseGroup
(
tp
,
cm
.
relfilter
,
1
,
nil
,
tp
)
end
local
g
=
Duel
.
SelectReleaseGroup
(
tp
,
cm
.
relfilter
,
1
,
1
,
nil
,
tp
)
local
g
=
Duel
.
SelectReleaseGroup
(
tp
,
cm
.
relfilter
,
1
,
1
,
nil
,
tp
)
Duel
.
Release
(
g
,
REASON_COST
)
end
)
Duel
.
Release
(
g
,
REASON_COST
)
end
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
2
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
deckfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
end
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
2
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
deckfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
LOCATION_DECK
)
end
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
LOCATION_DECK
)
end
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
deckfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
deckfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
)
end
end
)
.
Return
())
.
Return
())
end
end
function
cm
.
deckfilter
(
c
,
e
,
tp
)
function
cm
.
deckfilter
(
c
,
e
,
tp
)
return
(
c
:
IsCode
(
4231001
)
or
c
:
IsCode
(
4231002
))
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
return
(
c
:
IsCode
(
4231001
)
or
c
:
IsCode
(
4231002
))
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
end
function
cm
.
relfilter
(
c
,
tp
)
function
cm
.
relfilter
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsType
(
TYPE_NORMAL
)
and
Duel
.
GetMZoneCount
(
tp
,
c
,
tp
)
>
0
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsType
(
TYPE_NORMAL
)
and
Duel
.
GetMZoneCount
(
tp
,
c
,
tp
)
>
0
end
end
function
cm
.
costfilter
(
c
)
function
cm
.
costfilter
(
c
)
return
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsDiscardable
()
return
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsDiscardable
()
end
end
function
cm
.
thfilter
(
c
)
function
cm
.
thfilter
(
c
)
return
(
c
:
IsCode
(
4231004
)
or
c
:
IsCode
(
4231005
))
and
c
:
IsAbleToHand
()
return
(
c
:
IsCode
(
4231004
)
or
c
:
IsCode
(
4231005
))
and
c
:
IsAbleToHand
()
end
end
function
iCount
(
name
,
tp
,
m
,
id
)
function
iCount
(
name
,
tp
,
m
,
id
)
return
((
name
==
"get"
or
name
==
"set"
)
return
((
name
==
"get"
or
name
==
"set"
)
and
{(
name
==
"get"
and
{(
name
==
"get"
and
{
tonumber
(((
Duel
.
GetFlagEffect
(
tp
,
m
)
==
nil
)
and
{
0
}
or
{
Duel
.
GetFlagEffect
(
tp
,
m
)})[
1
])}
and
{
tonumber
(((
Duel
.
GetFlagEffect
(
tp
,
m
)
==
nil
)
and
{
0
}
or
{
Duel
.
GetFlagEffect
(
tp
,
m
)})[
1
])}
or
{
Debug
.
Message
(
""
,
"请使用Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)"
)
})[
1
]}
or
{
Debug
.
Message
(
""
,
"请使用Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)"
)
})[
1
]}
or
{(
bit
.
band
(
iCount
(
"get"
,
tp
,
m
,
id
),
math.pow
(
2
,
id
-
1
))
==
0
and
{
true
}
or
{
false
})[
1
]})[
1
]
or
{(
bit
.
band
(
iCount
(
"get"
,
tp
,
m
,
id
),
math.pow
(
2
,
id
-
1
))
==
0
and
{
true
}
or
{
false
})[
1
]})[
1
]
end
end
function
iFunc
(
c
,
x
)
function
iFunc
(
c
,
x
)
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
fe
=
function
(
name
,
...
)
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
return
iFunc
(
c
,
__this
)
end
local
fe
=
function
(
name
,
...
)
if
name
==
"RegisterEffect"
then
c
:
RegisterEffect
(
__this
:
Clone
())
else
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
end
return
iFunc
(
c
,
__this
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
func
=
{
e
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
local
func
=
{
e
=
fe
,
Clon
e
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
return
func
return
func
end
end
\ No newline at end of file
expansions/script/c4231004.lua
View file @
a6a72417
...
@@ -2,74 +2,74 @@
...
@@ -2,74 +2,74 @@
local
m
=
4231004
local
m
=
4231004
local
cm
=
_G
[
"c"
..
m
]
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
function
cm
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
c
:
EnableReviveLimit
()
iFunc
(
c
).
c
(
"RegisterEffect"
,
iFunc
(
c
)
iFunc
(
c
).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_SINGLE_RANGE
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_SINGLE_RANGE
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetCode"
,
EFFECT_BATTLE_DESTROY_REDIRECT
)
.
e
(
"SetCode"
,
EFFECT_BATTLE_DESTROY_REDIRECT
)
.
e
(
"SetValue"
,
LOCATION_REMOVED
)
.
e
(
"SetValue"
,
LOCATION_REMOVED
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
.
e
(
"SetCode"
,
EVENT_BATTLED
)
.
e
(
"SetCode"
,
EVENT_BATTLED
)
.
e
(
"SetCondition"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetCondition"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
bc
=
c
:
GetBattleTarget
()
local
bc
=
c
:
GetBattleTarget
()
return
bc
and
bc
:
IsStatus
(
STATUS_BATTLE_DESTROYED
)
and
not
c
:
IsStatus
(
STATUS_BATTLE_DESTROYED
)
end
)
return
bc
and
bc
:
IsStatus
(
STATUS_BATTLE_DESTROYED
)
and
not
c
:
IsStatus
(
STATUS_BATTLE_DESTROYED
)
end
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
bc
=
c
:
GetBattleTarget
()
local
bc
=
c
:
GetBattleTarget
()
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
0x1660000
)
e1
:
SetReset
(
RESET_EVENT
+
0x1660000
)
bc
:
RegisterEffect
(
e1
)
bc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetReset
(
RESET_EVENT
+
0x1660000
)
e2
:
SetReset
(
RESET_EVENT
+
0x1660000
)
bc
:
RegisterEffect
(
e2
)
bc
:
RegisterEffect
(
e2
)
Duel
.
Damage
(
1
-
tp
,
bc
:
GetTextAttack
()
/
2
,
REASON_BATTLE
)
Duel
.
Damage
(
1
-
tp
,
bc
:
GetTextAttack
()
/
2
,
REASON_BATTLE
)
end
)
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
)
.
e
(
"SetCode"
,
EFFECT_SET_ATTACK_FINAL
)
.
e
(
"SetCode"
,
EFFECT_SET_ATTACK_FINAL
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_SINGLE_RANGE
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_SINGLE_RANGE
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetCondition"
,
function
(
e
)
local
c
=
e
:
GetHandler
()
return
.
e
(
"SetCondition"
,
function
(
e
)
local
c
=
e
:
GetHandler
()
return
c
:
GetEquipGroup
():
IsExists
(
function
(
c
)
return
c
:
IsCode
(
4231006
)
end
,
1
,
nil
)
c
:
GetEquipGroup
():
IsExists
(
function
(
c
)
return
c
:
IsCode
(
4231006
)
end
,
1
,
nil
)
and
c
:
GetEquipGroup
():
IsExists
(
function
(
c
)
return
c
:
IsCode
(
4231007
)
end
,
1
,
nil
)
end
)
and
c
:
GetEquipGroup
():
IsExists
(
function
(
c
)
return
c
:
IsCode
(
4231007
)
end
,
1
,
nil
)
end
)
.
e
(
"SetValue"
,
function
(
e
,
c
)
return
c
:
GetAttack
()
*
2
end
)
.
e
(
"SetValue"
,
function
(
e
,
c
)
return
c
:
GetAttack
()
*
2
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetType"
,
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
.
e
(
"SetType"
,
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
.
e
(
"SetCode"
,
EVENT_CHAINING
)
.
e
(
"SetCode"
,
EVENT_CHAINING
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CANNOT_DISABLE
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CANNOT_DISABLE
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetOperation"
,
aux
.
chainreg
)
.
e
(
"SetOperation"
,
aux
.
chainreg
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetDescription"
,
aux
.
Stringid
(
51481927
,
0
))
.
e
(
"SetDescription"
,
aux
.
Stringid
(
51481927
,
0
))
.
e
(
"SetType"
,
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
.
e
(
"SetType"
,
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
.
e
(
"SetCode"
,
EVENT_CHAIN_SOLVED
)
.
e
(
"SetCode"
,
EVENT_CHAIN_SOLVED
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetCondition"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetCondition"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
and
re
:
IsActiveType
(
TYPE_SPELL
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
return
re
and
re
:
IsActiveType
(
TYPE_SPELL
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
and
re
:
GetHandler
()
~=
e
:
GetHandler
()
and
e
:
GetHandler
():
GetFlagEffect
(
1
)
>
0
end
)
and
re
:
GetHandler
()
~=
e
:
GetHandler
()
and
e
:
GetHandler
():
GetFlagEffect
(
1
)
>
0
end
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
ep
~=
tp
then
return
end
if
ep
~=
tp
then
return
end
if
Duel
.
Damage
(
tp
,
100
,
REASON_EFFECT
)
and
c
:
IsFaceup
()
then
if
Duel
.
Damage
(
tp
,
100
,
REASON_EFFECT
)
and
c
:
IsFaceup
()
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
100
)
e1
:
SetValue
(
100
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_DISABLE
)
e
:
GetHandler
():
RegisterEffect
(
e1
)
e
:
GetHandler
():
RegisterEffect
(
e1
)
end
end
)
end
end
)
.
Return
())
.
Return
())
end
end
function
iFunc
(
c
,
x
)
function
iFunc
(
c
,
x
)
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
fe
=
function
(
name
,
...
)
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
return
iFunc
(
c
,
__this
)
end
local
fe
=
function
(
name
,
...
)
if
name
==
"RegisterEffect"
then
c
:
RegisterEffect
(
__this
:
Clone
())
else
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
end
return
iFunc
(
c
,
__this
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
func
=
{
e
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
local
func
=
{
e
=
fe
,
Clon
e
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
return
func
return
func
end
end
\ No newline at end of file
expansions/script/c4231005.lua
View file @
a6a72417
...
@@ -3,87 +3,87 @@ local m=4231005
...
@@ -3,87 +3,87 @@ local m=4231005
local
cm
=
_G
[
"c"
..
m
]
local
cm
=
_G
[
"c"
..
m
]
cm
.
fit_monster
=
{
4231004
}
cm
.
fit_monster
=
{
4231004
}
function
cm
.
initial_effect
(
c
)
function
cm
.
initial_effect
(
c
)
iFunc
(
c
).
c
(
"RegisterEffect"
,
iFunc
(
c
)
iFunc
(
c
).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetCategory"
,
CATEGORY_SPECIAL_SUMMON
)
.
e
(
"SetCategory"
,
CATEGORY_SPECIAL_SUMMON
)
.
e
(
"SetType"
,
EFFECT_TYPE_ACTIVATE
)
.
e
(
"SetType"
,
EFFECT_TYPE_ACTIVATE
)
.
e
(
"SetCode"
,
EVENT_FREE_CHAIN
)
.
e
(
"SetCode"
,
EVENT_FREE_CHAIN
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
if
chk
==
0
then
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
return
Duel
.
IsExistingMatchingCard
(
cm
.
cfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
return
Duel
.
IsExistingMatchingCard
(
cm
.
cfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
and
((
ft
>-
1
and
Duel
.
IsExistingMatchingCard
(
cm
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
ft
))
and
((
ft
>-
1
and
Duel
.
IsExistingMatchingCard
(
cm
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
ft
))
or
(
ft
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
mfilter
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
,
ft
)))
or
(
ft
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
mfilter
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
,
ft
)))
end
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
aux
.
FALSE
)
end
end
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
aux
.
FALSE
)
end
end
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
tc
=
tg
:
GetFirst
()
local
tc
=
tg
:
GetFirst
()
if
tc
then
if
tc
then
if
ft
>
0
then
if
ft
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
mat
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
mfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
,
ft
)
mat
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
mfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
,
ft
)
else
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
mat
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
ft
)
mat
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
ft
)
end
end
tc
:
SetMaterial
(
mat
)
tc
:
SetMaterial
(
mat
)
Duel
.
ReleaseRitualMaterial
(
mat
)
Duel
.
ReleaseRitualMaterial
(
mat
)
Duel
.
BreakEffect
()
Duel
.
BreakEffect
()
Duel
.
SpecialSummon
(
tc
,
SUMMON_TYPE_RITUAL
,
tp
,
tp
,
false
,
true
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
tc
,
SUMMON_TYPE_RITUAL
,
tp
,
tp
,
false
,
true
,
POS_FACEUP
)
tc
:
CompleteProcedure
()
tc
:
CompleteProcedure
()
end
end
)
end
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetDescription"
,
aux
.
Stringid
(
m
,
0
))
.
e
(
"SetDescription"
,
aux
.
Stringid
(
m
,
0
))
.
e
(
"SetCategory"
,
CATEGORY_TOHAND
+
CATEGORY_SPECIAL_SUMMON
)
.
e
(
"SetCategory"
,
CATEGORY_TOHAND
+
CATEGORY_SPECIAL_SUMMON
)
.
e
(
"SetType"
,
EFFECT_TYPE_IGNITION
)
.
e
(
"SetType"
,
EFFECT_TYPE_IGNITION
)
.
e
(
"SetRange"
,
LOCATION_GRAVE
)
.
e
(
"SetRange"
,
LOCATION_GRAVE
)
.
e
(
"SetCountLimit"
,
1
,
m
)
.
e
(
"SetCountLimit"
,
1
,
m
)
.
e
(
"SetCost"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
.
e
(
"SetCost"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToDeckAsCost
()
end
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToDeckAsCost
()
end
Duel
.
SendtoDeck
(
e
:
GetHandler
(),
nil
,
2
,
REASON_COST
)
end
)
Duel
.
SendtoDeck
(
e
:
GetHandler
(),
nil
,
2
,
REASON_COST
)
end
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
)
end
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
)
end
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
local
mg
=
Duel
.
GetMatchingGroup
(
cm
.
cfilter2
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
nil
,
e
,
tp
)
local
mg
=
Duel
.
GetMatchingGroup
(
cm
.
cfilter2
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
nil
,
e
,
tp
)
if
mg
:
GetCount
()
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
if
mg
:
GetCount
()
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
1
))
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
1
))
then
Duel
.
BreakEffect
()
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
mg
:
Select
(
tp
,
1
,
1
,
nil
)
local
sg
=
mg
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SpecialSummon
(
sg
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
sg
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
end
end
end
end
end
)
end
)
.
Return
())
.
Return
())
end
end
function
cm
.
cfilter
(
c
,
e
,
tp
)
function
cm
.
cfilter
(
c
,
e
,
tp
)
return
c
:
IsCode
(
4231004
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_RITUAL
,
tp
,
false
,
true
)
return
c
:
IsCode
(
4231004
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_RITUAL
,
tp
,
false
,
true
)
end
end
function
cm
.
cfilter2
(
c
,
e
,
tp
)
function
cm
.
cfilter2
(
c
,
e
,
tp
)
return
c
:
IsCode
(
4231000
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_SPECIAL
,
tp
,
false
,
false
)
return
c
:
IsCode
(
4231000
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_SPECIAL
,
tp
,
false
,
false
)
end
end
function
cm
.
thfilter
(
c
)
function
cm
.
thfilter
(
c
)
return
c
:
IsCode
(
4231004
)
and
c
:
IsAbleToHand
()
return
c
:
IsCode
(
4231004
)
and
c
:
IsAbleToHand
()
end
end
function
cm
.
mfilter
(
c
,
ft
)
function
cm
.
mfilter
(
c
,
ft
)
return
c
:
GetEquipGroup
():
IsExists
(
function
(
c
)
return
c
:
IsCode
(
4231006
)
end
,
1
,
nil
)
return
c
:
GetEquipGroup
():
IsExists
(
function
(
c
)
return
c
:
IsCode
(
4231006
)
end
,
1
,
nil
)
and
c
:
GetEquipGroup
():
IsExists
(
function
(
c
)
return
c
:
IsCode
(
4231007
)
end
,
1
,
nil
)
and
c
:
GetEquipGroup
():
IsExists
(
function
(
c
)
return
c
:
IsCode
(
4231007
)
end
,
1
,
nil
)
and
(
not
((
c
:
GetSequence
()
==
5
or
c
:
GetSequence
()
==
6
)
and
ft
<=
0
)
or
ft
>
0
)
and
(
not
((
c
:
GetSequence
()
==
5
or
c
:
GetSequence
()
==
6
)
and
ft
<=
0
)
or
ft
>
0
)
end
end
function
iFunc
(
c
,
x
)
function
iFunc
(
c
,
x
)
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
fe
=
function
(
name
,
...
)
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
return
iFunc
(
c
,
__this
)
end
local
fe
=
function
(
name
,
...
)
if
name
==
"RegisterEffect"
then
c
:
RegisterEffect
(
__this
:
Clone
())
else
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
end
return
iFunc
(
c
,
__this
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
func
=
{
e
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
local
func
=
{
e
=
fe
,
Clon
e
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
return
func
return
func
end
end
expansions/script/c4231006.lua
View file @
a6a72417
...
@@ -2,100 +2,100 @@
...
@@ -2,100 +2,100 @@
local
m
=
4231006
local
m
=
4231006
local
cm
=
_G
[
"c"
..
m
]
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--red
function
cm
.
initial_effect
(
c
)
--red
iFunc
(
c
).
c
(
"RegisterEffect"
,
iFunc
(
c
)
iFunc
(
c
).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
)
.
e
(
"SetCode"
,
EFFECT_EQUIP_LIMIT
)
.
e
(
"SetCode"
,
EFFECT_EQUIP_LIMIT
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CANNOT_DISABLE
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CANNOT_DISABLE
)
.
e
(
"SetValue"
,
function
(
e
,
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
end
)
.
e
(
"SetValue"
,
function
(
e
,
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetCategory"
,
CATEGORY_EQUIP
)
.
e
(
"SetCategory"
,
CATEGORY_EQUIP
)
.
e
(
"SetType"
,
EFFECT_TYPE_ACTIVATE
)
.
e
(
"SetType"
,
EFFECT_TYPE_ACTIVATE
)
.
e
(
"SetCode"
,
EVENT_FREE_CHAIN
)
.
e
(
"SetCode"
,
EVENT_FREE_CHAIN
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CARD_TARGET
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CARD_TARGET
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
cm
.
eqfilter
(
chkc
)
end
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
cm
.
eqfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
e
:
SetLabel
(
0
)
e
:
SetLabel
(
0
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SelectTarget
(
tp
,
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
)
.
e
(
"SetOperation"
,
cm
.
operation
)
.
e
(
"SetOperation"
,
cm
.
operation
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetType"
,
EFFECT_TYPE_EQUIP
)
.
e
(
"SetType"
,
EFFECT_TYPE_EQUIP
)
.
e
(
"SetCode"
,
EFFECT_IMMUNE_EFFECT
)
.
e
(
"SetCode"
,
EFFECT_IMMUNE_EFFECT
)
.
e
(
"SetValue"
,
function
(
e
,
te
)
.
e
(
"SetValue"
,
function
(
e
,
te
)
local
g
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
)
local
g
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
)
local
sg
=
Group
.
FromCards
(
te
:
GetOwner
())
local
sg
=
Group
.
FromCards
(
te
:
GetOwner
())
return
not
((
te
:
GetHandler
():
IsType
(
TYPE_EQUIP
)
or
te
:
GetHandler
():
IsType
(
TYPE_RITUAL
))
and
te
:
GetHandler
():
IsType
(
TYPE_SPELL
))
and
not
(
g
==
nil
and
{(
te
:
GetOwner
()
~=
e
:
GetHandler
():
GetEquipTarget
()
and
{
false
}
or
{
true
})[
1
]}
or
{
g
:
IsContains
(
e
:
GetHandler
():
GetEquipTarget
())})[
1
]
end
)
return
not
((
te
:
GetHandler
():
IsType
(
TYPE_EQUIP
)
or
te
:
GetHandler
():
IsType
(
TYPE_RITUAL
))
and
te
:
GetHandler
():
IsType
(
TYPE_SPELL
))
and
not
(
g
==
nil
and
{(
te
:
GetOwner
()
~=
e
:
GetHandler
():
GetEquipTarget
()
and
{
false
}
or
{
true
})[
1
]}
or
{
g
:
IsContains
(
e
:
GetHandler
():
GetEquipTarget
())})[
1
]
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetCategory"
,
CATEGORY_SPECIAL_SUMMON
)
.
e
(
"SetCategory"
,
CATEGORY_SPECIAL_SUMMON
)
.
e
(
"SetType"
,
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
.
e
(
"SetType"
,
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
.
e
(
"SetCode"
,
EVENT_EQUIP
)
.
e
(
"SetCode"
,
EVENT_EQUIP
)
.
e
(
"SetRange"
,
0xff
)
.
e
(
"SetRange"
,
0xff
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_DELAY
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_DELAY
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
e
:
GetHandler
():
GetEquipTarget
()
==
nil
then
return
false
end
if
e
:
GetHandler
():
GetEquipTarget
()
==
nil
then
return
false
end
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
1
)
and
e
:
GetHandler
():
GetEquipTarget
():
IsType
(
TYPE_NORMAL
)
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
1
)
and
e
:
GetHandler
():
GetEquipTarget
():
IsType
(
TYPE_NORMAL
)
and
eg
:
IsContains
(
e
:
GetHandler
())
and
eg
:
IsContains
(
e
:
GetHandler
())
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
cfilter
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
nil
,
4231001
,
e
,
tp
)
end
and
Duel
.
IsExistingMatchingCard
(
cm
.
cfilter
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
nil
,
4231001
,
e
,
tp
)
end
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cfilter
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
4231001
,
e
,
tp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cfilter
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
4231001
,
e
,
tp
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetDescription"
,
aux
.
Stringid
(
m
,
0
))
.
e
(
"SetDescription"
,
aux
.
Stringid
(
m
,
0
))
.
e
(
"SetCategory"
,
CATEGORY_EQUIP
)
.
e
(
"SetCategory"
,
CATEGORY_EQUIP
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
.
e
(
"SetCode"
,
EVENT_TO_GRAVE
)
.
e
(
"SetCode"
,
EVENT_TO_GRAVE
)
.
e
(
"SetCondition"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetCondition"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
return
c
:
IsPreviousLocation
(
LOCATION_ONFIELD
)
and
c
:
IsPreviousPosition
(
POS_FACEUP
)
and
c
:
IsReason
(
REASON_DESTROY
)
and
c
:
CheckUniqueOnField
(
tp
)
end
)
return
c
:
IsPreviousLocation
(
LOCATION_ONFIELD
)
and
c
:
IsPreviousPosition
(
POS_FACEUP
)
and
c
:
IsReason
(
REASON_DESTROY
)
and
c
:
CheckUniqueOnField
(
tp
)
end
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
cm
.
eqfilter
(
chkc
)
end
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
cm
.
eqfilter
(
chkc
)
end
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
2
)
and
e
:
GetHandler
():
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
2
)
and
e
:
GetHandler
():
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
IsExistingTarget
(
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
and
Duel
.
IsExistingTarget
(
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
e
:
SetLabel
(
1
)
e
:
SetLabel
(
1
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
Duel
.
SelectTarget
(
tp
,
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
)
.
e
(
"SetOperation"
,
cm
.
operation
)
.
e
(
"SetOperation"
,
cm
.
operation
)
.
Return
())
.
Return
())
end
end
function
cm
.
eqfilter
(
c
)
function
cm
.
eqfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_SPELLCASTER
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_SPELLCASTER
)
end
end
function
cm
.
cfilter
(
c
,
code
,
e
,
tp
)
function
cm
.
cfilter
(
c
,
code
,
e
,
tp
)
return
c
:
IsCode
(
code
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
return
c
:
IsCode
(
code
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
end
function
cm
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
cm
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
local
tc
=
Duel
.
GetFirstTarget
()
if
c
:
IsRelateToEffect
(
e
)
and
tc
and
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
if
c
:
IsRelateToEffect
(
e
)
and
tc
and
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
if
Duel
.
Equip
(
tp
,
c
,
tc
)
~=
0
if
Duel
.
Equip
(
tp
,
c
,
tc
)
~=
0
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsFaceUp
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
then
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsFaceUp
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
then
if
e
:
GetLabel
()
==
0
then
return
end
if
e
:
GetLabel
()
==
0
then
return
end
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsFaceup
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsFaceup
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
end
end
end
end
end
end
end
function
iCount
(
name
,
tp
,
m
,
id
)
function
iCount
(
name
,
tp
,
m
,
id
)
return
((
name
==
"get"
or
name
==
"set"
)
return
((
name
==
"get"
or
name
==
"set"
)
and
{(
name
==
"get"
and
{(
name
==
"get"
and
{
tonumber
(((
Duel
.
GetFlagEffect
(
tp
,
m
)
==
nil
)
and
{
0
}
or
{
Duel
.
GetFlagEffect
(
tp
,
m
)})[
1
])}
and
{
tonumber
(((
Duel
.
GetFlagEffect
(
tp
,
m
)
==
nil
)
and
{
0
}
or
{
Duel
.
GetFlagEffect
(
tp
,
m
)})[
1
])}
or
{
Debug
.
Message
(
""
,
"请使用Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)"
)
})[
1
]}
or
{
Debug
.
Message
(
""
,
"请使用Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)"
)
})[
1
]}
or
{(
bit
.
band
(
iCount
(
"get"
,
tp
,
m
,
id
),
math.pow
(
2
,
id
-
1
))
==
0
and
{
true
}
or
{
false
})[
1
]})[
1
]
or
{(
bit
.
band
(
iCount
(
"get"
,
tp
,
m
,
id
),
math.pow
(
2
,
id
-
1
))
==
0
and
{
true
}
or
{
false
})[
1
]})[
1
]
end
end
function
iFunc
(
c
,
x
)
function
iFunc
(
c
,
x
)
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
fe
=
function
(
name
,
...
)
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
return
iFunc
(
c
,
__this
)
end
local
fe
=
function
(
name
,
...
)
if
name
==
"RegisterEffect"
then
c
:
RegisterEffect
(
__this
:
Clone
())
else
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
end
return
iFunc
(
c
,
__this
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
func
=
{
e
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
local
func
=
{
e
=
fe
,
Clon
e
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
return
func
return
func
end
end
\ No newline at end of file
expansions/script/c4231007.lua
View file @
a6a72417
...
@@ -2,98 +2,98 @@
...
@@ -2,98 +2,98 @@
local
m
=
4231007
local
m
=
4231007
local
cm
=
_G
[
"c"
..
m
]
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--red
function
cm
.
initial_effect
(
c
)
--red
iFunc
(
c
).
c
(
"RegisterEffect"
,
iFunc
(
c
)
iFunc
(
c
).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
)
.
e
(
"SetCode"
,
EFFECT_EQUIP_LIMIT
)
.
e
(
"SetCode"
,
EFFECT_EQUIP_LIMIT
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CANNOT_DISABLE
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CANNOT_DISABLE
)
.
e
(
"SetValue"
,
function
(
e
,
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
end
)
.
e
(
"SetValue"
,
function
(
e
,
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetCategory"
,
CATEGORY_EQUIP
)
.
e
(
"SetCategory"
,
CATEGORY_EQUIP
)
.
e
(
"SetType"
,
EFFECT_TYPE_ACTIVATE
)
.
e
(
"SetType"
,
EFFECT_TYPE_ACTIVATE
)
.
e
(
"SetCode"
,
EVENT_FREE_CHAIN
)
.
e
(
"SetCode"
,
EVENT_FREE_CHAIN
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CARD_TARGET
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CARD_TARGET
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
cm
.
eqfilter
(
chkc
)
end
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
cm
.
eqfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
e
:
SetLabel
(
0
)
e
:
SetLabel
(
0
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SelectTarget
(
tp
,
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
)
.
e
(
"SetOperation"
,
cm
.
operation
)
.
e
(
"SetOperation"
,
cm
.
operation
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetType"
,
EFFECT_TYPE_EQUIP
)
.
e
(
"SetType"
,
EFFECT_TYPE_EQUIP
)
.
e
(
"SetCode"
,
EFFECT_CANNOT_BE_EFFECT_TARGET
)
.
e
(
"SetCode"
,
EFFECT_CANNOT_BE_EFFECT_TARGET
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_IGNORE_IMMUNE
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_IGNORE_IMMUNE
)
.
e
(
"SetValue"
,
aux
.
tgoval
)
.
e
(
"SetValue"
,
aux
.
tgoval
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetCategory"
,
CATEGORY_SPECIAL_SUMMON
)
.
e
(
"SetCategory"
,
CATEGORY_SPECIAL_SUMMON
)
.
e
(
"SetType"
,
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
.
e
(
"SetType"
,
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
.
e
(
"SetCode"
,
EVENT_EQUIP
)
.
e
(
"SetCode"
,
EVENT_EQUIP
)
.
e
(
"SetRange"
,
0xff
)
.
e
(
"SetRange"
,
0xff
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_DELAY
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_DELAY
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
e
:
GetHandler
():
GetEquipTarget
()
==
nil
then
return
false
end
if
e
:
GetHandler
():
GetEquipTarget
()
==
nil
then
return
false
end
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
1
)
and
e
:
GetHandler
():
GetEquipTarget
():
IsType
(
TYPE_NORMAL
)
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
1
)
and
e
:
GetHandler
():
GetEquipTarget
():
IsType
(
TYPE_NORMAL
)
and
eg
:
IsContains
(
e
:
GetHandler
())
and
eg
:
IsContains
(
e
:
GetHandler
())
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
cfilter
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
nil
,
4231002
,
e
,
tp
)
end
and
Duel
.
IsExistingMatchingCard
(
cm
.
cfilter
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
nil
,
4231002
,
e
,
tp
)
end
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cfilter
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
4231002
,
e
,
tp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cfilter
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
4231002
,
e
,
tp
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetDescription"
,
aux
.
Stringid
(
m
,
0
))
.
e
(
"SetDescription"
,
aux
.
Stringid
(
m
,
0
))
.
e
(
"SetCategory"
,
CATEGORY_EQUIP
)
.
e
(
"SetCategory"
,
CATEGORY_EQUIP
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
.
e
(
"SetCode"
,
EVENT_TO_GRAVE
)
.
e
(
"SetCode"
,
EVENT_TO_GRAVE
)
.
e
(
"SetCondition"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetCondition"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
return
c
:
IsPreviousLocation
(
LOCATION_ONFIELD
)
and
c
:
IsPreviousPosition
(
POS_FACEUP
)
and
c
:
IsReason
(
REASON_DESTROY
)
and
c
:
CheckUniqueOnField
(
tp
)
end
)
return
c
:
IsPreviousLocation
(
LOCATION_ONFIELD
)
and
c
:
IsPreviousPosition
(
POS_FACEUP
)
and
c
:
IsReason
(
REASON_DESTROY
)
and
c
:
CheckUniqueOnField
(
tp
)
end
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
cm
.
eqfilter
(
chkc
)
end
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
cm
.
eqfilter
(
chkc
)
end
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
2
)
and
e
:
GetHandler
():
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
2
)
and
e
:
GetHandler
():
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
IsExistingTarget
(
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
and
Duel
.
IsExistingTarget
(
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
e
:
SetLabel
(
1
)
e
:
SetLabel
(
1
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
Duel
.
SelectTarget
(
tp
,
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
)
.
e
(
"SetOperation"
,
cm
.
operation
)
.
e
(
"SetOperation"
,
cm
.
operation
)
.
Return
())
.
Return
())
end
end
function
cm
.
eqfilter
(
c
)
function
cm
.
eqfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_SPELLCASTER
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_SPELLCASTER
)
end
end
function
cm
.
cfilter
(
c
,
code
,
e
,
tp
)
function
cm
.
cfilter
(
c
,
code
,
e
,
tp
)
return
c
:
IsCode
(
code
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
return
c
:
IsCode
(
code
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
end
function
cm
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
cm
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
local
tc
=
Duel
.
GetFirstTarget
()
if
c
:
IsRelateToEffect
(
e
)
and
tc
and
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
if
c
:
IsRelateToEffect
(
e
)
and
tc
and
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
if
Duel
.
Equip
(
tp
,
c
,
tc
)
~=
0
if
Duel
.
Equip
(
tp
,
c
,
tc
)
~=
0
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsFacedown
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
then
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsFacedown
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
then
if
e
:
GetLabel
()
==
0
then
return
end
if
e
:
GetLabel
()
==
0
then
return
end
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsFacedown
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsFacedown
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
end
end
end
end
end
end
end
function
iCount
(
name
,
tp
,
m
,
id
)
function
iCount
(
name
,
tp
,
m
,
id
)
return
((
name
==
"get"
or
name
==
"set"
)
return
((
name
==
"get"
or
name
==
"set"
)
and
{(
name
==
"get"
and
{(
name
==
"get"
and
{
tonumber
(((
Duel
.
GetFlagEffect
(
tp
,
m
)
==
nil
)
and
{
0
}
or
{
Duel
.
GetFlagEffect
(
tp
,
m
)})[
1
])}
and
{
tonumber
(((
Duel
.
GetFlagEffect
(
tp
,
m
)
==
nil
)
and
{
0
}
or
{
Duel
.
GetFlagEffect
(
tp
,
m
)})[
1
])}
or
{
Debug
.
Message
(
""
,
"请使用Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)"
)
})[
1
]}
or
{
Debug
.
Message
(
""
,
"请使用Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)"
)
})[
1
]}
or
{(
bit
.
band
(
iCount
(
"get"
,
tp
,
m
,
id
),
math.pow
(
2
,
id
-
1
))
==
0
and
{
true
}
or
{
false
})[
1
]})[
1
]
or
{(
bit
.
band
(
iCount
(
"get"
,
tp
,
m
,
id
),
math.pow
(
2
,
id
-
1
))
==
0
and
{
true
}
or
{
false
})[
1
]})[
1
]
end
end
function
iFunc
(
c
,
x
)
function
iFunc
(
c
,
x
)
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
fe
=
function
(
name
,
...
)
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
return
iFunc
(
c
,
__this
)
end
local
fe
=
function
(
name
,
...
)
if
name
==
"RegisterEffect"
then
c
:
RegisterEffect
(
__this
:
Clone
())
else
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
end
return
iFunc
(
c
,
__this
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
func
=
{
e
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
local
func
=
{
e
=
fe
,
Clon
e
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
return
func
return
func
end
end
\ No newline at end of file
expansions/script/c4231008.lua
View file @
a6a72417
...
@@ -2,72 +2,72 @@
...
@@ -2,72 +2,72 @@
local
m
=
4231008
local
m
=
4231008
local
cm
=
_G
[
"c"
..
m
]
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
function
cm
.
initial_effect
(
c
)
iFunc
(
c
).
c
(
"RegisterEffect"
,
iFunc
(
c
)
iFunc
(
c
).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
)
.
e
(
"SetCode"
,
EFFECT_EQUIP_LIMIT
)
.
e
(
"SetCode"
,
EFFECT_EQUIP_LIMIT
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CANNOT_DISABLE
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CANNOT_DISABLE
)
.
e
(
"SetValue"
,
function
(
e
,
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
end
)
.
e
(
"SetValue"
,
function
(
e
,
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetType"
,
EFFECT_TYPE_EQUIP
)
.
e
(
"SetType"
,
EFFECT_TYPE_EQUIP
)
.
e
(
"SetCode"
,
EFFECT_EXTRA_ATTACK
)
.
e
(
"SetCode"
,
EFFECT_EXTRA_ATTACK
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CANNOT_DISABLE
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CANNOT_DISABLE
)
.
e
(
"SetRange"
,
LOCATION_SZONE
)
.
e
(
"SetRange"
,
LOCATION_SZONE
)
.
e
(
"SetValue"
,
function
(
e
)
return
e
:
GetHandler
():
GetEquipTarget
():
GetEquipCount
()
-
1
end
)
.
e
(
"SetValue"
,
function
(
e
)
return
e
:
GetHandler
():
GetEquipTarget
():
GetEquipCount
()
-
1
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetType"
,
EFFECT_TYPE_ACTIVATE
)
.
e
(
"SetType"
,
EFFECT_TYPE_ACTIVATE
)
.
e
(
"SetCode"
,
EVENT_FREE_CHAIN
)
.
e
(
"SetCode"
,
EVENT_FREE_CHAIN
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CARD_TARGET
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CARD_TARGET
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
cm
.
eqfilter
(
chkc
)
end
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
cm
.
eqfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
cfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
IsExistingTarget
(
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
cfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
IsExistingTarget
(
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
end
)
Duel
.
SelectTarget
(
tp
,
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
end
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
local
tc
=
Duel
.
GetFirstTarget
()
if
c
:
IsRelateToEffect
(
e
)
and
tc
and
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
if
c
:
IsRelateToEffect
(
e
)
and
tc
and
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
if
Duel
.
Equip
(
tp
,
c
,
tc
)
~=
0
then
if
Duel
.
Equip
(
tp
,
c
,
tc
)
~=
0
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
end
end
end
)
end
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetCategory"
,
CATEGORY_TOHAND
)
.
e
(
"SetCategory"
,
CATEGORY_TOHAND
)
.
e
(
"SetType"
,
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
.
e
(
"SetType"
,
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
.
e
(
"SetCode"
,
EVENT_EQUIP
)
.
e
(
"SetCode"
,
EVENT_EQUIP
)
.
e
(
"SetRange"
,
0xff
)
.
e
(
"SetRange"
,
0xff
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_DELAY
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_DELAY
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
e
:
GetHandler
():
GetEquipTarget
()
==
nil
then
return
false
end
if
e
:
GetHandler
():
GetEquipTarget
()
==
nil
then
return
false
end
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
1
)
and
e
:
GetHandler
():
GetEquipTarget
():
IsType
(
TYPE_NORMAL
)
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
1
)
and
e
:
GetHandler
():
GetEquipTarget
():
IsType
(
TYPE_NORMAL
)
and
eg
:
IsContains
(
e
:
GetHandler
())
and
eg
:
IsContains
(
e
:
GetHandler
())
and
Duel
.
IsExistingMatchingCard
(
cm
.
gfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
and
Duel
.
IsExistingMatchingCard
(
cm
.
gfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
gfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
gfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
)
.
Return
())
.
Return
())
end
end
function
cm
.
cfilter
(
c
)
function
cm
.
cfilter
(
c
)
return
c
:
IsCode
(
4231005
)
and
c
:
IsAbleToHand
()
return
c
:
IsCode
(
4231005
)
and
c
:
IsAbleToHand
()
end
end
function
cm
.
gfilter
(
c
)
function
cm
.
gfilter
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
end
function
cm
.
eqfilter
(
c
)
function
cm
.
eqfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsType
(
TYPE_MONSTER
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
end
function
iCount
(
name
,
tp
,
m
,
id
)
function
iCount
(
name
,
tp
,
m
,
id
)
return
((
name
==
"get"
or
name
==
"set"
)
return
((
name
==
"get"
or
name
==
"set"
)
and
{(
name
==
"get"
and
{(
name
==
"get"
and
{
tonumber
(((
Duel
.
GetFlagEffect
(
tp
,
m
)
==
nil
)
and
{
0
}
or
{
Duel
.
GetFlagEffect
(
tp
,
m
)})[
1
])}
and
{
tonumber
(((
Duel
.
GetFlagEffect
(
tp
,
m
)
==
nil
)
and
{
0
}
or
{
Duel
.
GetFlagEffect
(
tp
,
m
)})[
1
])}
or
{
Debug
.
Message
(
""
,
"请使用Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)"
)
})[
1
]}
or
{
Debug
.
Message
(
""
,
"请使用Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)"
)
})[
1
]}
or
{(
bit
.
band
(
iCount
(
"get"
,
tp
,
m
,
id
),
math.pow
(
2
,
id
-
1
))
==
0
and
{
true
}
or
{
false
})[
1
]})[
1
]
or
{(
bit
.
band
(
iCount
(
"get"
,
tp
,
m
,
id
),
math.pow
(
2
,
id
-
1
))
==
0
and
{
true
}
or
{
false
})[
1
]})[
1
]
end
end
function
iFunc
(
c
,
x
)
function
iFunc
(
c
,
x
)
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
fe
=
function
(
name
,
...
)
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
return
iFunc
(
c
,
__this
)
end
local
fe
=
function
(
name
,
...
)
if
name
==
"RegisterEffect"
then
c
:
RegisterEffect
(
__this
:
Clone
())
else
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
end
return
iFunc
(
c
,
__this
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
func
=
{
e
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
local
func
=
{
e
=
fe
,
Clon
e
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
return
func
return
func
end
end
\ No newline at end of file
expansions/script/c4231009.lua
View file @
a6a72417
...
@@ -2,151 +2,151 @@
...
@@ -2,151 +2,151 @@
local
m
=
4231009
local
m
=
4231009
local
cm
=
_G
[
"c"
..
m
]
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
function
cm
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
c
:
EnableReviveLimit
()
iFunc
(
c
).
c
(
"RegisterEffect"
,
iFunc
(
c
)
iFunc
(
c
).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetDescription"
,
aux
.
Stringid
(
m
,
0
))
.
e
(
"SetDescription"
,
aux
.
Stringid
(
m
,
0
))
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
.
e
(
"SetCode"
,
EVENT_SPSUMMON_SUCCESS
)
.
e
(
"SetCode"
,
EVENT_SPSUMMON_SUCCESS
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_DELAY
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_DELAY
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
1
)
and
Duel
.
GetDecktopGroup
(
tp
,
3
):
FilterCount
(
function
(
c
,
e
)
return
c
:
IsDestructable
(
e
)
end
,
nil
,
e
)
==
3
end
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
)
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
1
)
and
Duel
.
GetDecktopGroup
(
tp
,
3
):
FilterCount
(
function
(
c
,
e
)
return
c
:
IsDestructable
(
e
)
end
,
nil
,
e
)
==
3
end
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetDecktopGroup
(
tp
,
3
)
local
g
=
Duel
.
GetDecktopGroup
(
tp
,
3
)
if
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
~=
0
then
if
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
~=
0
then
local
dmg
=
g
:
FilterCount
(
function
(
c
)
return
c
:
IsLocation
(
LOCATION_GRAVE
)
and
c
:
IsPreviousLocation
(
LOCATION_DECK
)
and
c
:
IsReason
(
REASON_DESTROY
)
and
((
c
:
IsType
(
Equip
)
and
c
:
IsType
(
TYPE_SPELL
))
or
(
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsType
(
TYPE_MONSTER
)))
end
,
nil
)
*
500
local
dmg
=
g
:
FilterCount
(
function
(
c
)
return
c
:
IsLocation
(
LOCATION_GRAVE
)
and
c
:
IsPreviousLocation
(
LOCATION_DECK
)
and
c
:
IsReason
(
REASON_DESTROY
)
and
((
c
:
IsType
(
Equip
)
and
c
:
IsType
(
TYPE_SPELL
))
or
(
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsType
(
TYPE_MONSTER
)))
end
,
nil
)
*
500
Duel
.
Damage
(
1
-
tp
,
dmg
,
REASON_EFFECT
)
Duel
.
Damage
(
1
-
tp
,
dmg
,
REASON_EFFECT
)
end
end
)
end
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetDescription"
,
aux
.
Stringid
(
m
,
0
))
.
e
(
"SetDescription"
,
aux
.
Stringid
(
m
,
0
))
.
e
(
"SetType"
,
EFFECT_TYPE_IGNITION
)
.
e
(
"SetType"
,
EFFECT_TYPE_IGNITION
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetRange"
,
LOCATION_MZONE
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
.
e
(
"SetTarget"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
2
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
filter1
,
tp
,
LOCATION_MZONE
,
0
,
1
,
e
:
GetHandler
())
and
Duel
.
IsExistingTarget
(
cm
.
filter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
if
chk
==
0
then
return
iCount
(
0
,
tp
,
m
,
2
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
filter1
,
tp
,
LOCATION_MZONE
,
0
,
1
,
e
:
GetHandler
())
and
Duel
.
IsExistingTarget
(
cm
.
filter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
local
g
=
Duel
.
SelectTarget
(
tp
,
cm
.
filter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectTarget
(
tp
,
cm
.
filter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
g
,
1
,
0
,
0
)
end
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
g
,
1
,
0
,
0
)
end
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
local
tc
=
Duel
.
GetFirstTarget
()
if
c
:
IsRelateToEffect
(
e
)
and
tc
and
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
if
c
:
IsRelateToEffect
(
e
)
and
tc
and
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter1
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
c
):
GetFirst
()
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter1
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
c
):
GetFirst
()
Duel
.
Equip
(
tp
,
tc
,
g
)
Duel
.
Equip
(
tp
,
tc
,
g
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_PHASE
+
PHASE_STANDBY
)
e2
:
SetCode
(
EVENT_PHASE
+
PHASE_STANDBY
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCountLimit
(
1
)
e2
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
+
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
+
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetOperation
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
e2
:
SetOperation
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Destroy
(
e
:
GetHandler
(),
REASON_RULE
)
Duel
.
Destroy
(
e
:
GetHandler
(),
REASON_RULE
)
end
)
end
)
tc
:
RegisterEffect
(
e2
)
tc
:
RegisterEffect
(
e2
)
end
end
)
end
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
)
.
e
(
"SetCode"
,
EFFECT_SPSUMMON_CONDITION
)
.
e
(
"SetCode"
,
EFFECT_SPSUMMON_CONDITION
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
.
e
(
"SetValue"
,
function
(
e
,
se
,
sp
,
st
)
return
e
:
GetHandler
():
GetLocation
()
~=
LOCATION_EXTRA
end
)
.
e
(
"SetValue"
,
function
(
e
,
se
,
sp
,
st
)
return
e
:
GetHandler
():
GetLocation
()
~=
LOCATION_EXTRA
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetType"
,
EFFECT_TYPE_FIELD
)
.
e
(
"SetType"
,
EFFECT_TYPE_FIELD
)
.
e
(
"SetCode"
,
EFFECT_SPSUMMON_PROC
)
.
e
(
"SetCode"
,
EFFECT_SPSUMMON_PROC
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_UNCOPYABLE
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_UNCOPYABLE
)
.
e
(
"SetRange"
,
LOCATION_EXTRA
)
.
e
(
"SetRange"
,
LOCATION_EXTRA
)
.
e
(
"SetCondition"
,
function
(
e
,
c
)
.
e
(
"SetCondition"
,
function
(
e
,
c
)
if
c
==
nil
then
return
true
end
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
local
tp
=
c
:
GetControler
()
return
Duel
.
GetMZoneCount
(
tp
)
>-
2
and
Duel
.
GetLocationCountFromEx
(
tp
)
>
0
return
Duel
.
GetMZoneCount
(
tp
)
>-
2
and
Duel
.
GetLocationCountFromEx
(
tp
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter1
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
tp
)
end
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter1
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
tp
)
end
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter1
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
tp
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter1
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter2
,
tp
,
LOCATION_SZONE
,
0
,
1
,
1
,
g1
:
GetFirst
())
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter2
,
tp
,
LOCATION_SZONE
,
0
,
1
,
1
,
g1
:
GetFirst
())
g1
:
Merge
(
g2
)
g1
:
Merge
(
g2
)
Duel
.
SendtoGrave
(
g1
,
REASON_COST
)
end
)
Duel
.
SendtoGrave
(
g1
,
REASON_COST
)
end
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
Return
()).
c
(
"RegisterEffect"
,
iFunc
(
c
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
)
.
e
(
"SetType"
,
EFFECT_TYPE_SINGLE
)
.
e
(
"SetCode"
,
EFFECT_FUSION_MATERIAL
)
.
e
(
"SetCode"
,
EFFECT_FUSION_MATERIAL
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
.
e
(
"SetProperty"
,
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
.
e
(
"SetCondition"
,
function
(
e
,
g
,
gc
,
chkfnf
)
.
e
(
"SetCondition"
,
function
(
e
,
g
,
gc
,
chkfnf
)
if
g
==
nil
then
return
true
end
if
g
==
nil
then
return
true
end
local
tp
=
e
:
GetHandlerPlayer
()
local
tp
=
e
:
GetHandlerPlayer
()
local
f1
=
cm
.
filter1
local
f1
=
cm
.
filter1
local
f2
=
cm
.
filter2
local
f2
=
cm
.
filter2
local
chkf
=
bit
.
band
(
chkfnf
,
0xff
)
local
chkf
=
bit
.
band
(
chkfnf
,
0xff
)
local
mg
=
g
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
(),
true
)
local
mg
=
g
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
(),
true
)
if
gc
then
if
gc
then
if
not
gc
:
IsCanBeFusionMaterial
(
e
:
GetHandler
(),
true
)
then
return
false
end
if
not
gc
:
IsCanBeFusionMaterial
(
e
:
GetHandler
(),
true
)
then
return
false
end
return
(
f1
(
gc
)
and
mg
:
IsExists
(
f2
,
1
,
gc
))
return
(
f1
(
gc
)
and
mg
:
IsExists
(
f2
,
1
,
gc
))
or
(
f2
(
gc
)
and
mg
:
IsExists
(
f1
,
1
,
gc
))
end
or
(
f2
(
gc
)
and
mg
:
IsExists
(
f1
,
1
,
gc
))
end
local
g1
=
Group
.
CreateGroup
()
local
g2
=
Group
.
CreateGroup
()
local
fs
=
false
local
g1
=
Group
.
CreateGroup
()
local
g2
=
Group
.
CreateGroup
()
local
fs
=
false
local
tc
=
mg
:
GetFirst
()
local
tc
=
mg
:
GetFirst
()
while
tc
do
while
tc
do
if
f1
(
tc
)
then
g1
:
AddCard
(
tc
)
if
aux
.
FConditionCheckF
(
tc
,
chkf
)
then
fs
=
true
end
end
if
f1
(
tc
)
then
g1
:
AddCard
(
tc
)
if
aux
.
FConditionCheckF
(
tc
,
chkf
)
then
fs
=
true
end
end
if
f2
(
tc
)
then
g2
:
AddCard
(
tc
)
if
aux
.
FConditionCheckF
(
tc
,
chkf
)
then
fs
=
true
end
end
if
f2
(
tc
)
then
g2
:
AddCard
(
tc
)
if
aux
.
FConditionCheckF
(
tc
,
chkf
)
then
fs
=
true
end
end
tc
=
mg
:
GetNext
()
tc
=
mg
:
GetNext
()
end
end
if
chkf
~=
PLAYER_NONE
then
if
chkf
~=
PLAYER_NONE
then
return
fs
and
g1
:
IsExists
(
aux
.
FConditionFilterF2
,
1
,
nil
,
g2
)
return
fs
and
g1
:
IsExists
(
aux
.
FConditionFilterF2
,
1
,
nil
,
g2
)
else
return
g1
:
IsExists
(
aux
.
FConditionFilterF2
,
1
,
nil
,
g2
)
end
end
)
else
return
g1
:
IsExists
(
aux
.
FConditionFilterF2
,
1
,
nil
,
g2
)
end
end
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
.
e
(
"SetOperation"
,
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
f1
=
cm
.
filter1
local
f1
=
cm
.
filter1
local
f2
=
cm
.
filter2
local
f2
=
cm
.
filter2
local
chkf
=
bit
.
band
(
chkfnf
,
0xff
)
local
chkf
=
bit
.
band
(
chkfnf
,
0xff
)
local
g
=
eg
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
(),
true
)
local
g
=
eg
:
Filter
(
Card
.
IsCanBeFusionMaterial
,
nil
,
e
:
GetHandler
(),
true
)
if
gc
then
if
gc
then
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
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
local
g1
=
sg
:
Select
(
tp
,
1
,
1
,
nil
)
local
g1
=
sg
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SetFusionMaterial
(
g1
)
Duel
.
SetFusionMaterial
(
g1
)
return
return
end
end
local
sg
=
g
:
Filter
(
aux
.
FConditionFilterF2c
,
nil
,
f1
,
f2
)
local
sg
=
g
:
Filter
(
aux
.
FConditionFilterF2c
,
nil
,
f1
,
f2
)
local
g1
=
nil
local
g1
=
nil
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
if
chkf
~=
PLAYER_NONE
then
if
chkf
~=
PLAYER_NONE
then
g1
=
sg
:
FilterSelect
(
tp
,
aux
.
FConditionCheckF
,
1
,
1
,
nil
,
chkf
)
g1
=
sg
:
FilterSelect
(
tp
,
aux
.
FConditionCheckF
,
1
,
1
,
nil
,
chkf
)
else
g1
=
sg
:
Select
(
tp
,
1
,
1
,
nil
)
end
else
g1
=
sg
:
Select
(
tp
,
1
,
1
,
nil
)
end
local
tc1
=
g1
:
GetFirst
()
local
tc1
=
g1
:
GetFirst
()
sg
:
RemoveCard
(
tc1
)
sg
:
RemoveCard
(
tc1
)
local
b1
=
f1
(
tc1
)
local
b1
=
f1
(
tc1
)
local
b2
=
f2
(
tc1
)
local
b2
=
f2
(
tc1
)
if
b1
and
not
b2
then
sg
:
Remove
(
aux
.
FConditionFilterF2r
,
nil
,
f1
,
f2
)
end
if
b1
and
not
b2
then
sg
:
Remove
(
aux
.
FConditionFilterF2r
,
nil
,
f1
,
f2
)
end
if
b2
and
not
b1
then
sg
:
Remove
(
aux
.
FConditionFilterF2r
,
nil
,
f2
,
f1
)
end
if
b2
and
not
b1
then
sg
:
Remove
(
aux
.
FConditionFilterF2r
,
nil
,
f2
,
f1
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
local
g2
=
sg
:
Select
(
tp
,
1
,
1
,
nil
)
local
g2
=
sg
:
Select
(
tp
,
1
,
1
,
nil
)
g1
:
Merge
(
g2
)
g1
:
Merge
(
g2
)
Duel
.
SetFusionMaterial
(
g1
)
end
)
Duel
.
SetFusionMaterial
(
g1
)
end
)
.
Return
())
.
Return
())
end
end
function
cm
.
spfilter1
(
c
,
tp
)
function
cm
.
spfilter1
(
c
,
tp
)
return
cm
.
filter1
(
c
)
and
c
:
IsAbleToGraveAsCost
()
and
c
:
IsCanBeFusionMaterial
()
return
cm
.
filter1
(
c
)
and
c
:
IsAbleToGraveAsCost
()
and
c
:
IsCanBeFusionMaterial
()
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter2
,
tp
,
LOCATION_SZONE
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter2
,
tp
,
LOCATION_SZONE
,
0
,
1
,
nil
)
end
end
function
cm
.
spfilter2
(
c
)
function
cm
.
spfilter2
(
c
)
return
cm
.
filter2
(
c
)
and
c
:
IsCanBeFusionMaterial
(
nil
,
true
)
and
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFaceup
()
return
cm
.
filter2
(
c
)
and
c
:
IsCanBeFusionMaterial
(
nil
,
true
)
and
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFaceup
()
end
end
function
cm
.
filter1
(
c
)
function
cm
.
filter1
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
end
end
function
cm
.
filter2
(
c
)
function
cm
.
filter2
(
c
)
return
c
:
IsType
(
TYPE_EQUIP
)
and
c
:
IsType
(
TYPE_SPELL
)
return
c
:
IsType
(
TYPE_EQUIP
)
and
c
:
IsType
(
TYPE_SPELL
)
end
end
function
iCount
(
name
,
tp
,
m
,
id
)
function
iCount
(
name
,
tp
,
m
,
id
)
return
((
name
==
"get"
or
name
==
"set"
)
return
((
name
==
"get"
or
name
==
"set"
)
and
{(
name
==
"get"
and
{(
name
==
"get"
and
{
tonumber
(((
Duel
.
GetFlagEffect
(
tp
,
m
)
==
nil
)
and
{
0
}
or
{
Duel
.
GetFlagEffect
(
tp
,
m
)})[
1
])}
and
{
tonumber
(((
Duel
.
GetFlagEffect
(
tp
,
m
)
==
nil
)
and
{
0
}
or
{
Duel
.
GetFlagEffect
(
tp
,
m
)})[
1
])}
or
{
Debug
.
Message
(
""
,
"请使用Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)"
)
})[
1
]}
or
{
Debug
.
Message
(
""
,
"请使用Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)"
)
})[
1
]}
or
{(
bit
.
band
(
iCount
(
"get"
,
tp
,
m
,
id
),
math.pow
(
2
,
id
-
1
))
==
0
and
{
true
}
or
{
false
})[
1
]})[
1
]
or
{(
bit
.
band
(
iCount
(
"get"
,
tp
,
m
,
id
),
math.pow
(
2
,
id
-
1
))
==
0
and
{
true
}
or
{
false
})[
1
]})[
1
]
end
end
function
iFunc
(
c
,
x
)
function
iFunc
(
c
,
x
)
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
__this
=
(
aux
.
GetValueType
(
c
)
==
"Card"
and
{(
x
==
nil
and
{
Effect
.
CreateEffect
(
c
)}
or
{
x
})[
1
]}
or
{
x
})[
1
]
local
fe
=
function
(
name
,
...
)
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
return
iFunc
(
c
,
__this
)
end
local
fe
=
function
(
name
,
...
)
if
name
==
"RegisterEffect"
then
c
:
RegisterEffect
(
__this
:
Clone
())
else
(
type
(
__this
[
name
])
==
"function"
and
{
__this
[
name
]}
or
{
""
})[
1
](
__this
,
...
)
end
return
iFunc
(
c
,
__this
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
fc
=
function
(
name
,
...
)
this
=
(
type
(
c
[
name
])
==
"function"
and
{
c
[
name
]}
or
{
""
})[
1
](
c
,
...
)
return
iFunc
(
c
,
c
)
end
local
func
=
{
e
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
local
func
=
{
e
=
fe
,
Clon
e
=
fe
,
c
=
fc
,
g
=
fc
,
v
=
function
()
return
this
end
,
Return
=
function
()
return
__this
:
Clone
()
end
}
return
func
return
func
end
end
\ No newline at end of file
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