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