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
alstroemeria-silentlove
ygopro-222DIY-cards
Commits
0e9dd768
Commit
0e9dd768
authored
Jun 25, 2023
by
songtongtong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
9dfc4481
Pipeline
#22396
passed with stages
in 20 minutes and 16 seconds
Changes
18
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
1940 additions
and
1931 deletions
+1940
-1931
expansions/script/c12001501.lua
expansions/script/c12001501.lua
+121
-121
expansions/script/c12001502.lua
expansions/script/c12001502.lua
+125
-125
expansions/script/c12001503.lua
expansions/script/c12001503.lua
+121
-121
expansions/script/c12001504.lua
expansions/script/c12001504.lua
+121
-121
expansions/script/c12001510.lua
expansions/script/c12001510.lua
+116
-115
expansions/script/c12001511.lua
expansions/script/c12001511.lua
+148
-147
expansions/script/c12001515.lua
expansions/script/c12001515.lua
+110
-109
expansions/script/c16400094.lua
expansions/script/c16400094.lua
+1
-1
expansions/script/c50221200.lua
expansions/script/c50221200.lua
+112
-112
expansions/script/c50222100.lua
expansions/script/c50222100.lua
+108
-108
expansions/script/c65050018.lua
expansions/script/c65050018.lua
+73
-72
expansions/script/c65060039.lua
expansions/script/c65060039.lua
+65
-67
expansions/script/c71401001.lua
expansions/script/c71401001.lua
+174
-174
expansions/script/c71401003.lua
expansions/script/c71401003.lua
+74
-74
expansions/script/c71401004.lua
expansions/script/c71401004.lua
+98
-98
expansions/script/c71401008.lua
expansions/script/c71401008.lua
+110
-110
expansions/script/c9310022.lua
expansions/script/c9310022.lua
+125
-118
expansions/script/c9310027.lua
expansions/script/c9310027.lua
+138
-138
No files found.
expansions/script/c12001501.lua
View file @
0e9dd768
--天外之灾 骨骸鱼
local
m
=
12001501
local
cm
=
_G
[
"c"
..
m
]
Duel
.
LoadScript
(
"c12000000.lua"
)
function
cm
.
initial_effect
(
c
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_REMOVE
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
sptg
)
e1
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e1
)
--search
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
12001501
,
2
))
e3
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_GRAVE
)
e3
:
SetCost
(
aux
.
bfgcost
)
e3
:
SetTarget
(
cm
.
thtg
)
e3
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsAbleToRemove
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
#
g
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
cm
.
grace
(
g
)
if
not
g
then
return
false
end
local
race
=
0
local
tc
=
g
:
GetFirst
()
while
tc
do
race
=
race
|
tc
:
GetRace
()
tc
=
g
:
GetNext
()
end
return
race
end
function
cm
.
gatt
(
g
)
if
not
g
then
return
false
end
local
att
=
0
local
tc
=
g
:
GetFirst
()
while
tc
do
att
=
att
|
tc
:
GetAttribute
()
tc
=
g
:
GetNext
()
end
return
race
end
function
cm
.
spfilter1
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
,
g
+
c
)
end
function
cm
.
spfilter2
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter3
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
,
g
+
c
)
end
function
cm
.
spfilter3
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
,
Group
.
FromCards
(
c
))
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
LOCATION_DECK
)
end
function
cm
.
thfilter3
(
c
,
e
,
tp
,
tc
,
tt
)
local
race
=
tc
:
GetRace
()
local
att
=
tc
:
GetAttribute
()
return
not
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsRace
(
race
)
and
c
:
IsAttribute
(
att
)
and
(
tt
==
1
and
c
:
IsAbleToRemove
()
or
tt
==
2
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
or
tt
==
3
and
c
:
IsAbleToHand
()
or
tt
==
4
and
c
:
IsAbleToGrave
()
)
end
function
cm
.
reop
(
e
,
tp
,
tc
,
tt
,
loc
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
12001500
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter3
,
tp
,
loc
,
0
,
1
,
nil
,
e
,
tp
,
tc
,
tt
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
12001500
,
1
))
then
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter3
,
tp
,
loc
,
0
,
1
,
1
,
nil
,
e
,
tp
,
tc
,
tt
)
tc
=
g1
:
GetFirst
()
end
if
tt
==
1
then
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
elseif
tt
==
2
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
elseif
tt
==
3
then
Duel
.
SendtoHand
(
tc
,
tp
,
REASON_EFFECT
)
elseif
tt
==
4
then
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
end
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
,
Group
.
FromCards
(
c
))
if
#
g1
>
0
then
cm
.
reop
(
e
,
tp
,
g1
:
GetFirst
(),
1
,
LOCATION_HAND
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
g1
+
c
)
if
#
g2
>
0
then
cm
.
reop
(
e
,
tp
,
g2
:
GetFirst
(),
1
,
LOCATION_DECK
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g3
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter3
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
g1
+
g2
+
c
)
if
#
g3
>
0
then
cm
.
reop
(
e
,
tp
,
g3
:
GetFirst
(),
2
,
LOCATION_DECK
)
end
end
end
--天外之灾 骨骸鱼
local
m
=
12001501
local
cm
=
_G
[
"c"
..
m
]
Duel
.
LoadScript
(
"c12000000.lua"
)
function
cm
.
initial_effect
(
c
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_REMOVE
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
sptg
)
e1
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e1
)
--search
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
12001501
,
2
))
e3
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_GRAVE
)
e3
:
SetCost
(
aux
.
bfgcost
)
e3
:
SetTarget
(
cm
.
thtg
)
e3
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsAbleToRemove
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
#
g
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
cm
.
grace
(
g
)
if
not
g
then
return
false
end
local
race
=
0
local
tc
=
g
:
GetFirst
()
while
tc
do
race
=
race
|
tc
:
GetRace
()
tc
=
g
:
GetNext
()
end
return
race
end
function
cm
.
gatt
(
g
)
if
not
g
then
return
false
end
local
att
=
0
local
tc
=
g
:
GetFirst
()
while
tc
do
att
=
att
|
tc
:
GetAttribute
()
tc
=
g
:
GetNext
()
end
return
race
end
function
cm
.
spfilter1
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
,
g
+
c
)
end
function
cm
.
spfilter2
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter3
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
,
g
+
c
)
end
function
cm
.
spfilter3
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
,
Group
.
FromCards
(
c
))
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
LOCATION_DECK
)
end
function
cm
.
thfilter3
(
c
,
e
,
tp
,
tc
,
tt
)
local
race
=
tc
:
GetRace
()
local
att
=
tc
:
GetAttribute
()
return
not
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsRace
(
race
)
and
c
:
IsAttribute
(
att
)
and
(
tt
==
1
and
c
:
IsAbleToRemove
()
or
tt
==
2
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
or
tt
==
3
and
c
:
IsAbleToHand
()
or
tt
==
4
and
c
:
IsAbleToGrave
()
)
end
function
cm
.
reop
(
e
,
tp
,
tc
,
tt
,
loc
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
12001500
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter3
,
tp
,
loc
,
0
,
1
,
nil
,
e
,
tp
,
tc
,
tt
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
12001500
,
1
))
then
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter3
,
tp
,
loc
,
0
,
1
,
1
,
nil
,
e
,
tp
,
tc
,
tt
)
tc
=
g1
:
GetFirst
()
end
if
tt
==
1
then
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
elseif
tt
==
2
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
elseif
tt
==
3
then
Duel
.
SendtoHand
(
tc
,
tp
,
REASON_EFFECT
)
elseif
tt
==
4
then
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
end
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
,
Group
.
FromCards
(
c
))
if
#
g1
>
0
then
cm
.
reop
(
e
,
tp
,
g1
:
GetFirst
(),
1
,
LOCATION_HAND
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
g1
+
c
)
if
#
g2
>
0
then
cm
.
reop
(
e
,
tp
,
g2
:
GetFirst
(),
1
,
LOCATION_DECK
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g3
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter3
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
g1
+
g2
+
c
)
if
#
g3
>
0
then
cm
.
reop
(
e
,
tp
,
g3
:
GetFirst
(),
2
,
LOCATION_DECK
)
end
end
end
end
\ No newline at end of file
expansions/script/c12001502.lua
View file @
0e9dd768
--天外之灾 浮游蛇
local
m
=
12001502
local
cm
=
_G
[
"c"
..
m
]
Duel
.
LoadScript
(
"c12000000.lua"
)
function
cm
.
initial_effect
(
c
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_REMOVE
+
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
sptg
)
e1
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e1
)
--search
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
12001501
,
2
))
e3
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_GRAVE
)
e3
:
SetCost
(
aux
.
bfgcost
)
e3
:
SetTarget
(
cm
.
thtg
)
e3
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsAbleToRemove
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
#
g
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
cm
.
grace
(
g
)
if
not
g
then
return
false
end
local
race
=
0
local
tc
=
g
:
GetFirst
()
while
tc
do
race
=
race
|
tc
:
GetRace
()
tc
=
g
:
GetNext
()
end
return
race
end
function
cm
.
gatt
(
g
)
if
not
g
then
return
false
end
local
att
=
0
local
tc
=
g
:
GetFirst
()
while
tc
do
att
=
att
|
tc
:
GetAttribute
()
tc
=
g
:
GetNext
()
end
return
race
end
function
cm
.
spfilter1
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
,
g
+
c
)
end
function
cm
.
spfilter2
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter3
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
,
g
+
c
)
end
function
cm
.
spfilter3
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
,
Group
.
FromCards
(
c
))
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thfilter3
(
c
,
e
,
tp
,
tc
,
tt
)
local
race
=
tc
:
GetRace
()
local
att
=
tc
:
GetAttribute
()
return
not
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsRace
(
race
)
and
c
:
IsAttribute
(
att
)
and
(
tt
==
1
and
c
:
IsAbleToRemove
()
or
tt
==
2
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
or
tt
==
3
and
c
:
IsAbleToHand
()
or
tt
==
4
and
c
:
IsAbleToGrave
()
)
end
function
cm
.
reop
(
e
,
tp
,
tc
,
tt
,
loc
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
12001500
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter3
,
tp
,
loc
,
0
,
1
,
nil
,
e
,
tp
,
tc
,
tt
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
12001500
,
1
))
then
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter3
,
tp
,
loc
,
0
,
1
,
1
,
nil
,
e
,
tp
,
tc
,
tt
)
tc
=
g1
:
GetFirst
()
end
if
tt
==
1
then
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
elseif
tt
==
2
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
elseif
tt
==
3
then
Duel
.
SendtoHand
(
tc
,
tp
,
REASON_EFFECT
)
elseif
tt
==
4
then
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
end
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
,
Group
.
FromCards
(
c
))
if
#
g1
>
0
then
cm
.
reop
(
e
,
tp
,
g1
:
GetFirst
(),
1
,
LOCATION_HAND
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
g1
+
c
)
if
#
g2
>
0
then
cm
.
reop
(
e
,
tp
,
g2
:
GetFirst
(),
1
,
LOCATION_DECK
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g3
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter3
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
g1
+
g2
+
c
)
if
#
g3
>
0
then
cm
.
reop
(
e
,
tp
,
g3
:
GetFirst
(),
3
,
LOCATION_DECK
)
end
end
end
end
--天外之灾 浮游蛇
local
m
=
12001502
local
cm
=
_G
[
"c"
..
m
]
Duel
.
LoadScript
(
"c12000000.lua"
)
function
cm
.
initial_effect
(
c
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_REMOVE
+
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
sptg
)
e1
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e1
)
--search
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
12001501
,
2
))
e3
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_GRAVE
)
e3
:
SetCost
(
aux
.
bfgcost
)
e3
:
SetTarget
(
cm
.
thtg
)
e3
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsAbleToRemove
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
#
g
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
cm
.
grace
(
g
)
if
not
g
then
return
false
end
local
race
=
0
local
tc
=
g
:
GetFirst
()
while
tc
do
race
=
race
|
tc
:
GetRace
()
tc
=
g
:
GetNext
()
end
return
race
end
function
cm
.
gatt
(
g
)
if
not
g
then
return
false
end
local
att
=
0
local
tc
=
g
:
GetFirst
()
while
tc
do
att
=
att
|
tc
:
GetAttribute
()
tc
=
g
:
GetNext
()
end
return
race
end
function
cm
.
spfilter1
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
,
g
+
c
)
end
function
cm
.
spfilter2
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter3
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
,
g
+
c
)
end
function
cm
.
spfilter3
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
,
Group
.
FromCards
(
c
))
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thfilter3
(
c
,
e
,
tp
,
tc
,
tt
)
local
race
=
tc
:
GetRace
()
local
att
=
tc
:
GetAttribute
()
return
not
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsRace
(
race
)
and
c
:
IsAttribute
(
att
)
and
(
tt
==
1
and
c
:
IsAbleToRemove
()
or
tt
==
2
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
or
tt
==
3
and
c
:
IsAbleToHand
()
or
tt
==
4
and
c
:
IsAbleToGrave
()
)
end
function
cm
.
reop
(
e
,
tp
,
tc
,
tt
,
loc
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
12001500
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter3
,
tp
,
loc
,
0
,
1
,
nil
,
e
,
tp
,
tc
,
tt
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
12001500
,
1
))
then
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter3
,
tp
,
loc
,
0
,
1
,
1
,
nil
,
e
,
tp
,
tc
,
tt
)
tc
=
g1
:
GetFirst
()
end
if
tt
==
1
then
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
elseif
tt
==
2
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
elseif
tt
==
3
then
Duel
.
SendtoHand
(
tc
,
tp
,
REASON_EFFECT
)
elseif
tt
==
4
then
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
end
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
,
Group
.
FromCards
(
c
))
if
#
g1
>
0
then
cm
.
reop
(
e
,
tp
,
g1
:
GetFirst
(),
1
,
LOCATION_HAND
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
g1
+
c
)
if
#
g2
>
0
then
cm
.
reop
(
e
,
tp
,
g2
:
GetFirst
(),
1
,
LOCATION_DECK
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g3
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter3
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
g1
+
g2
+
c
)
if
#
g3
>
0
then
cm
.
reop
(
e
,
tp
,
g3
:
GetFirst
(),
3
,
LOCATION_DECK
)
end
end
end
end
end
\ No newline at end of file
expansions/script/c12001503.lua
View file @
0e9dd768
--天外之灾 赤衣虿
local
m
=
12001503
local
cm
=
_G
[
"c"
..
m
]
Duel
.
LoadScript
(
"c12000000.lua"
)
function
cm
.
initial_effect
(
c
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_DRAW
+
CATEGORY_REMOVE
+
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
sptg
)
e1
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e1
)
--search
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
12001501
,
2
))
e3
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_GRAVE
)
e3
:
SetCost
(
aux
.
bfgcost
)
e3
:
SetTarget
(
cm
.
thtg
)
e3
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsAbleToRemove
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
#
g
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
cm
.
grace
(
g
)
if
not
g
then
return
false
end
local
race
=
0
local
tc
=
g
:
GetFirst
()
while
tc
do
race
=
race
|
tc
:
GetRace
()
tc
=
g
:
GetNext
()
end
return
race
end
function
cm
.
gatt
(
g
)
if
not
g
then
return
false
end
local
att
=
0
local
tc
=
g
:
GetFirst
()
while
tc
do
att
=
att
|
tc
:
GetAttribute
()
tc
=
g
:
GetNext
()
end
return
race
end
function
cm
.
spfilter1
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
,
g
+
c
)
end
function
cm
.
spfilter2
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter3
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
,
g
+
c
)
end
function
cm
.
spfilter3
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToGrave
()
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
,
Group
.
FromCards
(
c
))
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
0
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
cm
.
thfilter3
(
c
,
e
,
tp
,
tc
,
tt
)
local
race
=
tc
:
GetRace
()
local
att
=
tc
:
GetAttribute
()
return
not
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsRace
(
race
)
and
c
:
IsAttribute
(
att
)
and
(
tt
==
1
and
c
:
IsAbleToRemove
()
or
tt
==
2
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
or
tt
==
3
and
c
:
IsAbleToHand
()
or
tt
==
4
and
c
:
IsAbleToGrave
()
)
end
function
cm
.
reop
(
e
,
tp
,
tc
,
tt
,
loc
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
12001500
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter3
,
tp
,
loc
,
0
,
1
,
nil
,
e
,
tp
,
tc
,
tt
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
12001500
,
1
))
then
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter3
,
tp
,
loc
,
0
,
1
,
1
,
nil
,
e
,
tp
,
tc
,
tt
)
tc
=
g1
:
GetFirst
()
end
if
tt
==
1
then
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
elseif
tt
==
2
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
elseif
tt
==
3
then
Duel
.
SendtoHand
(
tc
,
tp
,
REASON_EFFECT
)
elseif
tt
==
4
then
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
end
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
,
Group
.
FromCards
(
c
))
if
#
g1
>
0
then
cm
.
reop
(
e
,
tp
,
g1
:
GetFirst
(),
1
,
LOCATION_HAND
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
g1
+
c
)
if
#
g2
>
0
then
cm
.
reop
(
e
,
tp
,
g2
:
GetFirst
(),
1
,
LOCATION_DECK
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g3
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter3
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
g1
+
g2
+
c
)
if
#
g3
>
0
then
cm
.
reop
(
e
,
tp
,
g3
:
GetFirst
(),
4
,
LOCATION_DECK
)
end
end
end
--天外之灾 赤衣虿
local
m
=
12001503
local
cm
=
_G
[
"c"
..
m
]
Duel
.
LoadScript
(
"c12000000.lua"
)
function
cm
.
initial_effect
(
c
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_DRAW
+
CATEGORY_REMOVE
+
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
sptg
)
e1
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e1
)
--search
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
12001501
,
2
))
e3
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_GRAVE
)
e3
:
SetCost
(
aux
.
bfgcost
)
e3
:
SetTarget
(
cm
.
thtg
)
e3
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsAbleToRemove
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
#
g
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
cm
.
grace
(
g
)
if
not
g
then
return
false
end
local
race
=
0
local
tc
=
g
:
GetFirst
()
while
tc
do
race
=
race
|
tc
:
GetRace
()
tc
=
g
:
GetNext
()
end
return
race
end
function
cm
.
gatt
(
g
)
if
not
g
then
return
false
end
local
att
=
0
local
tc
=
g
:
GetFirst
()
while
tc
do
att
=
att
|
tc
:
GetAttribute
()
tc
=
g
:
GetNext
()
end
return
race
end
function
cm
.
spfilter1
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
,
g
+
c
)
end
function
cm
.
spfilter2
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter3
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
,
g
+
c
)
end
function
cm
.
spfilter3
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToGrave
()
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
,
Group
.
FromCards
(
c
))
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
0
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
cm
.
thfilter3
(
c
,
e
,
tp
,
tc
,
tt
)
local
race
=
tc
:
GetRace
()
local
att
=
tc
:
GetAttribute
()
return
not
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsRace
(
race
)
and
c
:
IsAttribute
(
att
)
and
(
tt
==
1
and
c
:
IsAbleToRemove
()
or
tt
==
2
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
or
tt
==
3
and
c
:
IsAbleToHand
()
or
tt
==
4
and
c
:
IsAbleToGrave
()
)
end
function
cm
.
reop
(
e
,
tp
,
tc
,
tt
,
loc
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
12001500
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter3
,
tp
,
loc
,
0
,
1
,
nil
,
e
,
tp
,
tc
,
tt
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
12001500
,
1
))
then
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter3
,
tp
,
loc
,
0
,
1
,
1
,
nil
,
e
,
tp
,
tc
,
tt
)
tc
=
g1
:
GetFirst
()
end
if
tt
==
1
then
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
elseif
tt
==
2
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
elseif
tt
==
3
then
Duel
.
SendtoHand
(
tc
,
tp
,
REASON_EFFECT
)
elseif
tt
==
4
then
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
end
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
,
Group
.
FromCards
(
c
))
if
#
g1
>
0
then
cm
.
reop
(
e
,
tp
,
g1
:
GetFirst
(),
1
,
LOCATION_HAND
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
g1
+
c
)
if
#
g2
>
0
then
cm
.
reop
(
e
,
tp
,
g2
:
GetFirst
(),
1
,
LOCATION_DECK
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g3
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter3
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
g1
+
g2
+
c
)
if
#
g3
>
0
then
cm
.
reop
(
e
,
tp
,
g3
:
GetFirst
(),
4
,
LOCATION_DECK
)
end
end
end
end
\ No newline at end of file
expansions/script/c12001504.lua
View file @
0e9dd768
--天外之灾 白丝蛭
local
m
=
12001504
local
cm
=
_G
[
"c"
..
m
]
Duel
.
LoadScript
(
"c12000000.lua"
)
function
cm
.
initial_effect
(
c
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_DRAW
+
CATEGORY_REMOVE
+
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
sptg
)
e1
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e1
)
--search
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
12001501
,
2
))
e3
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_GRAVE
)
e3
:
SetCost
(
aux
.
bfgcost
)
e3
:
SetTarget
(
cm
.
thtg
)
e3
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsAbleToRemove
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
#
g
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
cm
.
grace
(
g
)
if
not
g
then
return
false
end
local
race
=
0
local
tc
=
g
:
GetFirst
()
while
tc
do
race
=
race
|
tc
:
GetRace
()
tc
=
g
:
GetNext
()
end
return
race
end
function
cm
.
gatt
(
g
)
if
not
g
then
return
false
end
local
att
=
0
local
tc
=
g
:
GetFirst
()
while
tc
do
att
=
att
|
tc
:
GetAttribute
()
tc
=
g
:
GetNext
()
end
return
race
end
function
cm
.
spfilter1
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
,
g
+
c
)
end
function
cm
.
spfilter2
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter3
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
,
g
+
c
)
end
function
cm
.
spfilter3
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
,
Group
.
FromCards
(
c
))
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
LOCATION_REMOVED
)
end
function
cm
.
thfilter3
(
c
,
e
,
tp
,
tc
,
tt
)
local
race
=
tc
:
GetRace
()
local
att
=
tc
:
GetAttribute
()
return
not
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsRace
(
race
)
and
c
:
IsAttribute
(
att
)
and
(
tt
==
1
and
c
:
IsAbleToRemove
()
or
tt
==
2
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
or
tt
==
3
and
c
:
IsAbleToHand
()
or
tt
==
4
and
c
:
IsAbleToGrave
()
)
end
function
cm
.
reop
(
e
,
tp
,
tc
,
tt
,
loc
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
12001500
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter3
,
tp
,
loc
,
0
,
1
,
nil
,
e
,
tp
,
tc
,
tt
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
12001500
,
1
))
then
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter3
,
tp
,
loc
,
0
,
1
,
1
,
nil
,
e
,
tp
,
tc
,
tt
)
tc
=
g1
:
GetFirst
()
end
if
tt
==
1
then
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
elseif
tt
==
2
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
elseif
tt
==
3
then
Duel
.
SendtoHand
(
tc
,
tp
,
REASON_EFFECT
)
elseif
tt
==
4
then
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
end
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
,
Group
.
FromCards
(
c
))
if
#
g1
>
0
then
cm
.
reop
(
e
,
tp
,
g1
:
GetFirst
(),
1
,
LOCATION_HAND
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
g1
+
c
)
if
#
g2
>
0
then
cm
.
reop
(
e
,
tp
,
g2
:
GetFirst
(),
1
,
LOCATION_DECK
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g3
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter3
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
,
e
,
tp
,
g1
+
g2
+
c
)
if
#
g3
>
0
then
cm
.
reop
(
e
,
tp
,
g3
:
GetFirst
(),
2
,
LOCATION_REMOVED
)
end
end
end
--天外之灾 白丝蛭
local
m
=
12001504
local
cm
=
_G
[
"c"
..
m
]
Duel
.
LoadScript
(
"c12000000.lua"
)
function
cm
.
initial_effect
(
c
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_DRAW
+
CATEGORY_REMOVE
+
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
sptg
)
e1
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e1
)
--search
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
12001501
,
2
))
e3
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_GRAVE
)
e3
:
SetCost
(
aux
.
bfgcost
)
e3
:
SetTarget
(
cm
.
thtg
)
e3
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsAbleToRemove
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
#
g
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
cm
.
grace
(
g
)
if
not
g
then
return
false
end
local
race
=
0
local
tc
=
g
:
GetFirst
()
while
tc
do
race
=
race
|
tc
:
GetRace
()
tc
=
g
:
GetNext
()
end
return
race
end
function
cm
.
gatt
(
g
)
if
not
g
then
return
false
end
local
att
=
0
local
tc
=
g
:
GetFirst
()
while
tc
do
att
=
att
|
tc
:
GetAttribute
()
tc
=
g
:
GetNext
()
end
return
race
end
function
cm
.
spfilter1
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
,
g
+
c
)
end
function
cm
.
spfilter2
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter3
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
,
g
+
c
)
end
function
cm
.
spfilter3
(
c
,
e
,
tp
,
g
)
local
att
=
cm
.
gatt
(
g
)
local
race
=
cm
.
grace
(
g
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
and
not
c
:
IsRace
(
race
)
and
not
c
:
IsAttribute
(
att
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
,
Group
.
FromCards
(
c
))
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
LOCATION_REMOVED
)
end
function
cm
.
thfilter3
(
c
,
e
,
tp
,
tc
,
tt
)
local
race
=
tc
:
GetRace
()
local
att
=
tc
:
GetAttribute
()
return
not
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsRace
(
race
)
and
c
:
IsAttribute
(
att
)
and
(
tt
==
1
and
c
:
IsAbleToRemove
()
or
tt
==
2
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
or
tt
==
3
and
c
:
IsAbleToHand
()
or
tt
==
4
and
c
:
IsAbleToGrave
()
)
end
function
cm
.
reop
(
e
,
tp
,
tc
,
tt
,
loc
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
12001500
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter3
,
tp
,
loc
,
0
,
1
,
nil
,
e
,
tp
,
tc
,
tt
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
12001500
,
1
))
then
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter3
,
tp
,
loc
,
0
,
1
,
1
,
nil
,
e
,
tp
,
tc
,
tt
)
tc
=
g1
:
GetFirst
()
end
if
tt
==
1
then
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
elseif
tt
==
2
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
elseif
tt
==
3
then
Duel
.
SendtoHand
(
tc
,
tp
,
REASON_EFFECT
)
elseif
tt
==
4
then
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
end
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
,
Group
.
FromCards
(
c
))
if
#
g1
>
0
then
cm
.
reop
(
e
,
tp
,
g1
:
GetFirst
(),
1
,
LOCATION_HAND
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
g1
+
c
)
if
#
g2
>
0
then
cm
.
reop
(
e
,
tp
,
g2
:
GetFirst
(),
1
,
LOCATION_DECK
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g3
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter3
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
,
e
,
tp
,
g1
+
g2
+
c
)
if
#
g3
>
0
then
cm
.
reop
(
e
,
tp
,
g3
:
GetFirst
(),
2
,
LOCATION_REMOVED
)
end
end
end
end
\ No newline at end of file
expansions/script/c12001510.lua
View file @
0e9dd768
--天外之灾龙 终结
local
m
=
12001510
local
cm
=
_G
[
"c"
..
m
]
Duel
.
LoadScript
(
"c12000000.lua"
)
function
cm
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCondition
(
cm
.
sprcon
)
e1
:
SetTarget
(
cm
.
sprtg
)
e1
:
SetOperation
(
cm
.
sprop
)
c
:
RegisterEffect
(
e1
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_DRAW
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTarget
(
cm
.
sptg
)
e1
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e1
)
--tograve
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e1
:
SetCategory
(
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
)
e1
:
SetTarget
(
cm
.
thtg
)
e1
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
sprfilter
(
c
)
return
(
c
:
IsFaceup
()
or
c
:
IsLocation
(
LOCATION_GRAVE
))
and
c
:
IsAbleToDeckAsCost
()
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
cm
.
fselect
(
g
,
tp
)
return
Duel
.
GetMZoneCount
(
tp
,
g
)
>
0
and
g
:
GetClassCount
(
Card
.
GetAttribute
)
==#
g
and
g
:
GetClassCount
(
Card
.
GetRace
)
==#
g
end
function
cm
.
sprcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
local
rg
=
Duel
.
GetMatchingGroup
(
cm
.
sprfilter
,
tp
,
LOCATION_REMOVED
+
LOCATION_GRAVE
,
0
,
nil
)
return
rg
:
CheckSubGroup
(
cm
.
fselect
,
3
,
3
,
tp
)
end
function
cm
.
sprtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
c
)
local
rg
=
Duel
.
GetMatchingGroup
(
cm
.
sprfilter
,
tp
,
LOCATION_REMOVED
+
LOCATION_GRAVE
,
0
,
nil
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
sg
=
rg
:
SelectSubGroup
(
tp
,
cm
.
fselect
,
true
,
3
,
3
,
tp
)
if
sg
then
sg
:
KeepAlive
()
e
:
SetLabelObject
(
sg
)
return
true
else
return
false
end
end
function
cm
.
sprop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
g
=
e
:
GetLabelObject
()
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_COST
)
g
:
DeleteGroup
()
end
function
cm
.
filter
(
c
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsDiscardable
()
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
Duel
.
DiscardHand
(
tp
,
cm
.
filter
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
2
)
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
2
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
2
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Draw
(
p
,
d
,
REASON_EFFECT
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetCode
(
EFFECT_CANNOT_DRAW
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetTargetRange
(
1
,
1
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
searchfilter
(
c
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsAbleToHand
()
and
c
:
IsFaceup
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
searchfilter
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_REMOVED
)
end
function
cm
.
dfilter
(
c
,
att
)
return
c
:
IsAttribute
(
att
)
and
c
:
IsFaceup
()
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
searchfilter
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
local
att
=
g
:
GetFirst
():
GetAttribute
()
local
mg
=
Duel
.
GetMatchingGroup
(
cm
.
dfilter
,
tp
,
0
,
LOCATION_MZONE
,
nil
,
att
)
if
#
mg
>
0
then
if
Duel
.
Destroy
(
mg
,
REASON_EFFECT
)
==
0
then
Duel
.
SendtoDeck
(
e
:
GetHandler
(),
nil
,
2
,
REASON_EFFECT
)
end
else
Duel
.
SendtoDeck
(
e
:
GetHandler
(),
nil
,
2
,
REASON_EFFECT
)
end
end
--天外之灾龙 终结
local
m
=
12001510
local
cm
=
_G
[
"c"
..
m
]
Duel
.
LoadScript
(
"c12000000.lua"
)
function
cm
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCondition
(
cm
.
sprcon
)
e1
:
SetTarget
(
cm
.
sprtg
)
e1
:
SetOperation
(
cm
.
sprop
)
c
:
RegisterEffect
(
e1
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_DRAW
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCost
(
cm
.
cost
)
e1
:
SetTarget
(
cm
.
sptg
)
e1
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e1
)
--tograve
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e1
:
SetCategory
(
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
)
e1
:
SetTarget
(
cm
.
thtg
)
e1
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
sprfilter
(
c
)
return
(
c
:
IsFaceup
()
or
c
:
IsLocation
(
LOCATION_GRAVE
))
and
c
:
IsAbleToDeckAsCost
()
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
cm
.
fselect
(
g
,
tp
)
return
Duel
.
GetMZoneCount
(
tp
,
g
)
>
0
and
g
:
GetClassCount
(
Card
.
GetAttribute
)
==#
g
and
g
:
GetClassCount
(
Card
.
GetRace
)
==#
g
end
function
cm
.
sprcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
local
rg
=
Duel
.
GetMatchingGroup
(
cm
.
sprfilter
,
tp
,
LOCATION_REMOVED
+
LOCATION_GRAVE
,
0
,
nil
)
return
rg
:
CheckSubGroup
(
cm
.
fselect
,
3
,
3
,
tp
)
end
function
cm
.
sprtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
c
)
local
rg
=
Duel
.
GetMatchingGroup
(
cm
.
sprfilter
,
tp
,
LOCATION_REMOVED
+
LOCATION_GRAVE
,
0
,
nil
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
sg
=
rg
:
SelectSubGroup
(
tp
,
cm
.
fselect
,
true
,
3
,
3
,
tp
)
if
sg
then
sg
:
KeepAlive
()
e
:
SetLabelObject
(
sg
)
return
true
else
return
false
end
end
function
cm
.
sprop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
g
=
e
:
GetLabelObject
()
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_COST
)
g
:
DeleteGroup
()
end
function
cm
.
filter
(
c
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsDiscardable
()
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
Duel
.
DiscardHand
(
tp
,
cm
.
filter
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
2
)
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
2
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
2
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Draw
(
p
,
d
,
REASON_EFFECT
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetCode
(
EFFECT_CANNOT_DRAW
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetTargetRange
(
1
,
1
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
searchfilter
(
c
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsAbleToHand
()
and
c
:
IsFaceup
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
searchfilter
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_REMOVED
)
end
function
cm
.
dfilter
(
c
,
att
)
return
c
:
IsAttribute
(
att
)
and
c
:
IsFaceup
()
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
searchfilter
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
local
att
=
g
:
GetFirst
():
GetAttribute
()
local
mg
=
Duel
.
GetMatchingGroup
(
cm
.
dfilter
,
tp
,
0
,
LOCATION_MZONE
,
nil
,
att
)
if
#
mg
>
0
then
if
Duel
.
Destroy
(
mg
,
REASON_EFFECT
)
==
0
then
Duel
.
SendtoDeck
(
e
:
GetHandler
(),
nil
,
2
,
REASON_EFFECT
)
end
else
Duel
.
SendtoDeck
(
e
:
GetHandler
(),
nil
,
2
,
REASON_EFFECT
)
end
end
end
\ No newline at end of file
expansions/script/c12001511.lua
View file @
0e9dd768
This diff is collapsed.
Click to expand it.
expansions/script/c12001515.lua
View file @
0e9dd768
--天外之灾神 混沌的零形
local
m
=
12001515
local
cm
=
_G
[
"c"
..
m
]
Duel
.
LoadScript
(
"c12000000.lua"
)
function
cm
.
initial_effect
(
c
)
--fusion summon
c
:
EnableReviveLimit
()
aux
.
AddFusionProcFunRep
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsFusionSetCard
,
0x6fb9
),
3
,
true
)
--special summon rule
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e2
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e2
:
SetRange
(
LOCATION_EXTRA
)
e2
:
SetCondition
(
cm
.
sprcon
)
e2
:
SetOperation
(
cm
.
sprop
)
c
:
RegisterEffect
(
e2
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTarget
(
cm
.
sptg
)
e1
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e1
)
--destroy replace
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_DESTROY_REPLACE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTarget
(
cm
.
desreptg
)
e2
:
SetValue
(
cm
.
desrepval
)
e2
:
SetOperation
(
cm
.
desrepop
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
sprfilter1
(
c
,
sc
,
tp
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemoveAsCost
()
and
c
:
IsCanBeFusionMaterial
(
sc
,
SUMMON_TYPE_SPECIAL
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
sprfilter2
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
tp
,
sc
,
c
)
end
function
cm
.
sprfilter2
(
c
,
tp
,
sc
,
tc
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsLevel
(
11
)
and
c
:
IsAbleToRemoveAsCost
()
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
c
,
sc
)
>
0
and
c
:
IsCanBeFusionMaterial
(
sc
,
SUMMON_TYPE_SPECIAL
)
and
c
:
GetRace
()
~=
tc
:
GetRace
()
and
c
:
GetAttribute
()
~=
tc
:
GetAttribute
()
end
function
cm
.
sprcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
return
Duel
.
IsExistingMatchingCard
(
cm
.
sprfilter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
c
,
tp
)
end
function
cm
.
sprop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
sprfilter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
c
,
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
sprfilter2
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
tp
,
c
,
g1
:
GetFirst
())
g1
:
Merge
(
g2
)
c
:
SetMaterial
(
g1
)
Duel
.
Remove
(
g1
,
POS_FACEUP
,
REASON_COST
)
end
function
cm
.
filter
(
c
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsDiscardable
()
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
Duel
.
DiscardHand
(
tp
,
cm
.
filter
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
end
function
cm
.
spfilter
(
c
,
e
,
tp
)
return
(
c
:
IsLocation
(
LOCATION_GRAVE
)
or
c
:
IsFaceup
())
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
cm
.
spfilter
),
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
local
att
=
g
:
GetFirst
();
GetAttribute
()
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetTargetRange
(
1
,
1
)
e1
:
SetTarget
(
function
()
return
c
:
IsAttribute
(
att
)
end
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
function
cm
.
repfilter
(
c
,
tp
)
return
c
:
IsControler
(
tp
)
and
c
:
IsLocation
(
LOCATION_ONFIELD
)
and
c
:
IsReason
(
REASON_BATTLE
+
REASON_EFFECT
)
and
not
c
:
IsReason
(
REASON_REPLACE
)
end
function
cm
.
desreptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
eg
:
IsExists
(
cm
.
repfilter
,
1
,
nil
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_GRAVE
,
0
,
2
,
nil
)
end
return
Duel
.
SelectEffectYesNo
(
tp
,
c
,
96
)
end
function
cm
.
desrepval
(
e
,
c
)
return
cm
.
repfilter
(
c
,
e
:
GetHandlerPlayer
())
end
function
cm
.
desrepop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
Hint
(
HINT_CARD
,
0
,
m
)
end
--天外之灾神 混沌的零形
local
m
=
12001515
local
cm
=
_G
[
"c"
..
m
]
Duel
.
LoadScript
(
"c12000000.lua"
)
function
cm
.
initial_effect
(
c
)
--fusion summon
c
:
EnableReviveLimit
()
aux
.
AddFusionProcFunRep
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsFusionSetCard
,
0x6fb9
),
3
,
true
)
--special summon rule
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e2
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e2
:
SetRange
(
LOCATION_EXTRA
)
e2
:
SetCondition
(
cm
.
sprcon
)
e2
:
SetOperation
(
cm
.
sprop
)
c
:
RegisterEffect
(
e2
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCost
(
cm
.
cost
)
e1
:
SetTarget
(
cm
.
sptg
)
e1
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e1
)
--destroy replace
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_DESTROY_REPLACE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTarget
(
cm
.
desreptg
)
e2
:
SetValue
(
cm
.
desrepval
)
e2
:
SetOperation
(
cm
.
desrepop
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
sprfilter1
(
c
,
sc
,
tp
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemoveAsCost
()
and
c
:
IsCanBeFusionMaterial
(
sc
,
SUMMON_TYPE_SPECIAL
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
sprfilter2
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
tp
,
sc
,
c
)
end
function
cm
.
sprfilter2
(
c
,
tp
,
sc
,
tc
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsLevel
(
11
)
and
c
:
IsAbleToRemoveAsCost
()
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
c
,
sc
)
>
0
and
c
:
IsCanBeFusionMaterial
(
sc
,
SUMMON_TYPE_SPECIAL
)
and
c
:
GetRace
()
~=
tc
:
GetRace
()
and
c
:
GetAttribute
()
~=
tc
:
GetAttribute
()
end
function
cm
.
sprcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
return
Duel
.
IsExistingMatchingCard
(
cm
.
sprfilter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
c
,
tp
)
end
function
cm
.
sprop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
sprfilter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
c
,
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
sprfilter2
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
tp
,
c
,
g1
:
GetFirst
())
g1
:
Merge
(
g2
)
c
:
SetMaterial
(
g1
)
Duel
.
Remove
(
g1
,
POS_FACEUP
,
REASON_COST
)
end
function
cm
.
filter
(
c
)
return
c
:
IsSetCard
(
0x6fb9
)
and
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsDiscardable
()
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
Duel
.
DiscardHand
(
tp
,
cm
.
filter
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
end
function
cm
.
spfilter
(
c
,
e
,
tp
)
return
(
c
:
IsLocation
(
LOCATION_GRAVE
)
or
c
:
IsFaceup
())
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
cm
.
spfilter
),
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
local
att
=
g
:
GetFirst
();
GetAttribute
()
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetTargetRange
(
1
,
1
)
e1
:
SetTarget
(
function
()
return
c
:
IsAttribute
(
att
)
end
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
function
cm
.
repfilter
(
c
,
tp
)
return
c
:
IsControler
(
tp
)
and
c
:
IsLocation
(
LOCATION_ONFIELD
)
and
c
:
IsReason
(
REASON_BATTLE
+
REASON_EFFECT
)
and
not
c
:
IsReason
(
REASON_REPLACE
)
end
function
cm
.
desreptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
eg
:
IsExists
(
cm
.
repfilter
,
1
,
nil
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_GRAVE
,
0
,
2
,
nil
)
end
return
Duel
.
SelectEffectYesNo
(
tp
,
c
,
96
)
end
function
cm
.
desrepval
(
e
,
c
)
return
cm
.
repfilter
(
c
,
e
:
GetHandlerPlayer
())
end
function
cm
.
desrepop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
Hint
(
HINT_CARD
,
0
,
m
)
end
expansions/script/c16400094.lua
View file @
0e9dd768
...
...
@@ -62,7 +62,7 @@ function cm.check(c)
return
c
:
IsSetCard
(
0xce2
)
and
(
c
:
IsLocation
(
LOCATION_GRAVE
)
or
c
:
IsFaceup
())
end
function
cm
.
value
(
e
,
c
)
return
Duel
.
GetMatchingGroupCount
(
cm
.
check
,
0
,
LOCATION_REMOVED
+
LOCATION_ONFIELD
+
LOCATION_GRAVE
,
LOCATION_REMOVED
+
LOCATION_ONFIELD
+
LOCATION_GRAVE
)
*
500
return
Duel
.
GetMatchingGroupCount
(
cm
.
check
,
0
,
LOCATION_REMOVED
+
LOCATION_ONFIELD
+
LOCATION_GRAVE
,
LOCATION_REMOVED
+
LOCATION_ONFIELD
+
LOCATION_GRAVE
,
nil
)
*
500
end
function
cm
.
thcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_SYNCHRO
)
...
...
expansions/script/c50221200.lua
View file @
0e9dd768
--暗之数码兽LV9 座天使兽
function
c50221200
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--cannot special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e1
:
SetValue
(
aux
.
FALSE
)
c
:
RegisterEffect
(
e1
)
--special summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e2
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e2
:
SetRange
(
LOCATION_HAND
)
e2
:
SetCondition
(
c50221200
.
scon
)
e2
:
SetOperation
(
c50221200
.
sop
)
c
:
RegisterEffect
(
e2
)
--token
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_HAND
)
e3
:
SetCountLimit
(
1
,
50221200
)
e3
:
SetCost
(
c50221200
.
spcost
)
e3
:
SetTarget
(
c50221200
.
sptg
)
e3
:
SetOperation
(
c50221200
.
spop
)
c
:
RegisterEffect
(
e3
)
--recover
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetCategory
(
CATEGORY_RECOVER
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EVENT_ATTACK_ANNOUNCE
)
e4
:
SetTarget
(
c50221200
.
rectg
)
e4
:
SetOperation
(
c50221200
.
recop
)
c
:
RegisterEffect
(
e4
)
--search
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e5
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e5
:
SetCode
(
EVENT_FREE_CHAIN
)
e5
:
SetRange
(
LOCATION_MZONE
)
e5
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_MAIN_END
)
e5
:
SetCountLimit
(
1
,
502212001
)
e5
:
SetCondition
(
c50221200
.
thcon
)
e5
:
SetTarget
(
c50221200
.
thtg
)
e5
:
SetOperation
(
c50221200
.
thop
)
c
:
RegisterEffect
(
e5
)
end
c50221200
.
lvup
=
{
502
21121
}
c50221200
.
lvdn
=
{
50218119
,
50218120
,
50218121
}
function
c50221200
.
spfilter
(
c
,
ft
,
tp
)
return
c
:
IsCode
(
50218121
)
and
(
ft
>
0
or
(
c
:
IsControler
(
tp
)
and
c
:
GetSequence
()
<
5
))
and
(
c
:
IsControler
(
tp
)
or
c
:
IsFaceup
())
end
function
c50221200
.
scon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
return
ft
>-
1
and
Duel
.
CheckReleaseGroup
(
tp
,
c50221200
.
spfilter
,
1
,
nil
,
ft
,
tp
)
end
function
c50221200
.
sop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
local
g
=
Duel
.
SelectReleaseGroup
(
tp
,
c50221200
.
spfilter
,
1
,
1
,
nil
,
ft
,
tp
)
Duel
.
Release
(
g
,
REASON_COST
)
end
function
c50221200
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsDiscardable
()
end
Duel
.
SendtoGrave
(
c
,
REASON_COST
+
REASON_DISCARD
)
end
function
c50221200
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
502
18147
,
0xcb1
,
0x4011
,
500
,
500
,
1
,
RACE_SPELLCASTER
,
ATTRIBUTE_DARK
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
end
function
c50221200
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
if
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
502
18147
,
0xcb1
,
0x4011
,
500
,
500
,
1
,
RACE_SPELLCASTER
,
ATTRIBUTE_DARK
)
then
local
token
=
Duel
.
CreateToken
(
tp
,
502
18147
)
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
c50221200
.
rectg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
local
rec
=
e
:
GetHandler
():
GetBaseAttack
()
Duel
.
SetOperationInfo
(
0
,
CATEGORY_RECOVER
,
nil
,
0
,
tp
,
rec
)
end
function
c50221200
.
recop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rec
=
e
:
GetHandler
():
GetBaseAttack
()
Duel
.
Recover
(
tp
,
rec
,
REASON_EFFECT
)
end
function
c50221200
.
filter
(
c
)
return
c
:
IsSetCard
(
0xcb1
)
and
c
:
IsAbleToHand
()
end
function
c50221200
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetCurrentPhase
()
==
PHASE_MAIN1
or
Duel
.
GetCurrentPhase
()
==
PHASE_MAIN2
end
function
c50221200
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c50221200
.
filter
,
tp
,
LOCATION_
HAND
+
LOCATION_DECK
+
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_
HAND
+
LOCATION_DECK
+
LOCATION_GRAVE
+
LOCATION_REMOVED
)
end
function
c50221200
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
c50221200
.
filter
),
tp
,
LOCATION_
HAND
+
LOCATION_DECK
+
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
--暗之数码兽LV9 座天使兽
function
c50221200
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--cannot special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e1
:
SetValue
(
aux
.
FALSE
)
c
:
RegisterEffect
(
e1
)
--special summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e2
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e2
:
SetRange
(
LOCATION_HAND
)
e2
:
SetCondition
(
c50221200
.
scon
)
e2
:
SetOperation
(
c50221200
.
sop
)
c
:
RegisterEffect
(
e2
)
--token
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_HAND
)
e3
:
SetCountLimit
(
1
,
50221200
)
e3
:
SetCost
(
c50221200
.
spcost
)
e3
:
SetTarget
(
c50221200
.
sptg
)
e3
:
SetOperation
(
c50221200
.
spop
)
c
:
RegisterEffect
(
e3
)
--recover
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetCategory
(
CATEGORY_RECOVER
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EVENT_ATTACK_ANNOUNCE
)
e4
:
SetTarget
(
c50221200
.
rectg
)
e4
:
SetOperation
(
c50221200
.
recop
)
c
:
RegisterEffect
(
e4
)
--search
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e5
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e5
:
SetCode
(
EVENT_FREE_CHAIN
)
e5
:
SetRange
(
LOCATION_MZONE
)
e5
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_MAIN_END
)
e5
:
SetCountLimit
(
1
,
502212001
)
e5
:
SetCondition
(
c50221200
.
thcon
)
e5
:
SetTarget
(
c50221200
.
thtg
)
e5
:
SetOperation
(
c50221200
.
thop
)
c
:
RegisterEffect
(
e5
)
end
c50221200
.
lvup
=
{
502
18121
}
c50221200
.
lvdn
=
{
50218119
,
50218120
,
50218121
}
function
c50221200
.
spfilter
(
c
,
ft
,
tp
)
return
c
:
IsCode
(
50218121
)
and
(
ft
>
0
or
(
c
:
IsControler
(
tp
)
and
c
:
GetSequence
()
<
5
))
and
(
c
:
IsControler
(
tp
)
or
c
:
IsFaceup
())
end
function
c50221200
.
scon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
return
ft
>-
1
and
Duel
.
CheckReleaseGroup
(
tp
,
c50221200
.
spfilter
,
1
,
nil
,
ft
,
tp
)
end
function
c50221200
.
sop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
local
g
=
Duel
.
SelectReleaseGroup
(
tp
,
c50221200
.
spfilter
,
1
,
1
,
nil
,
ft
,
tp
)
Duel
.
Release
(
g
,
REASON_COST
)
end
function
c50221200
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsDiscardable
()
end
Duel
.
SendtoGrave
(
c
,
REASON_COST
+
REASON_DISCARD
)
end
function
c50221200
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
502
23180
,
0xcb1
,
0x4011
,
500
,
500
,
1
,
RACE_SPELLCASTER
,
ATTRIBUTE_DARK
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
end
function
c50221200
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
if
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
502
23180
,
0xcb1
,
0x4011
,
500
,
500
,
1
,
RACE_SPELLCASTER
,
ATTRIBUTE_DARK
)
then
local
token
=
Duel
.
CreateToken
(
tp
,
502
23180
)
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
c50221200
.
rectg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
local
rec
=
e
:
GetHandler
():
GetBaseAttack
()
Duel
.
SetOperationInfo
(
0
,
CATEGORY_RECOVER
,
nil
,
0
,
tp
,
rec
)
end
function
c50221200
.
recop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rec
=
e
:
GetHandler
():
GetBaseAttack
()
Duel
.
Recover
(
tp
,
rec
,
REASON_EFFECT
)
end
function
c50221200
.
filter
(
c
)
return
c
:
IsSetCard
(
0xcb1
)
and
c
:
IsAbleToHand
()
end
function
c50221200
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetCurrentPhase
()
==
PHASE_MAIN1
or
Duel
.
GetCurrentPhase
()
==
PHASE_MAIN2
end
function
c50221200
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c50221200
.
filter
,
tp
,
LOCATION_
DECK
+
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_
DECK
+
LOCATION_GRAVE
+
LOCATION_REMOVED
)
end
function
c50221200
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
c50221200
.
filter
),
tp
,
LOCATION_
DECK
+
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
\ No newline at end of file
expansions/script/c50222100.lua
View file @
0e9dd768
--光之数码兽LV9 神龙兽
function
c50222100
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--cannot special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e1
:
SetValue
(
aux
.
FALSE
)
c
:
RegisterEffect
(
e1
)
--special summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e2
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e2
:
SetRange
(
LOCATION_HAND
)
e2
:
SetCondition
(
c50222100
.
scon
)
e2
:
SetOperation
(
c50222100
.
sop
)
c
:
RegisterEffect
(
e2
)
--token
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_HAND
)
e3
:
SetCountLimit
(
1
,
50222100
)
e3
:
SetCost
(
c50222100
.
spcost
)
e3
:
SetTarget
(
c50222100
.
sptg
)
e3
:
SetOperation
(
c50222100
.
spop
)
c
:
RegisterEffect
(
e3
)
--effect limit
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
50222100
,
0
))
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e4
:
SetCondition
(
c50222100
.
efcon
)
e4
:
SetOperation
(
c50222100
.
efop
)
c
:
RegisterEffect
(
e4
)
--tohand
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
50222100
,
1
))
e5
:
SetCategory
(
CATEGORY_TOHAND
)
e5
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e5
:
SetCode
(
EVENT_FREE_CHAIN
)
e5
:
SetRange
(
LOCATION_MZONE
)
e5
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e5
:
SetCountLimit
(
1
,
502221001
)
e5
:
SetTarget
(
c50222100
.
thtg
)
e5
:
SetOperation
(
c50222100
.
thop
)
c
:
RegisterEffect
(
e5
)
end
c50222100
.
lvup
=
{
50218124
}
c50222100
.
lvdn
=
{
50218122
,
50218123
,
50218124
}
function
c50222100
.
spfilter
(
c
,
ft
,
tp
)
return
c
:
IsCode
(
50218124
)
and
(
ft
>
0
or
(
c
:
IsControler
(
tp
)
and
c
:
GetSequence
()
<
5
))
and
(
c
:
IsControler
(
tp
)
or
c
:
IsFaceup
())
end
function
c50222100
.
scon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
return
ft
>-
1
and
Duel
.
CheckReleaseGroup
(
tp
,
c50222100
.
spfilter
,
1
,
nil
,
ft
,
tp
)
end
function
c50222100
.
sop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
local
g
=
Duel
.
SelectReleaseGroup
(
tp
,
c50222100
.
spfilter
,
1
,
1
,
nil
,
ft
,
tp
)
Duel
.
Release
(
g
,
REASON_COST
)
end
function
c50222100
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsDiscardable
()
end
Duel
.
SendtoGrave
(
c
,
REASON_COST
+
REASON_DISCARD
)
end
function
c50222100
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
502
18148
,
0xcb1
,
0x4011
,
700
,
300
,
1
,
RACE_FAIRY
,
ATTRIBUTE_LIGHT
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
end
function
c50222100
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
if
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
502
18148
,
0xcb1
,
0x4011
,
700
,
300
,
1
,
RACE_FAIRY
,
ATTRIBUTE_LIGHT
)
then
local
token
=
Duel
.
CreateToken
(
tp
,
502
18148
)
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
c50222100
.
efcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_SPECIAL
)
end
function
c50222100
.
efop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetTargetRange
(
0
,
LOCATION_MZONE
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
c50222100
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToHand
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
nil
)
if
chk
==
0
then
return
g
:
GetCount
()
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
0
)
end
function
c50222100
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToHand
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
end
--光之数码兽LV9 神龙兽
function
c50222100
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--cannot special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e1
:
SetValue
(
aux
.
FALSE
)
c
:
RegisterEffect
(
e1
)
--special summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e2
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e2
:
SetRange
(
LOCATION_HAND
)
e2
:
SetCondition
(
c50222100
.
scon
)
e2
:
SetOperation
(
c50222100
.
sop
)
c
:
RegisterEffect
(
e2
)
--token
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_HAND
)
e3
:
SetCountLimit
(
1
,
50222100
)
e3
:
SetCost
(
c50222100
.
spcost
)
e3
:
SetTarget
(
c50222100
.
sptg
)
e3
:
SetOperation
(
c50222100
.
spop
)
c
:
RegisterEffect
(
e3
)
--effect limit
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
50222100
,
0
))
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e4
:
SetCondition
(
c50222100
.
efcon
)
e4
:
SetOperation
(
c50222100
.
efop
)
c
:
RegisterEffect
(
e4
)
--tohand
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
50222100
,
1
))
e5
:
SetCategory
(
CATEGORY_TOHAND
)
e5
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e5
:
SetCode
(
EVENT_FREE_CHAIN
)
e5
:
SetRange
(
LOCATION_MZONE
)
e5
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e5
:
SetCountLimit
(
1
,
502221001
)
e5
:
SetTarget
(
c50222100
.
thtg
)
e5
:
SetOperation
(
c50222100
.
thop
)
c
:
RegisterEffect
(
e5
)
end
c50222100
.
lvup
=
{
50218124
}
c50222100
.
lvdn
=
{
50218122
,
50218123
,
50218124
}
function
c50222100
.
spfilter
(
c
,
ft
,
tp
)
return
c
:
IsCode
(
50218124
)
and
(
ft
>
0
or
(
c
:
IsControler
(
tp
)
and
c
:
GetSequence
()
<
5
))
and
(
c
:
IsControler
(
tp
)
or
c
:
IsFaceup
())
end
function
c50222100
.
scon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
return
ft
>-
1
and
Duel
.
CheckReleaseGroup
(
tp
,
c50222100
.
spfilter
,
1
,
nil
,
ft
,
tp
)
end
function
c50222100
.
sop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
local
g
=
Duel
.
SelectReleaseGroup
(
tp
,
c50222100
.
spfilter
,
1
,
1
,
nil
,
ft
,
tp
)
Duel
.
Release
(
g
,
REASON_COST
)
end
function
c50222100
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsDiscardable
()
end
Duel
.
SendtoGrave
(
c
,
REASON_COST
+
REASON_DISCARD
)
end
function
c50222100
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
502
23185
,
0xcb1
,
0x4011
,
700
,
300
,
1
,
RACE_FAIRY
,
ATTRIBUTE_LIGHT
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
end
function
c50222100
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
if
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
502
23185
,
0xcb1
,
0x4011
,
700
,
300
,
1
,
RACE_FAIRY
,
ATTRIBUTE_LIGHT
)
then
local
token
=
Duel
.
CreateToken
(
tp
,
502
23185
)
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
c50222100
.
efcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_SPECIAL
)
end
function
c50222100
.
efop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetTargetRange
(
0
,
LOCATION_MZONE
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
c50222100
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToHand
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
nil
)
if
chk
==
0
then
return
g
:
GetCount
()
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
0
)
end
function
c50222100
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToHand
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c65050018.lua
View file @
0e9dd768
--迷失水界的俯瞰
function
c65050018
.
initial_effect
(
c
)
--Activate
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e0
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e0
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c65050018
.
hspcost
)
e1
:
SetTarget
(
c65050018
.
hsptg
)
e1
:
SetOperation
(
c65050018
.
hspop
)
c
:
RegisterEffect
(
e1
)
--Activate
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetCategory
(
CATEGORY_TOHAND
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetCondition
(
c65050018
.
con
)
e3
:
SetTarget
(
c65050018
.
target
)
e3
:
SetOperation
(
c65050018
.
activate
)
c
:
RegisterEffect
(
e3
)
end
function
c65050018
.
costfil
(
c
)
return
c
:
IsAbleToDeckOrExtraAsCost
()
and
c
:
IsSetCard
(
0xcda3
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c65050018
.
hspcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c65050018
.
costfil
,
tp
,
LOCATION_GRAVE
,
0
,
3
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c65050018
.
costfil
,
tp
,
LOCATION_GRAVE
,
0
,
3
,
3
,
nil
)
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_COST
)
end
function
c65050018
.
hspfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0xcda3
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
,
1
-
tp
)
end
function
c65050018
.
hsptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c65050018
.
hspfilter
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
and
e
:
GetHandler
():
GetFlagEffect
(
65050018
)
==
0
end
e
:
GetHandler
():
RegisterFlagEffect
(
65050018
,
RESET_CHAIN
,
0
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
)
end
function
c65050018
.
hspop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c65050018
.
hspfilter
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
tc
=
g
:
GetFirst
()
if
tc
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
1
-
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
c65050018
.
confil
(
c
,
tp
)
return
c
:
IsSetCard
(
0xcda3
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsType
(
TYPE_LINK
)
and
c
:
IsSummonType
(
SUMMON_TYPE_LINK
)
end
function
c65050018
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c65050018
.
confil
,
1
,
nil
)
and
Duel
.
GetTurnPlayer
()
~=
tp
end
function
c65050018
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_ONFIELD
)
and
chkc
:
IsAbleToHand
()
and
chkc
:
IsControler
(
1
-
tp
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsAbleToHand
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsAbleToHand
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
0
)
end
function
c65050018
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
and
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
end
--迷失水界的俯瞰
function
c65050018
.
initial_effect
(
c
)
--Activate
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e0
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e0
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCost
(
c65050018
.
hspcost
)
e1
:
SetTarget
(
c65050018
.
hsptg
)
e1
:
SetOperation
(
c65050018
.
hspop
)
c
:
RegisterEffect
(
e1
)
--Activate
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetCategory
(
CATEGORY_TOHAND
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCondition
(
c65050018
.
con
)
e3
:
SetTarget
(
c65050018
.
target
)
e3
:
SetOperation
(
c65050018
.
activate
)
c
:
RegisterEffect
(
e3
)
end
function
c65050018
.
costfil
(
c
)
return
c
:
IsAbleToDeckOrExtraAsCost
()
and
c
:
IsSetCard
(
0xcda3
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c65050018
.
hspcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c65050018
.
costfil
,
tp
,
LOCATION_GRAVE
,
0
,
3
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c65050018
.
costfil
,
tp
,
LOCATION_GRAVE
,
0
,
3
,
3
,
nil
)
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_COST
)
end
function
c65050018
.
hspfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0xcda3
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
,
1
-
tp
)
end
function
c65050018
.
hsptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c65050018
.
hspfilter
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
and
e
:
GetHandler
():
GetFlagEffect
(
65050018
)
==
0
end
e
:
GetHandler
():
RegisterFlagEffect
(
65050018
,
RESET_CHAIN
,
0
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
)
end
function
c65050018
.
hspop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c65050018
.
hspfilter
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
tc
=
g
:
GetFirst
()
if
tc
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
1
-
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
c65050018
.
confil
(
c
,
tp
)
return
c
:
IsSetCard
(
0xcda3
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsType
(
TYPE_LINK
)
and
c
:
IsSummonType
(
SUMMON_TYPE_LINK
)
end
function
c65050018
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c65050018
.
confil
,
1
,
nil
)
and
Duel
.
GetTurnPlayer
()
~=
tp
and
e
:
GetFlagEffect
(
65050018
)
==
0
end
function
c65050018
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_ONFIELD
)
and
chkc
:
IsAbleToHand
()
and
chkc
:
IsControler
(
1
-
tp
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsAbleToHand
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsAbleToHand
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
0
)
e
:
GetHandler
():
RegisterFlagEffect
(
65050018
,
RESET_CHAIN
,
0
,
1
)
end
function
c65050018
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
and
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c65060039.lua
View file @
0e9dd768
--魔眼统界
function
c65060039
.
initial_effect
(
c
)
--Activate
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e0
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e0
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetRange
(
LOCATION_FZONE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetOperation
(
c65060039
.
actop
)
c
:
RegisterEffect
(
e1
)
--activate
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetCountLimit
(
1
,
65060039
)
e2
:
SetTarget
(
c65060039
.
target
)
e2
:
SetOperation
(
c65060039
.
activate
)
c
:
RegisterEffect
(
e2
)
end
c65060039
.
has_text_type
=
TYPE_DUAL
function
c65060039
.
actop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
if
re
:
IsActiveType
(
TYPE_MONSTER
)
and
rc
:
IsType
(
TYPE_DUAL
)
and
ep
==
tp
then
Duel
.
SetChainLimit
(
c65060039
.
chainlm
)
end
end
function
c65060039
.
chainlm
(
e
,
rp
,
tp
)
return
tp
==
rp
end
function
c65060039
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_PZONE
,
0
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c65060039
.
thfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_PZONE
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
g
:
GetCount
(),
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
g
:
GetCount
(),
tp
,
LOCATION_DECK
)
end
function
c65060039
.
thfilter1
(
c
)
return
c
:
IsType
(
TYPE_DUAL
)
and
c
:
IsAbleToHand
()
end
function
c65060039
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_PZONE
,
LOCATION_PZONE
)
local
ct
=
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
local
sg
=
Duel
.
GetOperatedGroup
()
if
ct
>=
1
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c65060039
.
thfilter1
,
tp
,
LOCATION_DECK
,
0
,
ct
,
ct
,
nil
)
if
g
:
GetCount
()
==
ct
then
Duel
.
SendtoHand
(
g
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
if
sg
:
FilterCount
(
Card
.
IsType
,
nil
,
TYPE_DUAL
)
==
2
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetDescription
(
aux
.
Stringid
(
65060039
,
4
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_EXTRA_PENDULUM_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCountLimit
(
1
,
29432356
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
aux
.
TargetBoolFunction
(
Card
.
IsType
,
TYPE_DUAL
))
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
--魔眼统界
function
c65060039
.
initial_effect
(
c
)
--Activate
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e0
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e0
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetRange
(
LOCATION_FZONE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetOperation
(
c65060039
.
actop
)
c
:
RegisterEffect
(
e1
)
--activate
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetCountLimit
(
1
,
65060039
)
e2
:
SetTarget
(
c65060039
.
target
)
e2
:
SetOperation
(
c65060039
.
activate
)
c
:
RegisterEffect
(
e2
)
end
function
c65060039
.
actop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
if
re
:
IsActiveType
(
TYPE_MONSTER
)
and
rc
:
IsType
(
TYPE_DUAL
)
and
ep
==
tp
then
Duel
.
SetChainLimit
(
c65060039
.
chainlm
)
end
end
function
c65060039
.
chainlm
(
e
,
rp
,
tp
)
return
tp
==
rp
end
function
c65060039
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_PZONE
,
0
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c65060039
.
thfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_PZONE
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
g
:
GetCount
(),
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
g
:
GetCount
(),
tp
,
LOCATION_DECK
)
end
function
c65060039
.
thfilter1
(
c
)
return
c
:
IsType
(
TYPE_DUAL
)
and
c
:
IsAbleToHand
()
end
function
c65060039
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_PZONE
,
0
)
local
ct
=
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
local
sg
=
Duel
.
GetOperatedGroup
()
if
ct
>=
1
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c65060039
.
thfilter1
,
tp
,
LOCATION_DECK
,
0
,
ct
,
ct
,
nil
)
if
g
:
GetCount
()
==
ct
then
Duel
.
SendtoHand
(
g
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
if
sg
:
FilterCount
(
Card
.
IsType
,
nil
,
TYPE_DUAL
)
==
2
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetDescription
(
aux
.
Stringid
(
65060039
,
4
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_EXTRA_PENDULUM_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
aux
.
TargetBoolFunction
(
Card
.
IsType
,
TYPE_DUAL
))
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
\ No newline at end of file
expansions/script/c71401001.lua
View file @
0e9dd768
This diff is collapsed.
Click to expand it.
expansions/script/c71401003.lua
View file @
0e9dd768
--蝶忆-「染」
xpcall
(
function
()
require
(
"expansions/script/c71401001"
)
end
,
function
()
require
(
"script/c71401001"
)
end
)
function
c71401003
.
initial_effect
(
c
)
yume
.
AddButterflyTrap
(
c
,
71401003
)
--tohand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
71401003
,
0
))
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
)
e2
:
SetCountLimit
(
1
,
71501003
)
e2
:
SetCondition
(
c71401003
.
con2
)
e2
:
SetCost
(
c71401003
.
cost2
)
e2
:
SetTarget
(
c71401003
.
tg2
)
e2
:
SetOperation
(
c71401003
.
op2
)
c
:
RegisterEffect
(
e2
)
yume
.
ButterflyCounter
()
end
function
c71401003
.
con2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
(
Duel
.
GetCurrentPhase
()
==
PHASE_MAIN1
or
Duel
.
GetCurrentPhase
()
==
PHASE_MAIN2
)
and
e
:
GetHandler
():
GetType
()
==
TYPE_TRAP
+
TYPE_CONTINUOUS
end
function
c71401003
.
filterc2
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c71401003
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c71401003
.
filterc2
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
,
0
,
1
,
nil
)
and
Duel
.
GetCustomActivityCount
(
71401001
,
tp
,
ACTIVITY_CHAIN
)
==
0
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c71401003
.
filterc2
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
yume
.
RegButterflyCostLimit
(
e
,
tp
)
end
function
c71401003
.
filter2
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsAttribute
(
ATTRIBUTE_LIGHT
)
and
(
c
:
IsLocation
(
LOCATION_GRAVE
)
or
c
:
IsFaceup
())
and
(
c
:
IsAbleToHand
()
or
not
c
:
IsForbidden
()
and
c
:
CheckUniqueOnField
(
tp
))
end
function
c71401003
.
tg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c71401003
.
filter2
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
)
end
function
c71401003
.
filter2a
(
c
)
return
c
:
IsAbleToRemove
()
and
c
:
IsFaceup
()
end
function
c71401003
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_OPERATECARD
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c71401003
.
filter2
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
)
local
tc
=
g
:
GetFirst
()
if
tc
then
local
b1
=
tc
:
IsAbleToHand
()
local
b2
=
not
tc
:
IsForbidden
()
and
tc
:
CheckUniqueOnField
(
tp
)
local
flag
=
0
if
b1
and
(
not
b2
or
Duel
.
SelectOption
(
tp
,
11
52
,
aux
.
Stringid
(
71401003
,
1
))
==
0
)
then
flag
=
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
else
if
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
flag
=
1
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_SPELL
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e1
)
end
end
local
rg
=
Duel
.
GetMatchingGroup
(
c71401003
.
filter2a
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
nil
)
if
flag
>
0
and
rg
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
71401003
,
2
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
srg
=
rg
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
Remove
(
srg
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
--蝶忆-「染」
xpcall
(
function
()
require
(
"expansions/script/c71401001"
)
end
,
function
()
require
(
"script/c71401001"
)
end
)
function
c71401003
.
initial_effect
(
c
)
yume
.
AddButterflyTrap
(
c
,
71401003
)
--tohand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
71401003
,
0
))
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
)
e2
:
SetCountLimit
(
1
,
71501003
)
e2
:
SetCondition
(
c71401003
.
con2
)
e2
:
SetCost
(
c71401003
.
cost2
)
e2
:
SetTarget
(
c71401003
.
tg2
)
e2
:
SetOperation
(
c71401003
.
op2
)
c
:
RegisterEffect
(
e2
)
yume
.
ButterflyCounter
()
end
function
c71401003
.
con2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
(
Duel
.
GetCurrentPhase
()
==
PHASE_MAIN1
or
Duel
.
GetCurrentPhase
()
==
PHASE_MAIN2
)
and
e
:
GetHandler
():
GetType
()
==
TYPE_TRAP
+
TYPE_CONTINUOUS
end
function
c71401003
.
filterc2
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c71401003
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c71401003
.
filterc2
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
,
0
,
1
,
nil
)
and
Duel
.
GetCustomActivityCount
(
71401001
,
tp
,
ACTIVITY_CHAIN
)
==
0
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c71401003
.
filterc2
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
yume
.
RegButterflyCostLimit
(
e
,
tp
)
end
function
c71401003
.
filter2
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsAttribute
(
ATTRIBUTE_LIGHT
)
and
(
c
:
IsLocation
(
LOCATION_GRAVE
)
or
c
:
IsFaceup
())
and
(
c
:
IsAbleToHand
()
or
not
c
:
IsForbidden
()
and
c
:
CheckUniqueOnField
(
tp
))
end
function
c71401003
.
tg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c71401003
.
filter2
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
)
end
function
c71401003
.
filter2a
(
c
)
return
c
:
IsAbleToRemove
()
and
c
:
IsFaceup
()
end
function
c71401003
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_OPERATECARD
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c71401003
.
filter2
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
)
local
tc
=
g
:
GetFirst
()
if
tc
then
local
b1
=
tc
:
IsAbleToHand
()
local
b2
=
not
tc
:
IsForbidden
()
and
tc
:
CheckUniqueOnField
(
tp
)
local
flag
=
0
if
b1
and
(
not
b2
or
Duel
.
SelectOption
(
tp
,
11
90
,
aux
.
Stringid
(
71401003
,
1
))
==
0
)
then
flag
=
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
else
if
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
flag
=
1
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_SPELL
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e1
)
end
end
local
rg
=
Duel
.
GetMatchingGroup
(
c71401003
.
filter2a
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
nil
)
if
flag
>
0
and
rg
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
71401003
,
2
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
srg
=
rg
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
Remove
(
srg
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
end
\ No newline at end of file
expansions/script/c71401004.lua
View file @
0e9dd768
--蝶现-「像」
xpcall
(
function
()
require
(
"expansions/script/c71401001"
)
end
,
function
()
require
(
"script/c71401001"
)
end
)
function
c71401004
.
initial_effect
(
c
)
--same effect send this card to grave and spsummon another card check
local
e0
=
aux
.
AddThisCardInGraveAlreadyCheck
(
c
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
71401004
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetRange
(
LOCATION_HAND
+
LOCATION_GRAVE
+
LOCATION_REMOVED
)
e1
:
SetCountLimit
(
1
,
71401004
)
e1
:
SetLabelObject
(
e0
)
e1
:
SetCost
(
c71401004
.
cost1
)
e1
:
SetCondition
(
c71401004
.
con1
)
e1
:
SetTarget
(
c71401004
.
tg1
)
e1
:
SetOperation
(
c71401004
.
op1
)
c
:
RegisterEffect
(
e1
)
local
e1a
=
e1
:
Clone
()
e1a
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e1a
)
--banish
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
71401004
,
1
))
e2
:
SetCategory
(
CATEGORY_REMOVE
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_LEAVE_FIELD
)
e2
:
SetCountLimit
(
1
,
71501004
)
e2
:
SetCondition
(
c71401004
.
con2
)
e2
:
SetCost
(
c71401004
.
cost2
)
e2
:
SetTarget
(
c71401004
.
tg2
)
e2
:
SetOperation
(
c71401004
.
op2
)
c
:
RegisterEffect
(
e2
)
yume
.
ButterflyCounter
()
end
function
c71401004
.
filtercon1
(
c
,
tp
,
se
)
return
se
==
nil
or
c
:
GetReasonEffect
()
~=
se
end
function
c71401004
.
con1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
se
=
e
:
GetLabelObject
():
GetLabelObject
()
return
eg
:
IsExists
(
c71401004
.
filtercon1
,
1
,
nil
,
tp
,
se
)
end
function
c71401004
.
filterc1
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsAbleTo
GraveAsCost
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c71401004
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c71401004
.
filterc1
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetCustomActivityCount
(
71401001
,
tp
,
ACTIVITY_CHAIN
)
==
0
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c71401004
.
filterc1
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
yume
.
RegButterflyCostLimit
(
e
,
tp
)
end
function
c71401004
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c71401004
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
c71401004
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetCustomActivityCount
(
71401001
,
tp
,
ACTIVITY_CHAIN
)
==
0
end
yume
.
RegButterflyCostLimit
(
e
,
tp
)
end
function
c71401004
.
con2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsPreviousPosition
(
POS_FACEUP
)
end
function
c71401004
.
filter2ext
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_CONTINUOUS
)
end
function
c71401004
.
filter2
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsAbleToRemove
()
end
function
c71401004
.
tg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c71401004
.
filter2ext
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c71401004
.
filter2
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
)
end
function
c71401004
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c71401004
.
filter2
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e1
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsRace
,
RACE_SPELLCASTER
))
e1
:
SetValue
(
1
)
Duel
.
RegisterEffect
(
e1
,
tp
)
--蝶现-「像」
xpcall
(
function
()
require
(
"expansions/script/c71401001"
)
end
,
function
()
require
(
"script/c71401001"
)
end
)
function
c71401004
.
initial_effect
(
c
)
--same effect send this card to grave and spsummon another card check
local
e0
=
aux
.
AddThisCardInGraveAlreadyCheck
(
c
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
71401004
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetRange
(
LOCATION_HAND
+
LOCATION_GRAVE
+
LOCATION_REMOVED
)
e1
:
SetCountLimit
(
1
,
71401004
)
e1
:
SetLabelObject
(
e0
)
e1
:
SetCost
(
c71401004
.
cost1
)
e1
:
SetCondition
(
c71401004
.
con1
)
e1
:
SetTarget
(
c71401004
.
tg1
)
e1
:
SetOperation
(
c71401004
.
op1
)
c
:
RegisterEffect
(
e1
)
local
e1a
=
e1
:
Clone
()
e1a
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e1a
)
--banish
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
71401004
,
1
))
e2
:
SetCategory
(
CATEGORY_REMOVE
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_LEAVE_FIELD
)
e2
:
SetCountLimit
(
1
,
71501004
)
e2
:
SetCondition
(
c71401004
.
con2
)
e2
:
SetCost
(
c71401004
.
cost2
)
e2
:
SetTarget
(
c71401004
.
tg2
)
e2
:
SetOperation
(
c71401004
.
op2
)
c
:
RegisterEffect
(
e2
)
yume
.
ButterflyCounter
()
end
function
c71401004
.
filtercon1
(
c
,
tp
,
se
)
return
se
==
nil
or
c
:
GetReasonEffect
()
~=
se
end
function
c71401004
.
con1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
se
=
e
:
GetLabelObject
():
GetLabelObject
()
return
eg
:
IsExists
(
c71401004
.
filtercon1
,
1
,
nil
,
tp
,
se
)
or
e
:
GetHandler
():
IsLocation
(
LOCATION_HAND
)
end
function
c71401004
.
filterc1
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsAbleTo
RemoveAsCost
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c71401004
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c71401004
.
filterc1
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetCustomActivityCount
(
71401001
,
tp
,
ACTIVITY_CHAIN
)
==
0
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c71401004
.
filterc1
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
tp
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
yume
.
RegButterflyCostLimit
(
e
,
tp
)
end
function
c71401004
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c71401004
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
c71401004
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetCustomActivityCount
(
71401001
,
tp
,
ACTIVITY_CHAIN
)
==
0
end
yume
.
RegButterflyCostLimit
(
e
,
tp
)
end
function
c71401004
.
con2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsPreviousPosition
(
POS_FACEUP
)
end
function
c71401004
.
filter2ext
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_CONTINUOUS
)
end
function
c71401004
.
filter2
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsAbleToRemove
()
end
function
c71401004
.
tg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c71401004
.
filter2ext
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c71401004
.
filter2
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
)
end
function
c71401004
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c71401004
.
filter2
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e1
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsRace
,
RACE_SPELLCASTER
))
e1
:
SetValue
(
1
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
\ No newline at end of file
expansions/script/c71401008.lua
View file @
0e9dd768
--蝶幻-「胧」
xpcall
(
function
()
require
(
"expansions/script/c71401001"
)
end
,
function
()
require
(
"script/c71401001"
)
end
)
function
c71401008
.
initial_effect
(
c
)
--synchro summon
aux
.
AddSynchroProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsRace
,
RACE_SPELLCASTER
),
aux
.
NonTuner
(
Card
.
IsRace
,
RACE_SPELLCASTER
),
1
)
c
:
EnableReviveLimit
()
--indestructable
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
LOCATION_SZONE
,
0
)
e1
:
SetTarget
(
c71401008
.
indtg
)
e1
:
SetValue
(
1
)
c
:
RegisterEffect
(
e1
)
--place
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
71401008
,
0
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
71401008
)
e2
:
SetCost
(
c71401008
.
cost2
)
e2
:
SetOperation
(
c71401008
.
op2
)
c
:
RegisterEffect
(
e2
)
--to hand
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
71401008
,
1
))
e3
:
SetCategory
(
CATEGORY_TOHAND
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCountLimit
(
1
,
71501008
)
e3
:
SetCondition
(
c71401008
.
con3
)
e3
:
SetCost
(
c71401008
.
cost3
)
e3
:
SetTarget
(
c71401008
.
tg3
)
e3
:
SetOperation
(
c71401008
.
op3
)
c
:
RegisterEffect
(
e3
)
yume
.
ButterflyCounter
()
end
function
c71401008
.
indtg
(
e
,
c
)
return
c
:
GetOriginalType
()
&
TYPE_MONSTER
~=
0
end
function
c71401008
.
filterc2
(
c
,
tp
)
return
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsAbleToRemoveAsCost
()
and
(
c
:
IsLocation
(
LOCATION_SZONE
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
)
and
Duel
.
IsExistingMatchingCard
(
c71401008
.
filter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
c
,
tp
)
end
function
c71401008
.
filter2
(
c
,
cc
,
tp
)
return
c
:
IsLevel
(
4
)
and
not
c
:
IsForbidden
()
and
c
:
CheckUniqueOnField
(
tp
,
LOCATION_ONFIELD
,
cc
)
end
function
c71401008
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c71401008
.
filterc2
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetCustomActivityCount
(
71401001
,
tp
,
ACTIVITY_CHAIN
)
==
0
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c71401008
.
filterc2
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
yume
.
RegButterflyCostLimit
(
e
,
tp
)
end
function
c71401008
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
c71401008
.
filter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
nil
,
tp
):
GetFirst
()
if
tc
then
local
c
=
e
:
GetHandler
()
local
ctype
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
71401008
,
2
),
aux
.
Stringid
(
71401008
,
3
))
==
0
and
TYPE_SPELL
or
TYPE_TRAP
if
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
ctype
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e1
)
if
c
:
IsRelateToEffect
(
e
)
and
not
c
:
IsImmuneToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
71401008
,
4
))
then
Duel
.
BreakEffect
()
if
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e2
:
SetValue
(
TYPE_SPELL
+
TYPE_CONTINUOUS
)
c
:
RegisterEffect
(
e2
)
end
end
end
end
end
function
c71401008
.
con3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetType
()
==
TYPE_SPELL
+
TYPE_CONTINUOUS
end
function
c71401008
.
filterc3
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c71401008
.
cost3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c71401008
.
filterc3
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
Duel
.
GetCustomActivityCount
(
71401001
,
tp
,
ACTIVITY_CHAIN
)
==
0
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c71401008
.
filterc3
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
yume
.
RegButterflyCostLimit
(
e
,
tp
)
end
function
c71401008
.
tg3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToHand
,
tp
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
+
LOCATION_REMOVED
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
+
LOCATION_REMOVED
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
0
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
+
LOCATION_REMOVED
)
end
function
c71401008
.
op3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToHand
,
tp
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
+
LOCATION_REMOVED
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
+
LOCATION_REMOVED
,
1
,
1
,
nil
)
if
sg
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
sg
,
nil
,
REASON_EFFECT
)
end
--蝶幻-「胧」
xpcall
(
function
()
require
(
"expansions/script/c71401001"
)
end
,
function
()
require
(
"script/c71401001"
)
end
)
function
c71401008
.
initial_effect
(
c
)
--synchro summon
aux
.
AddSynchroProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsRace
,
RACE_SPELLCASTER
),
aux
.
NonTuner
(
Card
.
IsRace
,
RACE_SPELLCASTER
),
1
)
c
:
EnableReviveLimit
()
--indestructable
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
LOCATION_SZONE
,
0
)
e1
:
SetTarget
(
c71401008
.
indtg
)
e1
:
SetValue
(
1
)
c
:
RegisterEffect
(
e1
)
--place
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
71401008
,
0
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
71401008
)
e2
:
SetCost
(
c71401008
.
cost2
)
e2
:
SetOperation
(
c71401008
.
op2
)
c
:
RegisterEffect
(
e2
)
--to hand
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
71401008
,
1
))
e3
:
SetCategory
(
CATEGORY_TOHAND
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCountLimit
(
1
,
71501008
)
e3
:
SetCondition
(
c71401008
.
con3
)
e3
:
SetCost
(
c71401008
.
cost3
)
e3
:
SetTarget
(
c71401008
.
tg3
)
e3
:
SetOperation
(
c71401008
.
op3
)
c
:
RegisterEffect
(
e3
)
yume
.
ButterflyCounter
()
end
function
c71401008
.
indtg
(
e
,
c
)
return
c
:
GetOriginalType
()
&
TYPE_MONSTER
~=
0
end
function
c71401008
.
filterc2
(
c
,
tp
)
return
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsAbleToRemoveAsCost
()
and
(
c
:
IsLocation
(
LOCATION_SZONE
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
)
and
Duel
.
IsExistingMatchingCard
(
c71401008
.
filter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
c
,
tp
)
end
function
c71401008
.
filter2
(
c
,
cc
,
tp
)
return
c
:
IsLevel
(
4
)
and
not
c
:
IsForbidden
()
and
c
:
CheckUniqueOnField
(
tp
,
LOCATION_ONFIELD
,
cc
)
end
function
c71401008
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c71401008
.
filterc2
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetCustomActivityCount
(
71401001
,
tp
,
ACTIVITY_CHAIN
)
==
0
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c71401008
.
filterc2
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
,
tp
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
yume
.
RegButterflyCostLimit
(
e
,
tp
)
end
function
c71401008
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
c71401008
.
filter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
nil
,
tp
):
GetFirst
()
if
tc
then
local
c
=
e
:
GetHandler
()
local
ctype
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
71401008
,
2
),
aux
.
Stringid
(
71401008
,
3
))
==
0
and
TYPE_SPELL
or
TYPE_TRAP
if
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
ctype
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e1
)
if
c
:
IsRelateToEffect
(
e
)
and
not
c
:
IsImmuneToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
71401008
,
4
))
then
Duel
.
BreakEffect
()
if
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e2
:
SetValue
(
TYPE_SPELL
+
TYPE_CONTINUOUS
)
c
:
RegisterEffect
(
e2
)
end
end
end
end
end
function
c71401008
.
con3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetType
()
==
TYPE_SPELL
+
TYPE_CONTINUOUS
end
function
c71401008
.
filterc3
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c71401008
.
cost3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c71401008
.
filterc3
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
Duel
.
GetCustomActivityCount
(
71401001
,
tp
,
ACTIVITY_CHAIN
)
==
0
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c71401008
.
filterc3
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
yume
.
RegButterflyCostLimit
(
e
,
tp
)
end
function
c71401008
.
tg3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToHand
,
tp
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
+
LOCATION_REMOVED
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
+
LOCATION_REMOVED
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
0
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
+
LOCATION_REMOVED
)
end
function
c71401008
.
op3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToHand
,
tp
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
+
LOCATION_REMOVED
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
+
LOCATION_REMOVED
,
1
,
1
,
nil
)
if
sg
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
sg
,
nil
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c9310022.lua
View file @
0e9dd768
--新宇宙勇机 雄伟单调士
function
c9310022
.
initial_effect
(
c
)
--special Summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetRange
(
LOCATION_HAND
+
LOCATION_GRAVE
)
e1
:
SetCountLimit
(
1
,
9310022
)
e1
:
SetTarget
(
c9310022
.
target
)
e1
:
SetOperation
(
c9310022
.
operation
)
c
:
RegisterEffect
(
e1
)
--nontuner
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCode
(
EFFECT_NONTUNER
)
e2
:
SetValue
(
c9310022
.
tnval
)
c
:
RegisterEffect
(
e2
)
--effect gain
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_BE_MATERIAL
)
e3
:
SetProperty
(
EFFECT_FLAG_EVENT_PLAYER
)
e3
:
SetCondition
(
c9310022
.
efcon
)
e3
:
SetOperation
(
c9310022
.
efop
)
c
:
RegisterEffect
(
e3
)
end
c9310022
.
named_with_CosmosHero
=
1
function
c9310022
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsLevel
(
8
)
end
function
c9310022
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
c
=
e
:
GetHandler
()
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
c9310022
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
Duel
.
IsExistingTarget
(
c9310022
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
c9310022
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
c
,
1
,
0
,
0
)
end
function
c9310022
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsFacedown
()
or
not
tc
:
IsRelateToEffect
(
e
)
or
tc
:
IsImmuneToEffect
(
e
)
or
tc
:
IsLevelBelow
(
4
)
then
return
end
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_LEVEL
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetValue
(
-
4
)
tc
:
RegisterEffect
(
e1
)
if
not
tc
:
IsImmuneToEffect
(
e1
)
and
c
:
IsRelateToEffect
(
e
)
and
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
~=
0
then
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_LEAVE_FIELD_REDIRECT
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_REDIRECT
)
e2
:
SetValue
(
LOCATION_DECKBOT
)
c
:
RegisterEffect
(
e2
,
true
)
end
end
function
c9310022
.
tnval
(
e
,
c
)
return
e
:
GetHandler
():
IsDefensePos
()
end
function
c9310022
.
efcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
bit
.
band
(
r
,
REASON_SYNCHRO
+
REASON_XYZ
)
~=
0
and
e
:
GetHandler
():
IsPreviousLocation
(
LOCATION_ONFIELD
)
end
function
c9310022
.
efop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
rc
=
c
:
GetReasonCard
()
local
e1
=
Effect
.
CreateEffect
(
rc
)
e1
:
SetDescription
(
aux
.
Stringid
(
9310022
,
0
))
e1
:
SetCategory
(
CATEGORY_DRAW
+
CATEGORY_ATKCHANGE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetTarget
(
c9310022
.
target2
)
e1
:
SetOperation
(
c9310022
.
operation2
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
rc
:
RegisterEffect
(
e1
,
true
)
if
not
rc
:
IsType
(
TYPE_EFFECT
)
then
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_ADD_TYPE
)
e2
:
SetValue
(
TYPE_EFFECT
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
rc
:
RegisterEffect
(
e2
,
true
)
end
end
function
c9310022
.
target2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c9310022
.
operation2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
if
Duel
.
Draw
(
p
,
d
,
REASON_EFFECT
)
~=
0
then
local
tc
=
Duel
.
GetOperatedGroup
():
GetFirst
()
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
if
tc
:
IsType
(
TYPE_MONSTER
)
and
tc
:
IsLevel
(
4
,
8
)
and
c
:
IsRelateToEffect
(
e
)
and
c
:
IsFaceup
()
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
1000
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_DISABLE
)
c
:
RegisterEffect
(
e1
)
else
Duel
.
BreakEffect
()
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
end
Duel
.
ShuffleHand
(
tp
)
end
end
--星联勇机 雄伟单调士
function
c9310022
.
initial_effect
(
c
)
--special Summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetRange
(
LOCATION_HAND
+
LOCATION_GRAVE
)
e1
:
SetCountLimit
(
1
,
9310022
)
e1
:
SetTarget
(
c9310022
.
target
)
e1
:
SetOperation
(
c9310022
.
operation
)
c
:
RegisterEffect
(
e1
)
--nontuner
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCode
(
EFFECT_NONTUNER
)
e2
:
SetValue
(
c9310022
.
tnval
)
c
:
RegisterEffect
(
e2
)
--effect gain
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_BE_MATERIAL
)
e3
:
SetProperty
(
EFFECT_FLAG_EVENT_PLAYER
)
e3
:
SetCondition
(
c9310022
.
efcon
)
e3
:
SetOperation
(
c9310022
.
efop
)
c
:
RegisterEffect
(
e3
)
end
c9310022
.
named_with_CosmosHero
=
1
function
c9310022
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsLevel
(
8
)
end
function
c9310022
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
c
=
e
:
GetHandler
()
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
c9310022
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
Duel
.
IsExistingTarget
(
c9310022
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
c9310022
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
c
,
1
,
0
,
0
)
end
function
c9310022
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsFacedown
()
or
not
tc
:
IsRelateToEffect
(
e
)
or
tc
:
IsImmuneToEffect
(
e
)
or
tc
:
IsLevelBelow
(
4
)
then
return
end
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_LEVEL
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetValue
(
-
4
)
tc
:
RegisterEffect
(
e1
)
if
not
tc
:
IsImmuneToEffect
(
e1
)
and
c
:
IsRelateToEffect
(
e
)
and
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
~=
0
then
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_LEAVE_FIELD_REDIRECT
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_REDIRECT
)
e2
:
SetValue
(
LOCATION_DECKBOT
)
c
:
RegisterEffect
(
e2
,
true
)
end
end
function
c9310022
.
tnval
(
e
,
c
)
return
e
:
GetHandler
():
IsDefensePos
()
end
function
c9310022
.
efcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
bit
.
band
(
r
,
REASON_SYNCHRO
+
REASON_XYZ
)
~=
0
and
e
:
GetHandler
():
IsPreviousLocation
(
LOCATION_ONFIELD
)
end
function
c9310022
.
efop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
rc
=
c
:
GetReasonCard
()
local
e1
=
Effect
.
CreateEffect
(
rc
)
e1
:
SetDescription
(
aux
.
Stringid
(
9310022
,
0
))
e1
:
SetCategory
(
CATEGORY_DRAW
+
CATEGORY_ATKCHANGE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetTarget
(
c9310022
.
target2
)
e1
:
SetOperation
(
c9310022
.
operation2
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
rc
:
RegisterEffect
(
e1
,
true
)
if
not
rc
:
IsType
(
TYPE_EFFECT
)
then
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_ADD_TYPE
)
e2
:
SetValue
(
TYPE_EFFECT
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
rc
:
RegisterEffect
(
e2
,
true
)
end
end
function
c9310022
.
target2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c9310022
.
operation2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
if
Duel
.
Draw
(
p
,
d
,
REASON_EFFECT
)
~=
0
then
local
tc
=
Duel
.
GetOperatedGroup
():
GetFirst
()
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
if
tc
:
IsType
(
TYPE_MONSTER
)
and
tc
:
IsLevel
(
4
,
8
)
and
c
:
IsRelateToEffect
(
e
)
and
c
:
IsFaceup
()
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
1000
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_DISABLE
)
c
:
RegisterEffect
(
e1
)
else
Duel
.
BreakEffect
()
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
end
Duel
.
ShuffleHand
(
tp
)
end
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_CANNOT_DRAW
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
expansions/script/c9310027.lua
View file @
0e9dd768
This diff is collapsed.
Click to expand it.
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