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
REIKAI
ygopro-222DIY-cards
Commits
415545ef
Commit
415545ef
authored
Feb 17, 2021
by
TanakaKotoha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
daniaozhuanzhuanzhuan
parent
eb00d419
Changes
44
Hide whitespace changes
Inline
Side-by-side
Showing
44 changed files
with
3842 additions
and
55 deletions
+3842
-55
expansions/222DIY.cdb
expansions/222DIY.cdb
+0
-0
expansions/script/c12014000.lua
expansions/script/c12014000.lua
+126
-11
expansions/script/c12014001.lua
expansions/script/c12014001.lua
+108
-0
expansions/script/c12014002.lua
expansions/script/c12014002.lua
+97
-1
expansions/script/c12014003.lua
expansions/script/c12014003.lua
+147
-0
expansions/script/c12014011.lua
expansions/script/c12014011.lua
+122
-1
expansions/script/c12014012.lua
expansions/script/c12014012.lua
+93
-1
expansions/script/c12014013.lua
expansions/script/c12014013.lua
+77
-1
expansions/script/c12014014.lua
expansions/script/c12014014.lua
+127
-1
expansions/script/c12014015.lua
expansions/script/c12014015.lua
+26
-1
expansions/script/c12014016.lua
expansions/script/c12014016.lua
+101
-1
expansions/script/c12014020.lua
expansions/script/c12014020.lua
+133
-0
expansions/script/c12024005.lua
expansions/script/c12024005.lua
+114
-1
expansions/script/c12024013.lua
expansions/script/c12024013.lua
+96
-1
expansions/script/c12030009.lua
expansions/script/c12030009.lua
+4
-12
expansions/script/c12037006.lua
expansions/script/c12037006.lua
+49
-0
expansions/script/c12037022.lua
expansions/script/c12037022.lua
+34
-1
expansions/script/c12037025.lua
expansions/script/c12037025.lua
+107
-1
expansions/script/c12038006.lua
expansions/script/c12038006.lua
+59
-1
expansions/script/c12053008.lua
expansions/script/c12053008.lua
+52
-0
expansions/script/c12062010.lua
expansions/script/c12062010.lua
+110
-1
expansions/script/c12062012.lua
expansions/script/c12062012.lua
+129
-1
expansions/script/c12062013.lua
expansions/script/c12062013.lua
+111
-1
expansions/script/c12062015.lua
expansions/script/c12062015.lua
+91
-1
expansions/script/c12062033.lua
expansions/script/c12062033.lua
+108
-1
expansions/script/c12062041.lua
expansions/script/c12062041.lua
+99
-1
expansions/script/c12062043.lua
expansions/script/c12062043.lua
+103
-1
expansions/script/c12062053.lua
expansions/script/c12062053.lua
+98
-1
expansions/script/c12065000.lua
expansions/script/c12065000.lua
+27
-1
expansions/script/c12065001.lua
expansions/script/c12065001.lua
+79
-1
expansions/script/c12065002.lua
expansions/script/c12065002.lua
+99
-1
expansions/script/c12065003.lua
expansions/script/c12065003.lua
+79
-1
expansions/script/c12065011.lua
expansions/script/c12065011.lua
+139
-1
expansions/script/c12065012.lua
expansions/script/c12065012.lua
+95
-1
expansions/script/c12065013.lua
expansions/script/c12065013.lua
+141
-1
expansions/script/c12065014.lua
expansions/script/c12065014.lua
+132
-1
expansions/script/c12080031.lua
expansions/script/c12080031.lua
+56
-1
expansions/script/c12083005.lua
expansions/script/c12083005.lua
+63
-1
expansions/script/c12083008.lua
expansions/script/c12083008.lua
+50
-0
expansions/script/c12083021.lua
expansions/script/c12083021.lua
+83
-0
expansions/script/c12083081.lua
expansions/script/c12083081.lua
+97
-0
expansions/script/c12083082.lua
expansions/script/c12083082.lua
+94
-1
expansions/script/c12083085.lua
expansions/script/c12083085.lua
+46
-1
expansions/script/c12083090.lua
expansions/script/c12083090.lua
+41
-0
No files found.
expansions/222DIY.cdb
View file @
415545ef
No preview for this file type
expansions/script/c12014000.lua
View file @
415545ef
--没问题少女!
function
c12014000
.
initial_effect
(
c
)
--immune
--约定的苍忍 德涅波拉
local
m
=
12014000
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--change race
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
12014000
,
0
))
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
12014000
)
e1
:
SetOperation
(
c12014000
.
immop
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetCode
(
EFFECT_ADD_RACE
)
e1
:
SetRange
(
0x3ee
)
e1
:
SetValue
(
RACE_MACHINE
)
c
:
RegisterEffect
(
e1
)
--special summon proc
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e2
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e2
:
SetRange
(
LOCATION_DECK
)
e2
:
SetCondition
(
cm
.
spcon
)
e2
:
SetOperation
(
cm
.
spop
)
e2
:
SetValue
(
1
)
c
:
RegisterEffect
(
e2
)
Duel
.
AddCustomActivityCounter
(
m
,
ACTIVITY_CHAIN
,
cm
.
chainfilter
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e4
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e4
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
+
EFFECT_FLAG_IGNORE_IMMUNE
)
e4
:
SetCondition
(
cm
.
actcon
)
e4
:
SetOperation
(
cm
.
actop
)
e4
:
SetLabelObject
(
e2
)
c
:
RegisterEffect
(
e4
)
--special summon
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
,
m
)
e3
:
SetCost
(
cm
.
cost
)
e3
:
SetTarget
(
cm
.
tg
)
e3
:
SetOperation
(
cm
.
op
)
c
:
RegisterEffect
(
e3
)
end
function
c12014000
.
immop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_CARD
,
0
,
12099999
)
function
cm
.
chainfilter
(
re
,
tp
,
cid
)
return
false
end
function
cm
.
spfilter
(
c
)
return
c
:
IsSetCard
(
0x5fae
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsPublic
()
end
function
cm
.
spcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
return
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter
,
tp
,
LOCATION_HAND
,
0
,
3
,
nil
)
and
Duel
.
GetActivityCount
(
tp
,
ACTIVITY_BATTLE_PHASE
)
==
0
and
not
Duel
.
CheckPhaseActivity
()
and
Duel
.
GetCustomActivityCount
(
m
,
tp
,
ACTIVITY_CHAIN
)
==
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
tp
=
e
:
GetHandlerPlayer
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CONFIRM
)
local
tt
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter
,
tp
,
LOCATION_HAND
,
0
,
3
,
3
,
nil
)
Duel
.
ConfirmCards
(
1
-
tp
,
tt
)
end
function
cm
.
actcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
te
=
e
:
GetLabelObject
()
return
re
==
te
end
function
cm
.
actfilter
(
c
,
tp
)
return
c
:
IsCode
(
12014002
)
and
c
:
GetActivateEffect
():
IsActivatable
(
tp
)
end
function
cm
.
actop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsCode
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
,
12083002
)
then
return
end
Duel
.
SendtoDeck
(
c
,
2
,
nil
,
REASON_EFFECT
)
local
g
=
Duel
.
GetMatchingGroup
(
cm
.
actfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
,
tp
)
if
g
:
GetCount
()
>
0
then
local
tc
=
g
:
GetFirst
()
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_FZONE
,
POS_FACEUP
,
true
)
local
te
=
tc
:
GetActivateEffect
()
local
tep
=
tc
:
GetControler
()
local
cost
=
te
:
GetCost
()
if
cost
then
cost
(
te
,
tep
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
1
)
end
end
end
function
cm
.
costfilter
(
c
)
return
c
:
IsRace
(
RACE_WARRIOR
)
and
c
:
IsAbleToDeckAsCost
()
end
function
cm
.
costfilter2
(
c
)
return
c
:
IsRace
(
RACE_MACHINE
)
and
c
:
IsAbleToDeckAsCost
()
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
costfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
costfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
costfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
costfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
g1
)
g1
:
Merge
(
g2
)
Duel
.
SendtoDeck
(
g1
,
nil
,
2
,
REASON_COST
)
end
function
cm
.
filter
(
c
,
e
,
tp
)
return
c
:
IsCode
(
12014001
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
,
POS_FACEUP
)
end
function
cm
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
and
e
:
GetHandler
():
IsAbleToDeck
()
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
if
Duel
.
SendtoDeck
(
e
:
GetHandler
(),
2
,
nil
,
REASON_EFFECT
)
~=
0
then
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_ONFIELD
,
nil
)
local
tc
=
g
:
GetFirst
()
while
tc
do
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e2
)
tc
=
g
:
GetNext
()
end
end
end
end
expansions/script/c12014001.lua
View file @
415545ef
...
...
@@ -2,5 +2,113 @@
local
m
=
12014001
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--change race
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetCode
(
EFFECT_ADD_RACE
)
e1
:
SetRange
(
0x3ee
)
e1
:
SetValue
(
RACE_MACHINE
)
c
:
RegisterEffect
(
e1
)
local
ex
=
Effect
.
CreateEffect
(
c
)
ex
:
SetType
(
EFFECT_TYPE_SINGLE
)
ex
:
SetCode
(
m
)
ex
:
SetRange
(
LOCATION_MZONE
)
ex
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_SINGLE_RANGE
)
c
:
RegisterEffect
(
ex
)
local
ex
=
Effect
.
CreateEffect
(
c
)
ex
:
SetType
(
EFFECT_TYPE_SINGLE
)
ex
:
SetCode
(
m
+
100
)
ex
:
SetRange
(
LOCATION_MZONE
)
ex
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
c
:
RegisterEffect
(
ex
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_ADJUST
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetOperation
(
cm
.
op
)
c
:
RegisterEffect
(
e2
)
cm
[
e2
]
=
{}
--special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EVENT_DESTROYED
)
e1
:
SetCondition
(
cm
.
condition
)
e1
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
copyfilter
(
c
,
ec
)
local
g
=
ec
:
GetColumnGroup
()
return
c
:
IsFaceup
()
and
g
and
g
:
IsContains
(
c
)
and
c
:
IsType
(
TYPE_EFFECT
)
and
not
c
:
IsType
(
TYPE_TRAPMONSTER
)
and
not
c
:
IsHasEffect
(
m
)
end
function
cm
.
gfilter
(
c
,
g
)
if
not
g
then
return
true
end
return
not
g
:
IsContains
(
c
)
end
function
cm
.
gfilter1
(
c
,
g
)
if
not
g
then
return
true
end
return
not
g
:
IsExists
(
cm
.
gfilter2
,
1
,
nil
,
c
:
GetOriginalCode
())
end
function
cm
.
gfilter2
(
c
,
code
)
return
c
:
GetOriginalCode
()
==
code
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
copyt
=
cm
[
e
]
local
exg
=
Group
.
CreateGroup
()
for
tc
,
cid
in
pairs
(
copyt
)
do
if
tc
and
cid
then
exg
:
AddCard
(
tc
)
end
end
local
g
=
Duel
.
GetMatchingGroup
(
cm
.
copyfilter
,
tp
,
0
,
LOCATION_MZONE
,
nil
,
e
:
GetHandler
())
local
dg
=
exg
:
Filter
(
cm
.
gfilter
,
nil
,
g
)
for
tc
in
aux
.
Next
(
dg
)
do
c
:
ResetEffect
(
copyt
[
tc
],
RESET_COPY
)
exg
:
RemoveCard
(
tc
)
copyt
[
tc
]
=
nil
end
local
cg
=
g
:
Filter
(
cm
.
gfilter1
,
nil
,
exg
)
local
f
=
Card
.
RegisterEffect
Card
.
RegisterEffect
=
function
(
tc
,
e
,
forced
)
e
:
SetCondition
(
cm
.
rcon
(
e
:
GetCondition
(),
tc
,
copyt
))
f
(
tc
,
e
,
forced
)
end
for
tc
in
aux
.
Next
(
cg
)
do
copyt
[
tc
]
=
c
:
CopyEffect
(
tc
:
GetOriginalCode
(),
RESET_EVENT
+
0x1fe0000
,
1
)
end
Card
.
RegisterEffect
=
f
end
function
cm
.
rcon
(
con
,
tc
,
copyt
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsHasEffect
(
m
+
100
)
then
c
:
ResetEffect
(
c
,
copyt
[
tc
],
RESET_COPY
)
copyt
[
tc
]
=
nil
return
false
end
if
not
con
or
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
then
return
true
end
return
e
:
IsHasType
(
0x7e0
)
and
c
:
GetFlagEffect
(
m
)
>
0
end
end
function
cm
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
()
==
e
:
GetHandler
()
and
bit
.
band
(
r
,
0x41
)
==
0x41
and
eg
end
function
cm
.
tgfilter
(
c
)
return
c
:
IsSetCard
(
0x5fa9
)
and
c
:
IsAbleToHand
()
end
function
cm
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
eg
then
return
end
local
tt
=
eg
:
GetCount
()
if
tt
>
0
and
Duel
.
IsPlayerAffectedByEffect
(
tp
,
12014002
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
tt
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
12014002
,
4
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
tt
,
tt
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
elseif
tt
>
0
then
Duel
.
Draw
(
tp
,
tt
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c12014002.lua
View file @
415545ef
...
...
@@ -2,5 +2,101 @@
local
m
=
12014002
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
c
:
EnableCounterPermit
(
0x2fb4
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
-- pure force
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_BATTLE_DESTROYING
)
e3
:
SetRange
(
LOCATION_FZONE
)
e3
:
SetCondition
(
cm
.
drcon
)
e3
:
SetOperation
(
cm
.
drop
)
c
:
RegisterEffect
(
e3
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_CHAINING
)
e3
:
SetRange
(
LOCATION_FZONE
)
e3
:
SetCondition
(
cm
.
drcon1
)
e3
:
SetOperation
(
cm
.
drop
)
c
:
RegisterEffect
(
e3
)
--change effect type
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCode
(
m
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
1
,
0
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_FZONE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetCost
(
cm
.
spcost
)
e3
:
SetTarget
(
cm
.
sptg
)
e3
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e3
)
--to grave
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e5
:
SetCategory
(
CATEGORY_TOGRAVE
)
e5
:
SetType
(
EFFECT_TYPE_IGNITION
)
e5
:
SetRange
(
LOCATION_FZONE
)
e5
:
SetCost
(
cm
.
tgcost
)
e5
:
SetTarget
(
cm
.
tgtg
)
e5
:
SetOperation
(
cm
.
tgop
)
c
:
RegisterEffect
(
e5
)
end
function
cm
.
drcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
eg
:
GetFirst
()
return
rc
:
IsRelateToBattle
()
and
rc
:
IsStatus
(
STATUS_OPPO_BATTLE
)
and
rc
:
IsFaceup
()
and
rc
:
IsSetCard
(
0x5fa9
)
and
rc
:
IsControler
(
tp
)
end
function
cm
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
e
:
GetHandler
():
AddCounter
(
0x2fb4
,
1
)
end
function
cm
.
drcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
and
rc
:
IsSetCard
(
0x3fa9
)
and
rc
:
IsType
(
TYPE_MONSTER
)
and
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TRIGGERING_LOCATION
)
==
LOCATION_MZONE
end
function
cm
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsCanRemoveCounter
(
tp
,
0x2fb4
,
1
,
REASON_COST
)
end
c
:
RemoveCounter
(
tp
,
0x2fb4
,
1
,
REASON_COST
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
cm
.
tgcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsCanRemoveCounter
(
tp
,
0x2fb4
,
7
,
REASON_COST
)
end
c
:
RemoveCounter
(
tp
,
0x2fb4
,
7
,
REASON_COST
)
end
function
cm
.
tgtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToGrave
,
tp
,
0
,
LOCATION_HAND
+
LOCATION_EXTRA
,
1
,
nil
)
end
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
0
,
LOCATION_HAND
+
LOCATION_EXTRA
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
g
,
g
:
GetCount
(),
0
,
0
)
end
function
cm
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
0
,
LOCATION_HAND
+
LOCATION_EXTRA
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
expansions/script/c12014003.lua
0 → 100644
View file @
415545ef
--电脑娘 德涅波拉
local
m
=
12014003
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--change race
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetCode
(
EFFECT_ADD_RACE
)
e1
:
SetRange
(
0x3ee
)
e1
:
SetValue
(
RACE_MACHINE
)
c
:
RegisterEffect
(
e1
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
12043003
,
3
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_TRIGGER_O
+
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_INACTIVATE
+
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_CANNOT_NEGATE
)
e1
:
SetRange
(
LOCATION_GRAVE
)
e1
:
SetCountLimit
(
1
,
m
+
100
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_STANDBY
)
e1
:
SetHintTiming
(
0
,
0x1e0
)
e1
:
SetCondition
(
cm
.
igcon
)
e1
:
SetTarget
(
cm
.
igtg
)
e1
:
SetOperation
(
cm
.
igop
)
c
:
RegisterEffect
(
e1
)
local
ex
=
Effect
.
CreateEffect
(
c
)
ex
:
SetType
(
EFFECT_TYPE_SINGLE
)
ex
:
SetCode
(
m
)
ex
:
SetRange
(
LOCATION_MZONE
)
ex
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_SINGLE_RANGE
)
c
:
RegisterEffect
(
ex
)
local
ex
=
Effect
.
CreateEffect
(
c
)
ex
:
SetType
(
EFFECT_TYPE_SINGLE
)
ex
:
SetCode
(
m
+
100
)
ex
:
SetRange
(
LOCATION_MZONE
)
ex
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
c
:
RegisterEffect
(
ex
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_ADJUST
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetOperation
(
cm
.
op
)
c
:
RegisterEffect
(
e2
)
cm
[
e2
]
=
{}
--special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_DRAW
+
CATEGORY_TODECK
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetCondition
(
cm
.
spcon
)
e1
:
SetTarget
(
cm
.
sptg
)
e1
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
spfilter
(
c
,
sp
)
return
c
:
GetSummonPlayer
()
==
sp
end
function
cm
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
aux
.
TRUE
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
eg
:
IsExists
(
cm
.
spfilter
,
1
,
nil
,
1
-
tp
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
ct
=
Duel
.
GetMatchingGroupCount
(
Card
.
IsSummonType
,
tp
,
0
,
LOCATION_MZONE
,
nil
,
SUMMON_TYPE_SPECIAL
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
cm
.
igcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetTurnPlayer
()
==
tp
end
function
cm
.
igtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFlagEffect
(
tp
,
12024003
)
==
0
and
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
>
0
and
e
:
GetHandler
():
IsAbleToRemove
()
end
end
function
cm
.
igop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
==
0
then
return
end
Duel
.
ConfirmDecktop
(
tp
,
1
)
local
g
=
Duel
.
GetDecktopGroup
(
tp
,
1
)
local
tc
=
g
:
GetFirst
()
if
tc
:
IsType
(
TYPE_MONSTER
)
and
tc
:
IsRace
(
RACE_WARRIOR
+
RACE_MACHINE
)
and
tc
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
Duel
.
Remove
(
e
:
GetHandler
(),
POS_FACEUP
,
REASON_EFFECT
)
else
Duel
.
RegisterFlagEffect
(
tp
,
12024003
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
end
function
cm
.
copyfilter
(
c
,
ec
)
local
g
=
ec
:
GetColumnGroup
()
return
c
:
IsFaceup
()
and
g
and
g
:
IsContains
(
c
)
and
c
:
IsType
(
TYPE_EFFECT
)
and
not
c
:
IsType
(
TYPE_TRAPMONSTER
)
and
not
c
:
IsHasEffect
(
m
)
end
function
cm
.
gfilter
(
c
,
g
)
if
not
g
then
return
true
end
return
not
g
:
IsContains
(
c
)
end
function
cm
.
gfilter1
(
c
,
g
)
if
not
g
then
return
true
end
return
not
g
:
IsExists
(
cm
.
gfilter2
,
1
,
nil
,
c
:
GetOriginalCode
())
end
function
cm
.
gfilter2
(
c
,
code
)
return
c
:
GetOriginalCode
()
==
code
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
copyt
=
cm
[
e
]
local
exg
=
Group
.
CreateGroup
()
for
tc
,
cid
in
pairs
(
copyt
)
do
if
tc
and
cid
then
exg
:
AddCard
(
tc
)
end
end
local
g
=
Duel
.
GetMatchingGroup
(
cm
.
copyfilter
,
tp
,
0
,
LOCATION_MZONE
,
nil
,
e
:
GetHandler
())
local
dg
=
exg
:
Filter
(
cm
.
gfilter
,
nil
,
g
)
for
tc
in
aux
.
Next
(
dg
)
do
c
:
ResetEffect
(
copyt
[
tc
],
RESET_COPY
)
exg
:
RemoveCard
(
tc
)
copyt
[
tc
]
=
nil
end
local
cg
=
g
:
Filter
(
cm
.
gfilter1
,
nil
,
exg
)
local
f
=
Card
.
RegisterEffect
Card
.
RegisterEffect
=
function
(
tc
,
e
,
forced
)
e
:
SetCondition
(
cm
.
rcon
(
e
:
GetCondition
(),
tc
,
copyt
))
f
(
tc
,
e
,
forced
)
end
for
tc
in
aux
.
Next
(
cg
)
do
copyt
[
tc
]
=
c
:
CopyEffect
(
tc
:
GetOriginalCode
(),
RESET_EVENT
+
0x1fe0000
,
1
)
end
Card
.
RegisterEffect
=
f
end
function
cm
.
rcon
(
con
,
tc
,
copyt
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsHasEffect
(
m
+
100
)
then
c
:
ResetEffect
(
c
,
copyt
[
tc
],
RESET_COPY
)
copyt
[
tc
]
=
nil
return
false
end
if
not
con
or
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
then
return
true
end
return
e
:
IsHasType
(
0x7e0
)
and
c
:
GetFlagEffect
(
m
)
>
0
end
end
\ No newline at end of file
expansions/script/c12014011.lua
View file @
415545ef
...
...
@@ -2,5 +2,126 @@
local
m
=
12014011
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--change race
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetCode
(
EFFECT_ADD_RACE
)
e1
:
SetRange
(
0x3ee
)
e1
:
SetValue
(
RACE_MACHINE
)
c
:
RegisterEffect
(
e1
)
--tohand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e1
)
--special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_CUSTOM
+
m
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
m
+
100
)
e1
:
SetCondition
(
cm
.
spcon
)
e1
:
SetCost
(
cm
.
spcost
)
e1
:
SetTarget
(
cm
.
sptg
)
e1
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e1
)
if
not
cm
.
global_check
then
cm
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_TO_HAND
)
ge1
:
SetCondition
(
cm
.
regcon
)
ge1
:
SetOperation
(
cm
.
regop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
cm
.
cfilter
(
c
,
tp
)
return
c
:
IsControler
(
tp
)
and
c
:
IsPreviousLocation
(
LOCATION_DECK
)
end
function
cm
.
regcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetCurrentPhase
()
==
PHASE_DRAW
then
return
false
end
local
v
=
0
if
eg
:
IsExists
(
cm
.
cfilter
,
1
,
nil
,
0
)
then
v
=
v
+
1
end
if
eg
:
IsExists
(
cm
.
cfilter
,
1
,
nil
,
1
)
then
v
=
v
+
2
end
if
v
==
0
then
return
false
end
e
:
SetLabel
(({
0
,
1
,
PLAYER_ALL
})[
v
])
return
true
end
function
cm
.
regop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
RaiseEvent
(
eg
,
EVENT_CUSTOM
+
m
,
re
,
r
,
rp
,
ep
,
e
:
GetLabel
())
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsAbleToHand
()
end
if
chk
==
0
then
return
true
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsAbleToHand
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
0
)
end
function
cm
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
if
tc
:
IsSetCard
(
0x5fa9
)
then
local
tt
=
1
if
tt
>
0
and
Duel
.
IsPlayerAffectedByEffect
(
tp
,
12014002
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
tt
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
12014002
,
4
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
tt
,
tt
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
elseif
tt
>
0
then
Duel
.
Draw
(
tp
,
tt
,
REASON_EFFECT
)
end
end
end
end
function
cm
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
e
:
GetHandler
():
IsReason
(
REASON_DRAW
)
end
function
cm
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x1fb3
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToGraveAsCost
()
end
Duel
.
SendtoGrave
(
e
:
GetHandler
(),
REASON_COST
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
IsPlayerCanDraw
(
1
-
tp
,
1
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
PLAYER_ALL
,
1
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tt
=
1
if
tt
>
0
and
Duel
.
IsPlayerAffectedByEffect
(
tp
,
12014002
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
tt
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
12014002
,
4
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
tt
,
tt
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
elseif
tt
>
0
then
Duel
.
Draw
(
tp
,
tt
,
REASON_EFFECT
)
end
local
g
=
Duel
.
GetOperatedGroup
()
if
not
g
:
GetFirst
():
IsType
(
TYPE_MONSTER
)
then
local
tg
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_HAND
,
0
)
local
tc
=
tg
:
RandomSelect
(
1
-
tp
,
1
):
GetFirst
()
if
tc
then
Duel
.
SendtoGrave
(
tc
,
REASON_DISCARD
+
REASON_EFFECT
)
end
end
Duel
.
Draw
(
1
-
tp
,
1
,
REASON_EFFECT
)
local
g
=
Duel
.
GetOperatedGroup
()
if
not
g
:
GetFirst
():
IsType
(
TYPE_MONSTER
)
then
local
tg
=
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_HAND
)
local
tc
=
tg
:
RandomSelect
(
tp
,
1
):
GetFirst
()
if
tc
then
Duel
.
SendtoGrave
(
tc
,
REASON_DISCARD
+
REASON_EFFECT
)
end
end
end
\ No newline at end of file
expansions/script/c12014012.lua
View file @
415545ef
...
...
@@ -2,5 +2,97 @@
local
m
=
12014012
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--change race
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetCode
(
EFFECT_ADD_RACE
)
e1
:
SetRange
(
0x3ee
)
e1
:
SetValue
(
RACE_MACHINE
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOHAND
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
comtg
)
e1
:
SetOperation
(
cm
.
comop
)
c
:
RegisterEffect
(
e1
)
--deck
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCountLimit
(
1
,
m
+
100
)
e1
:
SetTarget
(
cm
.
sptg
)
e1
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
comtfilter
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsAbleToHand
()
and
c
:
IsLevelBelow
(
4
)
and
Duel
.
GetMZoneCount
(
tp
,
c
,
tp
)
>
0
end
function
cm
.
comtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
cm
.
comtfilter
(
chkc
,
tp
)
end
if
chk
==
0
then
return
Duel
.
GetMZoneCount
(
tp
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
Duel
.
IsExistingTarget
(
cm
.
comtfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
g
=
Duel
.
SelectTarget
(
tp
,
cm
.
comtfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
--
function
cm
.
comop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
not
(
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
())
then
return
end
if
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
~=
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
cm
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
local
tt
=
1
if
tt
>
0
and
Duel
.
IsPlayerAffectedByEffect
(
tp
,
12014002
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
tt
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
12014002
,
4
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
tt
,
tt
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
elseif
tt
>
0
then
Duel
.
Draw
(
tp
,
tt
,
REASON_EFFECT
)
end
local
tc
=
Duel
.
GetOperatedGroup
():
GetFirst
()
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
if
tc
:
IsSetCard
(
0x5fa9
)
and
tc
:
IsType
(
TYPE_MONSTER
)
then
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
cm
.
spfilter
,
tp
,
LOCATION_HAND
,
0
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
70245411
,
2
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sc
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SpecialSummon
(
sc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
else
Duel
.
BreakEffect
()
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
+
REASON_DISCARD
)
end
Duel
.
ShuffleHand
(
tp
)
end
\ No newline at end of file
expansions/script/c12014013.lua
View file @
415545ef
...
...
@@ -2,5 +2,81 @@
local
m
=
12014013
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--change race
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetCode
(
EFFECT_ADD_RACE
)
e1
:
SetRange
(
0x3ee
)
e1
:
SetValue
(
RACE_MACHINE
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetRange
(
LOCATION_HAND
+
LOCATION_GRAVE
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetCondition
(
cm
.
spcon
)
e1
:
SetTarget
(
cm
.
sptg
)
e1
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e1
)
--special summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_TO_HAND
)
e2
:
SetCountLimit
(
1
,
m
+
100
)
e2
:
SetTarget
(
cm
.
thtg
)
e2
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
cfilter
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x5fa9
)
and
c
:
IsLevelAbove
(
6
)
and
c
:
IsControler
(
tp
)
end
function
cm
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
cm
.
cfilter
,
1
,
nil
,
tp
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
~=
0
and
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
~=
0
then
local
tt
=
1
if
tt
>
0
and
Duel
.
IsPlayerAffectedByEffect
(
tp
,
12014002
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
tt
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
12014002
,
4
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
tt
,
tt
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
elseif
tt
>
0
then
Duel
.
Draw
(
tp
,
tt
,
REASON_EFFECT
)
end
end
end
function
cm
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsRace
(
RACE_FAIRY
+
RACE_SPELLCASTER
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDiscardDeck
(
tp
,
3
)
end
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
Duel
.
IsPlayerCanDiscardDeck
(
tp
,
3
)
then
return
end
Duel
.
ConfirmDecktop
(
tp
,
3
)
local
g
=
Duel
.
GetDecktopGroup
(
tp
,
3
)
if
g
:
FilterCount
(
cm
.
spfilter
,
nil
,
e
,
tp
)
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
tg
=
g
:
FilterSelect
(
tp
,
cm
.
spfilter
,
1
,
1
,
nil
,
e
,
tp
)
g
:
Sub
(
tg
)
Duel
.
SpecialSummon
(
tg
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
Duel
.
ShuffleDeck
(
tp
)
end
\ No newline at end of file
expansions/script/c12014014.lua
View file @
415545ef
--首要暗·影 阿斯尔
Duel
.
LoadScript
(
"c12048000.lua"
)
local
m
=
12014014
local
cm
=
_G
[
"c"
..
m
]
cm
.
srre_front_side
=
12014014
cm
.
srre_back_side
=
12014015
function
cm
.
initial_effect
(
c
)
--change race
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetCode
(
EFFECT_ADD_RACE
)
e1
:
SetRange
(
0x3ee
)
e1
:
SetValue
(
RACE_MACHINE
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
m
+
100
)
e2
:
SetCondition
(
cm
.
spcon
)
e2
:
SetTarget
(
cm
.
sptg
)
e2
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e2
)
--draw
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTarget
(
cm
.
target
)
e2
:
SetOperation
(
cm
.
activate
)
c
:
RegisterEffect
(
e2
)
local
e2_1
=
e2
:
Clone
()
e2_1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2_1
)
--tograve
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e2
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_FIELD
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCode
(
EVENT_TO_HAND
)
e2
:
SetCondition
(
cm
.
tgcon
)
e2
:
SetOperation
(
cm
.
tgop
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
spfilter
(
c
,
race
)
return
not
c
:
IsType
(
TYPE_FUSION
+
TYPE_SYNCHRO
+
TYPE_XYZ
+
TYPE_LINK
)
and
c
:
IsRace
(
race
)
end
function
cm
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
Duel
.
IsExistingMatchingCard
(
cm
.
rfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
RACE_MACHINE
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
rfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
RACE_WARRIOR
)
end
function
cm
.
spfilter1
(
c
,
e
,
tp
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
chkc
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingTarget
(
cm
.
spfilter1
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
cm
.
spfilter1
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
aux
.
TRUE
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
0
,
LOCATION_MZONE
)
end
function
cm
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
TRUE
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
)
if
g
:
GetCount
()
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
sg
)
Duel
.
SendtoHand
(
sg
,
nil
,
REASON_EFFECT
)
local
tt
=
1
if
tt
>
0
and
Duel
.
IsPlayerAffectedByEffect
(
tp
,
12014002
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
tt
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
12014002
,
4
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
tt
,
tt
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
elseif
tt
>
0
then
Duel
.
Draw
(
tp
,
tt
,
REASON_EFFECT
)
end
end
function
cm
.
spcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsFaceup
()
and
Duel
.
GetTurnPlayer
()
==
tp
end
function
cm
.
sptg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
GetMZoneCount
(
tp
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
c
,
1
,
0
,
0
)
end
function
cm
.
spop1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
local
sg
=
Duel
.
GetMatchingGroup
(
aux
.
TRUE
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
aux
.
ExceptThisCard
(
e
))
sg
:
RemoveCard
(
c
)
Duel
.
Destroy
(
sg
,
REASON_EFFECT
)
srre
.
codechangeop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
function
cm
.
cfilter
(
c
,
tp
)
return
c
:
IsSetCard
(
0x5fa9
)
end
function
cm
.
tgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
r
==
REASON_DRAW
and
eg
:
IsExists
(
cm
.
cfilter
,
1
,
nil
,
tp
)
end
function
cm
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
Duel
.
IsPlayerCanDiscardDeck
(
tp
,
1
)
then
return
end
local
g
=
Duel
.
GetDecktopGroup
(
tp
,
1
)
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
if
Duel
.
GetFlagEffect
(
tp
,
m
)
>
2
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
2
))
then
srre
.
codechangeop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
end
\ No newline at end of file
expansions/script/c12014015.lua
View file @
415545ef
...
...
@@ -2,5 +2,30 @@
local
m
=
12014015
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--change race
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetCode
(
EFFECT_ADD_RACE
)
e1
:
SetRange
(
0x3ee
)
e1
:
SetValue
(
RACE_MACHINE
)
c
:
RegisterEffect
(
e1
)
--immune
local
e1
=
srre
.
immuneffect
(
c
,
1
)
--destroy
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_FIELD
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCode
(
EVENT_TO_HAND
)
e4
:
SetCondition
(
cm
.
descon
)
e4
:
SetOperation
(
cm
.
desop
)
c
:
RegisterEffect
(
e4
)
local
e4
=
srre
.
backeffect
(
c
)
end
function
cm
.
descon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
r
==
REASON_DRAW
end
function
cm
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Destroy
(
e
:
GetHandler
(),
REASON_EFFECT
)
end
expansions/script/c12014016.lua
View file @
415545ef
...
...
@@ -2,5 +2,105 @@
local
m
=
12014016
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--change race
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetCode
(
EFFECT_ADD_RACE
)
e1
:
SetRange
(
0x3ee
)
e1
:
SetValue
(
RACE_MACHINE
)
c
:
RegisterEffect
(
e1
)
--tohand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOHAND
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
comtg
)
e1
:
SetOperation
(
cm
.
comop
)
c
:
RegisterEffect
(
e1
)
--search
local
e7
=
Effect
.
CreateEffect
(
c
)
e7
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e7
:
SetCategory
(
CATEGORY_TOHAND
)
e7
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e7
:
SetCode
(
EVENT_FREE_CHAIN
)
e7
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e7
:
SetRange
(
LOCATION_MZONE
)
e7
:
SetCountLimit
(
1
,
m
+
100
)
e7
:
SetTarget
(
cm
.
destg
)
e7
:
SetOperation
(
cm
.
desop
)
c
:
RegisterEffect
(
e7
)
end
function
cm
.
comtfilter
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsAbleToHand
()
and
c
:
IsSetCard
(
0x5fa9
)
and
Duel
.
GetMZoneCount
(
tp
,
c
,
tp
)
>
0
end
function
cm
.
comtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
cm
.
comtfilter
(
chkc
,
tp
)
end
if
chk
==
0
then
return
Duel
.
GetMZoneCount
(
tp
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
Duel
.
IsExistingTarget
(
cm
.
comtfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
g
=
Duel
.
SelectTarget
(
tp
,
cm
.
comtfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
--
function
cm
.
comop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
if
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
<
5
then
return
end
Duel
.
ConfirmDecktop
(
tp
,
5
)
local
g
=
Duel
.
GetDecktopGroup
(
tp
,
5
):
Filter
(
Card
.
IsAbleToHand
,
nil
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
DisableShuffleCheck
()
Duel
.
SendtoHand
(
sg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
sg
)
local
tt
=
Duel
.
GetOperatedGroup
():
GetFirst
()
if
not
tt
:
IsSetCard
(
0x5fa9
)
then
Duel
.
SendtoDeck
(
tc
,
nil
,
2
,
REASON_EFFECT
)
end
end
function
cm
.
thfilter
(
c
,
atk
)
return
c
:
IsSetCard
(
0x5fa9
)
and
not
c
:
IsPublic
()
and
c
:
IsAbleToDeck
()
end
function
cm
.
filter
(
c
,
tp
)
return
c
:
IsFaceup
()
and
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
function
cm
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
local
g
=
Duel
.
SelectTarget
(
tp
,
cm
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
local
tt
=
1
if
tt
>
0
and
Duel
.
IsPlayerAffectedByEffect
(
tp
,
12014002
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
tt
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
12014002
,
4
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
tt
,
tt
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
elseif
tt
>
0
then
Duel
.
Draw
(
tp
,
tt
,
REASON_EFFECT
)
end
end
end
end
\ No newline at end of file
expansions/script/c12014020.lua
View file @
415545ef
...
...
@@ -2,5 +2,138 @@
local
m
=
12014020
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--link summon
aux
.
AddLinkProcedure
(
c
,
nil
,
2
,
4
,
cm
.
lcheck
)
c
:
EnableReviveLimit
()
--change race
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetCode
(
EFFECT_ADD_RACE
)
e1
:
SetRange
(
0x3ee
)
e1
:
SetValue
(
RACE_MACHINE
)
c
:
RegisterEffect
(
e1
)
--special summon
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetRange
(
LOCATION_MZONE
)
ge1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
+
EFFECT_FLAG_IGNORE_IMMUNE
+
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
ge1
:
SetOperation
(
cm
.
checkop
)
c
:
RegisterEffect
(
ge1
)
local
ex
=
Effect
.
CreateEffect
(
c
)
ex
:
SetType
(
EFFECT_TYPE_SINGLE
)
ex
:
SetCode
(
m
)
ex
:
SetRange
(
LOCATION_MZONE
)
ex
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_SINGLE_RANGE
)
c
:
RegisterEffect
(
ex
)
local
ex
=
Effect
.
CreateEffect
(
c
)
ex
:
SetType
(
EFFECT_TYPE_SINGLE
)
ex
:
SetCode
(
m
+
100
)
ex
:
SetRange
(
LOCATION_MZONE
)
ex
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
c
:
RegisterEffect
(
ex
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_ADJUST
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetOperation
(
cm
.
op
)
c
:
RegisterEffect
(
e2
)
cm
[
e2
]
=
{}
--spsummon
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
)
e3
:
SetCode
(
EVENT_LEAVE_FIELD
)
e3
:
SetCondition
(
cm
.
spcon
)
e3
:
SetTarget
(
cm
.
sptg
)
e3
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
lcheck
(
g
,
lc
)
return
g
:
IsExists
(
Card
.
IsRace
,
1
,
nil
,
RACE_WARRIOR
)
and
g
:
IsExists
(
Card
.
IsRace
,
1
,
nil
,
RACE_MACHINE
)
end
function
cm
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
re
:
GetHandler
()
==
c
then
Duel
.
SetChainLimit
(
cm
.
chainlm
)
end
end
function
cm
.
chainlm
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
cm
.
copyfilter
(
c
,
ec
)
local
g
=
ec
:
GetColumnGroup
()
return
c
:
IsFaceup
()
and
g
and
g
:
IsContains
(
c
)
and
c
:
IsType
(
TYPE_EFFECT
)
and
not
c
:
IsType
(
TYPE_TRAPMONSTER
)
and
not
c
:
IsHasEffect
(
m
)
end
function
cm
.
gfilter
(
c
,
g
)
if
not
g
then
return
true
end
return
not
g
:
IsContains
(
c
)
end
function
cm
.
gfilter1
(
c
,
g
)
if
not
g
then
return
true
end
return
not
g
:
IsExists
(
cm
.
gfilter2
,
1
,
nil
,
c
:
GetOriginalCode
())
end
function
cm
.
gfilter2
(
c
,
code
)
return
c
:
GetOriginalCode
()
==
code
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
copyt
=
cm
[
e
]
local
exg
=
Group
.
CreateGroup
()
for
tc
,
cid
in
pairs
(
copyt
)
do
if
tc
and
cid
then
exg
:
AddCard
(
tc
)
end
end
local
g
=
Duel
.
GetMatchingGroup
(
cm
.
copyfilter
,
tp
,
0
,
LOCATION_MZONE
,
nil
,
e
:
GetHandler
())
local
dg
=
exg
:
Filter
(
cm
.
gfilter
,
nil
,
g
)
for
tc
in
aux
.
Next
(
dg
)
do
c
:
ResetEffect
(
copyt
[
tc
],
RESET_COPY
)
exg
:
RemoveCard
(
tc
)
copyt
[
tc
]
=
nil
end
local
cg
=
g
:
Filter
(
cm
.
gfilter1
,
nil
,
exg
)
local
f
=
Card
.
RegisterEffect
Card
.
RegisterEffect
=
function
(
tc
,
e
,
forced
)
e
:
SetCondition
(
cm
.
rcon
(
e
:
GetCondition
(),
tc
,
copyt
))
f
(
tc
,
e
,
forced
)
end
for
tc
in
aux
.
Next
(
cg
)
do
copyt
[
tc
]
=
c
:
CopyEffect
(
tc
:
GetOriginalCode
(),
RESET_EVENT
+
0x1fe0000
,
1
)
end
Card
.
RegisterEffect
=
f
end
function
cm
.
rcon
(
con
,
tc
,
copyt
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsHasEffect
(
m
+
100
)
then
c
:
ResetEffect
(
c
,
copyt
[
tc
],
RESET_COPY
)
copyt
[
tc
]
=
nil
return
false
end
if
not
con
or
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
then
return
true
end
return
e
:
IsHasType
(
0x7e0
)
and
c
:
GetFlagEffect
(
m
)
>
0
end
end
function
cm
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsReason
(
REASON_EFFECT
)
and
c
:
GetReasonPlayer
()
==
1
-
tp
end
function
cm
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
Duel
.
SetChainLimit
(
cm
.
chainlm
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
cm
.
spfilter
),
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
Draw
(
tp
,
2
,
REASON_EFFECT
)
end
\ No newline at end of file
expansions/script/c12024005.lua
View file @
415545ef
...
...
@@ -2,5 +2,118 @@
local
m
=
12024005
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--search
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e2
:
SetCategory
(
CATEGORY_DRAW
+
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_HAND
)
e2
:
SetCountLimit
(
1
,
m
)
e2
:
SetTarget
(
cm
.
thtg
)
e2
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e2
)
--search
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
m
+
100
)
e2
:
SetCost
(
cm
.
thcost1
)
e2
:
SetTarget
(
cm
.
thtg1
)
e2
:
SetOperation
(
cm
.
thop1
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
GetMZoneCount
(
tp
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Draw
(
tp
,
tt
,
REASON_EFFECT
)
local
tg
=
Duel
.
GetOperatedGroup
()
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
local
g
=
Group
.
CreateGroup
()
if
tg
:
IsExists
(
Card
.
IsSetCard
,
nil
,
0xcfbe
)
and
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
e
:
GetHandler
(),
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
TRUE
,
tp
,
LOCATION_HAND
,
0
,
3
,
3
,
e
:
GetHandler
())
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_EFFECT
)
local
tc
=
g
:
GetFirst
()
while
tc
do
tc
:
ReverseInDeck
()
local
e5
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e5
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_SINGLE
)
e5
:
SetCode
(
EVENT_TO_HAND
)
e5
:
SetOperation
(
cm
.
rvdop
)
e5
:
SetReset
(
RESET_EVENT
+
0x1de0000
)
tc
:
RegisterEffect
(
e5
)
if
tc
:
IsType
(
TYPE_MONSTER
)
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
)
end
tc
=
g
:
GetNext
()
end
else
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_HAND
,
0
)
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_EFFECT
)
local
tc
=
g
:
GetFirst
()
while
tc
do
tc
:
ReverseInDeck
()
local
e5
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e5
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_SINGLE
)
e5
:
SetCode
(
EVENT_TO_HAND
)
e5
:
SetOperation
(
cm
.
rvdop
)
e5
:
SetReset
(
RESET_EVENT
+
0x1de0000
)
tc
:
RegisterEffect
(
e5
)
if
tc
:
IsType
(
TYPE_MONSTER
)
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
)
end
tc
=
g
:
GetNext
()
end
end
end
function
cm
.
rvdop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Recover
(
tp
,
1000
,
REASON_EFFECT
)
end
function
cm
.
thcost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckLPCost
(
tp
,
5000
)
end
Duel
.
PayLPCost
(
tp
,
5000
)
end
function
cm
.
filter
(
c
,
tt
)
return
(
(
tt
==
1
and
c
:
IsType
(
TYPE_QUICKPLAY
)
)
or
(
c
:
IsSetCard
(
0xcfbe
)
and
c
:
IsType
(
TYPE_MONSTER
)
)
)
and
c
:
IsAbleToHand
()
end
function
cm
.
thtg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
tt
=
0
if
c
:
GetColumnGroup
():
FilterCount
(
Card
.
IsFacedown
,
nil
)
>
0
then
tt
=
1
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
,
tt
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
end
function
cm
.
thop1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tt
=
0
if
c
:
GetColumnGroup
():
FilterCount
(
Card
.
IsFacedown
,
nil
)
>
0
then
tt
=
1
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
3
,
nil
,
tt
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
\ No newline at end of file
expansions/script/c12024013.lua
View file @
415545ef
...
...
@@ -2,5 +2,100 @@
local
m
=
12024013
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
activate
)
c
:
RegisterEffect
(
e1
)
--dr
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e3
:
SetCategory
(
CATEGORY_DRAW
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCondition
(
cm
.
drcon
)
e3
:
SetTarget
(
cm
.
drtg
)
e3
:
SetOperation
(
cm
.
drop
)
c
:
RegisterEffect
(
e3
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_REMOVE
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
aux
.
TRUE
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectTarget
(
tp
,
aux
.
TRUE
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
end
function
cm
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
--immune
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_BE_EFFECT_TARGET
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
1
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
)
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
local
tg
=
g
:
RandomSelect
(
tp
,
2
)
local
tc
=
tg
:
GetFirst
()
while
tc
do
tc
:
ReverseInDeck
()
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_SINGLE
)
e5
:
SetCode
(
EVENT_TO_HAND
)
e5
:
SetOperation
(
cm
.
rvdop
)
e5
:
SetReset
(
RESET_EVENT
+
0x1de0000
)
tc
:
RegisterEffect
(
e5
)
if
tc
:
IsType
(
TYPE_MONSTER
)
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
)
end
tc
=
tg
:
GetNext
()
end
Duel
.
ShuffleDeck
(
tp
)
if
c
:
IsRelateToEffect
(
e
)
and
c
:
IsCanTurnSet
()
then
Duel
.
BreakEffect
()
c
:
CancelToGrave
()
Duel
.
ChangePosition
(
c
,
POS_FACEDOWN
)
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
cm
.
rvdop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Recover
(
tp
,
1000
,
REASON_EFFECT
)
end
function
cm
.
drcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
==
1
-
tp
and
e
:
GetHandler
():
IsPreviousPosition
(
POS_FACEDOWN
)
end
function
cm
.
filter
(
c
,
e
,
tp
)
return
c
:
IsRace
(
RACE_FIEND
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
drtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
expansions/script/c12030009.lua
View file @
415545ef
...
...
@@ -111,23 +111,15 @@ function cm.filter11(c)
end
function
cm
.
drtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
filter11
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
if
rp
==
1
-
tp
and
tp
==
e
:
GetLabel
()
then
e
:
SetCategory
(
CATEGORY_TOHAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
3
,
tp
,
LOCATION_GRAVE
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
end
function
cm
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
rp
==
1
-
tp
and
tp
==
e
:
GetLabel
()
then
local
cc
=
1
else
local
cc
=
3
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter11
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
cc
,
nil
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter11
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
3
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
ShuffleHand
(
tp
)
end
end
\ No newline at end of file
expansions/script/c12037006.lua
View file @
415545ef
...
...
@@ -3,4 +3,53 @@ local m=12037006
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e3
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e3
:
SetType
(
EFFECT_TYPE_XMATERIAL
+
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetCost
(
cm
.
cost3
)
e3
:
SetCondition
(
cm
.
con3
)
e3
:
SetTarget
(
cm
.
thtg
)
e3
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e3
)
--tohand
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
m
)
e3
:
SetOperation
(
cm
.
thop1
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
thop1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
RegisterFlagEffect
(
tp
,
m
+
200
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
cm
.
cost3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
CheckRemoveOverlayCard
(
tp
,
1
,
REASON_COST
)
end
c
:
RemoveOverlayCard
(
tp
,
1
,
1
,
REASON_COST
)
end
function
cm
.
con3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsDefensePos
()
and
c
:
IsSetCard
(
0x2fb5
)
end
function
cm
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x1fb5
)
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsAbleToHand
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetFlagEffect
(
tp
,
m
+
200
)
==
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetFlagEffect
(
tp
,
m
+
200
)
>
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
--
expansions/script/c12037022.lua
View file @
415545ef
...
...
@@ -2,5 +2,38 @@
local
m
=
12037022
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_XYZ
)
and
c
:
IsSetCard
(
0x2fb5
)
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
cm
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
cm
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
end
function
cm
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
not
tc
:
IsImmuneToEffect
(
e
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_XMATERIAL
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
TRUE
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Overlay
(
tc
,
g
)
end
end
if
c
:
IsRelateToEffect
(
e
)
and
c
:
IsCanTurnSet
()
then
Duel
.
BreakEffect
()
c
:
CancelToGrave
()
Duel
.
ChangePosition
(
c
,
POS_FACEDOWN
)
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
\ No newline at end of file
expansions/script/c12037025.lua
View file @
415545ef
...
...
@@ -2,5 +2,111 @@
local
m
=
12037025
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
tgop
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
tfilter
(
c
)
return
c
:
IsSetCard
(
0x1fb5
)
and
not
c
:
IsPublic
()
end
function
cm
.
tgfilter
(
c
)
return
c
:
IsAbleToGrave
()
and
c
:
IsSetCard
(
0x2fb5
)
end
function
cm
.
thfilter1
(
c
,
e
,
tp
)
local
mg
=
Duel
.
GetMatchingGroup
(
cm
.
spfilter1
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
0
,
nil
,
c
)
return
c
:
IsType
(
TYPE_XYZ
)
and
c
:
IsSetCard
(
0x2fb5
)
and
c
:
IsXyzSummonable
(
nil
,
mg
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_XYZ
,
tp
,
false
,
false
)
end
function
cm
.
spfilter1
(
c
,
sc
)
return
c
:
IsAbleToRemove
()
and
c
:
IsCanBeXyzMaterial
(
sc
)
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
b1
=
(
Duel
.
IsExistingMatchingCard
(
cm
.
tfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
and
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_HAND
)
)
local
b2
=
Duel
.
IsExistingMatchingCard
(
cm
.
tgfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
)
local
b3
=
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter1
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
)
if
chk
==
0
then
return
b1
or
b2
or
b3
end
local
off
=
1
local
ops
=
{}
local
opval
=
{}
if
b1
then
ops
[
off
]
=
aux
.
Stringid
(
m
,
0
)
opval
[
off
-
1
]
=
1
off
=
off
+
1
end
if
b2
then
ops
[
off
]
=
aux
.
Stringid
(
m
,
1
)
opval
[
off
-
1
]
=
2
off
=
off
+
1
end
if
b3
then
ops
[
off
]
=
aux
.
Stringid
(
m
,
2
)
opval
[
off
-
1
]
=
3
off
=
off
+
1
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EFFECT
)
local
op
=
Duel
.
SelectOption
(
tp
,
table.unpack
(
ops
))
if
opval
[
op
]
==
1
then
e
:
SetCategory
(
CATEGORY_TOGRAVE
)
e
:
SetOperation
(
cm
.
atop
)
elseif
opval
[
op
]
==
2
then
e
:
SetCategory
(
CATEGORY_TOGRAVE
)
e
:
SetOperation
(
cm
.
tgop
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
elseif
opval
[
op
]
==
3
then
e
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e
:
SetOperation
(
cm
.
spop
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
end
end
function
cm
.
atop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CONFIRM
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
==
0
then
return
false
end
local
tc
=
g
:
GetFirst
()
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
local
tg
=
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_HAND
)
local
th
=
tg
:
RandomSelect
(
tp
,
1
):
GetFirst
()
if
th
then
Duel
.
SendtoGrave
(
th
,
REASON_DISCARD
+
REASON_EFFECT
)
end
end
function
cm
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tgfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
,
tp
)
local
tc
=
g
:
GetFirst
()
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
local
c
=
e
:
GetHandler
()
--atkup
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e2
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e2
:
SetRange
(
LOCATION_HAND
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_GRANT
)
e3
:
SetTargetRange
(
LOCATION_HAND
,
0
)
e3
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e3
:
SetTarget
(
cm
.
eftg
)
e3
:
SetLabelObject
(
e2
)
Duel
.
RegisterEffect
(
t3
,
tp
)
end
function
cm
.
eftg
(
e
,
c
)
return
c
:
IsSetCard
(
0x4fb5
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter1
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
tc
=
g
:
GetFirst
()
if
tc
then
local
lt
=
2
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter1
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
0
,
lt
,
lt
,
nil
)
Duel
.
Remove
(
sg
,
POS_FACEUP
,
REASON_EFFECT
)
Duel
.
SpecialSummon
(
tc
,
SUMMON_TYPE_XYZ
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
expansions/script/c12038006.lua
View file @
415545ef
...
...
@@ -2,5 +2,63 @@
local
m
=
12038006
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--spsummon1
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetCondition
(
cm
.
spcon1
)
e1
:
SetTarget
(
cm
.
sptg
)
e1
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e1
)
--tohand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_RECOVER
+
CATEGORY_DRAW
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetTarget
(
cm
.
sptg1
)
e2
:
SetOperation
(
cm
.
spop1
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
cfilter1
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_PSYCHO
)
end
function
cm
.
spcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
cm
.
cfilter1
,
1
,
nil
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
c
,
1
,
0
,
0
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
cm
.
spfilter
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsRace
(
RACE_PSYCHO
)
and
c
:
IsAbleToHand
()
end
function
cm
.
sptg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
nil
,
tp
,
LOCATION_ONFIELD
)
end
function
cm
.
spop1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
63
,
nil
)
if
not
g
then
return
end
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
local
tt
=
Duel
.
GetOperatedGroup
():
GetCount
()
if
tt
>
0
and
Duel
.
Recover
(
tp
,
tt
*
800
,
REASON_EFFECT
)
~=
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
2
))
then
Duel
.
DiscardHand
(
tp
,
aux
.
TRUE
,
1
,
1
,
REASON_EFFECT
+
REASON_DISCARD
)
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c12053008.lua
View file @
415545ef
Duel
.
LoadScript
(
"c12053099.lua"
)
--均衡使徒 天秤宫的苏列耶尔
local
m
=
12053008
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--draw
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCondition
(
cm
.
drcon
)
e1
:
SetTarget
(
cm
.
drtg
)
e1
:
SetOperation
(
cm
.
drop
)
c
:
RegisterEffect
(
e1
)
local
e1
=
jyuunishito
.
ef
(
c
)
end
function
cm
.
drcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
Card
.
IsRace
,
nil
,
RACE_FAIRY
)
end
function
cm
.
filter
(
c
,
e
,
tp
)
return
c
:
IsRace
(
RACE_FAIRY
)
and
c
:
IsLevel
(
8
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
drtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
cm
.
sr_srqn
(
c
,
code
,
rc
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
+
EFFECT_FLAG_IGNORE_RANGE
+
EFFECT_FLAG_IGNORE_IMMUNE
)
e2
:
SetCode
(
EVENT_TO_HAND
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e2
:
SetOperation
(
cm
.
sr_srop
)
rc
:
RegisterEffect
(
e2
)
rc
:
RegisterFlagEffect
(
code
,
RESET_EVENT
+
0x1fe0000
-
RESET_TOFIELD
,
EFFECT_FLAG_CLIENT_HINT
,
1
,
0
,
aux
.
Stringid
(
code
,
2
))
end
function
cm
.
sr_srop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_HAND
,
0
)
==
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_HAND
)
then
return
end
if
rp
==
PLAYER_ALL
or
Duel
.
GetFieldGroupCount
(
rp
,
LOCATION_HAND
,
0
)
>
Duel
.
GetFieldGroupCount
(
1
-
rp
,
LOCATION_HAND
,
0
)
then
Duel
.
Draw
(
1
-
rp
,
1
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c12062010.lua
View file @
415545ef
...
...
@@ -2,5 +2,114 @@
local
m
=
12062010
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--rec or dam
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e1
)
--place
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_LEAVE_FIELD
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCondition
(
cm
.
plcon
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
cm
.
pltg
)
e2
:
SetOperation
(
cm
.
plop
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
filter1
(
c
)
return
(
c
:
IsSetCard
(
0xfbb
)
or
c
:
IsSetCard
(
0x1fbd
)
)
and
c
:
IsAbleToHand
()
end
function
cm
.
cfilter
(
c
,
e
,
tp
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsLevel
(
1
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
f1
(
c
)
return
c
:
IsAbleToDeck
()
and
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsLevel
(
8
)
and
not
c
:
IsPublic
()
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
b1
=
(
Duel
.
IsExistingMatchingCard
(
cm
.
cfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
)
local
b2
=
(
Duel
.
IsExistingMatchingCard
(
cm
.
f1
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
)
if
chk
==
0
then
return
b1
or
b2
end
local
b3
=
(
Duel
.
CheckPhaseActivity
()
and
b1
and
b2
)
if
b1
and
b2
and
b3
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
1
),
aux
.
Stringid
(
m
,
2
),
aux
.
Stringid
(
m
,
3
))
elseif
b1
and
b2
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
1
),
aux
.
Stringid
(
m
,
2
))
elseif
b1
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
1
))
elseif
b2
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
2
))
+
1
else
return
end
e
:
SetLabel
(
op
)
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
aux
.
Stringid
(
m
,
op
+
1
))
if
op
==
0
then
e
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
e
:
SetOperation
(
cm
.
operation
)
elseif
op
==
1
then
e
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_DRAW
)
e
:
SetOperation
(
cm
.
operation1
)
elseif
op
==
2
then
e
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TODECK
+
CATEGORY_DRAW
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
nil
)
e
:
SetOperation
(
cm
.
operation2
)
end
end
function
cm
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
local
kp
=
Duel
.
GetTurnPlayer
()
if
Duel
.
GetCurrentPhase
()
<
PHASE_BATTLE_START
then
Duel
.
SkipPhase
(
kp
,
PHASE_STANDBY
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
kp
,
PHASE_MAIN1
,
RESET_PHASE
+
PHASE_END
,
1
)
end
end
end
function
cm
.
operation1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SELF
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
f1
,
tp
,
LOCATION_HAND
,
0
,
1
,
63
,
nil
)
local
sg
=
g
:
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
local
ct
=
Duel
.
SendtoDeck
(
g
,
nil
,
0
,
REASON_EFFECT
)
if
ct
>
0
then
Duel
.
ShuffleDeck
(
tp
)
Duel
.
BreakEffect
()
Duel
.
Draw
(
tp
,
ct
,
REASON_EFFECT
)
Duel
.
ShuffleHand
(
tp
)
end
end
function
cm
.
operation2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
c
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
c
.
operation1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
function
cm
.
plcfilter
(
c
,
tp
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsLevel
(
1
)
and
c
:
GetPreviousControler
()
==
tp
and
c
:
IsPreviousPosition
(
POS_FACEUP
)
and
c
:
GetReasonPlayer
()
==
1
-
tp
and
c
:
IsReason
(
REASON_EFFECT
)
and
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
end
function
cm
.
plcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
cm
.
plcfilter
,
1
,
nil
,
tp
)
end
function
cm
.
filter
(
c
,
e
,
tp
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsLevel
(
1
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
pltg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
plop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
expansions/script/c12062012.lua
View file @
415545ef
...
...
@@ -2,5 +2,133 @@
local
m
=
12062012
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--Cannot special summon
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e0
:
SetType
(
EFFECT_TYPE_SINGLE
)
e0
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e0
:
SetValue
(
cm
.
splimit
)
c
:
RegisterEffect
(
e0
)
--ac
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCost
(
cm
.
accost
)
e1
:
SetTarget
(
cm
.
actg
)
e1
:
SetOperation
(
cm
.
acop
)
c
:
RegisterEffect
(
e1
)
--destroy
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCode
(
EFFECT_SEND_REPLACE
)
e4
:
SetTarget
(
cm
.
reptg
)
e4
:
SetValue
(
cm
.
repval
)
c
:
RegisterEffect
(
e4
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e2
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e2
:
SetRange
(
LOCATION_HAND
)
e2
:
SetOperation
(
cm
.
spop
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_GRANT
)
e3
:
SetTargetRange
(
LOCATION_HAND
,
LOCATION_HAND
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetTarget
(
cm
.
eftg
)
e3
:
SetLabelObject
(
e2
)
c
:
RegisterEffect
(
e3
)
--destroy1
local
e22
=
Effect
.
CreateEffect
(
c
)
e22
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e22
:
SetCategory
(
CATEGORY_DESTROY
)
e22
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e22
:
SetCode
(
EVENT_FREE_CHAIN
)
e22
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e22
:
SetRange
(
LOCATION_MZONE
)
e22
:
SetCost
(
cm
.
descost
)
e22
:
SetTarget
(
cm
.
destg1
)
e22
:
SetOperation
(
cm
.
desop
)
c
:
RegisterEffect
(
e22
)
end
function
cm
.
eftg
(
e
,
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
end
function
cm
.
splimit
(
e
,
se
,
sp
,
st
)
local
ec
=
sc
:
GetHandler
()
return
sc
and
sc
:
IsRace
(
RACE_DRAGON
)
end
function
cm
.
accost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToGraveAsCost
()
end
Duel
.
SendtoGrave
(
e
:
GetHandler
(),
REASON_COST
)
end
function
cm
.
acfilter
(
c
,
tp
)
return
c
:
IsType
(
TYPE_FIELD
)
and
c
:
IsCode
(
12062015
)
and
c
:
GetActivateEffect
():
IsActivatable
(
tp
,
true
,
true
)
end
function
cm
.
actg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
acfilter
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
nil
,
tp
)
end
if
not
Duel
.
CheckPhaseActivity
()
then
e
:
SetLabel
(
1
)
else
e
:
SetLabel
(
0
)
end
end
function
cm
.
acop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetLabel
()
==
1
then
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_CHAIN
,
0
,
1
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
m
,
2
))
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
acfilter
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
tp
):
GetFirst
()
Duel
.
ResetFlagEffect
(
tp
,
m
)
if
tc
then
local
fc
=
Duel
.
GetFieldCard
(
tp
,
LOCATION_FZONE
,
0
)
if
fc
then
Duel
.
SendtoGrave
(
fc
,
REASON_RULE
)
Duel
.
BreakEffect
()
end
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_FZONE
,
POS_FACEUP
,
true
)
local
te
=
tc
:
GetActivateEffect
()
te
:
UseCountLimit
(
tp
,
1
,
true
)
local
tep
=
tc
:
GetControler
()
local
cost
=
te
:
GetCost
()
if
cost
then
cost
(
te
,
tep
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
1
)
end
Duel
.
RaiseEvent
(
tc
,
4179255
,
te
,
0
,
tp
,
tp
,
Duel
.
GetCurrentChain
())
end
end
function
cm
.
repfilter
(
c
,
tp
)
return
c
:
IsControler
(
tp
)
and
c
:
IsLocation
(
LOCATION_ONFIELD
)
and
c
:
GetDestination
()
==
LOCATION_GRAVE
and
c
:
IsAbleToHand
()
end
function
cm
.
reptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
eg
:
IsExists
(
cm
.
repfilter
,
1
,
nil
,
tp
)
end
if
eg
:
IsExists
(
cm
.
repfilter
,
1
,
nil
,
tp
)
then
local
g
=
eg
:
Filter
(
cm
.
repfilter
,
nil
,
tp
)
local
ct
=
g
:
GetCount
()
if
ct
>
1
then
Duel
.
SendtoHand
(
g
,
tp
,
REASON_EFFECT
)
end
return
true
else
return
false
end
end
function
cm
.
repval
(
e
,
c
)
return
false
end
function
cm
.
desfilter
(
c
)
return
c
:
IsType
(
TYPE_TUNER
)
and
c
:
IsLevel
(
1
)
and
c
:
IsAbleToGraveAsCost
()
end
function
cm
.
descost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
desfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
desfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
end
function
cm
.
destg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsOnField
()
and
chkc
:
IsControler
(
1
-
tp
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
aux
.
TRUE
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectTarget
(
tp
,
aux
.
TRUE
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
end
function
cm
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c12062013.lua
View file @
415545ef
...
...
@@ -2,5 +2,115 @@
local
m
=
12062013
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--Cannot special summon
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e0
:
SetType
(
EFFECT_TYPE_SINGLE
)
e0
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e0
:
SetValue
(
cm
.
splimit
)
c
:
RegisterEffect
(
e0
)
--search
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetCost
(
cm
.
thcost
)
e1
:
SetTarget
(
cm
.
thtg
)
e1
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e1
)
--special summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
m
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
cm
.
sptarget
)
e2
:
SetOperation
(
cm
.
spoperation
)
c
:
RegisterEffect
(
e2
)
--to hand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e1
:
SetCategory
(
CATEGORY_DRAW
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCost
(
cm
.
cost
)
e1
:
SetTarget
(
cm
.
thtg1
)
e1
:
SetOperation
(
cm
.
thop1
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
splimit
(
e
,
se
,
sp
,
st
)
local
sc
=
se
:
GetHandler
()
return
sc
and
sc
:
IsRace
(
RACE_DRAGON
)
end
function
cm
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsDiscardable
()
end
Duel
.
SendtoGrave
(
c
,
REASON_COST
+
REASON_DISCARD
)
end
function
cm
.
thfilter
(
c
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsLevel
(
1
)
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsAbleToHand
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
tg
=
Duel
.
GetFirstMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
tg
then
Duel
.
SendtoHand
(
tg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tg
)
end
end
function
cm
.
filter
(
c
,
e
,
tp
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsLevel
(
1
)
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
sptarget
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
end
function
cm
.
spoperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToHandAsCost
()
end
Duel
.
SendtoHand
(
c
,
nil
,
REASON_COST
)
end
function
cm
.
thtg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetOperation
(
cm
.
chainop
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e2
,
tp
)
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
3
))
then
Duel
.
DiscardHand
(
tp
,
aux
.
TRUE
,
1
,
1
,
REASON_EFFECT
+
REASON_DISCARD
)
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
function
cm
.
chainop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
re
:
IsActiveType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
ep
==
tp
then
Duel
.
SetChainLimit
(
cm
.
chainlm
)
end
end
function
cm
.
chainlm
(
e
,
rp
,
tp
)
return
function
(
e
,
ep
,
tp
)
return
tp
==
ep
or
e
:
GetHandler
():
GetOriginalType
()
&
(
TYPE_MONSTER
)
~=
0
end
end
\ No newline at end of file
expansions/script/c12062015.lua
View file @
415545ef
...
...
@@ -2,5 +2,95 @@
local
m
=
12062015
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
--immune spell
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
cm
.
efilter
)
c
:
RegisterEffect
(
e1
)
--avoid battle damage
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_AVOID_BATTLE_DAMAGE
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetCondition
(
cm
.
abdcon
)
c
:
RegisterEffect
(
e2
)
--draw
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e3
:
SetCategory
(
CATEGORY_DRAW
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_FZONE
)
e3
:
SetProperty
(
EFFECT_FLAG_BOTH_SIDE
+
EFFECT_FLAG_PLAYER_TARGET
)
e3
:
SetCountLimit
(
1
)
e3
:
SetTarget
(
cm
.
drtg
)
e3
:
SetOperation
(
cm
.
drop
)
c
:
RegisterEffect
(
e3
)
--Search
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e3
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetCost
(
cm
.
thcost
)
e3
:
SetTarget
(
cm
.
thtg
)
e3
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
abdcon
(
e
)
local
tp
=
e
:
GetHandlerPlayer
()
local
at
=
Duel
.
GetAttackTarget
()
return
not
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
(
at
==
nil
or
at
:
IsAttackPos
()
or
Duel
.
GetAttacker
():
GetAttack
()
>
at
:
GetDefense
())
end
function
cm
.
filter
(
c
)
return
not
c
:
IsRace
(
RACE_DRAGON
)
or
c
:
IsFacedown
()
end
function
cm
.
efilter
(
e
,
te
)
return
e
:
GetHandler
()
~=
te
:
GetHandler
()
and
te
:
GetActivateLocation
()
==
LOCATION_MZONE
and
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
IsActivated
()
and
te
:
GetHandler
():
GetSummonLocation
()
==
LOCATION_EXTRA
end
function
cm
.
drtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandlerPlayer
()
~=
tp
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
cm
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Draw
(
p
,
d
,
REASON_EFFECT
)
end
function
cm
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thcfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thcfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
cm
.
thcfilter
(
c
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
cm
.
thfilter
(
c
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsLevel
(
1
)
and
c
:
IsAbleToHand
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
\ No newline at end of file
expansions/script/c12062033.lua
View file @
415545ef
...
...
@@ -2,5 +2,112 @@
local
m
=
12062033
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--Cannot special summon
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e0
:
SetType
(
EFFECT_TYPE_SINGLE
)
e0
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e0
:
SetValue
(
cm
.
splimit
)
c
:
RegisterEffect
(
e0
)
--search
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetCost
(
cm
.
thcost
)
e1
:
SetTarget
(
cm
.
thtg
)
e1
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e1
)
--special summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
m
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
cm
.
sptarget
)
e2
:
SetOperation
(
cm
.
spoperation
)
c
:
RegisterEffect
(
e2
)
--to hand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e1
:
SetCategory
(
CATEGORY_DRAW
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCost
(
cm
.
cost
)
e1
:
SetTarget
(
cm
.
thtg1
)
e1
:
SetOperation
(
cm
.
thop1
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
splimit
(
e
,
se
,
sp
,
st
)
local
sc
=
se
:
GetHandler
()
return
sc
and
sc
:
IsRace
(
RACE_DRAGON
)
end
function
cm
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsDiscardable
()
end
Duel
.
SendtoGrave
(
c
,
REASON_COST
+
REASON_DISCARD
)
end
function
cm
.
thfilter
(
c
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsLevel
(
1
)
and
c
:
IsAttribute
(
ATTRIBUTE_EARTH
)
and
c
:
IsAbleToHand
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
tg
=
Duel
.
GetFirstMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
tg
then
Duel
.
SendtoHand
(
tg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tg
)
end
end
function
cm
.
filter
(
c
,
e
,
tp
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsLevel
(
1
)
and
c
:
IsAttribute
(
ATTRIBUTE_EARTH
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
sptarget
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
end
function
cm
.
spoperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToHandAsCost
()
end
Duel
.
SendtoHand
(
c
,
nil
,
REASON_COST
)
end
function
cm
.
thtg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
--damage conversion
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_REVERSE_DAMAGE
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
1
)
e1
:
SetValue
(
cm
.
rev
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
3
))
then
Duel
.
DiscardHand
(
tp
,
aux
.
TRUE
,
1
,
1
,
REASON_EFFECT
+
REASON_DISCARD
)
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
function
cm
.
rev
(
e
,
re
,
r
,
rp
,
rc
)
local
c
=
e
:
GetHandler
()
return
bit
.
band
(
r
,
REASON_BATTLE
)
~=
0
end
\ No newline at end of file
expansions/script/c12062041.lua
View file @
415545ef
...
...
@@ -2,5 +2,103 @@
local
m
=
12062041
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
m
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
activate
)
c
:
RegisterEffect
(
e1
)
--place
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_LEAVE_FIELD
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCondition
(
cm
.
plcon
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
cm
.
pltg
)
e2
:
SetOperation
(
cm
.
plop
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
filter
(
c
,
e
,
tp
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
end
function
cm
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
and
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
~=
0
then
local
tc
=
Duel
.
GetOperatedGroup
():
GetFirst
()
if
tc
:
IsAttribute
(
ATTRIBUTE_WIND
)
then
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
local
tc
=
g
:
GetFirst
()
while
tc
do
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SET_ATTACK_FINAL
)
e1
:
SetValue
(
0
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
tc
=
g
:
GetNext
()
end
end
--immune
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e2
:
SetCondition
(
cm
.
econ
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetValue
(
cm
.
efilter
)
tc
:
RegisterEffect
(
e2
)
end
end
function
cm
.
econ
(
e
,
tp
)
local
ph
=
Duel
.
GetCurrentPhase
()
return
ph
>=
PHASE_BATTLE_START
and
ph
<=
PHASE_BATTLE
end
function
cm
.
efilter
(
e
,
te
)
return
te
:
GetOwnerPlayer
()
~=
e
:
GetOwnerPlayer
()
end
function
cm
.
plcfilter
(
c
,
tp
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsLevel
(
1
)
and
c
:
GetPreviousControler
()
==
tp
and
c
:
IsPreviousPosition
(
POS_FACEUP
)
and
c
:
GetReasonPlayer
()
==
1
-
tp
and
c
:
IsReason
(
REASON_EFFECT
)
and
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
end
function
cm
.
plcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
cm
.
plcfilter
,
1
,
nil
,
tp
)
end
function
cm
.
thfilter
(
c
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsLevel
(
1
)
and
c
:
IsAbleToHand
()
end
function
cm
.
pltg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
plop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
local
e3
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EFFECT_CHANGE_BATTLE_DAMAGE
)
e3
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e3
:
SetTargetRange
(
1
,
0
)
e3
:
SetValue
(
HALF_DAMAGE
)
e3
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e3
,
tp
)
end
end
\ No newline at end of file
expansions/script/c12062043.lua
View file @
415545ef
...
...
@@ -2,5 +2,107 @@
local
m
=
12062043
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--Cannot special summon
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e0
:
SetType
(
EFFECT_TYPE_SINGLE
)
e0
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e0
:
SetValue
(
cm
.
splimit
)
c
:
RegisterEffect
(
e0
)
--search
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetCost
(
cm
.
thcost
)
e1
:
SetTarget
(
cm
.
thtg
)
e1
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e1
)
--special summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
m
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
cm
.
sptarget
)
e2
:
SetOperation
(
cm
.
spoperation
)
c
:
RegisterEffect
(
e2
)
--to hand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e1
:
SetCategory
(
CATEGORY_DRAW
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetCost
(
cm
.
cost
)
e1
:
SetTarget
(
cm
.
thtg1
)
e1
:
SetOperation
(
cm
.
thop1
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
splimit
(
e
,
se
,
sp
,
st
)
local
sc
=
se
:
GetHandler
()
return
sc
and
sc
:
IsRace
(
RACE_DRAGON
)
end
function
cm
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsDiscardable
()
end
Duel
.
SendtoGrave
(
c
,
REASON_COST
+
REASON_DISCARD
)
end
function
cm
.
thfilter
(
c
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsLevel
(
1
)
and
c
:
IsAttribute
(
ATTRIBUTE_WIND
)
and
c
:
IsAbleToHand
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
tg
=
Duel
.
GetFirstMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
tg
then
Duel
.
SendtoHand
(
tg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tg
)
end
end
function
cm
.
filter
(
c
,
e
,
tp
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsLevel
(
1
)
and
c
:
IsAttribute
(
ATTRIBUTE_WIND
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
sptarget
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
end
function
cm
.
spoperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToHandAsCost
()
end
Duel
.
SendtoHand
(
c
,
nil
,
REASON_COST
)
end
function
cm
.
thtg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetTargetRange
(
0
,
LOCATION_MZONE
)
e2
:
SetCode
(
EFFECT_SET_ATTACK
)
e2
:
SetValue
(
0
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e2
,
tp
)
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
3
))
then
Duel
.
DiscardHand
(
tp
,
aux
.
TRUE
,
1
,
1
,
REASON_EFFECT
+
REASON_DISCARD
)
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c12062053.lua
View file @
415545ef
...
...
@@ -2,5 +2,102 @@
local
m
=
12062053
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--Cannot special summon
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e0
:
SetType
(
EFFECT_TYPE_SINGLE
)
e0
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e0
:
SetValue
(
cm
.
splimit
)
c
:
RegisterEffect
(
e0
)
--search
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetCost
(
cm
.
thcost
)
e1
:
SetTarget
(
cm
.
thtg
)
e1
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e1
)
--special summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
m
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
cm
.
sptarget
)
e2
:
SetOperation
(
cm
.
spoperation
)
c
:
RegisterEffect
(
e2
)
--to hand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e1
:
SetCategory
(
CATEGORY_DRAW
+
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetCost
(
cm
.
cost
)
e1
:
SetTarget
(
cm
.
thtg1
)
e1
:
SetOperation
(
cm
.
thop1
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
splimit
(
e
,
se
,
sp
,
st
)
local
sc
=
se
:
GetHandler
()
return
sc
and
sc
:
IsRace
(
RACE_DRAGON
)
end
function
cm
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsDiscardable
()
end
Duel
.
SendtoGrave
(
c
,
REASON_COST
+
REASON_DISCARD
)
end
function
cm
.
thfilter
(
c
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsLevel
(
1
)
and
c
:
IsAttribute
(
ATTRIBUTE_WIND
)
and
c
:
IsAbleToHand
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
tg
=
Duel
.
GetFirstMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
tg
then
Duel
.
SendtoHand
(
tg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tg
)
end
end
function
cm
.
filter
(
c
,
e
,
tp
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsLevel
(
1
)
and
c
:
IsAttribute
(
ATTRIBUTE_WIND
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
sptarget
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
end
function
cm
.
spoperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToHandAsCost
()
end
Duel
.
SendtoHand
(
c
,
nil
,
REASON_COST
)
end
function
cm
.
thtg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
TRUE
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
3
))
then
Duel
.
DiscardHand
(
tp
,
aux
.
TRUE
,
1
,
1
,
REASON_EFFECT
+
REASON_DISCARD
)
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c12065000.lua
View file @
415545ef
...
...
@@ -2,5 +2,31 @@
local
m
=
12065000
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
12065002
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
+
EFFECT_FLAG_CANNOT_INACTIVATE
+
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_CANNOT_NEGATE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
cm
.
tg
)
e1
:
SetOperation
(
cm
.
op
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
filter
(
c
,
e
,
tp
)
return
c
:
IsCode
(
12065002
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_XYZ
,
tp
,
false
,
false
)
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
nil
,
c
)
>
0
end
function
cm
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
aux
.
TRUE
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
nil
,
TYPE_XYZ
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
tc
=
g
:
GetFirst
()
if
not
tc
then
return
end
tc
:
SetMaterial
(
nil
)
Duel
.
SpecialSummonStep
(
tc
,
SUMMON_TYPE_XYZ
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
\ No newline at end of file
expansions/script/c12065001.lua
View file @
415545ef
...
...
@@ -2,5 +2,83 @@
local
m
=
12065001
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
12065002
)
--tohand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e1
:
SetCost
(
cm
.
thcost
)
e1
:
SetLabel
(
1
,
m
)
e1
:
SetTarget
(
cm
.
thtg
)
e1
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e1
)
local
e3
=
e1
:
Clone
()
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e3
)
--spsummon
local
e11
=
Effect
.
CreateEffect
(
c
)
e11
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e11
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e11
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e11
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e11
:
SetCode
(
EVENT_LEAVE_FIELD
)
e11
:
SetRange
(
LOCATION_GRAVE
)
e11
:
SetCondition
(
cm
.
spcon
)
e11
:
SetTarget
(
cm
.
sptg
)
e11
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e11
)
end
function
cm
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
true
end
if
c
:
IsReleasable
()
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
3
))
then
Duel
.
Release
(
c
,
REASON_COST
)
e
:
SetLabel
(
0
)
end
end
function
cm
.
filter
(
c
,
e
,
tp
)
return
c
:
IsCode
(
12065002
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_XYZ
,
tp
,
false
,
false
)
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
nil
,
c
)
>
0
end
function
cm
.
thfilter
(
c
)
return
aux
.
IsCodeListed
(
c
,
12065002
)
and
c
:
IsAbleToHand
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
if
e
:
GetLabel
()
==
0
then
e
:
SetProperty
(
EFFECT_FLAG_CANNOT_INACTIVATE
+
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_CANNOT_NEGATE
)
end
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
#
g
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
cm
.
cfilter
(
c
,
tp
,
rp
)
return
c
:
IsPreviousPosition
(
POS_FACEUP
)
and
c
:
GetPreviousControler
()
==
tp
and
c
:
IsCode
(
12065002
)
and
rp
==
1
-
tp
end
function
cm
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
cm
.
cfilter
,
1
,
nil
,
tp
,
rp
)
and
c
:
IsLocation
(
LOCATION_GRAVE
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
nil
,
TYPE_XYZ
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
tc
=
g
:
GetFirst
()
if
not
tc
then
return
end
tc
:
SetMaterial
(
nil
)
if
Duel
.
SpecialSummonStep
(
tc
,
SUMMON_TYPE_XYZ
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
Duel
.
Overlay
(
tc
,
c
)
end
end
\ No newline at end of file
expansions/script/c12065002.lua
View file @
415545ef
...
...
@@ -2,5 +2,103 @@
local
m
=
12065002
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
12065002
)
--xyz summon
aux
.
AddXyzProcedure
(
c
,
nil
,
4
,
2
)
c
:
EnableReviveLimit
()
--splimit
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_SINGLE
)
e0
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e0
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e0
:
SetValue
(
cm
.
splimit
)
c
:
RegisterEffect
(
e0
)
--tograve
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e3
:
SetCategory
(
CATEGORY_TOGRAVE
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e3
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e3
:
SetTarget
(
cm
.
tgtg
)
e3
:
SetOperation
(
cm
.
tgop
)
c
:
RegisterEffect
(
e3
)
--to hand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
+
CATEGORY_HANDES
)
e1
:
SetType
(
EFFECT_TYPE_TRIGGER_O
+
EFFECT_TYPE_FIELD
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCondition
(
cm
.
thcon
)
e1
:
SetTarget
(
cm
.
thtg
)
e1
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e1
)
--immune
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCondition
(
cm
.
condition
)
e1
:
SetValue
(
cm
.
efilter
)
c
:
RegisterEffect
(
e1
)
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetRange
(
LOCATION_MZONE
)
ge1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
+
EFFECT_FLAG_IGNORE_IMMUNE
+
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
ge1
:
SetOperation
(
cm
.
checkop
)
c
:
RegisterEffect
(
ge1
)
end
function
cm
.
splimit
(
e
,
se
,
sp
,
st
)
return
(
se
:
IsHasType
(
EFFECT_TYPE_ACTIONS
)
and
aux
.
IsCodeListed
(
se
:
GetHandler
(),
12065002
)
)
end
function
cm
.
tgfilter
(
c
)
return
aux
.
IsCodeListed
(
c
,
12065002
)
and
c
:
IsAbleToGrave
()
end
function
cm
.
tgtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
end
function
cm
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetTurnPlayer
()
==
tp
end
function
cm
.
filter
(
c
)
return
aux
.
IsCodeListed
(
c
,
12065002
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
and
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
>
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
ShuffleHand
(
tp
)
Duel
.
BreakEffect
()
Duel
.
DiscardHand
(
tp
,
nil
,
1
,
1
,
REASON_EFFECT
)
end
end
function
cm
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetOverlayCount
()
==
3
end
function
cm
.
efilter
(
e
,
te
)
local
tp
=
e
:
GetControler
()
return
te
:
GetOwnerPlayer
()
==
1
-
tp
end
function
cm
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
re
:
GetHandler
()
==
c
then
re
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
+
EFFECT_FLAG_CANNOT_INACTIVATE
+
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_CANNOT_NEGATE
)
end
end
\ No newline at end of file
expansions/script/c12065003.lua
View file @
415545ef
...
...
@@ -2,5 +2,83 @@
local
m
=
12065003
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
12065002
)
--draw
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
activate
)
c
:
RegisterEffect
(
e1
)
local
e3
=
e1
:
Clone
()
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e3
)
--atkup
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e1
:
SetCategory
(
CATEGORY_ATKCHANGE
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_PRE_DAMAGE_CALCULATE
)
e1
:
SetRange
(
LOCATION_GRAVE
)
e1
:
SetCondition
(
cm
.
atkcon
)
e1
:
SetCost
(
cm
.
atkcost
)
e1
:
SetTarget
(
cm
.
atktarget
)
e1
:
SetOperation
(
cm
.
atkop
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
cm
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetCountLimit
(
1
)
e1
:
SetOperation
(
cm
.
retop
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
cm
.
filter
(
c
)
return
c
:
IsCode
(
12065002
)
and
c
:
IsFaceup
()
end
function
cm
.
filter1
(
c
)
return
not
c
:
IsCode
(
12065002
)
or
c
:
IsFacedown
()
end
function
cm
.
retop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tp
=
e
:
GetOwnerPlayer
()
if
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
not
Duel
.
IsExistingMatchingCard
(
cm
.
filter1
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
function
cm
.
atkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
Duel
.
GetAttackTarget
()
if
not
c
then
return
false
end
if
c
:
IsControler
(
1
-
tp
)
then
c
=
Duel
.
GetAttacker
()
end
e
:
SetLabelObject
(
c
)
return
c
and
c
:
IsCode
(
12065002
)
and
c
:
IsRelateToBattle
()
end
function
cm
.
atkcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToGraveAsCost
()
end
Duel
.
SendtoGrave
(
e
:
GetHandler
(),
REASON_COST
)
end
function
cm
.
atktarget
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsCanOverlay
()
end
end
function
cm
.
atkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
if
tc
:
IsFaceup
()
and
tc
:
IsRelateToBattle
()
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SET_ATTACK_FINAL
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_DAMAGE_CAL
)
e1
:
SetValue
(
c
:
GetBaseAttack
()
*
2
)
tc
:
RegisterEffect
(
e1
)
if
c
:
IsRelateToEffect
(
e
)
and
not
tc
:
IsImmuneToEffect
(
e
)
then
Duel
.
Overlay
(
tc
,
Group
.
FromCards
(
c
))
end
end
end
\ No newline at end of file
expansions/script/c12065011.lua
View file @
415545ef
...
...
@@ -2,5 +2,143 @@
local
m
=
12065011
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
12065002
)
--search
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetCost
(
cm
.
thcost
)
e1
:
SetTarget
(
cm
.
thtg
)
e1
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e1
)
--overlay
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e3
:
SetRange
(
LOCATION_GRAVE
)
e3
:
SetCountLimit
(
1
,
m
)
e3
:
SetTarget
(
cm
.
ovtg
)
e3
:
SetOperation
(
cm
.
ovop
)
c
:
RegisterEffect
(
e3
)
--get effect
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e2
:
SetCategory
(
CATEGORY_DISABLE
+
CATEGORY_DESTROY
)
e2
:
SetType
(
EFFECT_TYPE_XMATERIAL
+
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCondition
(
cm
.
discon
)
e2
:
SetCost
(
cm
.
discost
)
e2
:
SetTarget
(
cm
.
distg
)
e2
:
SetOperation
(
cm
.
disop
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsDiscardable
()
end
Duel
.
SendtoGrave
(
c
,
REASON_COST
+
REASON_DISCARD
)
end
function
cm
.
thfilter
(
c
)
return
aux
.
IsCodeListed
(
c
,
12065002
)
and
c
:
IsAbleToHand
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
tg
=
Duel
.
GetFirstMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
tg
then
Duel
.
SendtoHand
(
tg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tg
)
Duel
.
BreakEffect
()
Duel
.
DiscardHand
(
tp
,
nil
,
1
,
1
,
REASON_EFFECT
+
REASON_DISCARD
)
end
end
function
cm
.
ovfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x155
)
and
c
:
IsType
(
TYPE_XYZ
)
end
function
cm
.
ovtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
cm
.
ovfilter
(
chkc
)
and
chkc
~=
e
:
GetHandler
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
ovfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
e
:
GetHandler
())
and
e
:
GetHandler
():
IsCanOverlay
()
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
Duel
.
SelectTarget
(
tp
,
cm
.
ovfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
e
:
GetHandler
())
if
e
:
GetHandler
():
IsLocation
(
LOCATION_GRAVE
)
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_LEAVE_GRAVE
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
end
function
cm
.
ovop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
c
:
IsRelateToEffect
(
e
)
and
tc
:
IsRelateToEffect
(
e
)
and
not
c
:
IsImmuneToEffect
(
e
)
then
local
og
=
c
:
GetOverlayGroup
()
if
og
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
og
,
REASON_RULE
)
end
Duel
.
Overlay
(
tc
,
Group
.
FromCards
(
c
))
end
end
function
cm
.
discon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
GetOriginalCode
(
12065002
)
end
function
cm
.
discost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToRemoveAsCost
()
and
c
:
GetOverlayCount
()
==
3
end
if
Duel
.
Remove
(
c
,
POS_FACEUP
,
REASON_COST
+
REASON_TEMPORARY
)
~=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_CHAIN_END
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetLabelObject
(
c
)
e1
:
SetCountLimit
(
1
)
e1
:
SetOperation
(
scm
.
disretop
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
function
cm
.
disretop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
if
tc
:
IsType
(
TYPE_FIELD
)
and
tc
:
IsPreviousLocation
(
LOCATION_FZONE
)
then
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_FZONE
,
POS_FACEUP
,
true
)
elseif
tc
:
IsType
(
TYPE_PENDULUM
)
and
tc
:
IsPreviousLocation
(
LOCATION_PZONE
)
then
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
else
Duel
.
ReturnToField
(
e
:
GetLabelObject
())
end
end
function
cm
.
distg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
filter1
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
end
function
cm
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter1
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
local
tc
=
g
:
GetFirst
()
if
tc
and
tc
:
IsRelateToEffect
(
e
)
and
not
tc
:
IsDisabled
()
then
Duel
.
NegateRelatedChain
(
tc
,
RESET_TURN_SET
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetValue
(
RESET_TURN_SET
)
tc
:
RegisterEffect
(
e2
)
if
tc
:
IsType
(
TYPE_TRAPMONSTER
)
then
local
e3
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e3
:
SetCode
(
EFFECT_DISABLE_TRAPMONSTER
)
e3
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e3
)
end
Duel
.
AdjustInstantly
()
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c12065012.lua
View file @
415545ef
...
...
@@ -2,5 +2,99 @@
local
m
=
12065012
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
12065002
)
--tohand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e1
:
SetCost
(
cm
.
thcost
)
e1
:
SetLabel
(
1
,
m
)
e1
:
SetTarget
(
cm
.
thtg
)
e1
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e1
)
local
e3
=
e1
:
Clone
()
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e3
)
--to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
m
+
100
)
e2
:
SetCondition
(
cm
.
thcon
)
e2
:
SetTarget
(
cm
.
thtg
)
e2
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
true
end
if
c
:
IsAbleToHandAsCost
()
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
3
))
then
Duel
.
SendtoHand
(
c
,
tp
,
REASON_EFFECT
)
e
:
SetLabel
(
0
)
end
end
function
cm
.
thfilter
(
c
)
return
aux
.
IsCodeListed
(
c
,
12065002
)
and
c
:
IsAbleToGrave
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
if
e
:
GetLabel
()
==
0
then
e
:
SetProperty
(
EFFECT_FLAG_CANNOT_INACTIVATE
+
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_CANNOT_NEGATE
)
end
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
#
g
>
0
then
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
end
function
cm
.
cfilter
(
c
,
tp
)
return
c
:
IsCode
(
12065002
)
and
c
:
GetSummonPlayer
()
==
tp
end
function
cm
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
cm
.
cfilter
,
1
,
nil
,
tp
)
and
aux
.
exccon
(
e
)
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsCanOverlay
()
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_LEAVE_GRAVE
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
eg
:
Filter
(
cm
.
cfilter
,
nil
,
tp
):
GetFirst
()
if
c
:
IsRelateToEffect
(
e
)
and
tc
:
IsLocation
(
LOCATION_MZONE
)
and
tc
:
IsFaceup
()
and
tc
:
IsRelateToEffect
(
e
)
and
not
c
:
IsImmuneToEffect
(
e
)
then
local
og
=
c
:
GetOverlayGroup
()
if
og
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
og
,
REASON_RULE
)
end
Duel
.
Overlay
(
tc
,
Group
.
FromCards
(
c
))
end
end
function
cm
.
ovtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
cm
.
ovfilter
(
chkc
)
and
chkc
~=
e
:
GetHandler
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
ovfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
e
:
GetHandler
())
and
e
:
GetHandler
():
IsCanOverlay
()
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
Duel
.
SelectTarget
(
tp
,
cm
.
ovfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
e
:
GetHandler
())
if
e
:
GetHandler
():
IsLocation
(
LOCATION_GRAVE
)
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_LEAVE_GRAVE
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
end
function
cm
.
ovop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
c
:
IsRelateToEffect
(
e
)
and
tc
:
IsRelateToEffect
(
e
)
and
not
c
:
IsImmuneToEffect
(
e
)
then
local
og
=
c
:
GetOverlayGroup
()
if
og
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
og
,
REASON_RULE
)
end
Duel
.
Overlay
(
tc
,
Group
.
FromCards
(
c
))
end
end
\ No newline at end of file
expansions/script/c12065013.lua
View file @
415545ef
...
...
@@ -2,5 +2,145 @@
local
m
=
12065013
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
12065002
)
--search
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetCost
(
cm
.
thcost
)
e1
:
SetTarget
(
cm
.
thtg
)
e1
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e1
)
--overlay
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e3
:
SetRange
(
LOCATION_GRAVE
)
e3
:
SetCountLimit
(
1
,
m
)
e3
:
SetTarget
(
cm
.
ovtg
)
e3
:
SetOperation
(
cm
.
ovop
)
c
:
RegisterEffect
(
e3
)
--get effect
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e2
:
SetType
(
EFFECT_TYPE_XMATERIAL
+
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCondition
(
cm
.
discon
)
e2
:
SetCost
(
cm
.
discost
)
e2
:
SetTarget
(
cm
.
distg
)
e2
:
SetOperation
(
cm
.
disop
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsDiscardable
()
end
Duel
.
SendtoGrave
(
c
,
REASON_COST
+
REASON_DISCARD
)
end
function
cm
.
thfilter
(
c
)
return
aux
.
IsCodeListed
(
c
,
12065002
)
and
c
:
IsAbleToHand
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
tg
=
Duel
.
GetFirstMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
tg
then
Duel
.
SendtoHand
(
tg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tg
)
Duel
.
BreakEffect
()
Duel
.
DiscardHand
(
tp
,
nil
,
1
,
1
,
REASON_EFFECT
+
REASON_DISCARD
)
end
end
function
cm
.
ovfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x155
)
and
c
:
IsType
(
TYPE_XYZ
)
end
function
cm
.
ovtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
cm
.
ovfilter
(
chkc
)
and
chkc
~=
e
:
GetHandler
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
ovfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
e
:
GetHandler
())
and
e
:
GetHandler
():
IsCanOverlay
()
and
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
Duel
.
SelectTarget
(
tp
,
cm
.
ovfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
e
:
GetHandler
())
if
e
:
GetHandler
():
IsLocation
(
LOCATION_GRAVE
)
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_LEAVE_GRAVE
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
ovop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
c
:
IsRelateToEffect
(
e
)
and
tc
:
IsRelateToEffect
(
e
)
and
not
c
:
IsImmuneToEffect
(
e
)
then
local
og
=
c
:
GetOverlayGroup
()
if
og
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
og
,
REASON_RULE
)
end
Duel
.
Overlay
(
tc
,
Group
.
FromCards
(
c
))
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
#
g
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
end
function
cm
.
discon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
GetOriginalCode
(
12065002
)
end
function
cm
.
discost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToRemoveAsCost
()
and
c
:
GetOverlayCount
()
==
3
end
if
Duel
.
Remove
(
c
,
POS_FACEUP
,
REASON_COST
+
REASON_TEMPORARY
)
~=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_CHAIN_END
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetLabelObject
(
c
)
e1
:
SetCountLimit
(
1
)
e1
:
SetOperation
(
scm
.
disretop
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
function
cm
.
disretop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
if
tc
:
IsType
(
TYPE_FIELD
)
and
tc
:
IsPreviousLocation
(
LOCATION_FZONE
)
then
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_FZONE
,
POS_FACEUP
,
true
)
elseif
tc
:
IsType
(
TYPE_PENDULUM
)
and
tc
:
IsPreviousLocation
(
LOCATION_PZONE
)
then
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
else
Duel
.
ReturnToField
(
e
:
GetLabelObject
())
end
end
function
cm
.
distg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
end
function
cm
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
--reflect
local
e3
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EFFECT_REFLECT_BATTLE_DAMAGE
)
e3
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e3
:
SetCondition
(
cm
.
refcon
)
e3
:
SetValue
(
1
)
Duel
.
RegisterEffect
(
e3
,
tp
)
--indes
local
e5
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e5
:
SetType
(
EFFECT_TYPE_FIELD
)
e5
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e5
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e5
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e5
:
SetTarget
(
cm
.
indtg
)
Duel
.
RegisterEffect
(
e5
,
tp
)
end
function
cm
.
indtg
(
e
,
c
)
return
c
:
IsCode
(
12065002
)
end
function
cm
.
refcon
(
e
)
local
tt
=
Duel
.
GetAttackTarget
()
return
tt
and
tt
:
IsCode
(
12065002
)
end
\ No newline at end of file
expansions/script/c12065014.lua
View file @
415545ef
...
...
@@ -2,5 +2,136 @@
local
m
=
12065014
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
12065002
)
--search
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetCost
(
cm
.
thcost
)
e1
:
SetTarget
(
cm
.
thtg
)
e1
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e1
)
--overlay
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e3
:
SetType
(
EFFECT_TYPE_EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e3
:
SetRange
(
LOCATION_GRAVE
)
e3
:
SetCondition
(
cm
.
ovcon
)
e3
:
SetCountLimit
(
1
,
m
)
e3
:
SetTarget
(
cm
.
ovtg
)
e3
:
SetOperation
(
cm
.
ovop
)
c
:
RegisterEffect
(
e3
)
--get effect
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e1
:
SetCategory
(
CATEGORY_DRAW
)
e2
:
SetType
(
EFFECT_TYPE_XMATERIAL
+
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCondition
(
cm
.
discon
)
e2
:
SetCost
(
cm
.
discost
)
e2
:
SetTarget
(
cm
.
distg
)
e2
:
SetOperation
(
cm
.
disop
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsDiscardable
()
end
Duel
.
SendtoGrave
(
c
,
REASON_COST
+
REASON_DISCARD
)
end
function
cm
.
thfilter
(
c
)
return
aux
.
IsCodeListed
(
c
,
12065002
)
and
c
:
IsAbleToHand
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
tg
=
Duel
.
GetFirstMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
tg
then
Duel
.
SendtoHand
(
tg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tg
)
Duel
.
BreakEffect
()
Duel
.
DiscardHand
(
tp
,
nil
,
1
,
1
,
REASON_EFFECT
+
REASON_DISCARD
)
end
end
function
cm
.
ovfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x155
)
and
c
:
IsType
(
TYPE_XYZ
)
end
function
cm
.
ovtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
cm
.
ovfilter
(
chkc
)
and
chkc
~=
e
:
GetHandler
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
ovfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
e
:
GetHandler
())
and
e
:
GetHandler
():
IsCanOverlay
()
and
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
Duel
.
SelectTarget
(
tp
,
cm
.
ovfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
e
:
GetHandler
())
if
e
:
GetHandler
():
IsLocation
(
LOCATION_GRAVE
)
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_LEAVE_GRAVE
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
ovop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
c
:
IsRelateToEffect
(
e
)
and
tc
:
IsRelateToEffect
(
e
)
and
not
c
:
IsImmuneToEffect
(
e
)
then
local
og
=
c
:
GetOverlayGroup
()
if
og
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
og
,
REASON_RULE
)
end
Duel
.
Overlay
(
tc
,
Group
.
FromCards
(
c
))
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
#
g
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
end
function
cm
.
ovcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
Duel
.
GetCurrentPhase
()
==
PHASE_MAIN2
end
function
cm
.
discon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
GetOriginalCode
(
12065002
)
end
function
cm
.
discost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToRemoveAsCost
()
and
c
:
GetOverlayCount
()
==
3
end
if
Duel
.
Remove
(
c
,
POS_FACEUP
,
REASON_COST
+
REASON_TEMPORARY
)
~=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_CHAIN_END
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetLabelObject
(
c
)
e1
:
SetCountLimit
(
1
)
e1
:
SetOperation
(
scm
.
disretop
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
function
cm
.
disretop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
if
tc
:
IsType
(
TYPE_FIELD
)
and
tc
:
IsPreviousLocation
(
LOCATION_FZONE
)
then
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_FZONE
,
POS_FACEUP
,
true
)
elseif
tc
:
IsType
(
TYPE_PENDULUM
)
and
tc
:
IsPreviousLocation
(
LOCATION_PZONE
)
then
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
else
Duel
.
ReturnToField
(
e
:
GetLabelObject
())
end
end
function
cm
.
distg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
ct
=
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_HAND
,
0
)
if
chk
==
0
then
return
ct
>
0
and
Duel
.
IsPlayerCanDraw
(
tp
,
5
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_HANDES
,
nil
,
0
,
tp
,
ct
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
5
)
end
function
cm
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_HAND
,
0
)
if
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
+
REASON_DISCARD
)
~=
0
then
Duel
.
BreakEffect
()
Duel
.
Draw
(
tp
,
5
,
REASON_EFFECT
)
end
end
expansions/script/c12080031.lua
View file @
415545ef
...
...
@@ -2,5 +2,60 @@
local
m
=
12080031
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
0
,
m
)
--fusion material
c
:
EnableReviveLimit
()
aux
.
AddFusionProcFunRep
(
c
,
cm
.
ffilter
,
3
,
false
)
aux
.
AddContactFusionProcedure
(
c
,
Card
.
IsAbleToGraveAsCost
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
Duel
.
SendtoGrave
,
REASON_COST
)
--spsummon
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e3
:
SetCategory
(
CATEGORY_TOHAND
)
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_CHAINING
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCondition
(
cm
.
spcon
)
e3
:
SetTarget
(
cm
.
sptg
)
e3
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e3
)
--immune
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCondition
(
cm
.
imcon
)
e1
:
SetValue
(
cm
.
efilter
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
ffilter
(
c
,
fc
,
sub
,
mg
,
sg
)
return
(
not
sg
or
not
sg
:
IsExists
(
Card
.
IsFusionCode
,
1
,
c
,
c
:
GetFusionCode
())
)
and
c
:
IsSetCard
(
0xcfac
)
end
function
cm
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
==
1
-
tp
end
function
cm
.
searchfilter
(
c
)
return
c
:
IsSetCard
(
0xcfac
)
and
c
:
IsAbleToHand
()
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
searchfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
searchfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
cm
.
exfilter
(
c
)
return
c
:
IsSetCard
(
0xcfac
)
and
not
c
:
IsType
(
TYPE_FUSION
)
and
c
:
IsFaceup
()
end
function
cm
.
imcon
(
e
)
local
e
=
e
:
GetHandlerPlayer
()
return
Duel
.
IsExistingMatchingCard
(
cm
.
exfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
cm
.
efilter
(
e
,
te
)
return
te
:
GetOwner
()
~=
e
:
GetOwner
()
end
\ No newline at end of file
expansions/script/c12083005.lua
View file @
415545ef
...
...
@@ -2,5 +2,67 @@
local
m
=
12083005
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--change race
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetCode
(
EFFECT_ADD_RACE
)
e1
:
SetRange
(
0x3ee
)
e1
:
SetValue
(
RACE_SPELLCASTER
)
c
:
RegisterEffect
(
e1
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e1
:
SetCategory
(
CATEGORY_DRAW
)
e1
:
SetType
(
EFFECT_TYPE_TRIGGER_O
+
EFFECT_TYPE_FIELD
)
e1
:
SetRange
(
LOCATION_GRAVE
)
e1
:
SetCountLimit
(
1
,
m
+
100
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_STANDBY
)
e1
:
SetHintTiming
(
0
,
0x1e0
)
e1
:
SetCondition
(
cm
.
igcon
)
e1
:
SetTarget
(
cm
.
igtg
)
e1
:
SetOperation
(
cm
.
igop
)
c
:
RegisterEffect
(
e1
)
--special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e1
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCondition
(
cm
.
spcon
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x6fae
)
end
function
cm
.
spcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
return
Duel
.
GetLocationCount
(
c
:
GetControler
(),
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
c
:
GetControler
(),
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
cm
.
igcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetTurnPlayer
()
==
tp
end
function
cm
.
igtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
Duel
.
IsExistingMatchingCard
(
Card
.
IsPublic
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
and
Duel
.
IsPlayerCanDraw
(
tp
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToDeck
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
nil
,
1
,
tp
,
LOCATION_HAND
)
end
function
cm
.
ffilter
(
c
)
return
not
c
:
IsRace
(
RACE_SPELLCASTER
+
RACE_FAIRY
)
end
function
cm
.
igop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_HAND
,
0
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
ShuffleHand
(
tp
)
if
g
:
FilterCount
(
cm
.
ffilter
,
nil
)
>
0
then
return
end
local
p
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
)
Duel
.
Hint
(
HINT_SELECTMSG
,
p
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectMatchingCard
(
p
,
Card
.
IsAbleToDeck
,
p
,
LOCATION_HAND
,
0
,
1
,
63
,
nil
)
if
g
:
GetCount
()
==
0
then
return
end
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_EFFECT
)
Duel
.
ShuffleDeck
(
p
)
Duel
.
BreakEffect
()
Duel
.
Draw
(
p
,
g
:
GetCount
(),
REASON_EFFECT
)
end
\ No newline at end of file
expansions/script/c12083008.lua
View file @
415545ef
...
...
@@ -3,4 +3,54 @@ local m=12083008
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_SEARCH
+
CATEGORY_TOHAND
+
CATEGORY_DRAW
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
m
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetTarget
(
cm
.
rectg
)
e1
:
SetOperation
(
cm
.
recop
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
rectg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
100
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_RECOVER
,
nil
,
0
,
tp
,
600
)
end
function
cm
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x6fae
)
and
c
:
IsAbleToHand
()
end
function
cm
.
thfilter1
(
c
)
return
c
:
IsCode
(
12083003
)
and
c
:
IsAbleToHand
()
end
function
cm
.
tfilter
(
c
)
return
c
:
IsCode
(
12083003
)
and
c
:
IsAbleToHand
()
end
function
cm
.
recop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Recover
(
p
,
d
,
REASON_EFFECT
)
if
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_MZONE
,
0
)
==
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
1
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsCode
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
,
12083002
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
2
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
if
Duel
.
IsExistingMatchingCard
(
cm
.
tfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
3
))
then
local
g
=
Duel
.
GetMatchingGroup
(
cm
.
tfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
nil
)
if
g
:
GetCount
()
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
sg
)
Duel
.
SendtoHand
(
sg
,
nil
,
REASON_EFFECT
)
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
expansions/script/c12083021.lua
View file @
415545ef
...
...
@@ -2,5 +2,88 @@
local
m
=
12083021
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--fusion material
c
:
EnableReviveLimit
()
aux
.
AddFusionProcFun2
(
c
,
cm
.
ffiltera
,
cm
.
ffilterb
,
true
)
aux
.
AddContactFusionProcedure
(
c
,
Card
.
IsAbleToRemoveAsCost
,
LOCATION_ONFIELD
,
0
,
Duel
.
Release
,
REASON_COST
)
--change race
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetCode
(
EFFECT_ADD_RACE
)
e1
:
SetRange
(
0x3ee
)
e1
:
SetValue
(
RACE_SPELLCASTER
)
c
:
RegisterEffect
(
e1
)
--indes
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetCondition
(
cm
.
immcon
)
e2
:
SetOperation
(
cm
.
immop
)
c
:
RegisterEffect
(
e2
)
--search
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e3
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
m
)
e3
:
SetTarget
(
cm
.
thtg
)
e3
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
ffiltera
(
c
)
return
c
:
IsRace
(
RACE_FAIRY
)
end
function
cm
.
ffilterb
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
end
function
cm
.
immcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
and
re
:
GetHandler
():
IsCode
(
24094653
)
and
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_FUSION
)
end
function
cm
.
immop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
c
:
RegisterFlagEffect
(
m
,
RESET_PHASE
+
PHASE_END
+
RESET_EVENT
+
RESETS_STANDARD
,
0
,
1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e2
:
SetTargetRange
(
0
,
1
)
e2
:
SetValue
(
cm
.
aclimit
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetRange
(
LOCATION_MZONE
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
aclimit
(
e
,
re
,
tp
)
local
rc
=
re
:
GetHandler
()
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
rc
:
IsAttackBelow
(
2000
)
end
function
cm
.
thfilter
(
c
)
return
c
:
IsCode
(
24094653
)
and
c
:
IsAbleToHand
()
end
function
cm
.
thfilter
(
c
)
return
c
:
IsRace
(
RACE_FAIRY
)
and
c
:
IsAbleToHand
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
if
Duel
.
GetFlagEffect
(
m
)
~=
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
tg
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
tg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tg
)
end
end
end
end
\ No newline at end of file
expansions/script/c12083081.lua
0 → 100644
View file @
415545ef
--燃烧的情绪 芙拉玛
local
m
=
12083081
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--Normal monster
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetCode
(
EFFECT_ADD_TYPE
)
e1
:
SetRange
(
LOCATION_HAND
+
LOCATION_GRAVE
)
e1
:
SetValue
(
TYPE_NORMAL
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_REMOVE_TYPE
)
e2
:
SetValue
(
TYPE_EFFECT
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e1
:
Clone
()
e3
:
SetCode
(
EFFECT_CHANGE_RACE
)
e3
:
SetValue
(
RACE_DRAGON
)
c
:
RegisterEffect
(
e3
)
--send to grave
local
e11
=
Effect
.
CreateEffect
(
c
)
e11
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e11
:
SetCategory
(
CATEGORY_TOGRAVE
)
e11
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e11
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e11
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e11
:
SetRange
(
LOCATION_MZONE
)
e11
:
SetCountLimit
(
1
,
m
+
100
)
e11
:
SetTarget
(
cm
.
tgtg
)
e11
:
SetOperation
(
cm
.
tgop
)
c
:
RegisterEffect
(
e11
)
local
e21
=
e11
:
Clone
()
e21
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
c
:
RegisterEffect
(
e21
)
--spsummon
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetRange
(
LOCATION_GRAVE
)
e3
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e3
:
SetCost
(
aux
.
bfgcost
)
e3
:
SetTarget
(
cm
.
sptg
)
e3
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
tgtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
cm
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCondition
(
cm
.
thcon
)
e1
:
SetOperation
(
cm
.
thop
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
cm
.
tgfilter
(
c
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsAbleToGrave
()
end
function
cm
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
return
Duel
.
IsExistingMatchingCard
(
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
local
tc
=
g
:
GetFirst
()
if
tc
and
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
>
0
and
tc
:
IsLocation
(
LOCATION_GRAVE
)
and
tc
:
IsRace
(
RACE_DRAGON
)
and
tc
:
IsType
(
TYPE_NORMAL
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
1
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
function
cm
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsType
(
TYPE_NORMAL
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsControler
(
tp
)
and
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
cm
.
spfilter
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingTarget
(
cm
.
spfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
cm
.
spfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
\ No newline at end of file
expansions/script/c12083082.lua
View file @
415545ef
...
...
@@ -2,5 +2,98 @@
local
m
=
12083082
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--Normal monster
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetCode
(
EFFECT_ADD_TYPE
)
e1
:
SetRange
(
LOCATION_HAND
+
LOCATION_GRAVE
)
e1
:
SetValue
(
TYPE_NORMAL
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_REMOVE_TYPE
)
e2
:
SetValue
(
TYPE_EFFECT
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e1
:
Clone
()
e3
:
SetCode
(
EFFECT_CHANGE_RACE
)
e3
:
SetValue
(
RACE_DRAGON
)
c
:
RegisterEffect
(
e3
)
--send to grave
local
e11
=
Effect
.
CreateEffect
(
c
)
e11
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e11
:
SetCategory
(
CATEGORY_TOGRAVE
)
e11
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e11
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e11
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e11
:
SetRange
(
LOCATION_MZONE
)
e11
:
SetCountLimit
(
1
,
m
+
100
)
e11
:
SetCost
(
cm
.
tgcost
)
e11
:
SetTarget
(
cm
.
tgtg
)
e11
:
SetOperation
(
cm
.
tgop
)
c
:
RegisterEffect
(
e11
)
local
e21
=
e11
:
Clone
()
e21
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
c
:
RegisterEffect
(
e21
)
--spsummon
local
e12
=
Effect
.
CreateEffect
(
c
)
e12
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e12
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e12
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e12
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e12
:
SetRange
(
LOCATION_GRAVE
)
e12
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e12
:
SetCountLimit
(
1
,
m
)
e12
:
SetCondition
(
cm
.
spcon
)
e12
:
SetTarget
(
cm
.
sptg
)
e12
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e12
)
end
function
cm
.
tgcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsReleasable
()
end
Duel
.
Release
(
e
:
GetHandler
(),
REASON_COST
)
end
function
cm
.
tgtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
cm
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCondition
(
cm
.
thcon
)
e1
:
SetOperation
(
cm
.
thop
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
cm
.
filter
(
c
,
e
,
tp
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsLevelAbove
(
7
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
cm
.
spcfil
(
c
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsLevelAbove
(
7
)
end
function
cm
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
and
eg
:
IsExists
(
cm
.
spcfil
,
1
,
nil
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
expansions/script/c12083085.lua
View file @
415545ef
...
...
@@ -2,5 +2,50 @@
local
m
=
12083085
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
m
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
activate
)
c
:
RegisterEffect
(
e1
)
Duel
.
AddCustomActivityCounter
(
m
,
ACTIVITY_SPSUMMON
,
cm
.
counterfilter
)
end
function
cm
.
counterfilter
(
c
)
return
c
:
IsRace
(
RACE_DRAGON
)
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetCustomActivityCount
(
m
,
tp
,
ACTIVITY_SPSUMMON
)
==
0
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_OATH
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
cm
.
splimit
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
cm
.
splimit
(
e
,
c
)
return
not
c
:
IsRace
(
RACE_DRAGON
)
end
function
cm
.
tgfilter
(
c
)
return
c
:
IsAttribute
(
ATTRIBUTE_FIRE
)
and
c
:
IsDefenseAbove
(
1500
)
and
c
:
IsAbleToGrave
()
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
local
tc
=
g
:
GetFirst
()
if
tc
and
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
>
0
and
tc
:
IsLocation
(
LOCATION_GRAVE
)
and
tc
:
IsRace
(
RACE_DRAGON
)
and
tc
:
IsType
(
TYPE_NORMAL
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c12083090.lua
0 → 100644
View file @
415545ef
--陪葬炎龙
local
m
=
12083090
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--level
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetRange
(
LOCATION_MZONE
+
LOCATION_HAND
)
e1
:
SetCost
(
cm
.
lvcost
)
e1
:
SetTarget
(
cm
.
tgtg
)
e1
:
SetOperation
(
cm
.
tgop
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
lvcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsReleasable
()
end
Duel
.
Release
(
e
:
GetHandler
(),
REASON_COST
)
end
function
cm
.
gfilter
(
c
,
tp
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
c
:
GetCode
())
end
function
cm
.
tgfilter
(
c
,
code
)
return
c
:
IsCode
(
code
)
and
c
:
IsAbleToGrave
()
end
function
cm
.
tgtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
chkc
:
IsRace
(
RACE_DRAGON
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
gfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
Duel
.
SelectTarget
(
tp
,
cm
.
tgfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
tp
)
end
function
cm
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
2
,
nil
,
tc
:
GetCode
())
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment