Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro-2pick
Commits
52888c11
Commit
52888c11
authored
Nov 18, 2017
by
Momobako
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Push by Appveyor
parent
2ad74955
Changes
77
Hide whitespace changes
Inline
Side-by-side
Showing
77 changed files
with
4960 additions
and
295 deletions
+4960
-295
expansions/222DIY.cdb
expansions/222DIY.cdb
+0
-0
expansions/script/c10901013.lua
expansions/script/c10901013.lua
+1
-1
expansions/script/c10902000.lua
expansions/script/c10902000.lua
+57
-0
expansions/script/c10902001.lua
expansions/script/c10902001.lua
+113
-0
expansions/script/c10902002.lua
expansions/script/c10902002.lua
+106
-0
expansions/script/c10902003.lua
expansions/script/c10902003.lua
+100
-0
expansions/script/c10902004.lua
expansions/script/c10902004.lua
+124
-0
expansions/script/c10902005.lua
expansions/script/c10902005.lua
+141
-0
expansions/script/c10902006.lua
expansions/script/c10902006.lua
+98
-0
expansions/script/c10902007.lua
expansions/script/c10902007.lua
+85
-0
expansions/script/c1151001.lua
expansions/script/c1151001.lua
+138
-0
expansions/script/c1151003.lua
expansions/script/c1151003.lua
+153
-0
expansions/script/c1151005.lua
expansions/script/c1151005.lua
+127
-0
expansions/script/c1151101.lua
expansions/script/c1151101.lua
+110
-0
expansions/script/c1151201.lua
expansions/script/c1151201.lua
+48
-85
expansions/script/c1151203.lua
expansions/script/c1151203.lua
+87
-0
expansions/script/c1151205.lua
expansions/script/c1151205.lua
+93
-0
expansions/script/c1151212.lua
expansions/script/c1151212.lua
+78
-0
expansions/script/c1151214.lua
expansions/script/c1151214.lua
+172
-0
expansions/script/c1151216.lua
expansions/script/c1151216.lua
+161
-0
expansions/script/c1151217.lua
expansions/script/c1151217.lua
+103
-0
expansions/script/c1151219.lua
expansions/script/c1151219.lua
+173
-0
expansions/script/c1152001.lua
expansions/script/c1152001.lua
+1
-1
expansions/script/c1152002.lua
expansions/script/c1152002.lua
+4
-5
expansions/script/c1152003.lua
expansions/script/c1152003.lua
+2
-2
expansions/script/c1152005.lua
expansions/script/c1152005.lua
+1
-8
expansions/script/c1152101.lua
expansions/script/c1152101.lua
+2
-2
expansions/script/c1152203.lua
expansions/script/c1152203.lua
+1
-1
expansions/script/c1152205.lua
expansions/script/c1152205.lua
+1
-1
expansions/script/c1152208.lua
expansions/script/c1152208.lua
+1
-0
expansions/script/c1152209.lua
expansions/script/c1152209.lua
+13
-12
expansions/script/c1152212.lua
expansions/script/c1152212.lua
+1
-1
expansions/script/c1152301.lua
expansions/script/c1152301.lua
+0
-5
expansions/script/c1152304.lua
expansions/script/c1152304.lua
+6
-16
expansions/script/c1152306.lua
expansions/script/c1152306.lua
+15
-13
expansions/script/c1152999.lua
expansions/script/c1152999.lua
+3
-3
expansions/script/c17111001.lua
expansions/script/c17111001.lua
+66
-0
expansions/script/c17111002.lua
expansions/script/c17111002.lua
+57
-0
expansions/script/c17111003.lua
expansions/script/c17111003.lua
+57
-0
expansions/script/c17111004.lua
expansions/script/c17111004.lua
+47
-0
expansions/script/c17111005.lua
expansions/script/c17111005.lua
+56
-0
expansions/script/c17111010.lua
expansions/script/c17111010.lua
+160
-0
expansions/script/c17111011.lua
expansions/script/c17111011.lua
+160
-0
expansions/script/c17111012.lua
expansions/script/c17111012.lua
+147
-0
expansions/script/c22250001.lua
expansions/script/c22250001.lua
+6
-6
expansions/script/c22250002.lua
expansions/script/c22250002.lua
+0
-9
expansions/script/c22250003.lua
expansions/script/c22250003.lua
+2
-8
expansions/script/c22250004.lua
expansions/script/c22250004.lua
+1
-1
expansions/script/c22250005.lua
expansions/script/c22250005.lua
+3
-3
expansions/script/c22250006.lua
expansions/script/c22250006.lua
+14
-8
expansions/script/c22250101.lua
expansions/script/c22250101.lua
+1
-1
expansions/script/c22250102.lua
expansions/script/c22250102.lua
+6
-16
expansions/script/c22250161.lua
expansions/script/c22250161.lua
+95
-0
expansions/script/c22251001.lua
expansions/script/c22251001.lua
+5
-4
expansions/script/c22251002.lua
expansions/script/c22251002.lua
+4
-8
expansions/script/c22251101.lua
expansions/script/c22251101.lua
+2
-1
expansions/script/c22251102.lua
expansions/script/c22251102.lua
+90
-0
expansions/script/c22251201.lua
expansions/script/c22251201.lua
+130
-0
expansions/script/c22251501.lua
expansions/script/c22251501.lua
+101
-0
expansions/script/c22251502.lua
expansions/script/c22251502.lua
+117
-0
expansions/script/c22252001.lua
expansions/script/c22252001.lua
+5
-3
expansions/script/c22252101.lua
expansions/script/c22252101.lua
+1
-0
expansions/script/c22252201.lua
expansions/script/c22252201.lua
+92
-0
expansions/script/c500001.lua
expansions/script/c500001.lua
+70
-0
expansions/script/c500002.lua
expansions/script/c500002.lua
+57
-0
expansions/script/c500003.lua
expansions/script/c500003.lua
+66
-0
expansions/script/c500004.lua
expansions/script/c500004.lua
+74
-0
expansions/script/c500005.lua
expansions/script/c500005.lua
+150
-0
expansions/script/c500006.lua
expansions/script/c500006.lua
+155
-0
expansions/script/c500007.lua
expansions/script/c500007.lua
+174
-0
expansions/script/c500008.lua
expansions/script/c500008.lua
+144
-0
expansions/script/c500009.lua
expansions/script/c500009.lua
+136
-0
expansions/script/c500010.lua
expansions/script/c500010.lua
+138
-0
expansions/script/c57300027.lua
expansions/script/c57300027.lua
+40
-0
expansions/script/c580043.lua
expansions/script/c580043.lua
+0
-56
expansions/strings.conf
expansions/strings.conf
+6
-1
lflist.conf
lflist.conf
+6
-14
No files found.
expansions/222DIY.cdb
View file @
52888c11
No preview for this file type
expansions/script/c10901013.lua
View file @
52888c11
...
...
@@ -24,7 +24,7 @@ function cm.disable(e,c)
return
c
==
e
:
GetHandler
()
end
function
cm
.
sumcon
(
e
)
return
Duel
.
GetTurnCount
()
<
10
return
Duel
.
GetTurnCount
()
<
9
end
function
cm
.
drfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCode
(
10901003
)
...
...
expansions/script/c10902000.lua
0 → 100644
View file @
52888c11
--星彩的显化
local
m
=
10902000
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
activate
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
92204263
,
0
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetTarget
(
cm
.
seqtg
)
e2
:
SetOperation
(
cm
.
seqop
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
filter
(
c
)
return
c
:
IsSetCard
(
0x235
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
cm
.
target
(
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
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
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
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
cm
.
seqfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
GetEquipCount
()
~=
0
end
function
cm
.
seqtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
cm
.
seqfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
seqfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
92204263
,
1
))
Duel
.
SelectTarget
(
tp
,
cm
.
seqfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
end
function
cm
.
seqop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
local
tc
=
Duel
.
GetFirstTarget
()
if
not
tc
:
IsRelateToEffect
(
e
)
or
tc
:
IsControler
(
1
-
tp
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
571
)
local
s
=
Duel
.
SelectDisableField
(
tp
,
1
,
LOCATION_MZONE
,
0
,
0
)
local
nseq
=
math.log
(
s
,
2
)
Duel
.
MoveSequence
(
tc
,
nseq
)
end
expansions/script/c10902001.lua
0 → 100644
View file @
52888c11
--星彩的双星
local
m
=
10902001
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--equip
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
3064425
,
0
))
e1
:
SetCategory
(
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
eqtg
)
e1
:
SetOperation
(
cm
.
eqop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
59755122
,
0
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetCountLimit
(
1
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCost
(
cm
.
spcost
)
e2
:
SetTarget
(
cm
.
sptg
)
e2
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
11493868
,
1
))
e3
:
SetCategory
(
CATEGORY_TOGRAVE
+
CATEGORY_DRAW
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCost
(
cm
.
cost
)
e3
:
SetTarget
(
cm
.
target
)
e3
:
SetOperation
(
cm
.
activate
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
qfilter
(
c
)
return
c
:
IsFaceup
()
end
function
cm
.
eqtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
cm
.
qfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
IsExistingTarget
(
cm
.
qfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
cm
.
qfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
e
:
GetHandler
())
end
function
cm
.
eqop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
c
:
IsLocation
(
LOCATION_MZONE
)
and
c
:
IsFacedown
()
then
return
end
local
tc
=
Duel
.
GetFirstTarget
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
or
tc
:
GetControler
()
~=
tp
or
tc
:
IsFacedown
()
or
not
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoGrave
(
c
,
REASON_EFFECT
)
return
end
Duel
.
Equip
(
tp
,
c
,
tc
,
true
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e1
:
SetValue
(
cm
.
eqlimit
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_EQUIP
)
e2
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e2
:
SetValue
(
1
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
eqlimit
(
e
,
c
)
return
c
:
IsFaceup
()
end
function
cm
.
cost
(
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
.
filter
(
c
)
return
((
c
:
IsFaceup
()
or
c
:
IsLocation
(
LOCATION_HAND
))
and
c
:
IsSetCard
(
0x235
))
and
c
:
IsAbleToGrave
()
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
2
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
2
)
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
.
filter
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
e
:
GetHandler
())
local
tc
=
g
:
GetFirst
()
if
tc
and
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
>
0
and
tc
:
IsLocation
(
LOCATION_GRAVE
)
then
Duel
.
Draw
(
tp
,
2
,
REASON_EFFECT
)
end
end
function
cm
.
scfilter
(
c
,
g
)
return
g
:
IsContains
(
c
)
and
c
:
IsSetCard
(
0x235
)
and
c
:
IsFaceup
()
end
function
cm
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
cg
=
e
:
GetHandler
():
GetColumnGroup
()
if
chkc
then
return
chkc
:
IsOnField
()
and
cm
.
scfilter
(
chkc
,
cg
)
end
if
chk
==
0
then
return
Duel
.
CheckReleaseGroup
(
tp
,
cm
.
scfilter
,
1
,
nil
,
cg
)
end
local
g
=
Duel
.
SelectReleaseGroup
(
tp
,
cm
.
scfilter
,
1
,
1
,
nil
,
cg
)
Duel
.
Release
(
g
,
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
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
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
expansions/script/c10902002.lua
0 → 100644
View file @
52888c11
--星彩的神树
local
m
=
10902002
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
3064425
,
0
))
e1
:
SetCategory
(
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetTarget
(
cm
.
eqtg
)
e1
:
SetOperation
(
cm
.
eqop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
7093411
,
1
))
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e2
:
SetTarget
(
cm
.
settarget
)
e2
:
SetOperation
(
cm
.
setoperation
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
59755122
,
0
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetCountLimit
(
1
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCost
(
cm
.
spcost
)
e3
:
SetTarget
(
cm
.
sptg
)
e3
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
filter
(
c
)
return
c
:
IsFaceup
()
end
function
cm
.
eqtg
(
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
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
IsExistingTarget
(
cm
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
cm
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
e
:
GetHandler
())
end
function
cm
.
eqop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
c
:
IsLocation
(
LOCATION_MZONE
)
and
c
:
IsFacedown
()
then
return
end
local
tc
=
Duel
.
GetFirstTarget
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
or
tc
:
GetControler
()
~=
tp
or
tc
:
IsFacedown
()
or
not
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoGrave
(
c
,
REASON_EFFECT
)
return
end
Duel
.
Equip
(
tp
,
c
,
tc
,
true
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e1
:
SetValue
(
cm
.
eqlimit
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
eqlimit
(
e
,
c
)
return
c
:
IsFaceup
()
end
function
cm
.
stfilter
(
c
)
return
c
:
IsSetCard
(
0x235
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsForbidden
()
end
function
cm
.
settarget
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
stfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
cm
.
setoperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
stfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
local
tc
=
g
:
GetFirst
()
if
tc
then
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fc0000
)
e1
:
SetValue
(
TYPE_SPELL
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e1
)
end
end
function
cm
.
scfilter
(
c
,
g
)
return
g
:
IsContains
(
c
)
and
c
:
IsSetCard
(
0x235
)
and
c
:
IsFaceup
()
end
function
cm
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
cg
=
e
:
GetHandler
():
GetColumnGroup
()
if
chkc
then
return
chkc
:
IsOnField
()
and
cm
.
scfilter
(
chkc
,
cg
)
end
if
chk
==
0
then
return
Duel
.
CheckReleaseGroup
(
tp
,
cm
.
scfilter
,
1
,
nil
,
cg
)
end
local
g
=
Duel
.
SelectReleaseGroup
(
tp
,
cm
.
scfilter
,
1
,
1
,
nil
,
cg
)
Duel
.
Release
(
g
,
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
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
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
expansions/script/c10902003.lua
0 → 100644
View file @
52888c11
--星彩的守望者
local
m
=
10902003
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
3064425
,
0
))
e1
:
SetCategory
(
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetTarget
(
cm
.
eqtg
)
e1
:
SetOperation
(
cm
.
eqop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
7093411
,
1
))
e2
:
SetCategory
(
CATEGORY_SEARCH
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
m
)
e2
:
SetTarget
(
cm
.
settarget
)
e2
:
SetOperation
(
cm
.
setoperation
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
59755122
,
0
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetCountLimit
(
1
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCost
(
cm
.
spcost
)
e3
:
SetTarget
(
cm
.
sptg
)
e3
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
filter
(
c
)
return
c
:
IsFaceup
()
end
function
cm
.
eqtg
(
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
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
IsExistingTarget
(
cm
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
cm
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
e
:
GetHandler
())
end
function
cm
.
eqop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
c
:
IsLocation
(
LOCATION_MZONE
)
and
c
:
IsFacedown
()
then
return
end
local
tc
=
Duel
.
GetFirstTarget
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
or
tc
:
GetControler
()
~=
tp
or
tc
:
IsFacedown
()
or
not
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoGrave
(
c
,
REASON_EFFECT
)
return
end
Duel
.
Equip
(
tp
,
c
,
tc
,
true
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e1
:
SetValue
(
cm
.
eqlimit
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
eqlimit
(
e
,
c
)
return
c
:
IsFaceup
()
end
function
cm
.
sefilter
(
c
)
return
c
:
IsSetCard
(
0x235
)
and
c
:
IsAbleToHand
()
end
function
cm
.
settarget
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
sefilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
setoperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
sefilter
,
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
function
cm
.
scfilter
(
c
,
g
)
return
g
:
IsContains
(
c
)
and
c
:
IsSetCard
(
0x235
)
and
c
:
IsFaceup
()
end
function
cm
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
cg
=
e
:
GetHandler
():
GetColumnGroup
()
if
chkc
then
return
chkc
:
IsOnField
()
and
cm
.
scfilter
(
chkc
,
cg
)
end
if
chk
==
0
then
return
Duel
.
CheckReleaseGroup
(
tp
,
cm
.
scfilter
,
1
,
nil
,
cg
)
end
local
g
=
Duel
.
SelectReleaseGroup
(
tp
,
cm
.
scfilter
,
1
,
1
,
nil
,
cg
)
Duel
.
Release
(
g
,
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
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
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
expansions/script/c10902004.lua
0 → 100644
View file @
52888c11
--星彩的舞浪者
local
m
=
10902004
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
3064425
,
0
))
e1
:
SetCategory
(
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetTarget
(
cm
.
eqtg
)
e1
:
SetOperation
(
cm
.
eqop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
7093411
,
1
))
e2
:
SetCategory
(
CATEGORY_TODECK
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
m
)
e2
:
SetTarget
(
cm
.
settarget
)
e2
:
SetOperation
(
cm
.
setoperation
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
59755122
,
0
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetCountLimit
(
1
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCost
(
cm
.
spcost
)
e3
:
SetTarget
(
cm
.
sptg
)
e3
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e3
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetCode
(
EFFECT_CANNOT_INACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCondition
(
cm
.
tgcon
)
e4
:
SetValue
(
cm
.
effectfilter
)
c
:
RegisterEffect
(
e4
)
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetType
(
EFFECT_TYPE_FIELD
)
e5
:
SetCode
(
EFFECT_CANNOT_DISEFFECT
)
e5
:
SetRange
(
LOCATION_MZONE
)
e5
:
SetCondition
(
cm
.
tgcon
)
e5
:
SetValue
(
cm
.
effectfilter
)
c
:
RegisterEffect
(
e5
)
end
function
cm
.
filter
(
c
)
return
c
:
IsFaceup
()
end
function
cm
.
eqtg
(
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
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
IsExistingTarget
(
cm
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
cm
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
e
:
GetHandler
())
end
function
cm
.
eqop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
c
:
IsLocation
(
LOCATION_MZONE
)
and
c
:
IsFacedown
()
then
return
end
local
tc
=
Duel
.
GetFirstTarget
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
or
tc
:
GetControler
()
~=
tp
or
tc
:
IsFacedown
()
or
not
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoGrave
(
c
,
REASON_EFFECT
)
return
end
Duel
.
Equip
(
tp
,
c
,
tc
,
true
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e1
:
SetValue
(
cm
.
eqlimit
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
eqlimit
(
e
,
c
)
return
c
:
IsFaceup
()
end
function
cm
.
tdfilter
(
c
)
return
c
:
IsAbleToDeck
()
end
function
cm
.
settarget
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
tdfilter
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
end
local
g
=
Duel
.
GetMatchingGroup
(
cm
.
tdfilter
,
tp
,
0
,
LOCATION_ONFIELD
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
g
,
1
,
0
,
0
)
end
function
cm
.
setoperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tdfilter
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_EFFECT
)
end
end
function
cm
.
tgcon
(
e
)
local
c
=
e
:
GetHandler
()
return
c
:
GetSummonLocation
()
==
LOCATION_SZONE
and
c
:
GetEquipCount
()
~=
0
end
function
cm
.
effectfilter
(
e
,
ct
)
local
p
=
e
:
GetHandlerPlayer
()
local
te
,
tp
,
loc
=
Duel
.
GetChainInfo
(
ct
,
CHAININFO_TRIGGERING_EFFECT
,
CHAININFO_TRIGGERING_PLAYER
,
CHAININFO_TRIGGERING_LOCATION
)
local
tc
=
te
:
GetHandler
()
return
p
==
tp
and
bit
.
band
(
loc
,
LOCATION_ONFIELD
)
~=
0
and
tc
:
IsSetCard
(
0x235
)
end
function
cm
.
scfilter
(
c
,
g
)
return
g
:
IsContains
(
c
)
and
c
:
IsSetCard
(
0x235
)
and
c
:
IsFaceup
()
end
function
cm
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
cg
=
e
:
GetHandler
():
GetColumnGroup
()
if
chkc
then
return
chkc
:
IsOnField
()
and
cm
.
scfilter
(
chkc
,
cg
)
end
if
chk
==
0
then
return
Duel
.
CheckReleaseGroup
(
tp
,
cm
.
scfilter
,
1
,
nil
,
cg
)
end
local
g
=
Duel
.
SelectReleaseGroup
(
tp
,
cm
.
scfilter
,
1
,
1
,
nil
,
cg
)
Duel
.
Release
(
g
,
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
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
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
\ No newline at end of file
expansions/script/c10902005.lua
0 → 100644
View file @
52888c11
--星彩的天使
local
m
=
10902005
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--equip
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
3064425
,
0
))
e1
:
SetCategory
(
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetCondition
(
cm
.
eqcon
)
e1
:
SetTarget
(
cm
.
eqtg
)
e1
:
SetOperation
(
cm
.
eqop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
+
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e2
:
SetRange
(
LOCATION_HAND
)
e2
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
59755122
,
0
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetCountLimit
(
1
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCost
(
cm
.
spcost
)
e3
:
SetTarget
(
cm
.
sptg
)
e3
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e3
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e4
:
SetCode
(
EVENT_CHAIN_SOLVING
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCondition
(
cm
.
discon
)
e4
:
SetOperation
(
cm
.
disop
)
c
:
RegisterEffect
(
e4
)
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e5
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e5
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e5
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e5
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e5
:
SetCountLimit
(
1
,
m
)
e5
:
SetTarget
(
cm
.
sptg
)
e5
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e5
)
end
function
cm
.
filter
(
c
)
return
c
:
IsFaceup
()
end
function
cm
.
eqtg
(
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
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
IsExistingTarget
(
cm
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
cm
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
e
:
GetHandler
())
end
function
cm
.
eqop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
c
:
IsLocation
(
LOCATION_MZONE
)
and
c
:
IsFacedown
()
then
return
end
local
tc
=
Duel
.
GetFirstTarget
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
or
tc
:
GetControler
()
~=
tp
or
tc
:
IsFacedown
()
or
not
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoGrave
(
c
,
REASON_EFFECT
)
return
end
Duel
.
Equip
(
tp
,
c
,
tc
,
true
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e1
:
SetValue
(
cm
.
eqlimit
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_EQUIP
)
e2
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e2
:
SetValue
(
cm
.
efilter
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
eqlimit
(
e
,
c
)
return
c
:
IsFaceup
()
end
function
cm
.
efilter
(
e
,
te
)
return
te
:
GetOwnerPlayer
()
~=
e
:
GetHandlerPlayer
()
and
te
:
GetOwner
()
~=
e
:
GetOwner
()
and
te
:
IsActiveType
(
TYPE_MONSTER
)
end
function
cm
.
seqfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x235
)
end
function
cm
.
eqcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
cm
.
seqfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
function
cm
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter
,
tp
,
LOCATION_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
.
discon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
loc
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TRIGGERING_LOCATION
)
local
c
=
e
:
GetHandler
()
return
ep
~=
tp
and
c
:
GetSummonLocation
()
==
LOCATION_SZONE
and
not
(
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
and
re
:
IsType
(
TYPE_SPELL
))
and
loc
==
LOCATION_HAND
end
function
cm
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
NegateEffect
(
ev
)
end
function
cm
.
scfilter
(
c
,
g
)
return
g
:
IsContains
(
c
)
and
c
:
IsSetCard
(
0x235
)
and
c
:
IsFaceup
()
end
function
cm
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
cg
=
e
:
GetHandler
():
GetColumnGroup
()
if
chkc
then
return
chkc
:
IsOnField
()
and
cm
.
scfilter
(
chkc
,
cg
)
end
if
chk
==
0
then
return
Duel
.
CheckReleaseGroup
(
tp
,
cm
.
scfilter
,
1
,
nil
,
cg
)
end
local
g
=
Duel
.
SelectReleaseGroup
(
tp
,
cm
.
scfilter
,
1
,
1
,
nil
,
cg
)
Duel
.
Release
(
g
,
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
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
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
expansions/script/c10902006.lua
0 → 100644
View file @
52888c11
--小小的星辉
local
m
=
10902006
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetOperation
(
cm
.
activate
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_SOLVING
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCondition
(
cm
.
discon
)
e2
:
SetOperation
(
cm
.
disop
)
c
:
RegisterEffect
(
e2
)
--Equip
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCategory
(
CATEGORY_EQUIP
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e3
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e3
:
SetCountLimit
(
1
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCost
(
cm
.
cost
)
e3
:
SetTarget
(
cm
.
target
)
e3
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_BE_EFFECT_TARGET
)
e1
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
)
e1
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x235
))
e1
:
SetTargetRange
(
LOCATION_ONFIELD
,
0
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetValue
(
aux
.
indoval
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
cm
.
ngfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x235
)
end
function
cm
.
cnfilter
(
c
,
tp
)
return
c
:
IsControler
(
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
and
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x235
)
end
function
cm
.
discon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
re
:
GetHandler
():
GetColumnGroup
():
FilterCount
(
cm
.
cnfilter
,
nil
,
tp
)
>
0
then
return
end
return
rp
~=
tp
and
re
:
IsActiveType
(
TYPE_SPELL
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
ngfilter
,
tp
,
LOCATION_SZONE
,
0
,
2
,
nil
)
end
function
cm
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
NegateEffect
(
ev
)
end
function
cm
.
cpfilter
(
c
,
ft
)
return
c
:
IsFaceup
()
and
c
:
IsAbleToHandAsCost
()
and
c
:
IsSetCard
(
0x235
)
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
cpfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cpfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_COST
)
end
function
cm
.
cfilter
(
c
)
return
c
:
IsFaceup
()
end
function
cm
.
filter2
(
c
)
return
c
:
IsSetCard
(
0x235
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsForbidden
()
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsControler
(
tp
)
and
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
cm
.
cfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
IsExistingTarget
(
cm
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
filter2
,
tp
,
LOCATION_GRAVE
+
LOCATION_HAND
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
cm
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_LEAVE_GRAVE
,
nil
,
1
,
tp
,
LOCATION_GRAVE
+
LOCATION_HAND
)
end
function
cm
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter2
,
tp
,
LOCATION_GRAVE
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
local
sc
=
sg
:
GetFirst
()
if
sc
and
tc
:
IsFaceup
()
and
tc
:
IsRelateToEffect
(
e
)
then
if
not
Duel
.
Equip
(
tp
,
sc
,
tc
,
true
)
then
return
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e1
:
SetValue
(
cm
.
eqlimit
)
e1
:
SetLabelObject
(
tc
)
sc
:
RegisterEffect
(
e1
)
end
end
function
cm
.
eqlimit
(
e
,
c
)
return
e
:
GetLabelObject
()
==
c
end
expansions/script/c10902007.lua
0 → 100644
View file @
52888c11
--星彩的背弃者
local
m
=
10902007
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--link summon
aux
.
AddLinkProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsLinkType
,
TYPE_EFFECT
),
3
,
3
)
c
:
EnableReviveLimit
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetCode
(
EFFECT_CANNOT_BE_LINK_MATERIAL
)
e1
:
SetValue
(
1
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_NEGATE
+
CATEGORY_DESTROY
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCondition
(
cm
.
discon
)
e2
:
SetCost
(
cm
.
discost
)
e2
:
SetTarget
(
cm
.
distg
)
e2
:
SetOperation
(
cm
.
disop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
10441498
,
1
))
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_F
)
e3
:
SetCode
(
EVENT_RELEASE
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCondition
(
cm
.
thcon
)
e3
:
SetTarget
(
cm
.
thtg
)
e3
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e3
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e4
:
SetTarget
(
cm
.
distarget
)
e4
:
SetCode
(
EFFECT_DISABLE
)
c
:
RegisterEffect
(
e4
)
end
function
cm
.
distarget
(
e
,
c
)
return
e
:
GetHandler
():
GetLinkedGroup
():
IsContains
(
c
)
and
not
(
c
:
GetEquipCount
()
~=
0
and
c
:
GetEquipGroup
():
IsExists
(
Card
.
IsSetCard
,
1
,
nil
,
0x235
))
end
function
cm
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x235
)
and
c
:
IsAbleToGraveAsCost
()
end
function
cm
.
discon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
c
:
IsStatus
(
STATUS_BATTLE_DESTROYED
)
and
Duel
.
IsChainNegatable
(
ev
)
end
function
cm
.
ngfilter
(
c
,
g
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
g
:
IsContains
(
c
)
and
not
c
:
IsDisabled
()
end
function
cm
.
discost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
lg
=
e
:
GetHandler
():
GetLinkedGroup
()
if
chk
==
0
then
return
Duel
.
CheckReleaseGroup
(
tp
,
cm
.
ngfilter
,
1
,
nil
,
lg
)
end
local
g
=
Duel
.
SelectReleaseGroup
(
tp
,
cm
.
ngfilter
,
1
,
1
,
nil
,
lg
)
Duel
.
Release
(
g
,
REASON_COST
)
end
function
cm
.
distg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_NEGATE
,
eg
,
1
,
0
,
0
)
if
re
:
GetHandler
():
IsDestructable
()
and
re
:
GetHandler
():
IsRelateToEffect
(
re
)
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
eg
,
1
,
0
,
0
)
end
end
function
cm
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
NegateActivation
(
ev
)
and
re
:
GetHandler
():
IsRelateToEffect
(
re
)
then
Duel
.
Destroy
(
eg
,
REASON_EFFECT
)
end
end
function
cm
.
thfilter2
(
c
,
tp
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsPreviousLocation
(
LOCATION_ONFIELD
+
LOCATION_HAND
)
and
c
:
IsSetCard
(
0x235
)
end
function
cm
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
cm
.
thfilter2
,
1
,
e
:
GetHandler
(),
tp
)
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
Duel
.
SetChainLimit
(
aux
.
FALSE
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
lp
=
Duel
.
GetLP
(
1
-
tp
)
Duel
.
SetLP
(
1
-
tp
,
lp
-
1000
)
end
expansions/script/c1151001.lua
0 → 100644
View file @
52888c11
--永远鲜红的幼月
function
c1151001
.
initial_effect
(
c
)
--
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_FIELD
)
e0
:
SetCode
(
EFFECT_SPSUMMON_PROC_G
)
e0
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
+
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_IGNORE_IMMUNE
)
e0
:
SetRange
(
LOCATION_MZONE
)
e0
:
SetCondition
(
c1151001
.
synCon
)
e0
:
SetOperation
(
c1151001
.
synOp
)
e0
:
SetValue
(
SUMMON_TYPE_SYNCHRO
)
c
:
RegisterEffect
(
e0
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTarget
(
c1151001
.
tg1
)
e1
:
SetOperation
(
c1151001
.
op1
)
c
:
RegisterEffect
(
e1
)
--
end
--
c1151001
.
named_with_Leimi
=
1
function
c1151001
.
IsLeimi
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
named_with_Leimi
end
c1151001
.
named_with_Leisp
=
1
function
c1151001
.
IsLeisp
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
c
.
named_with_Leisp
end
function
c1151001
.
IsFulan
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
named_with_Fulan
end
c1151001
.
named_with_Lulsp
=
1
function
c1151001
.
IsFulsp
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
c
.
named_with_Fulsp
end
--
function
c1151001
.
synLvfilter
(
c
,
syncard
)
if
c
:
IsType
(
TYPE_LINK
)
then
return
99
end
if
c
:
IsType
(
TYPE_XYZ
)
then
return
c
:
GetRank
()
else
return
c
:
GetSynchroLevel
(
syncard
)
end
end
function
c1151001
.
filter
(
c
,
tp
,
mg
,
turner
,
e
)
local
lv
=
c
:
GetLevel
()
-
turner
:
GetLevel
()
if
lv
<
1
then
return
false
end
local
flag
=
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
turner
)
<
1
return
c
:
IsRace
(
RACE_FIEND
)
and
c
:
IsType
(
TYPE_SYNCHRO
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_SYNCHRO
,
tp
,
true
,
false
)
and
mg
:
IsExists
(
c1151001
.
matfilter
,
1
,
turner
,
mg
,
tp
,
lv
,
c
,
flag
)
end
function
c1151001
.
matfilter
(
c
,
mg
,
tp
,
lv
,
sync
,
flag
)
if
flag
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
c
)
<
1
then
return
end
local
val
=
c1151001
.
synLvfilter
(
c
,
sync
)
if
val
==
99
then
return
false
end
lv
=
lv
-
val
if
lv
==
0
then
return
true
end
if
lv
>
1
then
local
g
=
mg
:
Clone
()
g
:
RemoveCard
(
c
)
return
g
:
CheckWithSumEqual
(
c1151001
.
synLvfilter
,
lv
,
1
,
99
,
sync
)
end
return
false
end
function
c1151001
.
synCon
(
e
,
c
,
og
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
local
mg
=
Duel
.
GetMatchingGroup
(
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
0
,
c
)
return
Duel
.
IsExistingMatchingCard
(
c1151001
.
filter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
tp
,
mg
,
c
,
e
)
end
function
c1151001
.
synOp
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
,
sg
,
og
)
local
tp
=
c
:
GetControler
()
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
0
,
c
)
local
syncG
=
Duel
.
SelectMatchingCard
(
tp
,
c1151001
.
filter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
,
tp
,
g
,
c
,
e
)
if
syncG
:
GetCount
()
<
1
then
return
end
sg
:
Merge
(
syncG
)
sync
=
syncG
:
GetFirst
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SMATERIAL
)
local
mg
=
Group
.
FromCards
(
c
)
mg
:
Select
(
tp
,
1
,
1
,
nil
)
g
:
RemoveCard
(
c
)
local
lv
=
sync
:
GetLevel
()
-
c
:
GetLevel
()
local
flag
=
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
c
)
<
1
local
fmat
=
g
:
FilterSelect
(
tp
,
c1151001
.
matfilter
,
1
,
1
,
c
,
g
,
tp
,
lv
,
c
,
flag
):
GetFirst
()
local
val
=
c1151001
.
synLvfilter
(
fmat
,
sync
)
mg
:
AddCard
(
fmat
)
g
:
RemoveCard
(
fmat
)
lv
=
lv
-
val
if
lv
>
1
then
local
temp
=
g
:
SelectWithSumEqual
(
tp
,
c1151001
.
synLvfilter
,
lv
,
1
,
99
,
sync
)
mg
:
Merge
(
temp
)
end
sync
:
SetMaterial
(
mg
)
Duel
.
SendtoGrave
(
mg
,
REASON_MATERIAL
+
REASON_SYNCHRO
)
sync
:
CompleteProcedure
()
end
--
function
c1151001
.
tfilter1
(
c
)
return
(((
c
:
IsType
(
TYPE_SPELL
)
or
c
:
IsType
(
TYPE_TRAP
))
and
c1151001
.
IsLeisp
(
c
))
or
(
c
:
IsType
(
TYPE_MONSTER
)
and
c1151001
.
IsFulan
(
c
)))
and
c
:
IsAbleToHand
()
end
function
c1151001
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c1151001
.
tfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
GetFlagEffect
(
1151001
)
==
0
end
end
--
function
c1151001
.
ofilter1
(
c
)
return
c
:
IsRace
(
RACE_FIEND
)
end
function
c1151001
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
c
=
e
:
GetHandler
()
if
eg
:
IsExists
(
c1151001
.
ofilter1
,
1
,
e
:
GetHandler
())
and
not
c
:
IsDisabled
()
then
Duel
.
Hint
(
HINT_CARD
,
0
,
1151001
)
c
:
RegisterFlagEffect
(
1151001
,
RESET_EVENT
+
0x1fe0000
,
0
,
1
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c1151001
.
tfilter1
,
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
end
expansions/script/c1151003.lua
0 → 100644
View file @
52888c11
--红之恶魔·蕾米莉亚
function
c1151003
.
initial_effect
(
c
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_GRAVE
)
e1
:
SetCountLimit
(
1
,
1151003
)
e1
:
SetCost
(
c1151003
.
cost1
)
e1
:
SetTarget
(
c1151003
.
tg1
)
e1
:
SetOperation
(
c1151003
.
op1
)
c
:
RegisterEffect
(
e1
)
--
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
1151003
,
0
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCost
(
c1151003
.
cost2
)
e2
:
SetTarget
(
c1151003
.
tg2
)
e2
:
SetOperation
(
c1151003
.
op2
)
c
:
RegisterEffect
(
e2
)
--
end
--
c1151003
.
named_with_Leimi
=
1
function
c1151003
.
IsLeimi
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
named_with_Leimi
end
c1151003
.
named_with_Leisp
=
1
function
c1151003
.
IsLeisp
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
c
.
named_with_Leisp
end
--
function
c1151003
.
cfilter
(
c
)
return
c
:
IsAbleToDeck
()
end
function
c1151003
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c1151003
.
cfilter1
,
tp
,
LOCATION_SZONE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c1151003
.
cfilter1
,
tp
,
LOCATION_SZONE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_EFFECT
)
end
end
--
function
c1151003
.
tg1
(
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
,
tp
,
LOCATION_GRAVE
)
end
--
function
c1151003
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsLocation
(
LOCATION_GRAVE
)
then
if
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
~=
0
then
local
e1_1
=
Effect
.
CreateEffect
(
c
)
e1_1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e1_1
:
SetCode
(
EVENT_LEAVE_FIELD
)
e1_1
:
SetReset
(
RESET_EVENT
+
0x01020000
)
e1_1
:
SetCondition
(
c1151003
.
con1_1
)
e1_1
:
SetOperation
(
c1151003
.
op1_1
)
c
:
RegisterEffect
(
e1_1
)
local
e1_2
=
Effect
.
CreateEffect
(
c
)
e1_2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1_2
:
SetCode
(
EFFECT_LEAVE_FIELD_REDIRECT
)
e1_2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1_2
:
SetReset
(
RESET_EVENT
+
0x47e0000
)
e1_2
:
SetValue
(
LOCATION_REMOVED
)
c
:
RegisterEffect
(
e1_2
,
true
)
end
end
end
function
c1151003
.
con1_1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsPreviousPosition
(
POS_FACEUP
)
end
function
c1151003
.
op1_1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
1151990
,
0
,
0x4011
,
200
,
200
,
1
,
RACE_FIEND
,
ATTRIBUTE_DARK
)
then
Duel
.
Hint
(
HINT_CARD
,
0
,
1151003
)
local
token
=
Duel
.
CreateToken
(
tp
,
1151990
)
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
--
function
c1151003
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
e
:
SetLabel
(
1
)
if
chk
==
0
then
return
true
end
end
function
c1151003
.
tfilter2
(
c
,
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
c
:
GetType
()
==
TYPE_SPELL
and
c
:
IsAbleToRemoveAsCost
()
and
c1151003
.
IsLeisp
(
c
)
then
if
c
:
CheckActivateEffect
(
true
,
true
,
false
)
~=
nil
then
return
true
end
local
te
=
c
:
GetActivateEffect
()
local
con
=
te
:
GetCondition
()
if
con
and
not
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
then
return
false
end
local
tg
=
te
:
GetTarget
()
if
tg
and
not
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
0
)
then
return
false
end
end
return
false
end
--
function
c1151003
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
te
=
e
:
GetLabelObject
()
if
not
te
then
return
end
e
:
SetLabelObject
(
te
:
GetLabelObject
())
local
op
=
te
:
GetOperation
()
if
op
then
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
then
Duel
.
MoveToField
(
e
:
GetHandler
(),
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
local
e2_1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2_1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e2_1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2_1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2_1
:
SetReset
(
RESET_EVENT
+
0x1fc0000
)
e2_1
:
SetValue
(
TYPE_SPELL
+
TYPE_CONTINUOUS
)
e
:
GetHandler
():
RegisterEffect
(
e2_1
,
true
)
end
end
--
function
c1151003
.
tg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
e
:
GetLabel
()
==
0
then
return
false
end
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
false
end
e
:
SetLabel
(
0
)
return
Duel
.
IsExistingMatchingCard
(
c1151003
.
tfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c1151003
.
tfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
g
:
GetFirst
()
local
te
,
ceg
,
cep
,
cev
,
cre
,
cr
,
crp
local
fchain
=
c1151003
.
tfilter2
(
tc
)
if
fchain
then
te
,
ceg
,
cep
,
cev
,
cre
,
cr
,
crp
=
tc
:
CheckActivateEffect
(
true
,
true
,
true
)
else
te
=
tc
:
GetActivateEffect
()
end
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
e
:
SetCategory
(
te
:
GetCategory
())
e
:
SetProperty
(
te
:
GetProperty
())
local
tg
=
te
:
GetTarget
()
if
tg
then
if
fchain
then
tg
(
e
,
tp
,
ceg
,
cep
,
cev
,
cre
,
cr
,
crp
,
1
)
else
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
1
)
end
end
te
:
SetLabelObject
(
e
:
GetLabelObject
())
e
:
SetLabelObject
(
te
)
end
--
\ No newline at end of file
expansions/script/c1151005.lua
0 → 100644
View file @
52888c11
--浓雾的吸血鬼·蕾米莉亚
function
c1151005
.
initial_effect
(
c
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
1151005
,
3
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetTarget
(
c1151005
.
tg1
)
e1
:
SetOperation
(
c1151005
.
op1
)
c
:
RegisterEffect
(
e1
)
--
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
1151005
,
2
))
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
1151006
)
e2
:
SetTarget
(
c1151005
.
tg2
)
e2
:
SetOperation
(
c1151005
.
op2
)
c
:
RegisterEffect
(
e2
)
--
end
--
c1151005
.
named_with_Leimi
=
1
function
c1151005
.
IsLeimi
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
named_with_Leimi
end
function
c1151005
.
IsLeisp
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
c
.
named_with_Leisp
end
--
function
c1151005
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
>
0
end
end
--
function
c1151005
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
1151005
,
0
))
local
tc
=
Duel
.
GetDecktopGroup
(
tp
,
1
):
GetFirst
()
local
t
=
0
local
opt
=
Duel
.
SelectOption
(
tp
,
70
,
71
,
72
)
if
opt
==
0
then
t
=
TYPE_MONSTER
else
if
opt
==
1
then
t
=
TYPE_SPELL
else
t
=
TYPE_TRAP
end
end
Duel
.
ConfirmDecktop
(
tp
,
1
)
Duel
.
ShuffleDeck
(
tp
)
if
tc
:
IsType
(
t
)
and
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_DECK
)
>
0
then
if
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_DECK
)
==
1
then
Duel
.
SortDecktop
(
tp
,
1
-
tp
,
1
)
else
Duel
.
SortDecktop
(
tp
,
1
-
tp
,
2
)
end
if
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
e
:
GetHandler
(),
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
else
if
e
:
GetHandler
():
IsAbleToHand
()
then
Duel
.
SendtoHand
(
e
:
GetHandler
(),
nil
,
REASON_EFFECT
)
end
end
end
end
--
function
c1151005
.
tfilter2
(
c
)
return
c1151005
.
IsLeisp
(
c
)
and
c
:
IsType
(
TYPE_SPELL
)
end
function
c1151005
.
tg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
c1151005
.
tfilter2
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c1151005
.
tfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
1151005
,
1
))
local
g
=
Duel
.
SelectTarget
(
tp
,
c1151005
.
tfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
end
--
function
c1151005
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsLocation
(
LOCATION_GRAVE
)
then
local
e2_1
=
Effect
.
CreateEffect
(
tc
)
e2_1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2_1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e2_1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2_1
:
SetValue
(
TYPE_CONTINUOUS
+
TYPE_SPELL
)
e2_1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e2_1
,
true
)
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
local
e2_2
=
Effect
.
CreateEffect
(
tc
)
e2_2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2_2
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
+
EFFECT_FLAG_CANNOT_DISABLE
)
e2_2
:
SetCode
(
EFFECT_CHANGE_CODE
)
e2_2
:
SetRange
(
LOCATION_SZONE
)
e2_2
:
SetValue
(
1151999
)
e2_2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e2_2
,
true
)
local
e2_3
=
Effect
.
CreateEffect
(
tc
)
e2_3
:
SetType
(
EFFECT_TYPE_FIELD
)
e2_3
:
SetCode
(
EFFECT_SPSUMMON_PROC_G
)
e2_3
:
SetRange
(
LOCATION_SZONE
)
e2_3
:
SetCountLimit
(
1
,
1151999
)
e2_3
:
SetCondition
(
c1151005
.
con2_3
)
e2_3
:
SetOperation
(
c1151005
.
op2_3
)
e2_3
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e2_3
,
true
)
end
end
--
function
c1151005
.
cfilter2_3
(
c
,
e
,
tp
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
c
:
GetLevel
()
<
5
and
c
:
IsRace
(
RACE_FIEND
)
end
function
c1151005
.
con2_3
(
e
,
c
,
og
)
local
tp
=
e
:
GetHandlerPlayer
()
local
c
=
e
:
GetHandler
()
return
Duel
.
IsExistingMatchingCard
(
c1151005
.
cfilter2_3
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
and
c
:
IsFaceup
()
and
not
c
:
IsDisabled
()
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
end
--
function
c1151005
.
op2_3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
,
sg
,
og
)
local
c
=
e
:
GetHandler
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c1151005
.
cfilter2_3
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
sg
:
Merge
(
g
)
end
--
expansions/script/c1151101.lua
0 → 100644
View file @
52888c11
--蕾米莉亚·斯卡蕾特
function
c1151101
.
initial_effect
(
c
)
--
aux
.
AddSynchroProcedure
(
c
,
c1151101
.
filter0_1
,
c1151101
.
filter0_2
,
1
)
c
:
EnableReviveLimit
()
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
1151101
,
0
))
e1
:
SetCategory
(
CATEGORY_TODECK
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
1151101
)
e1
:
SetTarget
(
c1151101
.
tg1
)
e1
:
SetOperation
(
c1151101
.
op1
)
c
:
RegisterEffect
(
e1
)
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_CANNOT_BE_EFFECT_TARGET
)
e3
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetValue
(
aux
.
tgoval
)
c
:
RegisterEffect
(
e3
)
--
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
1151101
,
1
))
e4
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_TOGRAVE
+
CATEGORY_DESTROY
)
e4
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e4
:
SetCode
(
EVENT_FREE_CHAIN
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCountLimit
(
1
,
1151102
)
e4
:
SetTarget
(
c1151101
.
tg4
)
e4
:
SetOperation
(
c1151101
.
op4
)
c
:
RegisterEffect
(
e4
)
--
end
--
c1151101
.
named_with_Leimi
=
1
function
c1151101
.
IsLeimi
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
named_with_Leimi
end
function
c1151101
.
IsLeisp
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
c
.
named_with_Leisp
end
--
function
c1151101
.
filter0_1
(
c
)
return
c1151101
.
IsLeimi
(
c
)
and
c
:
IsType
(
TYPE_TUNER
)
end
function
c1151101
.
filter0_2
(
c
)
return
c
:
IsRace
(
RACE_FIEND
)
end
--
function
c1151101
.
tfilter1
(
c
)
return
c
:
IsAbleToDeck
()
end
function
c1151101
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c1151101
.
tfilter1
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
nil
,
1
,
0
,
LOCATION_GRAVE
)
end
--
function
c1151101
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c1151101
.
tfilter1
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoDeck
(
g
,
nil
,
0
,
REASON_EFFECT
)
end
end
end
--
function
c1151101
.
tg4
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
>
0
end
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
aux
.
Stringid
(
1151101
,
2
))
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
0
)
local
ac
=
Duel
.
AnnounceCard
(
tp
)
e
:
SetLabel
(
ac
)
end
--
function
c1151101
.
ofilter4
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c1151101
.
op4
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
or
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
:
GetCode
()
==
e
:
GetLabel
()
and
tc
:
IsAbleToHand
()
then
Duel
.
DisableShuffleCheck
()
if
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
~=
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
if
Duel
.
IsExistingMatchingCard
(
c1151101
.
ofilter4
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
c1151101
.
ofilter4
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g2
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g2
,
REASON_EFFECT
)
end
end
Duel
.
ShuffleHand
(
tp
)
end
else
Duel
.
DisableShuffleCheck
()
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
end
end
--
expansions/script/c1151201.lua
View file @
52888c11
...
...
@@ -3,12 +3,10 @@ function c1151201.initial_effect(c)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
1151201
,
0
))
e1
:
SetCategory
(
CATEGORY_TODECK
)
e1
:
SetCategory
(
CATEGORY_TO
HAND
+
CATEGORY_TO
DECK
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
1151201
)
e1
:
SetCost
(
c1151201
.
cost1
)
e1
:
SetCondition
(
c1151201
.
con1
)
e1
:
SetTarget
(
c1151201
.
tg1
)
e1
:
SetOperation
(
c1151201
.
op1
)
c
:
RegisterEffect
(
e1
)
...
...
@@ -19,7 +17,6 @@ function c1151201.initial_effect(c)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e2
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetCountLimit
(
1
,
1151200
)
e2
:
SetCondition
(
c1151201
.
con2
)
e2
:
SetTarget
(
c1151201
.
tg2
)
e2
:
SetOperation
(
c1151201
.
op2
)
...
...
@@ -38,41 +35,46 @@ function c1151201.IsLeisp(c)
end
--
function
c1151201
.
cfilter1
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
return
c
:
Is
Race
(
RACE_FIEND
)
and
c
:
Is
Type
(
TYPE_MONSTER
)
end
function
c1151201
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckReleaseGroup
(
tp
,
c1151201
.
cfilter2
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_
RELEASE
)
local
g
=
Duel
.
Select
ReleaseGroup
(
tp
,
c1151201
.
cfilter2
,
1
,
1
,
nil
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c1151201
.
cfilter1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_
SELF
)
local
g
=
Duel
.
Select
MatchingCard
(
tp
,
c1151201
.
cfilter1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Release
(
g
,
REASON_EFFECT
)
end
end
--
function
c1151201
.
con1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
tp
==
Duel
.
GetTurnPlayer
()
local
tc
=
g
:
GetFirst
()
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
local
e1_1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1_1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1_1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1_1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1_1
:
SetValue
(
TYPE_SPELL
+
TYPE_CONTINUOUS
)
e1_1
:
SetReset
(
RESET_EVENT
+
0x1fc0000
)
tc
:
RegisterEffect
(
e1_1
,
true
)
end
end
--
function
c1151201
.
tfilter1
(
c
)
return
c
:
IsAbleTo
Deck
()
return
c
:
IsAbleTo
Hand
()
end
function
c1151201
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c1151201
.
tfilter1
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TO
DECK
,
nil
,
0
,
0
,
LOCATION_ONFIELD
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TO
HAND
,
nil
,
1
,
0
,
LOCATION_ONFIELD
)
end
--
function
c1151201
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_
TODECK
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_
OPPO
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c1151201
.
tfilter1
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
2
,
nil
)
if
g
:
GetCount
()
>
0
then
if
Duel
.
SendtoDeck
(
g
,
nil
,
0
,
REASON_EFFECT
)
~=
0
and
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_DECK
)
>
0
then
Duel
.
BreakEffect
()
if
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_DECK
)
==
1
then
Duel
.
SortDecktop
(
tp
,
1
-
tp
,
1
)
else
Duel
.
SortDecktop
(
tp
,
1
-
tp
,
2
)
end
end
if
g
:
GetCount
()
==
1
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
else
if
g
:
GetCount
()
>
1
then
local
tg
=
g
:
RandomSelect
(
tp
,
1
,
1
,
nil
)
local
tc
=
tg
:
GetFirst
()
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
g
:
RemoveCard
(
tc
)
Duel
.
SendtoDeck
(
g
,
nil
,
0
,
REASON_EFFECT
)
end
end
end
--
...
...
@@ -80,69 +82,30 @@ function c1151201.con2(e,tp,eg,ep,ev,re,r,rp)
return
Duel
.
IsChainNegatable
(
ev
)
and
rp
~=
tp
end
--
function
c1151201
.
tfilter2
(
c
)
return
c
:
IsAttribute
(
ATTRIBUTE_DARK
)
and
c
:
IsRace
(
RACE_FIEND
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c1151201
.
tg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c1151201
.
tfilter2
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_NEGATE
,
eg
,
1
,
0
,
0
)
end
--
function
c1151201
.
ofilter2
(
c
)
return
c
:
IsRace
(
RACE_FIEND
)
end
function
c1151201
.
ofilter2x
(
c
)
return
c
:
IsAbleToRemove
()
or
c
:
IsAbleToGrave
()
end
function
c1151201
.
ofilter2x1
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c1151201
.
ofilter2x2
(
c
)
return
c
:
IsAbleToRemove
()
end
function
c1151201
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
NegateActivation
(
ev
)
and
Duel
.
CheckReleaseGroup
(
tp
,
c1151201
.
ofilter2
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c1151201
.
ofilter2x
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
1151201
,
2
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
local
g2
=
Duel
.
SelectReleaseGroup
(
tp
,
c1151201
.
ofilter2
,
1
,
1
,
nil
)
if
g2
:
GetCount
()
>
0
then
if
Duel
.
Release
(
g2
,
REASON_EFFECT
)
~=
0
then
if
Duel
.
IsExistingMatchingCard
(
c1151201
.
ofilter2x1
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
and
not
Duel
.
IsExistingMatchingCard
(
c1151201
.
ofilter2x2
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
then
local
sel
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
1151201
,
3
))
if
sel
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c1151201
.
ofilter2x1
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
end
else
if
Duel
.
IsExistingMatchingCard
(
c1151201
.
ofilter2x1
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c1151201
.
ofilter2x2
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
then
local
sel
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
1151201
,
3
),
aux
.
Stringid
(
1151201
,
4
))
if
sel
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c1151201
.
ofilter2x1
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c1151201
.
ofilter2x2
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
else
if
not
Duel
.
IsExistingMatchingCard
(
c1151201
.
ofilter2x1
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c1151201
.
ofilter2x2
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
then
local
sel
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
1151201
,
4
))
if
sel
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c1151201
.
ofilter2x2
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
end
end
end
end
end
if
Duel
.
NegateActivation
(
ev
)
then
local
tc
=
re
:
GetHandler
()
local
code
=
tc
:
GetCode
()
local
e2_1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2_1
:
SetType
(
EFFECT_TYPE_FIELD
)
e2_1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2_1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e2_1
:
SetTargetRange
(
0
,
1
)
e2_1
:
SetValue
(
c1151201
.
limit2_1
)
e2_1
:
SetLabel
(
code
)
e2_1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e2_1
,
tp
)
end
end
function
c1151201
.
limit2_1
(
e
,
re
)
return
re
:
GetHandler
():
GetCode
()
==
e
:
GetLabel
()
end
--
\ No newline at end of file
expansions/script/c1151203.lua
0 → 100644
View file @
52888c11
--冥符『红色的冥界』
function
c1151203
.
initial_effect
(
c
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCost
(
c1151203
.
cost1
)
e1
:
SetTarget
(
c1151203
.
tg1
)
e1
:
SetOperation
(
c1151203
.
op1
)
c
:
RegisterEffect
(
e1
)
--
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_TOGRAVE
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCost
(
c1151203
.
cost2
)
e2
:
SetTarget
(
c1151203
.
tg2
)
e2
:
SetOperation
(
c1151203
.
op2
)
c
:
RegisterEffect
(
e2
)
--
end
--
function
c1151203
.
IsLeimi
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
named_with_Leimi
end
function
c1151203
.
IsLeisp
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
c
.
named_with_Leisp
end
--
function
c1151203
.
cfilter1
(
c
)
return
c
:
IsRace
(
RACE_FIEND
)
and
c
:
IsAttribute
(
ATTRIBUTE_DARK
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
GetAttack
()
==
1800
and
c
:
IsAbleToGraveAsCost
()
end
function
c1151203
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c1151203
.
cfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c1151203
.
cfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
end
--
function
c1151203
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
1151990
,
0
,
0x4011
,
200
,
200
,
1
,
RACE_FIEND
,
ATTRIBUTE_DARK
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
end
--
function
c1151203
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
1151990
,
0
,
0x4011
,
200
,
200
,
1
,
RACE_FIEND
,
ATTRIBUTE_DARK
)
then
local
token
=
Duel
.
CreateToken
(
tp
,
1151990
)
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
e
:
GetHandler
():
CancelToGrave
()
end
--
function
c1151203
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToRemoveAsCost
()
end
Duel
.
Remove
(
e
:
GetHandler
(),
POS_FACEUP
,
REASON_COST
)
end
--
function
c1151203
.
tfilter2
(
c
)
return
c
:
IsAbleToDeck
()
and
not
c
:
IsCode
(
1151203
)
end
function
c1151203
.
tg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c1151203
.
tfilter2
,
tp
,
LOCATION_REMOVED
,
0
,
2
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
nil
,
1
,
tp
,
LOCATION_REMOVED
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_REMOVED
)
end
--
function
c1151203
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
IsExistingMatchingCard
(
c1151203
.
tfilter2
,
tp
,
LOCATION_REMOVED
,
0
,
2
,
nil
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SELF
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c1151203
.
tfilter2
,
tp
,
LOCATION_REMOVED
,
0
,
2
,
2
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
local
tg
=
g
:
RandomSelect
(
tp
,
1
,
1
,
nil
)
local
tc
=
tg
:
GetFirst
()
g
:
RemoveCard
(
tc
)
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
+
REASON_RETURN
)
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_EFFECT
)
end
end
end
expansions/script/c1151205.lua
0 → 100644
View file @
52888c11
--神术『吸血鬼幻想』
function
c1151205
.
initial_effect
(
c
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
c1151205
.
tg1
)
e1
:
SetOperation
(
c1151205
.
op1
)
c
:
RegisterEffect
(
e1
)
--
end
--
function
c1151205
.
IsLeimi
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
named_with_Leimi
end
c1151205
.
named_with_Leisp
=
1
function
c1151205
.
IsLeisp
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
c
.
named_with_Leisp
end
function
c1151205
.
IsFulan
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
named_with_Fulan
end
--
function
c1151205
.
tfilter1_1
(
c
)
return
c1151205
.
IsLeimi
(
c
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
c1151205
.
tfilter1_2
(
c
)
return
(
c1151205
.
IsLeisp
(
c
)
and
(
c
:
IsType
(
TYPE_SPELL
)
or
c
:
IsType
(
TYPE_TRAP
))
and
c
:
IsAbleToHand
()
and
not
c
:
IsCode
(
1151205
))
or
(
c1151205
.
IsFulan
(
c
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
())
end
function
c1151205
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
(
Duel
.
IsExistingMatchingCard
(
c1151205
.
tfilter1_1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
not
Duel
.
IsExistingMatchingCard
(
c1151205
.
ofilter1_1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
))
or
Duel
.
IsExistingMatchingCard
(
c1151205
.
ofilter1_2
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
--
function
c1151205
.
ofilter1_1
(
c
)
return
c1151205
.
IsLeimi
(
c
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsFaceup
()
end
function
c1151205
.
ofilter1_2
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsRace
(
RACE_FIEND
)
and
c
:
GetLevel
()
>
0
end
function
c1151205
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
Duel
.
IsExistingMatchingCard
(
c1151205
.
ofilter1_1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
then
if
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
<
1
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
c1151205
.
tfilter1_1
,
tp
,
LOCATION_DECK
,
0
,
nil
)
local
dcount
=
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
local
seq
=-
1
local
tc
=
g
:
GetFirst
()
local
spcard
=
nil
while
tc
do
if
tc
:
GetSequence
()
>
seq
then
seq
=
tc
:
GetSequence
()
spcard
=
tc
end
tc
=
g
:
GetNext
()
end
if
seq
==-
1
then
Duel
.
ConfirmDecktop
(
tp
,
dcount
)
Duel
.
ShuffleDeck
(
tp
)
return
end
Duel
.
ConfirmDecktop
(
tp
,
dcount
-
seq
)
if
spcard
:
IsAbleToHand
()
then
Duel
.
SendtoHand
(
spcard
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
spcard
)
end
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c1151205
.
ofilter1_2
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
local
tc
=
g
:
GetFirst
()
Duel
.
Hint
(
HINT_SELECTMSG
,
1
-
tp
,
567
)
local
lv
=
Duel
.
AnnounceNumber
(
tp
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
)
local
e1_3
=
Effect
.
CreateEffect
(
tc
)
e1_3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1_3
:
SetCode
(
EFFECT_CHANGE_LEVEL
)
e1_3
:
SetValue
(
lv
)
e1_3
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1_3
)
if
Duel
.
IsExistingMatchingCard
(
c1151205
.
tfilter1_2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
tc
:
GetLevel
()
==
lv
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
1151205
,
0
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c1151205
.
tfilter1_2
,
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
end
end
end
expansions/script/c1151212.lua
0 → 100644
View file @
52888c11
--必杀『碎心』
function
c1151212
.
initial_effect
(
c
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_TODECK
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
c1151212
.
tg1
)
e1
:
SetOperation
(
c1151212
.
op1
)
c
:
RegisterEffect
(
e1
)
--
end
--
function
c1151212
.
IsLeimi
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
named_with_Leimi
end
c1151212
.
named_with_Leisp
=
1
function
c1151212
.
IsLeisp
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
c
.
named_with_Leisp
end
--
function
c1151212
.
tfilter1
(
c
)
return
c1151212
.
IsLeimi
(
c
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsFaceup
()
end
function
c1151212
.
tfilter1x
(
c
)
return
(
c
:
IsAbleToDeck
()
or
c
:
IsDestructable
())
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c1151212
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_ONFIELD
)
and
chkc
:
IsControler
(
1
-
tp
)
and
c1151212
.
tfilter1x
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c1151212
.
tfilter1
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
Duel
.
IsExistingTarget
(
c1151212
.
tfilter1x
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_OPPO
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c1151212
.
tfilter1x
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
end
--
function
c1151212
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
and
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsLocation
(
LOCATION_MZONE
)
and
not
tc
:
IsImmuneToEffect
(
e
)
then
local
code
=
tc
:
GetCode
()
if
tc
:
IsDestructable
()
and
not
tc
:
IsAbleToDeck
()
then
local
sel
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
1151212
,
0
))
if
sel
==
0
then
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
end
else
if
tc
:
IsDestructable
()
and
tc
:
IsAbleToDeck
()
then
local
sel
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
1151212
,
0
),
aux
.
Stringid
(
1151212
,
1
))
if
sel
==
0
then
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
else
Duel
.
SendtoDeck
(
tc
,
nil
,
1
,
REASON_EFFECT
)
end
else
if
not
tc
:
IsDestructable
()
and
tc
:
IsAbleToDeck
()
then
local
sel
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
1151212
,
1
))
if
sel
==
0
then
Duel
.
SendtoDeck
(
tc
,
1
,
REASON_EFFECT
)
end
end
end
end
local
e1_1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1_1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1_1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1_1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1_1
:
SetTargetRange
(
0
,
1
)
e1_1
:
SetTarget
(
c1151212
.
limit1_1
)
e1_1
:
SetLabel
(
code
)
e1_1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1_1
,
tp
)
end
end
function
c1151212
.
limit1_1
(
e
,
c
,
sump
,
sumtype
,
sumpos
,
targetp
,
se
)
return
c
:
IsCode
(
e
:
GetLabel
())
end
--
expansions/script/c1151214.lua
0 → 100644
View file @
52888c11
--神枪『冈格尼尔之枪』
function
c1151214
.
initial_effect
(
c
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_DRAW
+
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
1151214
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetTarget
(
c1151214
.
tg1
)
e1
:
SetOperation
(
c1151214
.
op1
)
c
:
RegisterEffect
(
e1
)
--
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_EQUIP
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
1151215
)
e2
:
SetTarget
(
c1151214
.
tg2
)
e2
:
SetOperation
(
c1151214
.
op2
)
c
:
RegisterEffect
(
e2
)
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e3
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e3
:
SetValue
(
c1151214
.
limit3
)
c
:
RegisterEffect
(
e3
)
--
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e4
:
SetCode
(
EVENT_EQUIP
)
e4
:
SetRange
(
LOCATION_SZONE
)
e4
:
SetOperation
(
c1151214
.
op4
)
c
:
RegisterEffect
(
e4
)
--
end
--
function
c1151214
.
IsLeimi
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
named_with_Leimi
end
c1151214
.
named_with_Leisp
=
1
function
c1151214
.
IsLeisp
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
c
.
named_with_Leisp
end
--
function
c1151214
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroupCount
(
aux
.
TRUE
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
local
g2
=
Duel
.
GetMatchingGroupCount
(
aux
.
TRUE
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
g
>=
g2
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c1151214
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
~=
0
then
local
tc
=
Duel
.
GetOperatedGroup
():
GetFirst
()
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
if
(
tc
:
IsAttribute
(
ATTRIBUTE_DARK
)
and
tc
:
IsRace
(
RACE_FIEND
))
then
if
Duel
.
GetMatchingGroupCount
(
Card
.
IsDestructable
,
tp
,
0
,
LOCATION_ONFIELD
,
nil
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
1151214
,
0
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
dg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsDestructable
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
Destroy
(
dg
,
REASON_EFFECT
)
end
else
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
end
end
Duel
.
ShuffleHand
(
tp
)
end
--
function
c1151214
.
tfilter2
(
c
)
return
c
:
IsFaceup
()
and
c1151214
.
IsLeimi
(
c
)
end
function
c1151214
.
tg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
c1151214
.
tfilter2
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
IsExistingTarget
(
c1151214
.
tfilter2
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
c1151214
.
tfilter2
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
end
--
function
c1151214
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
local
tc
=
Duel
.
GetFirstTarget
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
tc
:
IsFaceup
()
and
tc
:
IsRelateToEffect
(
e
)
then
local
e2_1
=
Effect
.
CreateEffect
(
c
)
e2_1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2_1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e2_1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2_1
:
SetValue
(
TYPE_EQUIP
+
TYPE_SPELL
)
e2_1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
c
:
RegisterEffect
(
e2_1
,
true
)
Duel
.
Equip
(
tp
,
c
,
tc
,
true
)
local
e2_2
=
Effect
.
CreateEffect
(
c
)
e2_2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2_2
:
SetCode
(
EFFECT_LEAVE_FIELD_REDIRECT
)
e2_2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2_2
:
SetReset
(
RESET_EVENT
+
0x47e0000
)
e2_2
:
SetValue
(
LOCATION_REMOVED
)
c
:
RegisterEffect
(
e2_2
,
true
)
end
end
end
--
function
c1151214
.
limit3
(
e
,
c
)
return
c1151214
.
IsLeimi
(
c
)
end
--
function
c1151214
.
op4
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
eg
:
GetFirst
()
~=
e
:
GetHandler
()
then
return
end
local
tc
=
e
:
GetHandler
():
GetEquipTarget
()
if
tc
then
local
e4_1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e4_1
:
SetDescription
(
aux
.
Stringid
(
1151214
,
0
))
e4_1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_TODECK
)
e4_1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e4_1
:
SetRange
(
LOCATION_MZONE
)
e4_1
:
SetCode
(
EVENT_BATTLE_DAMAGE
)
e4_1
:
SetLabelObject
(
e
:
GetHandler
())
e4_1
:
SetCondition
(
c1151214
.
con4_1
)
e4_1
:
SetTarget
(
c1151214
.
tg4_1
)
e4_1
:
SetOperation
(
c1151214
.
op4_1
)
tc
:
RegisterEffect
(
e4_1
,
true
)
if
e4_1
:
GetHandler
()
==
nil
then
return
end
end
end
--
function
c1151214
.
con4_1
(
e
)
local
g
=
e
:
GetHandler
():
GetEquipGroup
()
if
g
:
IsContains
(
e
:
GetLabelObject
())
then
return
not
e
:
GetLabelObject
():
IsDisabled
()
else
return
false
end
end
--
function
c1151214
.
tfilter4_1
(
c
)
return
c
:
IsAbleToHand
()
end
function
c1151214
.
tg4_1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c1151214
.
tfilter4_1
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
0
,
1
,
0
,
LOCATION_GRAVE
)
end
--
function
c1151214
.
ofilter4_1
(
c
)
return
c
:
IsAbleToDeck
()
end
function
c1151214
.
op4_1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c1151214
.
tfilter4_1
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
if
Duel
.
SendtoHand
(
g
,
1
-
tp
,
REASON_EFFECT
)
~=
0
and
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_HAND
)
>
0
then
local
g2
=
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_HAND
)
if
g2
:
GetCount
()
>
0
then
Duel
.
ConfirmCards
(
tp
,
g2
)
local
g3
=
Duel
.
SelectMatchingCard
(
tp
,
c1151214
.
ofilter4_1
,
tp
,
0
,
LOCATION_HAND
,
1
,
1
,
nil
)
if
g3
:
GetCount
()
>
0
then
local
sel
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
1151214
,
1
),
aux
.
Stringid
(
1151214
,
2
))
if
sel
==
0
then
Duel
.
SendtoDeck
(
g3
,
nil
,
2
,
REASON_EFFECT
)
else
Duel
.
SendtoDeck
(
g3
,
nil
,
1
,
REASON_EFFECT
)
end
end
end
end
end
end
----
expansions/script/c1151216.lua
0 → 100644
View file @
52888c11
--红蝙蝠『吸血鬼之夜』
function
c1151216
.
initial_effect
(
c
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCost
(
c1151216
.
cost1
)
e1
:
SetCondition
(
c1151216
.
con1
)
e1
:
SetTarget
(
c1151216
.
tg1
)
e1
:
SetOperation
(
c1151216
.
op1
)
c
:
RegisterEffect
(
e1
)
--
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCost
(
c1151216
.
cost2
)
e2
:
SetTarget
(
c1151216
.
tg2
)
e2
:
SetOperation
(
c1151216
.
op2
)
c
:
RegisterEffect
(
e2
)
--
Duel
.
AddCustomActivityCounter
(
1151216
,
ACTIVITY_SUMMON
,
c1151216
.
counterfilter
)
Duel
.
AddCustomActivityCounter
(
1151217
,
ACTIVITY_SPSUMMON
,
c1151216
.
counterfilter
)
--
end
--
function
c1151216
.
IsLeimi
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
named_with_Leimi
end
function
c1151216
.
IsLeisp
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
c
.
named_with_Leisp
end
--
function
c1151216
.
counterfilter
(
c
)
return
c
:
IsAttribute
(
ATTRIBUTE_DARK
)
and
c
:
IsRace
(
RACE_FIEND
)
end
--
function
c1151216
.
cfilter1
(
c
)
return
c
:
IsRace
(
RACE_FIEND
)
and
c
:
IsFaceup
()
end
function
c1151216
.
con1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
c1151216
.
cfilter1
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
--
function
c1151216
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckLPCost
(
tp
,
1200
)
and
Duel
.
GetCustomActivityCount
(
1151216
,
tp
,
ACTIVITY_SUMMON
)
==
0
and
Duel
.
GetCustomActivityCount
(
1151217
,
tp
,
ACTIVITY_SPSUMMON
)
==
0
end
local
e1_1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1_1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1_1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_OATH
)
e1_1
:
SetCode
(
EFFECT_CANNOT_SUMMON
)
e1_1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1_1
:
SetTargetRange
(
1
,
0
)
e1_1
:
SetTarget
(
c1151216
.
splimit1_1
)
Duel
.
RegisterEffect
(
e1_1
,
tp
)
local
e1_2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1_2
:
SetType
(
EFFECT_TYPE_FIELD
)
e1_2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_OATH
)
e1_2
:
SetCode
(
EFFECT_CANNOT_SUMMON
)
e1_2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1_2
:
SetTargetRange
(
1
,
0
)
e1_2
:
SetTarget
(
c1151216
.
splimit1_1
)
Duel
.
RegisterEffect
(
e1_2
,
tp
)
Duel
.
PayLPCost
(
tp
,
1200
)
end
function
c1151216
.
splimit1_1
(
e
,
c
)
return
not
(
c
:
IsAttribute
(
ATTRIBUTE_DARK
)
and
c
:
IsRace
(
RACE_FIEND
))
end
--
function
c1151216
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
1151990
,
0
,
0x4011
,
200
,
200
,
1
,
RACE_FIEND
,
ATTRIBUTE_DARK
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
end
--
function
c1151216
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
1151990
,
0
,
0x4011
,
200
,
200
,
1
,
RACE_FIEND
,
ATTRIBUTE_DARK
)
then
local
ft
=
2
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
59822133
)
then
ft
=
1
end
for
i
=
1
,
ft
do
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
local
token
=
Duel
.
CreateToken
(
tp
,
1151990
)
Duel
.
SpecialSummonStep
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
Duel
.
SpecialSummonComplete
()
end
end
--
function
c1151216
.
cfilter2
(
c
)
return
c
:
IsRace
(
RACE_FIEND
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c1151216
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToRemoveAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c1151216
.
cfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c1151216
.
cfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
local
tc
=
g
:
GetFirst
()
g
:
AddCard
(
e
:
GetHandler
())
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
local
e2_4
=
Effect
.
CreateEffect
(
tc
)
e2_4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2_4
:
SetRange
(
LOCATION_REMOVED
)
e2_4
:
SetCode
(
EVENT_PHASE
+
PHASE_STANDBY
)
e2_4
:
SetCountLimit
(
1
)
e2_4
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_STANDBY
+
RESET_SELF_TURN
)
e2_4
:
SetCondition
(
c1151216
.
con2_4
)
e2_4
:
SetOperation
(
c1151216
.
op2_4
)
tc
:
RegisterEffect
(
e2_4
)
end
function
c1151216
.
con2_4
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetTurnPlayer
()
==
tp
end
function
c1151216
.
op2_4
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
SendtoHand
(
e
:
GetHandler
(),
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
e
:
GetHandler
())
end
--
function
c1151216
.
tfilter2
(
c
,
e
,
tp
)
return
c
:
IsRace
(
RACE_FIEND
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c1151216
.
tg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c1151216
.
tfilter2
,
tp
,
LOCATION_SZONE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
LOCATION_SZONE
)
end
--
function
c1151216
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
local
tg
=
Duel
.
GetMatchingGroup
(
c1151216
.
tfilter2
,
tp
,
LOCATION_SZONE
,
0
,
nil
,
e
,
tp
)
if
ft
<=
0
or
tg
:
GetCount
()
==
0
then
return
end
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
59822133
)
then
ft
=
1
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
tg
:
Select
(
tp
,
ft
,
ft
,
nil
)
local
tc
=
g
:
GetFirst
()
while
tc
do
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
local
e2_1
=
Effect
.
CreateEffect
(
tc
)
e2_1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2_1
:
SetCode
(
EFFECT_DISABLE
)
e2_1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e2_1
)
local
e2_2
=
Effect
.
CreateEffect
(
tc
)
e2_2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2_2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2_2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e2_2
)
local
e2_3
=
Effect
.
CreateEffect
(
tc
)
e2_3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2_3
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
+
EFFECT_FLAG_CANNOT_DISABLE
)
e2_3
:
SetCode
(
EFFECT_CHANGE_CODE
)
e2_3
:
SetRange
(
LOCATION_MZONE
)
e2_3
:
SetValue
(
1151990
)
e2_3
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e2_3
)
tc
=
g
:
GetNext
()
end
end
--
expansions/script/c1151217.lua
0 → 100644
View file @
52888c11
--神鬼『蕾米莉亚潜行者』
function
c1151217
.
initial_effect
(
c
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCondition
(
c1151217
.
con1
)
e1
:
SetTarget
(
c1151217
.
tg1
)
e1
:
SetOperation
(
c1151217
.
op1
)
c
:
RegisterEffect
(
e1
)
--
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCost
(
c1151217
.
cost2
)
e2
:
SetCondition
(
c1151217
.
con2
)
e2
:
SetTarget
(
c1151217
.
tg2
)
e2
:
SetOperation
(
c1151217
.
op2
)
c
:
RegisterEffect
(
e2
)
--
end
--
function
c1151217
.
IsLeimi
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
named_with_Leimi
end
c1151217
.
named_with_Leisp
=
1
function
c1151217
.
IsLeisp
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
c
.
named_with_Leisp
end
--
function
c1151217
.
cfilter1
(
c
)
return
c1151217
.
IsLeimi
(
c
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsFaceup
()
end
function
c1151217
.
con1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
c1151217
.
cfilter1
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
--
function
c1151217
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_EXTRA
+
LOCATION_DECK
)
>
0
end
end
--
function
c1151217
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
code
=
re
:
GetHandler
():
GetCode
()
local
g
=
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_EXTRA
+
LOCATION_DECK
)
Duel
.
ConfirmCards
(
tp
,
g
)
local
tg
=
g
:
Filter
(
Card
.
IsCode
,
nil
,
code
)
if
tg
:
GetCount
()
>
0
then
Duel
.
Remove
(
tg
,
POS_FACEDOWN
,
REASON_EFFECT
)
end
end
--
function
c1151217
.
cfilter2
(
c
)
return
c
:
IsRace
(
RACE_FIEND
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAttribute
(
ATTRIBUTE_DARK
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c1151217
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToRemoveAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c1151217
.
cfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c1151217
.
cfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
g
:
AddCard
(
e
:
GetHandler
())
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
--
function
c1151217
.
confilter2
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
end
function
c1151217
.
con2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsExistingMatchingCard
(
c1151217
.
confilter2
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
--
function
c1151217
.
tfilter2
(
c
,
e
,
tp
)
return
c1151217
.
IsLeimi
(
c
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c1151217
.
tg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c1151217
.
tfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
--
function
c1151217
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c1151217
.
tfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
local
tc
=
g
:
GetFirst
()
if
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
~=
0
then
local
e2_1
=
Effect
.
CreateEffect
(
tc
)
e2_1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2_1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e2_1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e2_1
:
SetRange
(
LOCATION_MZONE
)
e2_1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
)
e2_1
:
SetValue
(
c1151217
.
efilter2_1
)
tc
:
RegisterEffect
(
e2_1
,
true
)
end
end
end
function
c1151217
.
efilter2_1
(
e
,
re
)
return
re
:
GetHandlerPlayer
()
~=
e
:
GetHandlerPlayer
()
end
expansions/script/c1151219.lua
0 → 100644
View file @
52888c11
--运命『悲惨的命运』
function
c1151219
.
initial_effect
(
c
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TOGRAVE
+
CATEGORY_SEARCH
+
CATEGORY_TOHAND
+
CATEGORY_REMOVE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCost
(
c1151219
.
cost1
)
e1
:
SetTarget
(
c1151219
.
tg1
)
e1
:
SetOperation
(
c1151219
.
op1
)
c
:
RegisterEffect
(
e1
)
--
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_DESTROY_REPLACE
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetTarget
(
c1151219
.
tg2
)
e2
:
SetValue
(
c1151219
.
val2
)
e2
:
SetOperation
(
c1151219
.
op2
)
c
:
RegisterEffect
(
e2
)
--
end
--
function
c1151219
.
IsLeimi
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
named_with_Leimi
end
c1151219
.
named_with_Leisp
=
1
function
c1151219
.
IsLeisp
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
c
.
named_with_Leisp
end
function
c1151219
.
IsFulan
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
named_with_Fulan
end
c1151219
.
named_with_Fulsp
=
1
function
c1151219
.
IsLeisp
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
c
.
named_with_Fulsp
end
--
function
c1151219
.
cfilter1
(
c
)
return
c
:
IsRace
(
RACE_FIEND
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c1151219
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c1151219
.
cfilter1
,
tp
,
LOCATION_ONFIELD
+
LOCATION_HAND
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SELF
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c1151219
.
cfilter1
,
tp
,
LOCATION_ONFIELD
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
local
tc
=
g
:
GetFirst
()
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
local
e1_1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1_1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1_1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1_1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1_1
:
SetValue
(
TYPE_SPELL
+
TYPE_CONTINUOUS
)
e1_1
:
SetReset
(
RESET_EVENT
+
0x1fc0000
)
tc
:
RegisterEffect
(
e1_1
,
true
)
end
end
--
function
c1151219
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
1
-
tp
,
LOCATION_DECK
,
0
)
>
1
end
end
--
function
c1151219
.
tfilter1_M
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
end
function
c1151219
.
tfilter1_S
(
c
)
return
c
:
IsType
(
TYPE_SPELL
)
end
function
c1151219
.
tfilter1_T
(
c
)
return
c
:
IsType
(
TYPE_TRAP
)
end
function
c1151219
.
ofilter1_1
(
c
)
return
c1151219
.
IsLeimi
(
c
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToGrave
()
end
function
c1151219
.
ofilter1_2
(
c
)
return
c1151219
.
IsFulan
(
c
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
c1151219
.
ofilter1_3
(
c
)
return
c
:
IsAbleToHand
()
end
function
c1151219
.
ofilter1_4
(
c
)
return
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsAbleToRemove
()
end
function
c1151219
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetFieldGroupCount
(
1
-
tp
,
LOCATION_DECK
,
0
)
>
1
then
Duel
.
ConfirmDecktop
(
1
-
tp
,
2
)
local
g
=
Duel
.
GetDecktopGroup
(
1
-
tp
,
2
)
if
g
:
GetCount
()
>
0
then
if
g
:
IsExists
(
c1151219
.
tfilter1_M
,
1
,
nil
)
then
if
Duel
.
IsExistingMatchingCard
(
c1151219
.
ofilter1_1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c1151219
.
ofilter1_2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
then
local
sel
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
1151219
,
0
),
aux
.
Stringid
(
1151219
,
1
))
if
sel
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1_1
=
Duel
.
SelectMatchingCard
(
tp
,
c1151219
.
ofilter1_1
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g1_1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1_1
,
REASON_EFFECT
)
end
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g1_2
=
Duel
.
SelectMatchingCard
(
tp
,
c1151219
.
ofilter1_2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g1_2
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g1_2
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g1_2
)
end
end
else
if
Duel
.
IsExistingMatchingCard
(
c1151219
.
ofilter1_1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
not
Duel
.
IsExistingMatchingCard
(
c1151219
.
ofilter1_2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1_1
=
Duel
.
SelectMatchingCard
(
tp
,
c1151219
.
ofilter1_1
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g1_1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1_1
,
REASON_EFFECT
)
end
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g1_2
=
Duel
.
SelectMatchingCard
(
tp
,
c1151219
.
ofilter1_2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g1_2
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g1_2
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g1_2
)
end
end
end
end
if
g
:
IsExists
(
c1151219
.
tfilter1_S
,
1
,
nil
)
then
if
g
:
IsExists
(
c1151219
.
ofilter1_3
,
1
,
nil
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g1_3
=
g
:
FilterSelect
(
tp
,
c1151219
.
ofilter1_3
,
1
,
1
,
nil
)
if
g1_3
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g1_3
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g1_3
)
end
end
end
if
g
:
IsExists
(
c1151219
.
tfilter1_T
,
1
,
nil
)
then
local
g1_4
=
Duel
.
GetMatchingGroup
(
aux
.
TRUE
,
tp
,
0
,
LOCATION_HAND
,
nil
)
if
g1_4
:
GetCount
()
>
0
then
Duel
.
ConfirmCards
(
tp
,
g1_4
)
if
g1_4
:
IsExists
(
c1151219
.
ofilter1_4
,
1
,
nil
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g1_5
=
Duel
.
SelectMatchingCard
(
tp
,
c1151219
.
ofilter1_4
,
tp
,
0
,
LOCATION_HAND
,
1
,
1
,
nil
)
if
g1_5
:
GetCount
()
>
0
then
Duel
.
Remove
(
g1_5
,
POS_FACEDOWN
,
REASON_EFFECT
)
end
end
Duel
.
ShuffleDeck
(
1
-
tp
)
end
end
end
end
end
--
function
c1151219
.
cfilter2
(
c
)
return
c1151219
.
IsLeimi
(
c
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsFaceup
()
end
function
c1151219
.
tfilter2
(
c
,
tp
)
return
c
:
IsLocation
(
LOCATION_ONFIELD
)
and
c
:
IsControler
(
tp
)
end
function
c1151219
.
tg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c1151219
.
cfilter2
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsAbleToRemove
()
and
eg
:
IsExists
(
c1151219
.
tfilter2
,
1
,
nil
,
tp
)
end
return
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
1151219
,
2
))
end
--
function
c1151219
.
val2
(
e
,
c
)
return
c1151219
.
tfilter2
(
c
,
e
:
GetHandlerPlayer
())
end
--
function
c1151219
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Remove
(
e
:
GetHandler
(),
POS_FACEUP
,
REASON_EFFECT
)
end
--
\ No newline at end of file
expansions/script/c1152001.lua
View file @
52888c11
...
...
@@ -45,7 +45,7 @@ function c1152001.tfilter1(c)
return
c
:
IsFaceup
()
and
not
c
:
IsDisabled
()
end
function
c1152001
.
tfilter1_2
(
c
)
return
c1152001
.
IsFulsp
(
c
)
and
(
c
:
IsType
(
TYPE_SPELL
)
or
c
:
IsType
(
TYPE_TRAP
))
and
c
:
IsAbleToRemove
()
and
bit
.
band
(
c
:
GetReason
(),
REASON_DESTROY
)
~=
0
return
c1152001
.
IsFulsp
(
c
)
and
c
:
IsAbleToRemove
()
and
bit
.
band
(
c
:
GetReason
(),
REASON_DESTROY
)
~=
0
end
function
c1152001
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsControler
(
1
-
tp
)
and
chkc
:
IsOnField
()
and
c1152001
.
tfilter1
(
chkc
)
end
...
...
expansions/script/c1152002.lua
View file @
52888c11
...
...
@@ -3,9 +3,8 @@ function c1152002.initial_effect(c)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCondition
(
c1152002
.
con1
)
e1
:
SetTarget
(
c1152002
.
tg1
)
...
...
@@ -39,7 +38,7 @@ function c1152002.con1(e,tp,eg,ep,ev,re,r,rp)
end
--
function
c1152002
.
tfilter1
(
c
)
return
((
c
1152002
.
IsFulan
(
c
)
and
c
:
IsType
(
TYPE_MONSTER
))
or
(
c1152002
.
IsFulsp
(
c
)
and
(
c
:
IsType
(
TYPE_SPELL
)
or
c
:
IsType
(
TYPE_TRAP
)
)))
and
c
:
IsDestructable
()
return
((
c
:
IsRace
(
RACE_FIEND
)
and
c
:
IsType
(
TYPE_MONSTER
))
or
(
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsFaceup
(
)))
and
c
:
IsDestructable
()
end
function
c1152002
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c1152002
.
tfilter1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
GetFlagEffect
(
tp
,
1152000
)
==
0
end
...
...
@@ -75,7 +74,7 @@ function c1152002.op1_1(e,tp,eg,ep,ev,re,r,rp)
if
not
c
:
IsHasEffect
(
EFFECT_NECRO_VALLEY
)
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
1152002
,
1
))
then
Duel
.
SendtoHand
(
c
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
end
end
end
...
...
@@ -90,7 +89,7 @@ function c1152002.tfilter2(c,e,tp)
end
function
c1152002
.
tg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c1152002
.
tfilter2
,
tp
,
LOCATION_SZONE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
LOCATION_SZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
LOCATION_SZONE
)
end
--
function
c1152002
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
...
...
expansions/script/c1152003.lua
View file @
52888c11
...
...
@@ -37,11 +37,11 @@ function c1152003.cfilter1_1(c)
return
c
:
IsType
(
TYPE_MONSTER
)
end
function
c1152003
.
cfilter1_2
(
c
)
return
(
c
:
IsType
(
TYPE_SPELL
)
or
c
:
IsType
(
TYPE_TRAP
))
and
c1152003
.
IsFulsp
(
c
)
and
c
:
IsSSetable
()
and
bit
.
band
(
c
:
GetReason
(),
REASON_DESTROY
)
~=
0
return
(
c
:
IsType
(
TYPE_SPELL
)
or
c
:
IsType
(
TYPE_TRAP
))
and
c1152003
.
IsFulsp
(
c
)
and
c
:
IsSSetable
()
and
c
:
GetReason
()
==
REASON_DESTROY
end
function
c1152003
.
con1
(
e
,
c
)
if
c
==
nil
then
return
true
end
return
Duel
.
GetMatchingGroupCount
(
c1152003
.
cfilter1_1
,
tp
,
LOCATION_ONFIELD
,
0
,
nil
)
==
0
and
Duel
.
GetMatchingGroupCount
(
c1152003
.
cfilter1_2
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
not
e
:
GetHandler
():
IsHasEffect
(
EFFECT_NECRO_VALLEY
)
return
Duel
.
GetMatchingGroupCount
(
c1152003
.
cfilter1_1
,
tp
,
LOCATION_ONFIELD
,
0
,
nil
)
==
0
and
Duel
.
GetMatchingGroupCount
(
c1152003
.
cfilter1_2
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
--
function
c1152003
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
...
...
expansions/script/c1152005.lua
View file @
52888c11
...
...
@@ -3,10 +3,10 @@ function c1152005.initial_effect(c)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_DESTROY
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_GRAVE
+
LOCATION_HAND
)
e1
:
SetCondition
(
c1152005
.
con1
)
e1
:
SetTarget
(
c1152005
.
tg1
)
e1
:
SetOperation
(
c1152005
.
op1
)
c
:
RegisterEffect
(
e1
)
...
...
@@ -31,13 +31,6 @@ function c1152005.IsFulsp(c)
return
c
.
named_with_Fulsp
end
--
function
c1152005
.
cfilter1
(
c
)
return
c
:
IsCode
(
1152999
)
and
c
:
IsFaceup
()
end
function
c1152005
.
con1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
c1152005
.
cfilter1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
--
function
c1152005
.
tfilter1_1
(
c
,
e
)
return
c
:
IsDestructable
()
and
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsFaceup
()
and
not
c
:
IsImmuneToEffect
(
e
)
and
not
c
:
IsCode
(
1152999
)
end
...
...
expansions/script/c1152101.lua
View file @
52888c11
...
...
@@ -50,12 +50,12 @@ function c1152101.cfilter1(c)
return
c
:
IsAbleToGraveAsCost
()
end
function
c1152101
.
cost1
(
e
,
c
,
tp
)
return
Duel
.
IsExistingMatchingCard
(
c1152101
.
cfilter1
,
tp
,
LOCATION_
MZONE
,
LOCATION_MZONE
,
1
,
nil
)
return
Duel
.
IsExistingMatchingCard
(
c1152101
.
cfilter1
,
tp
,
LOCATION_
ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
--
function
c1152101
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c1152101
.
cfilter1
,
tp
,
LOCATION_
MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c1152101
.
cfilter1
,
tp
,
LOCATION_
ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
end
...
...
expansions/script/c1152203.lua
View file @
52888c11
...
...
@@ -101,7 +101,7 @@ function c1152203.op1(e,tp,eg,ep,ev,re,r,rp)
local
sg
=
g
:
FilterSelect
(
tp
,
c1152203
.
tfilter1
,
1
,
1
,
nil
)
if
sg
:
GetCount
()
>
0
then
local
tc
=
sg
:
GetFirst
()
if
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
~=
0
and
c1152203
.
IsFulsp
(
tc
)
and
(
tc
:
IsType
(
TYPE_SPELL
)
or
tc
:
IsType
(
TYPE_TRAP
))
then
if
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
~=
0
and
c1152203
.
IsFulsp
(
tc
)
and
(
tc
:
IsType
(
TYPE_SPELL
)
or
tc
:
IsType
(
TYPE_TRAP
))
then
local
code
=
tc
:
GetOriginalCode
()
if
Duel
.
IsExistingMatchingCard
(
c1152203
.
ofilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
code
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
1152203
,
0
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
...
...
expansions/script/c1152205.lua
View file @
52888c11
...
...
@@ -111,7 +111,7 @@ function c1152205.op2_1(e,tp,eg,ep,ev,re,r,rp)
if
g2
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_CARD
,
0
,
1152205
)
local
num
=
g2
:
GetCount
()
local
hert
=
num
*
2
00
local
hert
=
num
*
4
00
if
Duel
.
SelectYesNo
(
1
-
tp
,
aux
.
Stringid
(
1152205
,
0
))
then
local
tc
=
g2
:
GetFirst
()
while
tc
do
...
...
expansions/script/c1152208.lua
View file @
52888c11
...
...
@@ -3,6 +3,7 @@ function c1152208.initial_effect(c)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCondition
(
c1152208
.
con1
)
...
...
expansions/script/c1152209.lua
View file @
52888c11
...
...
@@ -80,7 +80,7 @@ function c1152209.op1(e,tp,eg,ep,ev,re,r,rp)
if
gn
:
GetCount
()
>
0
then
local
tc
=
gn
:
GetFirst
()
while
tc
do
if
tc
:
IsType
(
TYPE_MONSTER
)
then
if
tc
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsRace
(
RACE_FIEND
)
then
gr
:
AddCard
(
tc
)
end
tc
=
gn
:
GetNext
()
...
...
@@ -118,20 +118,21 @@ function c1152209.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
e
:
SetLabelObject
(
rc
)
local
loc
,
np
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TRIGGERING_LOCATION
,
CHAININFO_TRIGGERING_CONTROLER
)
if
chk
==
0
then
return
loc
==
LOCATION_MZONE
and
np
==
tp
and
re
:
IsActiveType
(
TYPE_MONSTER
)
and
c1152209
.
IsFulan
(
rc
)
end
return
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
1152209
,
0
))
end
--
function
c1152209
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Remove
(
e
:
GetHandler
(),
POS_FACEUP
,
REASON_EFFECT
)
local
rc
=
e
:
GetLabelObject
()
local
e2_1
=
Effect
.
CreateEffect
(
rc
)
e2_1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2_1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e2_1
:
SetRange
(
LOCATION_MZONE
)
e2_1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e2_1
:
SetValue
(
c1152209
.
efilter2_1
)
e2_1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_CHAIN
)
rc
:
RegisterEffect
(
e2_1
)
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
1152209
,
0
))
then
Duel
.
Remove
(
e
:
GetHandler
(),
POS_FACEUP
,
REASON_EFFECT
)
local
rc
=
e
:
GetLabelObject
()
local
e2_1
=
Effect
.
CreateEffect
(
rc
)
e2_1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2_1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e2_1
:
SetRange
(
LOCATION_MZONE
)
e2_1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e2_1
:
SetValue
(
c1152209
.
efilter2_1
)
e2_1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_CHAIN
)
rc
:
RegisterEffect
(
e2_1
)
end
end
function
c1152209
.
efilter2_1
(
e
,
re
)
return
e
:
GetOwnerPlayer
()
~=
re
:
GetOwnerPlayer
()
...
...
expansions/script/c1152212.lua
View file @
52888c11
...
...
@@ -37,7 +37,7 @@ function c1152212.tfilter1_2(c)
return
c1152212
.
IsFulsp
(
c
)
and
(
c
:
IsType
(
TYPE_SPELL
)
or
c
:
IsType
(
TYPE_TRAP
))
and
c
:
IsAbleToRemove
()
and
bit
.
band
(
c
:
GetReason
(),
REASON_DESTROY
)
~=
0
end
function
c1152212
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToHand
()
and
e
:
GetHandler
():
IsLocation
(
LOCATION_REMOVED
)
and
c
:
IsFaceup
()
and
(
Duel
.
IsExistingMatchingCard
(
c1152212
.
tfilter1_1
,
tp
,
LOCATION_ONFIELD
+
LOCATION_HAND
,
0
,
1
,
nil
)
or
Duel
.
IsExistingMatchingCard
(
c1152212
.
tfilter1_2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
))
end
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToHand
()
and
e
:
GetHandler
():
IsLocation
(
LOCATION_REMOVED
)
and
e
:
GetHandler
()
:
IsFaceup
()
and
(
Duel
.
IsExistingMatchingCard
(
c1152212
.
tfilter1_1
,
tp
,
LOCATION_ONFIELD
+
LOCATION_HAND
,
0
,
1
,
nil
)
or
Duel
.
IsExistingMatchingCard
(
c1152212
.
tfilter1_2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
))
end
end
--
function
c1152212
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
...
...
expansions/script/c1152301.lua
View file @
52888c11
...
...
@@ -5,7 +5,6 @@ function c1152301.initial_effect(c)
e1
:
SetCategory
(
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCondition
(
c1152301
.
con1
)
e1
:
SetTarget
(
c1152301
.
tg1
)
e1
:
SetOperation
(
c1152301
.
op1
)
c
:
RegisterEffect
(
e1
)
...
...
@@ -30,10 +29,6 @@ function c1152301.IsFulsp(c)
return
c
.
named_with_Fulsp
end
--
function
c1152301
.
con1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
(
re
:
IsActiveType
(
TYPE_SPELL
)
and
re
:
GetHandler
():
IsType
(
TYPE_QUICKPLAY
))
or
re
:
IsActiveType
(
TYPE_TRAP
)
end
--
function
c1152301
.
tfilter1
(
c
)
return
c
:
IsDestructable
()
end
...
...
expansions/script/c1152304.lua
View file @
52888c11
...
...
@@ -14,14 +14,14 @@ function c1152304.initial_effect(c)
e2
:
SetCategory
(
CATEGORY_TODECK
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_
DESTROYE
D
)
e2
:
SetCode
(
EVENT_
LEAVE_FIEL
D
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
1152304
)
e2
:
SetCondition
(
c1152304
.
con2
)
e2
:
SetCost
(
c1152304
.
cost2
)
e2
:
SetTarget
(
c1152304
.
tg2
)
e2
:
SetOperation
(
c1152304
.
op2
)
c
:
RegisterEffect
(
e2
)
--
end
--
function
c1152304
.
IsFulan
(
c
)
...
...
@@ -35,37 +35,27 @@ function c1152304.IsFulsp(c)
end
--
function
c1152304
.
cfilter1
(
c
)
return
c
1152304
.
IsFulan
(
c
)
and
c
:
IsFaceup
()
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAttribute
(
ATTRIBUTE_DARK
)
and
c
:
IsRace
(
RACE_FIEND
)
and
c
:
IsFaceup
()
end
function
c1152304
.
con1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
re
:
IsHasProperty
(
EFFECT_FLAG_CARD_TARGET
)
then
return
false
end
if
not
Duel
.
IsExistingMatchingCard
(
c1152304
.
cfilter1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
then
return
false
end
local
tg
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TARGET_CARDS
)
return
tg
:
IsExists
(
c1152304
.
cfilter1
,
1
,
nil
)
and
re
:
IsActiveType
(
TYPE_SPELL
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
and
Duel
.
IsChainNegatable
(
ev
)
return
tg
and
Duel
.
IsChainNegatable
(
ev
)
end
--
function
c1152304
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_NEGATE
,
eg
,
1
,
0
,
0
)
if
re
:
GetHandler
():
IsRelateToEffect
(
re
)
then
if
Duel
.
GetFieldGroupCount
(
1
-
tp
,
LOCATION_HAND
,
0
)
~=
0
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
nil
,
1
,
1
-
tp
,
LOCATION_HAND
)
end
end
Duel
.
SetChainLimit
(
aux
.
FALSE
)
end
--
function
c1152304
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
NegateActivation
(
ev
)
if
re
:
GetHandler
():
IsRelateToEffect
(
re
)
then
local
g
=
Duel
.
GetFieldGroup
(
1
-
tp
,
LOCATION_HAND
,
0
)
if
g
:
GetCount
()
==
0
then
return
end
local
sg
=
g
:
RandomSelect
(
1
-
tp
,
1
)
Duel
.
Destroy
(
sg
,
REASON_EFFECT
)
end
end
--
function
c1152304
.
cfilter2
(
c
,
tp
)
return
c
:
IsPreviousLocation
(
LOCATION_ONFIELD
)
and
c
:
GetPreviousControler
()
==
tp
and
c
:
IsReason
(
REASON_EFFECT
)
and
c
1152304
.
IsFulan
(
c
)
return
c
:
IsPreviousLocation
(
LOCATION_ONFIELD
)
and
c
:
GetPreviousControler
()
==
tp
and
c1152304
.
IsFulan
(
c
)
end
function
c1152304
.
con2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c1152304
.
cfilter2
,
1
,
nil
,
tp
)
...
...
expansions/script/c1152306.lua
View file @
52888c11
...
...
@@ -50,10 +50,10 @@ function c1152306.con2(e,tp,eg,ep,ev,re,r,rp)
end
--
function
c1152306
.
tfilter2_1
(
c
,
e
,
tp
)
return
c1152306
.
IsFulsp
(
c
)
and
c
:
IsAbleToRemove
()
and
bit
.
band
(
c
:
GetReason
(),
REASON_DESTROY
)
~=
0
and
Duel
.
IsExistingMatchingCard
(
c1152306
.
tfilter2_2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
c
:
GetCode
(
))
return
c1152306
.
IsFulsp
(
c
)
and
c
:
IsAbleToRemove
()
and
Duel
.
IsExistingMatchingCard
(
c1152306
.
tfilter2_2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
c
:
GetCode
())
and
(
c
:
IsType
(
TYPE_SPELL
)
or
c
:
IsType
(
TYPE_TRAP
))
end
function
c1152306
.
tfilter2_2
(
c
,
code
)
return
c
:
Is
Code
(
code
)
and
c
:
IsAbleToHand
()
return
c
:
Is
AbleToHand
()
and
c
:
IsCode
(
code
)
end
function
c1152306
.
tg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c1152306
.
tfilter2_1
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
...
...
@@ -80,18 +80,20 @@ end
function
c1152306
.
con3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
re
:
IsHasProperty
(
EFFECT_FLAG_CARD_TARGET
)
then
local
tg
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TARGET_CARDS
)
local
tc
=
tg
:
GetFirst
()
local
i
=
0
while
tc
do
if
tc
==
e
:
GetHandler
()
and
e
:
GetHandler
():
IsFacedown
()
then
i
=
1
if
tg
then
local
tc
=
tg
:
GetFirst
()
local
i
=
0
while
tc
do
if
tc
==
e
:
GetHandler
()
and
e
:
GetHandler
():
IsFacedown
()
then
i
=
1
end
tc
=
tg
:
GetNext
()
end
if
i
==
1
then
return
true
else
return
false
end
tc
=
tg
:
GetNext
()
end
if
i
==
1
then
return
true
else
return
false
end
else
return
false
...
...
expansions/script/c1152999.lua
View file @
52888c11
...
...
@@ -45,11 +45,11 @@ function c1152999.IsFulsp(c)
end
--
function
c1152999
.
ofilter1
(
c
,
e
,
tp
)
return
c
1152999
.
IsFulan
(
c
)
and
c
:
IsFaceup
()
and
c
:
IsAbleToHand
(
)
return
c
:
IsFaceup
()
and
c
:
IsAbleToHand
()
and
(
c
:
IsType
(
TYPE_SPELL
)
or
c
:
IsType
(
TYPE_TRAP
)
)
end
function
c1152999
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
c1152999
.
ofilter1
,
tp
,
LOCATION_ONFIELD
,
0
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
c1152999
.
ofilter1
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
nil
)
if
g
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
1152999
,
0
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
...
...
@@ -95,7 +95,7 @@ function c1152999.op2(e,tp,eg,ep,ev,re,r,rp,c)
end
--
function
c1152999
.
cfilter3
(
c
)
return
(
c
:
IsType
(
TYPE_SPELL
)
or
c
:
IsType
(
TYPE_TRAP
))
and
c1152999
.
IsFulsp
(
c
)
return
(
c
:
IsType
(
TYPE_SPELL
)
or
c
:
IsType
(
TYPE_TRAP
))
end
function
c1152999
.
tfilter3
(
c
)
return
(
c
:
IsType
(
TYPE_SPELL
)
or
c
:
IsType
(
TYPE_TRAP
))
and
c1152999
.
IsFulsp
(
c
)
and
c
:
IsDestructable
()
...
...
expansions/script/c17111001.lua
0 → 100644
View file @
52888c11
--ロードジェネラル·ロミオ
local
m
=
17111001
local
cm
=
_G
[
"c"
..
m
]
cm
.
dfc_front_side
=
m
cm
.
dfc_back_side
=
m
+
1
function
cm
.
initial_effect
(
c
)
--Change
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e0
:
SetType
(
EFFECT_TYPE_IGNITION
)
e0
:
SetRange
(
LOCATION_MZONE
)
e0
:
SetCondition
(
cm
.
changecon
)
e0
:
SetTarget
(
cm
.
changetg
)
e0
:
SetOperation
(
cm
.
changeop
)
c
:
RegisterEffect
(
e0
)
--must attack
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_MUST_ATTACK
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
0
,
LOCATION_MZONE
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_MUST_ATTACK_MONSTER
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_MUST_BE_ATTACKED
)
e3
:
SetValue
(
1
)
c
:
RegisterEffect
(
e3
)
--synchro level
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
)
e4
:
SetCode
(
EFFECT_SYNCHRO_LEVEL
)
e4
:
SetValue
(
cm
.
slevel
)
c
:
RegisterEffect
(
e4
)
end
cm
.
is_named_with_Commander
=
1
function
cm
.
IsCommander
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
is_named_with_Commander
end
function
cm
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
(
c
:
IsCode
(
17111003
)
or
c
:
IsCode
(
17111004
))
end
function
cm
.
changecon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
cm
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
function
cm
.
changetg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
.
dfc_back_side
and
c
.
dfc_front_side
==
c
:
GetOriginalCode
()
end
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
end
function
cm
.
changeop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
or
c
:
IsFacedown
()
or
c
:
IsImmuneToEffect
(
e
)
then
return
end
local
tcode
=
c
.
dfc_back_side
c
:
SetEntityCode
(
tcode
,
true
)
c
:
ReplaceEffect
(
tcode
,
0
,
0
)
Duel
.
Hint
(
12
,
0
,
aux
.
Stringid
(
m
,
12
))
end
function
cm
.
slevel
(
e
,
c
)
local
lv
=
e
:
GetHandler
():
GetLevel
()
return
2
*
65536
+
lv
end
\ No newline at end of file
expansions/script/c17111002.lua
0 → 100644
View file @
52888c11
--ロードジェネラル·ロミオ
local
m
=
17111002
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--must attack
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_MUST_ATTACK
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
0
,
LOCATION_MZONE
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_MUST_ATTACK_MONSTER
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_MUST_BE_ATTACKED
)
e3
:
SetValue
(
1
)
c
:
RegisterEffect
(
e3
)
--synchro level
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
)
e4
:
SetCode
(
EFFECT_SYNCHRO_LEVEL
)
e4
:
SetValue
(
cm
.
slevel
)
c
:
RegisterEffect
(
e4
)
--back
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e5
:
SetCode
(
EVENT_ADJUST
)
e5
:
SetRange
(
LOCATION_DECK
+
LOCATION_GRAVE
+
LOCATION_REMOVED
+
LOCATION_HAND
+
LOCATION_EXTRA
)
e5
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_SET_AVAILABLE
)
e5
:
SetCondition
(
cm
.
backon
)
e5
:
SetOperation
(
cm
.
backop
)
c
:
RegisterEffect
(
e5
)
end
cm
.
is_named_with_Commander
=
1
function
cm
.
IsCommander
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
is_named_with_Commander
end
function
cm
.
slevel
(
e
,
c
)
local
lv
=
e
:
GetHandler
():
GetLevel
()
return
2
*
65536
+
lv
end
function
cm
.
backon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
.
dfc_front_side
and
c
:
GetOriginalCode
()
==
c
.
dfc_back_side
end
function
cm
.
backop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tcode
=
c
.
dfc_front_side
c
:
SetEntityCode
(
tcode
)
Duel
.
ConfirmCards
(
tp
,
Group
.
FromCards
(
c
))
Duel
.
ConfirmCards
(
1
-
tp
,
Group
.
FromCards
(
c
))
c
:
ReplaceEffect
(
tcode
,
0
,
0
)
end
\ No newline at end of file
expansions/script/c17111003.lua
0 → 100644
View file @
52888c11
--ブリンセス·ジュリエット
local
m
=
17111003
local
cm
=
_G
[
"c"
..
m
]
cm
.
dfc_front_side
=
m
cm
.
dfc_back_side
=
m
+
1
function
cm
.
initial_effect
(
c
)
--Change
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCondition
(
cm
.
changecon
)
e1
:
SetTarget
(
cm
.
changetg
)
e1
:
SetOperation
(
cm
.
changeop
)
c
:
RegisterEffect
(
e1
)
--direct attack
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DIRECT_ATTACK
)
c
:
RegisterEffect
(
e2
)
--synchro level
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_SYNCHRO_LEVEL
)
e3
:
SetValue
(
cm
.
slevel
)
c
:
RegisterEffect
(
e3
)
end
cm
.
is_named_with_Commander
=
1
function
cm
.
IsCommander
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
is_named_with_Commander
end
function
cm
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
(
c
:
IsCode
(
17111001
)
or
c
:
IsCode
(
17111002
))
end
function
cm
.
changecon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
cm
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
function
cm
.
changetg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
.
dfc_back_side
and
c
.
dfc_front_side
==
c
:
GetOriginalCode
()
end
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
end
function
cm
.
changeop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
or
c
:
IsFacedown
()
or
c
:
IsImmuneToEffect
(
e
)
then
return
end
local
tcode
=
c
.
dfc_back_side
c
:
SetEntityCode
(
tcode
,
true
)
c
:
ReplaceEffect
(
tcode
,
0
,
0
)
Duel
.
Hint
(
12
,
0
,
aux
.
Stringid
(
m
,
12
))
end
function
cm
.
slevel
(
e
,
c
)
local
lv
=
e
:
GetHandler
():
GetLevel
()
return
2
*
65536
+
lv
end
\ No newline at end of file
expansions/script/c17111004.lua
0 → 100644
View file @
52888c11
--ブリンセス·ジュリエット
local
m
=
17111004
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--direct attack
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DIRECT_ATTACK
)
c
:
RegisterEffect
(
e1
)
--synchro level
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_SYNCHRO_LEVEL
)
e2
:
SetValue
(
cm
.
slevel
)
c
:
RegisterEffect
(
e2
)
--back
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_ADJUST
)
e3
:
SetRange
(
LOCATION_DECK
+
LOCATION_GRAVE
+
LOCATION_REMOVED
+
LOCATION_HAND
+
LOCATION_EXTRA
)
e3
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_SET_AVAILABLE
)
e3
:
SetCondition
(
cm
.
backon
)
e3
:
SetOperation
(
cm
.
backop
)
c
:
RegisterEffect
(
e3
)
end
cm
.
is_named_with_Commander
=
1
function
cm
.
IsCommander
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
is_named_with_Commander
end
function
cm
.
slevel
(
e
,
c
)
local
lv
=
e
:
GetHandler
():
GetLevel
()
return
2
*
65536
+
lv
end
function
cm
.
backon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
.
dfc_front_side
and
c
:
GetOriginalCode
()
==
c
.
dfc_back_side
end
function
cm
.
backop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tcode
=
c
.
dfc_front_side
c
:
SetEntityCode
(
tcode
)
Duel
.
ConfirmCards
(
tp
,
Group
.
FromCards
(
c
))
Duel
.
ConfirmCards
(
1
-
tp
,
Group
.
FromCards
(
c
))
c
:
ReplaceEffect
(
tcode
,
0
,
0
)
end
\ No newline at end of file
expansions/script/c17111005.lua
0 → 100644
View file @
52888c11
--円卓会議
local
m
=
17111005
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
)
e1
:
SetCost
(
cm
.
cost
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
IsCommander
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
is_named_with_Commander
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
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
cm
.
splimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
cm
.
splimit
(
e
,
c
,
sump
,
sumtype
,
sumpos
,
targetp
,
se
)
return
not
cm
.
IsCommander
(
c
)
and
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
cm
.
spfilter
(
c
,
e
,
tp
)
return
cm
.
IsCommander
(
c
)
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
local
g
=
Duel
.
GetMatchingGroup
(
cm
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
,
e
,
tp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
59822133
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
1
and
g
:
GetClassCount
(
Card
.
GetCode
)
>=
2
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
2
,
tp
,
LOCATION_DECK
)
end
function
cm
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
local
g
=
Duel
.
GetMatchingGroup
(
cm
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
,
e
,
tp
)
if
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
59822133
)
and
ft
>
1
and
g
:
GetClassCount
(
Card
.
GetCode
)
>
1
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g1
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
g
:
Remove
(
Card
.
IsCode
,
nil
,
g1
:
GetFirst
():
GetCode
())
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g2
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
g1
:
Merge
(
g2
)
Duel
.
SpecialSummon
(
g1
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
expansions/script/c17111010.lua
0 → 100644
View file @
52888c11
--列奥尼达
local
m
=
17111011
local
cm
=
_G
[
"c"
..
m
]
cm
.
dfc_front_side
=
m
cm
.
dfc_back_side
=
m
+
1
function
cm
.
initial_effect
(
c
)
--synchro summon
aux
.
AddSynchroProcedure
(
c
,
nil
,
aux
.
NonTuner
(
nil
),
1
)
c
:
EnableReviveLimit
()
--Change
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e0
:
SetType
(
EFFECT_TYPE_IGNITION
)
e0
:
SetRange
(
LOCATION_MZONE
)
e0
:
SetCondition
(
cm
.
changecon
)
e0
:
SetTarget
(
cm
.
changetg
)
e0
:
SetOperation
(
cm
.
changeop
)
c
:
RegisterEffect
(
e0
)
--set
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetCode
(
EVENT_DESTROYED
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCondition
(
cm
.
tfcon
)
e1
:
SetTarget
(
cm
.
tftg
)
e1
:
SetOperation
(
cm
.
tfop
)
c
:
RegisterEffect
(
e1
)
--spsummon voice
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetOperation
(
cm
.
sumsuc
)
c
:
RegisterEffect
(
e2
)
--atk voice
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e3
:
SetCategory
(
CATEGORY_ATKCHANGE
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_ATTACK_ANNOUNCE
)
e3
:
SetOperation
(
cm
.
atksuc
)
c
:
RegisterEffect
(
e3
)
--destroy voice
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e4
:
SetCode
(
EVENT_DESTROYED
)
e4
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e4
:
SetCondition
(
cm
.
descon
)
e4
:
SetOperation
(
cm
.
dessuc
)
c
:
RegisterEffect
(
e4
)
end
cm
.
is_named_with_Commander
=
1
function
cm
.
IsCommander
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
is_named_with_Commander
end
function
cm
.
changecon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_MZONE
,
0
)
<
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_MZONE
)
end
function
cm
.
changetg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
.
dfc_back_side
and
c
.
dfc_front_side
==
c
:
GetOriginalCode
()
end
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
end
function
cm
.
changeop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
or
c
:
IsFacedown
()
or
c
:
IsImmuneToEffect
(
e
)
then
return
end
local
tcode
=
c
.
dfc_back_side
c
:
SetEntityCode
(
tcode
,
true
)
c
:
ReplaceEffect
(
tcode
,
0
,
0
)
Duel
.
Hint
(
12
,
0
,
aux
.
Stringid
(
m
,
8
))
end
function
cm
.
tfcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
and
c
:
IsFaceup
()
end
function
cm
.
tftg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
cm
.
tfop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
end
local
token
=
Duel
.
CreateToken
(
tp
,
17111013
)
Duel
.
MoveToField
(
token
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetValue
(
TYPE_SPELL
+
TYPE_CONTINUOUS
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fc0000
)
token
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCondition
(
cm
.
atkcon
)
e2
:
SetOperation
(
cm
.
atkop
)
token
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
token
:
RegisterEffect
(
e3
)
end
function
cm
.
cfilter
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
GetSummonPlayer
()
==
tp
end
function
cm
.
atkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
cm
.
cfilter
,
1
,
nil
,
tp
)
end
function
cm
.
atkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
eg
:
Filter
(
cm
.
cfilter
,
nil
,
tp
):
Filter
(
Card
.
IsFaceup
,
nil
)
local
tc
=
g
:
GetFirst
()
while
tc
do
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
1200
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
tc
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
9
))
e3
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_ATTACK_ANNOUNCE
)
e3
:
SetOperation
(
cm
.
atkbop
)
tc
:
RegisterEffect
(
e3
)
tc
=
g
:
GetNext
()
end
end
function
cm
.
atkbop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetValue
(
cm
.
efilter
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_DAMAGE
)
e
:
GetHandler
():
RegisterEffect
(
e1
)
end
function
cm
.
efilter
(
e
,
te
)
return
te
:
GetOwner
()
~=
e
:
GetOwner
()
end
function
cm
.
descon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsPreviousLocation
(
LOCATION_MZONE
+
LOCATION_SZONE
)
and
c
:
IsFaceup
()
end
function
cm
.
sumsuc
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
12
,
0
,
aux
.
Stringid
(
m
,
5
))
end
function
cm
.
atksuc
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
12
,
0
,
aux
.
Stringid
(
m
,
6
))
end
function
cm
.
dessuc
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
12
,
0
,
aux
.
Stringid
(
m
,
7
))
end
\ No newline at end of file
expansions/script/c17111011.lua
0 → 100644
View file @
52888c11
--列奥尼达
local
m
=
17111011
local
cm
=
_G
[
"c"
..
m
]
cm
.
dfc_front_side
=
m
cm
.
dfc_back_side
=
m
+
1
function
cm
.
initial_effect
(
c
)
--synchro summon
aux
.
AddSynchroProcedure
(
c
,
nil
,
aux
.
NonTuner
(
nil
),
1
)
c
:
EnableReviveLimit
()
--Change
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e0
:
SetType
(
EFFECT_TYPE_IGNITION
)
e0
:
SetRange
(
LOCATION_MZONE
)
e0
:
SetCondition
(
cm
.
changecon
)
e0
:
SetTarget
(
cm
.
changetg
)
e0
:
SetOperation
(
cm
.
changeop
)
c
:
RegisterEffect
(
e0
)
--set
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetCode
(
EVENT_DESTROYED
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCondition
(
cm
.
tfcon
)
e1
:
SetTarget
(
cm
.
tftg
)
e1
:
SetOperation
(
cm
.
tfop
)
c
:
RegisterEffect
(
e1
)
--spsummon voice
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetOperation
(
cm
.
sumsuc
)
c
:
RegisterEffect
(
e2
)
--atk voice
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e3
:
SetCategory
(
CATEGORY_ATKCHANGE
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_ATTACK_ANNOUNCE
)
e3
:
SetOperation
(
cm
.
atksuc
)
c
:
RegisterEffect
(
e3
)
--destroy voice
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e4
:
SetCode
(
EVENT_DESTROYED
)
e4
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e4
:
SetCondition
(
cm
.
descon
)
e4
:
SetOperation
(
cm
.
dessuc
)
c
:
RegisterEffect
(
e4
)
end
cm
.
is_named_with_Commander
=
1
function
cm
.
IsCommander
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
is_named_with_Commander
end
function
cm
.
changecon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_MZONE
,
0
)
<
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_MZONE
)
end
function
cm
.
changetg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
.
dfc_back_side
and
c
.
dfc_front_side
==
c
:
GetOriginalCode
()
end
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
end
function
cm
.
changeop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
or
c
:
IsFacedown
()
or
c
:
IsImmuneToEffect
(
e
)
then
return
end
local
tcode
=
c
.
dfc_back_side
c
:
SetEntityCode
(
tcode
,
true
)
c
:
ReplaceEffect
(
tcode
,
0
,
0
)
Duel
.
Hint
(
12
,
0
,
aux
.
Stringid
(
m
,
8
))
end
function
cm
.
tfcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
and
c
:
IsFaceup
()
end
function
cm
.
tftg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
cm
.
tfop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
end
local
token
=
Duel
.
CreateToken
(
tp
,
17111013
)
Duel
.
MoveToField
(
token
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetValue
(
TYPE_SPELL
+
TYPE_CONTINUOUS
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fc0000
)
token
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCondition
(
cm
.
atkcon
)
e2
:
SetOperation
(
cm
.
atkop
)
token
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
token
:
RegisterEffect
(
e3
)
end
function
cm
.
cfilter
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
GetSummonPlayer
()
==
tp
end
function
cm
.
atkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
cm
.
cfilter
,
1
,
nil
,
tp
)
end
function
cm
.
atkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
eg
:
Filter
(
cm
.
cfilter
,
nil
,
tp
):
Filter
(
Card
.
IsFaceup
,
nil
)
local
tc
=
g
:
GetFirst
()
while
tc
do
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
1200
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
tc
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
9
))
e3
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_ATTACK_ANNOUNCE
)
e3
:
SetOperation
(
cm
.
atkbop
)
tc
:
RegisterEffect
(
e3
)
tc
=
g
:
GetNext
()
end
end
function
cm
.
atkbop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetValue
(
cm
.
efilter
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_DAMAGE
)
e
:
GetHandler
():
RegisterEffect
(
e1
)
end
function
cm
.
efilter
(
e
,
te
)
return
te
:
GetOwner
()
~=
e
:
GetOwner
()
end
function
cm
.
descon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsPreviousLocation
(
LOCATION_MZONE
+
LOCATION_SZONE
)
and
c
:
IsFaceup
()
end
function
cm
.
sumsuc
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
12
,
0
,
aux
.
Stringid
(
m
,
5
))
end
function
cm
.
atksuc
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
12
,
0
,
aux
.
Stringid
(
m
,
6
))
end
function
cm
.
dessuc
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
12
,
0
,
aux
.
Stringid
(
m
,
7
))
end
\ No newline at end of file
expansions/script/c17111012.lua
0 → 100644
View file @
52888c11
--列奥尼达
local
m
=
17111012
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--synchro summon
aux
.
AddSynchroProcedure
(
c
,
nil
,
aux
.
NonTuner
(
nil
),
1
)
c
:
EnableReviveLimit
()
--set
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetCode
(
EVENT_DESTROYED
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCondition
(
cm
.
tfcon
)
e1
:
SetTarget
(
cm
.
tftg
)
e1
:
SetOperation
(
cm
.
tfop
)
c
:
RegisterEffect
(
e1
)
--atk voice
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e3
:
SetCategory
(
CATEGORY_ATKCHANGE
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_ATTACK_ANNOUNCE
)
e3
:
SetOperation
(
cm
.
atksuc
)
c
:
RegisterEffect
(
e3
)
--destroy voice
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e4
:
SetCode
(
EVENT_DESTROYED
)
e4
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e4
:
SetCondition
(
cm
.
descon
)
e4
:
SetOperation
(
cm
.
dessuc
)
c
:
RegisterEffect
(
e4
)
--back
local
e8
=
Effect
.
CreateEffect
(
c
)
e8
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e8
:
SetCode
(
EVENT_ADJUST
)
e8
:
SetRange
(
LOCATION_DECK
+
LOCATION_GRAVE
+
LOCATION_REMOVED
+
LOCATION_HAND
+
LOCATION_EXTRA
)
e8
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_SET_AVAILABLE
)
e8
:
SetCondition
(
cm
.
backon
)
e8
:
SetOperation
(
cm
.
backop
)
c
:
RegisterEffect
(
e8
)
end
cm
.
is_named_with_Commander
=
1
function
cm
.
IsCommander
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
is_named_with_Commander
end
function
cm
.
backon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
.
dfc_front_side
and
c
:
GetOriginalCode
()
==
c
.
dfc_back_side
end
function
cm
.
backop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tcode
=
c
.
dfc_front_side
c
:
SetEntityCode
(
tcode
)
Duel
.
ConfirmCards
(
tp
,
Group
.
FromCards
(
c
))
Duel
.
ConfirmCards
(
1
-
tp
,
Group
.
FromCards
(
c
))
c
:
ReplaceEffect
(
tcode
,
0
,
0
)
end
function
cm
.
tfcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
and
c
:
IsFaceup
()
end
function
cm
.
tftg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
cm
.
tfop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
end
local
token
=
Duel
.
CreateToken
(
tp
,
17111013
)
Duel
.
MoveToField
(
token
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetValue
(
TYPE_SPELL
+
TYPE_CONTINUOUS
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fc0000
)
token
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCondition
(
cm
.
atkcon
)
e2
:
SetOperation
(
cm
.
atkop
)
token
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
token
:
RegisterEffect
(
e3
)
end
function
cm
.
cfilter
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
GetSummonPlayer
()
==
tp
end
function
cm
.
atkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
cm
.
cfilter
,
1
,
nil
,
tp
)
end
function
cm
.
atkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
eg
:
Filter
(
cm
.
cfilter
,
nil
,
tp
):
Filter
(
Card
.
IsFaceup
,
nil
)
local
tc
=
g
:
GetFirst
()
while
tc
do
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
1200
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
tc
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
9
))
e3
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_ATTACK_ANNOUNCE
)
e3
:
SetOperation
(
cm
.
atkbop
)
tc
:
RegisterEffect
(
e3
)
tc
=
g
:
GetNext
()
end
end
function
cm
.
atkbop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetValue
(
cm
.
efilter
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_DAMAGE
)
e
:
GetHandler
():
RegisterEffect
(
e1
)
end
function
cm
.
efilter
(
e
,
te
)
return
te
:
GetOwner
()
~=
e
:
GetOwner
()
end
function
cm
.
descon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsPreviousLocation
(
LOCATION_MZONE
+
LOCATION_SZONE
)
and
c
:
IsFaceup
()
end
function
cm
.
sumsuc
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
12
,
0
,
aux
.
Stringid
(
m
,
5
))
end
function
cm
.
atksuc
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
12
,
0
,
aux
.
Stringid
(
m
,
6
))
end
function
cm
.
dessuc
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
12
,
0
,
aux
.
Stringid
(
m
,
7
))
end
\ No newline at end of file
expansions/script/c22250001.lua
View file @
52888c11
...
...
@@ -6,7 +6,7 @@ function c22250001.initial_effect(c)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_FUSION_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetRange
(
LOCATION_HAND
+
LOCATION_GRAVE
)
e1
:
SetCountLimit
(
1
,
222500011
)
e1
:
SetCondition
(
c22250001
.
spcon
)
e1
:
SetTarget
(
c22250001
.
sptg
)
...
...
@@ -17,11 +17,11 @@ function c22250001.initial_effect(c)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
22250001
,
1
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOGRAVE
)
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCountLimit
(
1
,
222500012
)
e3
:
SetCode
(
EVENT_CHAINING
)
e3
:
SetRange
(
LOCATION_HAND
)
e3
:
SetCountLimit
(
1
,
222500012
)
e3
:
SetCondition
(
c22250001
.
cecon
)
e3
:
SetTarget
(
c22250001
.
cetg
)
e3
:
SetOperation
(
c22250001
.
ceop
)
...
...
@@ -65,7 +65,7 @@ function c22250001.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function
c22250001
.
xfilter
(
c
,
tp
)
return
c
:
IsLocation
(
LOCATION_
MZONE
)
and
c
:
IsFaceup
()
and
c22250001
.
IsRiviera
(
c
)
and
c
:
IsControler
(
tp
)
return
c
:
IsLocation
(
LOCATION_
ONFIELD
)
and
c
:
IsFaceup
()
and
c22250001
.
IsRiviera
(
c
)
and
c
:
IsControler
(
tp
)
end
function
c22250001
.
cecon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
==
re
or
not
re
:
IsHasProperty
(
EFFECT_FLAG_CARD_TARGET
)
then
return
false
end
...
...
@@ -80,8 +80,8 @@ end
function
c22250001
.
cetg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
tf
=
re
:
GetTarget
()
local
res
,
ceg
,
cep
,
cev
,
cre
,
cr
,
crp
=
Duel
.
CheckEvent
(
re
:
GetCode
(),
true
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_
MZONE
)
and
chkc
:
IsControler
(
tp
)
and
c22250001
.
cefilter
(
chkc
,
re
,
rp
,
tf
,
ceg
,
cep
,
cev
,
cre
,
cr
,
crp
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c22250001
.
cefilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
re
,
rp
,
tf
,
ceg
,
cep
,
cev
,
cre
,
cr
,
crp
,
e
:
GetHandler
())
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
end
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_
ONFIELD
)
and
chkc
:
IsControler
(
tp
)
and
c22250001
.
cefilter
(
chkc
,
re
,
rp
,
tf
,
ceg
,
cep
,
cev
,
cre
,
cr
,
crp
)
end
if
chk
==
0
then
return
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c22250001
.
ceop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
...
...
expansions/script/c22250002.lua
View file @
52888c11
...
...
@@ -17,7 +17,6 @@ function c22250002.initial_effect(c)
e1
:
SetCategory
(
CATEGORY_DISABLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetCode
(
EVENT_BATTLE_START
)
e1
:
SetCondition
(
c22250002
.
descon
)
e1
:
SetTarget
(
c22250002
.
destg
)
e1
:
SetOperation
(
c22250002
.
desop
)
c
:
RegisterEffect
(
e1
)
...
...
@@ -65,14 +64,6 @@ function c22250002.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function
c22250002
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c22250002
.
IsRiviera
(
c
)
end
function
c22250002
.
descon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
c
:
GetBattleTarget
()
return
Duel
.
IsExistingMatchingCard
(
c22250002
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
e
:
GetHandler
())
and
tc
end
function
c22250002
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
tc
=
c
:
GetBattleTarget
()
...
...
expansions/script/c22250003.lua
View file @
52888c11
...
...
@@ -44,18 +44,11 @@ function c22250003.spop(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
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_LEAVE_FIELD_REDIRECT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
0xfe0000
)
e1
:
SetValue
(
LOCATION_REMOVED
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTargetRange
(
LOCATION_
MZONE
,
0
)
e2
:
SetTargetRange
(
LOCATION_
ONFIELD
,
0
)
e2
:
SetReset
(
RESET_EVENT
+
0xfe0000
)
e2
:
SetTarget
(
c22250003
.
etarget
)
e2
:
SetValue
(
c22250003
.
efilter
)
...
...
@@ -97,6 +90,7 @@ function c22250003.setop(e,tp,eg,ep,ev,re,r,rp)
if
lct
<
sct
then
sct
=
lct
end
if
not
c
:
IsRelateToEffect
(
e
)
or
not
c
:
IsAbleToGrave
()
then
return
end
if
Duel
.
SendtoGrave
(
c
,
REASON_EFFECT
)
>
0
and
sct
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
c22250003
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
sct
,
nil
,
false
)
if
sg
:
GetCount
()
>
0
then
Duel
.
SSet
(
tp
,
sg
)
...
...
expansions/script/c22250004.lua
View file @
52888c11
...
...
@@ -41,7 +41,7 @@ function c22250004.spfilter(c,code,e,tp)
end
function
c22250004
.
filter
(
c
,
e
,
tp
)
local
code
=
c
:
GetCode
()
return
c
:
IsFaceup
()
and
c22250004
.
IsRiviera
(
c
)
and
c
:
GetBattledGroupCount
()
>
0
and
Duel
.
IsExistingMatchingCard
(
c22250004
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
code
,
e
,
tp
)
return
c
:
IsFaceup
()
and
c22250004
.
IsRiviera
(
c
)
and
Duel
.
IsExistingMatchingCard
(
c22250004
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
code
,
e
,
tp
)
end
function
c22250004
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
c22250004
.
filter
(
chkc
,
e
,
tp
)
end
...
...
expansions/script/c22250005.lua
View file @
52888c11
...
...
@@ -93,7 +93,7 @@ end
function
c22250005
.
negtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsFaceup
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_
DESTROY
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_
FACEUP
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DISABLE
,
g
,
1
,
0
,
0
)
end
...
...
@@ -106,13 +106,13 @@ function c22250005.negop(e,tp,eg,ep,ev,re,r,rp)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e1
:
SetValue
(
-
3
00
)
e1
:
SetValue
(
-
5
00
)
tc
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e1
:
SetValue
(
-
3
00
)
e1
:
SetValue
(
-
5
00
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
...
...
expansions/script/c22250006.lua
View file @
52888c11
--Riviera 罗莎
function
c22250006
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
22250006
,
0
))
...
...
@@ -37,13 +36,13 @@ function c22250006.spcon(e,tp,eg,ep,ev,re,r,rp)
end
function
c22250006
.
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
,
tru
e
)
end
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
fals
e
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c22250006
.
spop
(
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
,
tru
e
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
fals
e
,
POS_FACEUP
)
if
c
:
IsPreviousLocation
(
LOCATION_GRAVE
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
...
...
@@ -52,7 +51,6 @@ function c22250006.spop(e,tp,eg,ep,ev,re,r,rp)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e1
:
SetValue
(
LOCATION_REMOVED
)
c
:
RegisterEffect
(
e1
)
c
:
CompleteProcedure
()
end
end
function
c22250006
.
efcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
...
...
@@ -63,7 +61,7 @@ function c22250006.efop(e,tp,eg,ep,ev,re,r,rp)
local
rc
=
c
:
GetReasonCard
()
local
e2
=
Effect
.
CreateEffect
(
rc
)
e2
:
SetDescription
(
aux
.
Stringid
(
22250006
,
1
))
e2
:
SetCategory
(
CATEGORY_
DESTROY
)
e2
:
SetCategory
(
CATEGORY_
TOHAND
+
CATEGORY_REMOVE
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetProperty
(
EFFECT_FLAG_NO_TURN_RESET
+
EFFECT_FLAG_CARD_TARGET
)
...
...
@@ -82,23 +80,31 @@ function c22250006.efop(e,tp,eg,ep,ev,re,r,rp)
end
end
function
c22250006
.
filter2
(
c
)
return
bit
.
band
(
c
:
GetReason
(),
0x40008
)
==
0x40008
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
and
c
:
IsAbleTo
Deck
()
return
bit
.
band
(
c
:
GetReason
(),
0x40008
)
==
0x40008
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
and
c
:
IsAbleTo
Remove
()
end
function
c22250006
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
false
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c22250006
.
filter2
,
tp
,
LOCATION_GRAVE
,
0
,
2
,
nil
)
end
local
g
=
Duel
.
SelectTarget
(
tp
,
c22250006
.
filter2
,
tp
,
LOCATION_GRAVE
,
0
,
2
,
2
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_
TODECK
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_
REMOVE
,
nil
,
1
,
0
,
0
)
end
function
c22250006
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
)
local
sg
=
g
:
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
if
sg
:
GetCount
()
==
2
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
tc
=
sg
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
sg
:
RemoveCard
(
tc
)
Duel
.
SendtoDeck
(
sg
,
nil
,
1
,
REASON_EFFECT
)
Duel
.
Remove
(
sg
,
POS_FACEUP
,
REASON_EFFECT
)
if
Duel
.
IsExistingMatchingCard
(
c22250006
.
filterx
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
22250006
,
2
))
then
local
g
=
Duel
.
GetMatchingGroup
(
c22250006
.
filterx
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
Duel
.
SendtoHand
(
g
:
GetFirst
(),
nil
,
REASON_EFFECT
)
end
end
end
function
c22250006
.
filterx
(
c
)
return
c
:
IsCode
(
22250001
)
and
c
:
IsAbleToHand
()
end
\ No newline at end of file
expansions/script/c22250101.lua
View file @
52888c11
...
...
@@ -95,7 +95,7 @@ function c22250101.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local
c
=
e
:
GetHandler
()
local
d
=
c
:
GetBattleTarget
()
local
ct
=
c
:
GetMaterial
():
FilterCount
(
c22250101
.
atkfilter
,
nil
)
if
chk
==
0
then
return
ct
>
0
and
d
:
IsRelateToBattle
()
and
c
:
IsRelateToBattle
()
and
c
:
IsAttackable
()
end
if
chk
==
0
then
return
ct
>
0
and
d
:
IsRelateToBattle
()
and
c
:
IsRelateToBattle
()
and
c
:
GetSummonType
()
==
SUMMON_TYPE_FUSION
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c22250101
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
...
...
expansions/script/c22250102.lua
View file @
52888c11
...
...
@@ -5,7 +5,8 @@ function c22250102.initial_effect(c)
aux
.
AddFusionProcFun2
(
c
,
c22250102
.
ffilter
,
aux
.
FilterBoolFunction
(
Card
.
IsRace
,
RACE_FAIRY
),
true
)
--exchange atk
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetType
(
EFFECT_TYPE_TRIGGER_F
+
EFFECT_TYPE_FIELD
)
e5
:
SetCategory
(
CATEGORY_ATKCHANGE
)
e5
:
SetType
(
EFFECT_TYPE_TRIGGER_O
+
EFFECT_TYPE_FIELD
)
e5
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
)
e5
:
SetRange
(
LOCATION_MZONE
)
e5
:
SetCode
(
EVENT_BATTLE_START
)
...
...
@@ -68,27 +69,16 @@ end
function
c22250102
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
c
=
e
:
GetHandler
()
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
+
LOCATION_REMOVED
)
and
c22250102
.
filter
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c22250102
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
,
e
,
tp
)
and
c
:
IsAbleToRemove
()
and
(
c
:
GetSequence
()
<
5
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c22250102
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
,
e
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c22250102
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
LOCATION_GRAVE
+
LOCATION_REMOVED
)
end
function
c22250102
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsAbleToRemove
()
then
return
end
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
Remove
(
c
,
POS_FACEUP
,
REASON_EFFECT
+
REASON_TEMPORARY
)
~=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetLabelObject
(
c
)
e1
:
SetCountLimit
(
1
)
e1
:
SetOperation
(
c22250102
.
retop
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
c22250102
.
retop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
...
...
expansions/script/c22250161.lua
0 → 100644
View file @
52888c11
--利维艾拉 乌尔斯拉
function
c22250161
.
initial_effect
(
c
)
--link summon
aux
.
AddLinkProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsLinkType
,
TYPE_EFFECT
),
2
,
2
)
c
:
EnableReviveLimit
()
--summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
22250161
,
0
))
e1
:
SetCategory
(
CATEGORY_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTarget
(
c22250161
.
stg
)
e1
:
SetOperation
(
c22250161
.
sop
)
c
:
RegisterEffect
(
e1
)
--spsummon
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e4
:
SetCode
(
EVENT_BE_MATERIAL
)
e4
:
SetOperation
(
c22250161
.
tgop
)
c
:
RegisterEffect
(
e4
)
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
22250161
,
1
))
e5
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e5
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_F
)
e5
:
SetRange
(
LOCATION_GRAVE
)
e5
:
SetCountLimit
(
1
)
e5
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e5
:
SetCondition
(
c22250161
.
spcon
)
e5
:
SetTarget
(
c22250161
.
sptg
)
e5
:
SetOperation
(
c22250161
.
spop
)
c
:
RegisterEffect
(
e5
)
end
c22250161
.
named_with_Riviera
=
1
function
c22250161
.
IsRiviera
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
named_with_Riviera
end
function
c22250161
.
filter
(
c
,
e
,
zone
)
return
c22250161
.
IsRiviera
(
c
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsSummonable
(
true
,
e
,
0
,
zone
)
end
function
c22250161
.
stg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
zone
=
e
:
GetHandler
():
GetLinkedZone
()
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
zone
~=
0
and
Duel
.
IsExistingMatchingCard
(
c22250161
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
0
,
zone
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
end
function
c22250161
.
sop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
zone
=
e
:
GetHandler
():
GetLinkedZone
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<
1
or
zone
==
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c22250161
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
0
,
zone
)
local
tc
=
g
:
GetFirst
()
if
tc
then
Duel
.
Summon
(
tp
,
tc
,
true
,
nil
,
0
,
zone
)
if
c
:
IsRelateToEffect
(
e
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
,
2
)
e1
:
SetValue
(
tc
:
GetAttack
())
c
:
RegisterEffect
(
e1
)
end
end
end
function
c22250161
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
(
c
:
IsLocation
(
LOCATION_GRAVE
)
and
r
==
REASON_FUSION
)
then
return
end
if
Duel
.
GetCurrentPhase
()
<=
PHASE_END
then
c
:
RegisterFlagEffect
(
22250161
,
RESET_EVENT
+
0x1ff0000
+
RESET_PHASE
+
PHASE_END
,
0
,
2
)
else
c
:
RegisterFlagEffect
(
22250161
,
RESET_EVENT
+
0x1ff0000
+
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
end
function
c22250161
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
GetTurnID
()
~=
Duel
.
GetTurnCount
()
and
c
:
GetFlagEffect
(
22250161
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c22250161
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c22250161
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
800
)
e1
:
SetReset
(
RESET_EVENT
+
0xfe0000
)
c
:
RegisterEffect
(
e1
)
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
\ No newline at end of file
expansions/script/c22251001.lua
View file @
52888c11
...
...
@@ -6,7 +6,6 @@ function c22251001.initial_effect(c)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_FUSION_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
22251001
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetTarget
(
c22251001
.
target
)
e1
:
SetOperation
(
c22251001
.
activate
)
c
:
RegisterEffect
(
e1
)
...
...
@@ -33,7 +32,6 @@ function c22251001.initial_effect(c)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCost
(
c22251001
.
cost
)
e2
:
SetCondition
(
c22251001
.
con
)
e2
:
SetTarget
(
c22251001
.
tg
)
...
...
@@ -164,15 +162,18 @@ function c22251001.op(e,tp,eg,ep,ev,re,r,rp,chk)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
-
5
00
*
e
:
GetLabel
())
e1
:
SetValue
(
-
4
00
*
e
:
GetLabel
())
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
e1
:
SetValue
(
-
5
00
*
e
:
GetLabel
())
e1
:
SetValue
(
-
4
00
*
e
:
GetLabel
())
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
)
if
tc
:
GetAttack
()
*
tc
:
GetDefense
()
==
0
then
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
end
tc
=
g
:
GetNext
()
end
end
...
...
expansions/script/c22251002.lua
View file @
52888c11
...
...
@@ -3,7 +3,6 @@ function c22251002.initial_effect(c)
--draw
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
22251002
,
0
))
e1
:
SetCategory
(
CATEGORY_DRAW
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_HAND
)
...
...
@@ -95,13 +94,10 @@ function c22251002.tdfilter(c)
return
c
:
IsCode
(
22251002
)
and
c
:
IsAbleToDeck
()
end
function
c22251002
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
g
=
Duel
.
GetMatchingGroup
(
c22251002
.
tdfilter
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
if
chk
==
0
then
return
g
:
GetCount
()
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
g
,
g
:
GetCount
(),
0
,
0
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToDeck
()
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c22251002
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c22251002
.
tdfilter
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoDeck
(
g
,
nil
,
1
,
REASON_EFFECT
)
end
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
Duel
.
SendtoDeck
(
e
:
GetHandler
(),
nil
,
1
,
REASON_EFFECT
)
end
expansions/script/c22251101.lua
View file @
52888c11
...
...
@@ -62,7 +62,7 @@ function c22251101.activate(e,tp,eg,ep,ev,re,r,rp)
end
function
c22251101
.
droperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_CARD
,
0
,
22251101
)
Duel
.
Draw
(
tp
,
c22251101
[
tp
],
REASON_EFFECT
)
Duel
.
Draw
(
tp
,
c22251101
[
tp
]
*
2
,
REASON_EFFECT
)
end
function
c22251101
.
costfilter
(
c
)
return
c
:
IsCode
(
22251101
)
and
c
:
IsAbleToDeckAsCost
()
...
...
@@ -80,6 +80,7 @@ function c22251101.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c22251101
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
false
)
end
end
function
c22251101
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c22251101
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
false
)
if
g
:
GetCount
()
>
0
then
Duel
.
SSet
(
tp
,
g
:
GetFirst
())
...
...
expansions/script/c22251102.lua
0 → 100644
View file @
52888c11
--惊喜还是惊吓?
function
c22251102
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
22251102
,
0
))
e1
:
SetCategory
(
CATEGORY_DRAW
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
2
,
22251102
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCost
(
c22251102
.
cost
)
e1
:
SetTarget
(
c22251102
.
target
)
e1
:
SetOperation
(
c22251102
.
activate
)
c
:
RegisterEffect
(
e1
)
--ind
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
22251102
,
1
))
e2
:
SetCategory
(
CATEGORY_DRAW
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCost
(
c22251102
.
cost2
)
e2
:
SetTarget
(
c22251102
.
tg
)
e2
:
SetOperation
(
c22251102
.
op
)
c
:
RegisterEffect
(
e2
)
end
c22251102
.
named_with_Riviera
=
1
function
c22251102
.
IsRiviera
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
named_with_Riviera
end
function
c22251102
.
filter
(
c
)
return
c22251102
.
IsRiviera
(
c
)
and
c
:
IsAbleToGrave
()
end
function
c22251102
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c22251102
.
filter
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
e
:
GetHandler
())
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c22251102
.
filter
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
e
:
GetHandler
())
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
Duel
.
RegisterFlagEffect
(
tp
,
22251102
,
0
,
0
,
0
)
local
flag
=
Duel
.
GetFlagEffect
(
tp
,
22251102
)
if
flag
%
3
~=
0
then
e
:
SetLabel
(
0
)
else
e
:
SetLabel
(
1
)
end
end
function
c22251102
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
flag
=
Duel
.
GetFlagEffect
(
tp
,
22251102
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
2
)
end
if
e
:
GetLabel
()
==
0
then
e
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
2
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
2
)
end
function
c22251102
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetLabel
()
==
0
then
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Draw
(
p
,
d
,
REASON_EFFECT
)
elseif
e
:
GetLabel
()
==
1
then
while
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_HAND
,
0
)
>
2
do
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_EFFECT
,
nil
)
end
end
end
function
c22251102
.
costfilter
(
c
)
return
c
:
IsCode
(
22251102
)
and
c
:
IsAbleToDeckAsCost
()
end
function
c22251102
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroup
(
c22251102
.
costfilter
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
if
chk
==
0
then
return
g
:
GetCount
()
>
1
end
local
rg
=
g
:
RandomSelect
(
tp
,
2
)
Duel
.
SendtoDeck
(
rg
,
nil
,
1
,
REASON_COST
)
end
function
c22251102
.
tg
(
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
c22251102
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
>
0
then
local
tc
=
Duel
.
GetOperatedGroup
():
GetFirst
()
if
c22251102
.
IsRiviera
(
tc
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
tc
:
IsSummonable
(
true
,
e
,
0
)
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
22251102
,
2
))
then
Duel
.
Summon
(
tp
,
tc
,
true
,
nil
,
0
)
else
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
Duel
.
ShuffleHand
(
tp
)
end
elseif
not
(
c22251102
.
IsRiviera
(
tc
)
and
tc
:
IsType
(
TYPE_MONSTER
))
then
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
end
end
end
\ No newline at end of file
expansions/script/c22251201.lua
0 → 100644
View file @
52888c11
--壮绝圣战
function
c22251201
.
initial_effect
(
c
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
22251201
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetOperation
(
c22251201
.
activate
)
c
:
RegisterEffect
(
e1
)
--SpecialSummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCost
(
c22251201
.
cost
)
e1
:
SetTarget
(
c22251201
.
target
)
e1
:
SetOperation
(
c22251201
.
operation
)
c
:
RegisterEffect
(
e1
)
--set
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_TO_DECK
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
22251201
)
e2
:
SetCondition
(
c22251201
.
con
)
e2
:
SetCost
(
c22251201
.
cost2
)
e2
:
SetTarget
(
c22251201
.
tg
)
e2
:
SetOperation
(
c22251201
.
op
)
c
:
RegisterEffect
(
e2
)
end
c22251201
.
named_with_Riviera
=
1
function
c22251201
.
IsRiviera
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
named_with_Riviera
end
function
c22251201
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
c22251201
.
announce_filter2
=
{
22250001
,
OPCODE_ISCODE
,
22250002
,
OPCODE_ISCODE
,
22250003
,
OPCODE_ISCODE
,
22250004
,
OPCODE_ISCODE
,
22250005
,
OPCODE_ISCODE
,
22250006
,
OPCODE_ISCODE
,
22250101
,
OPCODE_ISCODE
,
22250102
,
OPCODE_ISCODE
,
OPCODE_OR
,
OPCODE_OR
,
OPCODE_OR
,
OPCODE_OR
,
OPCODE_OR
,
OPCODE_OR
,
OPCODE_OR
,
OPCODE_OR
}
local
ac
=
Duel
.
AnnounceCardFilter
(
tp
,
table.unpack
(
c22251201
.
announce_filter2
))
c
:
SetHint
(
CHINT_CARD
,
ac
)
--tograve
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCondition
(
c22251201
.
tgcon
)
e1
:
SetTarget
(
c22251201
.
tgtg
)
e1
:
SetOperation
(
c22251201
.
tgop
)
e1
:
SetLabel
(
ac
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e1
:
Clone
()
end
function
c22251201
.
filter
(
c
,
code
)
return
c
:
IsFaceup
()
and
c
:
IsCode
(
code
)
end
function
c22251201
.
tgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c22251201
.
filter
,
1
,
nil
,
e
:
GetLabel
())
and
rp
==
tp
end
function
c22251201
.
tgfilter
(
c
,
code
)
return
c22251201
.
IsRiviera
(
c
)
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsAbleToGrave
()
end
function
c22251201
.
tgtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c22251201
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
0
,
0
,
0
,
0
)
end
function
c22251201
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c22251201
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
end
function
c22251201
.
costfilter
(
c
)
return
c22251201
.
IsRiviera
(
c
)
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsAbleToDeckAsCost
()
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsCode
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
c
,
c
:
GetCode
())
end
function
c22251201
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c22251201
.
costfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c22251201
.
costfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
g
:
Merge
(
Duel
.
GetFieldGroup
(
tp
,
LOCATION_GRAVE
,
0
):
Filter
(
Card
.
IsCode
,
nil
,
g
:
GetFirst
():
GetCode
()):
Select
(
tp
,
1
,
1
,
g
:
GetFirst
()))
Duel
.
SendtoDeck
(
g
,
nil
,
1
,
REASON_COST
)
end
function
c22251201
.
spfilter
(
c
,
e
,
tp
)
return
c22251201
.
IsRiviera
(
c
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c22251201
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c22251201
.
spfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
0
)
end
function
c22251201
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<
1
or
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c22251201
.
spfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
c22251201
.
tdcfilter
(
c
)
return
c22251201
.
IsRiviera
(
c
)
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsPreviousLocation
(
LOCATION_GRAVE
)
end
function
c22251201
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c22251201
.
tdcfilter
,
1
,
nil
)
end
function
c22251201
.
cfilter
(
c
)
return
c
:
IsCode
(
22251201
)
and
c
:
IsAbleToDeckAsCost
()
end
function
c22251201
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c22251201
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
e
:
GetHandler
())
end
local
g
=
Duel
.
GetMatchingGroup
(
c22251201
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
e
:
GetHandler
())
Duel
.
SendtoDeck
(
g
,
nil
,
1
,
REASON_COST
)
end
function
c22251201
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsSSetable
()
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_LEAVE_GRAVE
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c22251201
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
c
:
IsSSetable
()
then
Duel
.
SSet
(
tp
,
c
)
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
end
end
expansions/script/c22251501.lua
0 → 100644
View file @
52888c11
--降临之地 利维艾拉
local
m
=
22251501
local
cm
=
_G
[
"c"
..
m
]
cm
.
dfc_front_side
=
m
cm
.
dfc_back_side
=
m
+
1
function
c22251501
.
initial_effect
(
c
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
22251501
,
1
))
e2
:
SetCategory
(
CATEGORY_TOGRAVE
+
CATEGORY_DRAW
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_NO_TURN_RESET
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetCountLimit
(
1
,
22251501
+
EFFECT_COUNT_CODE_OATH
)
e2
:
SetTarget
(
c22251501
.
tgtg
)
e2
:
SetOperation
(
c22251501
.
tgop
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
22251501
,
0
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetProperty
(
EFFECT_FLAG_NO_TURN_RESET
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCondition
(
c22251501
.
sccon
)
e2
:
SetTarget
(
c22251501
.
sctg
)
e2
:
SetOperation
(
c22251501
.
scop
)
c
:
RegisterEffect
(
e2
)
--turn back side
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
)
e3
:
SetCode
(
EVENT_ADJUST
)
e3
:
SetRange
(
LOCATION_FZONE
)
e3
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_SET_AVAILABLE
)
e3
:
SetCondition
(
c22251501
.
con
)
e3
:
SetOperation
(
c22251501
.
op
)
c
:
RegisterEffect
(
e3
)
end
c22251501
.
named_with_Riviera
=
1
function
c22251501
.
IsRiviera
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
named_with_Riviera
end
function
c22251501
.
filter
(
c
)
return
c22251501
.
IsRiviera
(
c
)
and
c
:
IsFaceup
()
end
function
c22251501
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
c22251501
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
c22251501
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tcode
=
c
.
dfc_back_side
c
:
SetEntityCode
(
tcode
,
true
)
c
:
ReplaceEffect
(
tcode
,
0
,
0
)
end
function
c22251501
.
sccon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_MZONE
,
0
)
==
0
end
function
c22251501
.
sfilter
(
c
,
e
,
tp
)
return
c22251501
.
IsRiviera
(
c
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
c
:
IsRace
(
RACE_FAIRY
)
end
function
c22251501
.
sctg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c22251501
.
sfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
0
,
1
,
0
,
0
)
end
function
c22251501
.
scop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<
1
or
not
c
:
IsRelateToEffect
(
e
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c22251501
.
sfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
fale
,
false
,
POS_FACEUP
)
end
end
function
c22251501
.
tgfilter
(
c
)
return
c
:
IsAbleToGrave
()
and
c22251501
.
IsRiviera
(
c
)
and
c
:
IsFaceup
()
end
function
c22251501
.
tgtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsOnField
()
and
c22251501
.
tgfilter
(
chkc
)
and
chkc
~=
e
:
GetHandler
()
end
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
IsExistingTarget
(
c22251501
.
tgfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c22251501
.
tgfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
e
:
GetHandler
())
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
0
,
1
,
tp
,
0
)
end
function
c22251501
.
tgop
(
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
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
>
0
and
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c22251502.lua
0 → 100644
View file @
52888c11
--约束之地 利维艾拉
local
m
=
22251502
local
cm
=
_G
[
"c"
..
m
]
cm
.
dfc_front_side
=
m
-
1
cm
.
dfc_back_side
=
m
function
c22251502
.
initial_effect
(
c
)
--tohand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
22251502
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_NO_TURN_RESET
)
e1
:
SetRange
(
LOCATION_FZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetTarget
(
c22251502
.
thtg
)
e1
:
SetOperation
(
c22251502
.
thop
)
c
:
RegisterEffect
(
e1
)
--Activate(effect)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
22251502
,
1
))
e4
:
SetCategory
(
CATEGORY_NEGATE
+
CATEGORY_DESTROY
)
e4
:
SetProperty
(
EFFECT_FLAG_NO_TURN_RESET
)
e4
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e4
:
SetCode
(
EVENT_CHAINING
)
e4
:
SetRange
(
LOCATION_FZONE
)
e4
:
SetCountLimit
(
1
)
e4
:
SetCondition
(
c22251502
.
condition2
)
e4
:
SetTarget
(
c22251502
.
target2
)
e4
:
SetOperation
(
c22251502
.
activate2
)
c
:
RegisterEffect
(
e4
)
--turn back1
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
)
e3
:
SetCode
(
EVENT_ADJUST
)
e3
:
SetRange
(
LOCATION_FZONE
)
e3
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_SET_AVAILABLE
)
e3
:
SetCondition
(
c22251502
.
con
)
e3
:
SetOperation
(
c22251502
.
op
)
c
:
RegisterEffect
(
e3
)
--back2
local
e8
=
Effect
.
CreateEffect
(
c
)
e8
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e8
:
SetCode
(
EVENT_ADJUST
)
e8
:
SetRange
(
LOCATION_DECK
+
LOCATION_GRAVE
+
LOCATION_REMOVED
+
LOCATION_HAND
+
LOCATION_EXTRA
)
e8
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_SET_AVAILABLE
)
e8
:
SetCountLimit
(
1
)
e8
:
SetCondition
(
c22251502
.
backon
)
e8
:
SetOperation
(
c22251502
.
backop
)
c
:
RegisterEffect
(
e8
)
end
c22251502
.
named_with_Riviera
=
1
function
c22251502
.
IsRiviera
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
named_with_Riviera
end
function
c22251502
.
thfilter
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
c22251502
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
+
LOCATION_REMOVED
)
and
chkc
:
IsControler
(
tp
)
and
c22251502
.
thfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c22251502
.
thfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
sg
=
Duel
.
SelectTarget
(
tp
,
c22251502
.
thfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
sg
,
sg
:
GetCount
(),
0
,
0
)
end
function
c22251502
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
and
tc
:
IsRelateToEffect
(
e
)
and
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
end
end
function
c22251502
.
ncfilter
(
c
)
return
c22251502
.
IsRiviera
(
c
)
and
c
:
IsFaceup
()
end
function
c22251502
.
condition2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
and
Duel
.
IsChainNegatable
(
ev
)
and
Duel
.
GetMatchingGroupCount
(
c22251502
.
ncfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
==
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_MZONE
,
0
)
end
function
c22251502
.
target2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_NEGATE
,
eg
,
1
,
0
,
0
)
if
re
:
GetHandler
():
IsDestructable
()
and
re
:
GetHandler
():
IsRelateToEffect
(
re
)
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
eg
,
1
,
0
,
0
)
end
end
function
c22251502
.
activate2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
Duel
.
NegateActivation
(
ev
)
and
re
:
GetHandler
():
IsRelateToEffect
(
re
)
then
Duel
.
Destroy
(
eg
,
REASON_EFFECT
)
end
end
function
c22251502
.
filter
(
c
)
return
c22251502
.
IsRiviera
(
c
)
and
c
:
IsFaceup
()
end
function
c22251502
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsExistingMatchingCard
(
c22251502
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
c22251502
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tcode
=
c
.
dfc_front_side
c
:
SetEntityCode
(
tcode
,
true
)
c
:
ReplaceEffect
(
tcode
,
0
,
0
)
end
function
c22251502
.
backon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
.
dfc_front_side
and
c
:
GetOriginalCode
()
==
c
.
dfc_back_side
end
function
c22251502
.
backop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tcode
=
c
.
dfc_front_side
c
:
SetEntityCode
(
tcode
)
Duel
.
ConfirmCards
(
tp
,
Group
.
FromCards
(
c
))
Duel
.
ConfirmCards
(
1
-
tp
,
Group
.
FromCards
(
c
))
c
:
ReplaceEffect
(
tcode
,
0
,
0
)
end
\ No newline at end of file
expansions/script/c22252001.lua
View file @
52888c11
...
...
@@ -13,7 +13,6 @@ function c22252001.initial_effect(c)
--ind
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
22252001
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_GRAVE
)
...
...
@@ -52,7 +51,7 @@ function c22252001.activate(e,tp,eg,ep,ev,re,r,rp)
sg
=
sg
:
Select
(
tp
,
ft
,
ft
,
nil
)
end
local
ct
=
Duel
.
SpecialSummon
(
sg
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
if
ct
>
0
and
sg
:
FilterCount
(
Card
.
IsRace
,
nil
,
RACE_FAIRY
)
<
2
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
22252001
,
2
))
then
if
ct
>
0
and
sg
:
FilterCount
(
Card
.
IsRace
,
nil
,
RACE_FAIRY
)
<
sg
:
GetCount
()
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
22252001
,
2
))
then
local
tc
=
sg
:
GetFirst
()
while
tc
do
if
not
tc
:
IsRace
(
RACE_FAIRY
)
then
...
...
@@ -81,7 +80,7 @@ function c22252001.op(e,tp,eg,ep,ev,re,r,rp)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsRace
,
RACE_FAIRY
))
e1
:
SetTarget
(
aux
.
TargetBoolFunction
(
c22252001
.
eefilter
))
e1
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetValue
(
c22252001
.
efilter
)
...
...
@@ -90,3 +89,6 @@ end
function
c22252001
.
efilter
(
e
,
re
)
return
e
:
GetHandlerPlayer
()
~=
re
:
GetHandlerPlayer
()
and
re
:
IsActiveType
(
TYPE_MONSTER
)
end
function
c22252001
.
eefilter
(
c
)
return
c22252001
.
IsRiviera
(
c
)
and
c
:
IsFaceup
()
end
expansions/script/c22252101.lua
View file @
52888c11
...
...
@@ -106,6 +106,7 @@ function c22252101.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function
c22252101
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<
1
or
not
Duel
.
IsExistingMatchingCard
(
c22252101
.
spfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c22252101
.
spfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
\ No newline at end of file
expansions/script/c22252201.lua
0 → 100644
View file @
52888c11
--对碑文的解读
function
c22252201
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
0
,
22252201
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetOperation
(
c22252201
.
activate
)
c
:
RegisterEffect
(
e1
)
--ANNOUNCE_CARD
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_F
)
e2
:
SetCode
(
EVENT_PHASE
+
PHASE_STANDBY
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetTarget
(
c22252201
.
target
)
e2
:
SetOperation
(
c22252201
.
operation
)
c
:
RegisterEffect
(
e2
)
--activate in set turn
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EFFECT_TRAP_ACT_IN_SET_TURN
)
e3
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
LOCATION_SZONE
,
0
)
e3
:
SetTarget
(
aux
.
TargetBoolFunction
(
c22252201
.
eefilter
))
c
:
RegisterEffect
(
e3
)
end
c22252201
.
named_with_Riviera
=
1
function
c22252201
.
IsRiviera
(
c
)
local
m
=
_G
[
"c"
..
c
:
GetCode
()]
return
m
and
m
.
named_with_Riviera
end
function
c22252201
.
thfilter
(
c
)
return
c22252201
.
IsRiviera
(
c
)
and
c
:
IsAbleToHand
()
end
function
c22252201
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
Duel
.
IsExistingMatchingCard
(
c22252201
.
thfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
22252201
,
0
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c22252201
.
thfilter
,
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
end
function
c22252201
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
true
end
end
function
c22252201
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
c22252201
.
announce_filter2
=
{
22251001
,
OPCODE_ISCODE
,
22251002
,
OPCODE_ISCODE
,
22251101
,
OPCODE_ISCODE
,
22251201
,
OPCODE_ISCODE
,
22251501
,
OPCODE_ISCODE
,
22252001
,
OPCODE_ISCODE
,
22252101
,
OPCODE_ISCODE
,
22252201
,
OPCODE_ISCODE
,
OPCODE_OR
,
OPCODE_OR
,
OPCODE_OR
,
OPCODE_OR
,
OPCODE_OR
,
OPCODE_OR
,
OPCODE_OR
,
OPCODE_OR
}
local
ac
=
Duel
.
AnnounceCardFilter
(
tp
,
table.unpack
(
c22252201
.
announce_filter2
))
c
:
SetHint
(
CHINT_CARD
,
ac
)
--tohand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCondition
(
c22252201
.
spcon
)
e1
:
SetTarget
(
c22252201
.
sptg
)
e1
:
SetOperation
(
c22252201
.
spop
)
e1
:
SetLabel
(
ac
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
end
function
c22252201
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
ep
==
tp
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
and
re
:
GetHandler
():
IsCode
(
e
:
GetLabel
())
end
function
c22252201
.
tehfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsAbleToHand
()
end
function
c22252201
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c22252201
.
tehfilter
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
0
,
0
)
end
function
c22252201
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c22252201
.
tehfilter
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
local
tc
=
g
:
GetFirst
()
if
tc
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
end
end
function
c22252201
.
eefilter
(
c
)
return
c22252201
.
IsRiviera
(
c
)
end
\ No newline at end of file
expansions/script/c500001.lua
0 → 100644
View file @
52888c11
--ダイナミスト・ハウリング
function
c500001
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
c500001
.
target
)
e1
:
SetOperation
(
c500001
.
activate
)
c
:
RegisterEffect
(
e1
)
--set
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
500001
,
1
))
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetCountLimit
(
1
,
500001
)
e2
:
SetCost
(
c500001
.
cost
)
e2
:
SetOperation
(
c500001
.
operation
)
c
:
RegisterEffect
(
e2
)
end
function
c500001
.
costfilter
(
c
)
return
((
c
:
IsRace
(
RACE_FAIRY
)
and
c
:
IsAttribute
(
ATTRIBUTE_LIGHT
))
or
(
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_CONTINUOUS
)))
and
c
:
IsReleasable
()
end
function
c500001
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c500001
.
costfilter
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c500001
.
costfilter
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
99
,
nil
)
local
ct
=
Duel
.
Release
(
g
,
REASON_COST
)
e
:
SetLabel
(
ct
)
end
function
c500001
.
operation
(
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
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetOperation
(
c500001
.
setop
)
e1
:
SetLabel
(
e
:
GetLabel
())
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
c500001
.
setop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c500001
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
local
ft
,
ct
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
),
e
:
GetLabel
()
local
ct2
=
math.min
(
ft
,
ct
)
Duel
.
Hint
(
HINT_CARD
,
0
,
500001
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sg
=
g
:
Select
(
tp
,
1
,
ct2
,
nil
)
if
sg
:
GetCount
()
>
0
then
Duel
.
SSet
(
tp
,
sg
,
tp
)
Duel
.
ConfirmCards
(
1
-
tp
,
sg
)
end
end
function
c500001
.
setfilter
(
c
)
return
(
c
:
IsSetCard
(
0xffac
)
or
c
:
IsSetCard
(
0xffad
))
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsSSetable
()
end
function
c500001
.
rfilter
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsAttribute
(
ATTRIBUTE_LIGHT
)
and
c
:
IsReleasable
()
end
function
c500001
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c500001
.
rfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_RELEASE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c500001
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
c500001
.
rfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
+
REASON_RELEASE
)
end
end
\ No newline at end of file
expansions/script/c500002.lua
0 → 100644
View file @
52888c11
--甘兔庵
function
c500002
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
c500002
.
target
)
e1
:
SetOperation
(
c500002
.
activate
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_F
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetCondition
(
c500002
.
negcon
)
e2
:
SetOperation
(
c500002
.
negop
)
c
:
RegisterEffect
(
e2
)
end
function
c500002
.
cfilter
(
c
,
tp
)
return
c
:
IsOnField
()
and
c
:
IsControler
(
tp
)
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
end
function
c500002
.
negcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ex
,
tg
,
tc
=
Duel
.
GetOperationInfo
(
ev
,
CATEGORY_DESTROY
)
return
ex
and
tg
~=
nil
and
tc
+
tg
:
FilterCount
(
c500002
.
cfilter
,
nil
,
tp
)
-
tg
:
GetCount
()
>
0
and
e
:
GetHandler
():
IsFacedown
()
and
e
:
GetHandler
():
GetActivateEffect
():
IsActivatable
(
tp
)
end
function
c500002
.
negop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
NegateActivation
(
ev
)
then
if
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
and
re
:
GetHandler
():
IsRelateToEffect
(
re
)
then
Duel
.
SendtoGrave
(
eg
,
REASON_EFFECT
)
end
if
not
c
:
GetActivateEffect
():
IsActivatable
(
tp
)
then
return
end
Duel
.
ChangePosition
(
c
,
POS_FACEUP
)
local
te
=
c
:
GetActivateEffect
()
local
tep
=
c
:
GetControler
()
local
cost
=
te
:
GetCost
()
if
cost
then
cost
(
te
,
tep
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
1
)
end
Duel
.
RaiseEvent
(
c
,
500002
,
te
,
0
,
tp
,
tp
,
Duel
.
GetCurrentChain
())
end
end
function
c500002
.
rfilter
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsAttribute
(
ATTRIBUTE_LIGHT
)
and
c
:
IsReleasable
()
end
function
c500002
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c500002
.
rfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_RELEASE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c500002
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
c500002
.
rfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
+
REASON_RELEASE
)
end
end
\ No newline at end of file
expansions/script/c500003.lua
0 → 100644
View file @
52888c11
--大小姐女仆 纱路
function
c500003
.
initial_effect
(
c
)
--race
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetCode
(
EFFECT_ADD_RACE
)
e1
:
SetRange
(
LOCATION_HAND
+
LOCATION_GRAVE
)
e1
:
SetValue
(
RACE_FAIRY
)
c
:
RegisterEffect
(
e1
)
--activate from hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_TRAP_ACT_IN_HAND
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTarget
(
c500003
.
tg
)
e2
:
SetTargetRange
(
LOCATION_HAND
,
0
)
c
:
RegisterEffect
(
e2
)
--yyyy
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
500003
,
0
))
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e4
:
SetCode
(
EVENT_TO_GRAVE
)
e4
:
SetTarget
(
c500003
.
target
)
e4
:
SetOperation
(
c500003
.
operation
)
c
:
RegisterEffect
(
e4
)
end
function
c500003
.
filter1
(
c
)
return
(
c
:
IsSetCard
(
0xffac
)
or
c
:
IsSetCard
(
0xffad
))
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsSSetable
()
end
function
c500003
.
filter2
(
c
)
return
c
:
IsReleasable
()
and
c
:
IsAttribute
(
ATTRIBUTE_LIGHT
)
and
not
c
:
IsCode
(
500003
)
end
function
c500003
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
b1
=
Duel
.
IsExistingMatchingCard
(
c500003
.
filter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
local
b2
=
Duel
.
IsExistingMatchingCard
(
c500003
.
filter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
if
chk
==
0
then
return
b1
or
b2
end
local
op
=
0
if
b1
and
b2
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
500003
,
1
),
aux
.
Stringid
(
500003
,
2
))
elseif
b1
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
500003
,
1
))
else
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
500003
,
2
))
+
1
end
e
:
SetLabel
(
op
)
if
op
~=
0
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_RELEASE
,
nil
,
1
,
0
,
LOCATION_DECK
)
end
end
function
c500003
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetLabel
()
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
c500003
.
filter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
tc
then
Duel
.
SSet
(
tp
,
tc
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c500003
.
filter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
+
REASON_RELEASE
)
end
end
end
function
c500003
.
tg
(
e
,
c
)
return
c
:
IsSetCard
(
0xffac
)
or
c
:
IsSetCard
(
0xffad
)
end
\ No newline at end of file
expansions/script/c500004.lua
0 → 100644
View file @
52888c11
--千金女佣 千夜
function
c500004
.
initial_effect
(
c
)
--race
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetCode
(
EFFECT_ADD_RACE
)
e1
:
SetRange
(
LOCATION_HAND
+
LOCATION_GRAVE
)
e1
:
SetValue
(
RACE_FAIRY
)
c
:
RegisterEffect
(
e1
)
--Trap activate in set turn
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_TRAP_ACT_IN_SET_TURN
)
e2
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTarget
(
c500004
.
tg
)
e2
:
SetTargetRange
(
LOCATION_SZONE
,
0
)
c
:
RegisterEffect
(
e2
)
--To Hand
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetCategory
(
CATEGORY_SUMMON
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
)
e4
:
SetCode
(
EVENT_RELEASE
)
e4
:
SetRange
(
LOCATION_GRAVE
+
LOCATION_REMOVED
)
e4
:
SetCountLimit
(
1
,
500004
)
e4
:
SetCost
(
c500004
.
cost
)
e4
:
SetTarget
(
c500004
.
target
)
e4
:
SetOperation
(
c500004
.
operation
)
c
:
RegisterEffect
(
e4
)
end
function
c500004
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToHandAsCost
()
end
Duel
.
SendtoHand
(
e
:
GetHandler
(),
nil
,
REASON_COST
)
end
function
c500004
.
filter1
(
c
)
return
c
:
IsRace
(
RACE_FAIRY
)
and
c
:
IsAttribute
(
ATTRIBUTE_LIGHT
)
and
c
:
IsSummonable
(
true
,
nil
)
end
function
c500004
.
filter2
(
c
)
return
c
:
IsReason
(
REASON_RELEASE
)
and
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsSSetable
()
end
function
c500004
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
b1
=
Duel
.
IsExistingMatchingCard
(
c500004
.
filter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
local
b2
=
Duel
.
IsExistingMatchingCard
(
c500004
.
filter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
if
chk
==
0
then
return
b1
or
b2
end
local
op
=
0
if
b1
and
b2
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
500004
,
1
),
aux
.
Stringid
(
500004
,
2
))
elseif
b1
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
500004
,
1
))
else
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
500004
,
2
))
+
1
end
e
:
SetLabel
(
op
)
if
op
==
0
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SUMMON
,
nil
,
1
,
0
,
0
)
end
end
function
c500004
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetLabel
()
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c500004
.
filter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Summon
(
tp
,
g
:
GetFirst
(),
true
,
nil
)
end
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c500004
.
filter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SSet
(
tp
,
g
:
GetFirst
())
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
end
function
c500004
.
tg
(
e
,
c
)
return
c
:
IsSetCard
(
0xffac
)
or
c
:
IsSetCard
(
0xffad
)
end
\ No newline at end of file
expansions/script/c500005.lua
0 → 100644
View file @
52888c11
--Foodie De Lapin
function
c500005
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
c500005
.
tg
)
e1
:
SetOperation
(
c500005
.
activate
)
c
:
RegisterEffect
(
e1
)
--set
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
500005
,
1
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCountLimit
(
1
,
500005
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCost
(
c500005
.
scost
)
e2
:
SetTarget
(
c500005
.
stg
)
e2
:
SetOperation
(
c500005
.
sop
)
c
:
RegisterEffect
(
e2
)
--set2
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
500005
,
1
))
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetCountLimit
(
1
,
500105
)
e3
:
SetRange
(
LOCATION_GRAVE
+
LOCATION_REMOVED
)
e3
:
SetCost
(
c500005
.
scost2
)
e3
:
SetTarget
(
c500005
.
stg2
)
e3
:
SetOperation
(
c500005
.
sop2
)
c
:
RegisterEffect
(
e3
)
Duel
.
AddCustomActivityCounter
(
500005
,
ACTIVITY_CHAIN
,
c500005
.
chainfilter
)
end
function
c500005
.
costfilter
(
c
,
tp
)
return
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_CONTINUOUS
)
and
c
:
IsReleasableByEffect
()
and
(
c
:
IsOnField
()
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
)
end
function
c500005
.
setfilter
(
c
,
tp
)
return
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_CONTINUOUS
)
and
(
c
:
IsSSetable
()
or
c
:
GetActivateEffect
():
IsActivatable
(
tp
))
end
function
c500005
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
e
:
GetLabel
()
==
100
then
return
Duel
.
IsExistingMatchingCard
(
c500005
.
setfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c500005
.
costfilter
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
nil
,
tp
)
else
return
true
end
end
end
function
c500005
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
c500005
.
setfilter
,
tp
,
LOCATION_GRAVE
,
0
,
nil
,
tp
)
if
g
:
GetCount
()
>
0
and
Duel
.
IsExistingMatchingCard
(
c500005
.
costfilter
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetCustomActivityCount
(
500005
,
tp
,
ACTIVITY_CHAIN
)
==
0
and
(
e
:
GetLabel
()
==
100
or
(
Duel
.
GetFlagEffect
(
tp
,
500005
)
==
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
500005
,
0
))))
then
if
e
:
GetLabel
()
~=
100
then
Duel
.
RegisterFlagEffect
(
tp
,
500005
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
local
rg
=
Duel
.
SelectMatchingCard
(
tp
,
c500005
.
costfilter
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
,
tp
)
Duel
.
Release
(
rg
,
REASON_COST
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_OATH
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
c500005
.
aclimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
local
g
=
Duel
.
GetMatchingGroup
(
c500005
.
setfilter
,
tp
,
LOCATION_GRAVE
,
0
,
nil
,
tp
)
local
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
if
not
tc
then
return
end
if
tc
:
IsSSetable
()
and
(
not
tc
:
GetActivateEffect
():
IsActivatable
(
tp
)
or
not
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
500005
,
2
)))
then
Duel
.
SSet
(
tp
,
tc
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
else
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
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
end
function
c500005
.
aclimit
(
e
,
re
,
tp
)
return
re
:
GetActivateLocation
()
==
LOCATION_MZONE
end
function
c500005
.
chainfilter
(
re
,
tp
,
cid
)
return
re
:
GetActivateLocation
()
~=
LOCATION_MZONE
end
function
c500005
.
setfilter3
(
c
)
return
c
:
IsType
(
TYPE_TRAP
+
TYPE_SPELL
)
and
c
:
IsSSetable
()
and
(
c
:
IsSetCard
(
0xffac
)
or
c
:
IsSetCard
(
0xffad
))
end
function
c500005
.
sop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c500005
.
setfilter3
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SSet
(
tp
,
tc
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
end
function
c500005
.
stg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c500005
.
setfilter3
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetFlagEffect
(
tp
,
500005
)
==
0
end
end
function
c500005
.
scost
(
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
c500005
.
cfilter
(
c
,
tp
,
rc
)
local
g
=
Group
.
FromCards
(
c
,
rc
)
return
c
:
IsType
(
TYPE_TRAP
+
TYPE_SPELL
)
and
(
c
:
IsSetCard
(
0xffac
)
or
c
:
IsSetCard
(
0xffad
))
and
c
:
IsAbleToDeckAsCost
()
and
c
:
IsFaceup
()
and
Duel
.
IsExistingMatchingCard
(
c500005
.
setfilter3
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
g
,
tp
)
end
function
c500005
.
scost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToDeckAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c500005
.
cfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
e
:
GetHandler
(),
tp
,
e
:
GetHandler
())
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c500005
.
cfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
e
:
GetHandler
(),
tp
,
e
:
GetHandler
())
g
:
AddCard
(
e
:
GetHandler
())
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_COST
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_SKIP_BP
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
0
)
local
ph
=
Duel
.
GetCurrentPhase
()
if
Duel
.
GetTurnPlayer
()
==
tp
then
e1
:
SetLabel
(
Duel
.
GetTurnCount
())
e1
:
SetCondition
(
c500005
.
skipcon
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
+
RESET_SELF_TURN
,
2
)
else
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
+
RESET_SELF_TURN
,
1
)
end
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
c500005
.
skipcon
(
e
)
return
Duel
.
GetTurnCount
()
~=
e
:
GetLabel
()
end
function
c500005
.
stg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c500005
.
setfilter3
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
end
function
c500005
.
sop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c500005
.
setfilter3
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SSet
(
tp
,
tc
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
end
expansions/script/c500006.lua
0 → 100644
View file @
52888c11
--Fruitless de Lapin
function
c500006
.
initial_effect
(
c
)
--Activate1
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
500006
,
4
))
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
--Activate2
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetDescription
(
aux
.
Stringid
(
500006
,
0
))
e0
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e0
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e0
:
SetCountLimit
(
1
,
500006
)
e0
:
SetCode
(
EVENT_TO_HAND
)
e0
:
SetCost
(
c500006
.
thcost
)
e0
:
SetCondition
(
c500006
.
thcon
)
e0
:
SetTarget
(
c500006
.
thtg
)
e0
:
SetOperation
(
c500006
.
thop
)
c
:
RegisterEffect
(
e0
)
--sssss
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
500006
,
1
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCode
(
EVENT_TO_HAND
)
e2
:
SetCountLimit
(
1
,
500006
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCost
(
c500006
.
thcost
)
e2
:
SetCondition
(
c500006
.
thcon
)
e2
:
SetTarget
(
c500006
.
thtg
)
e2
:
SetOperation
(
c500006
.
thop
)
c
:
RegisterEffect
(
e2
)
--set
local
ex2
=
Effect
.
CreateEffect
(
c
)
ex2
:
SetDescription
(
aux
.
Stringid
(
500005
,
1
))
ex2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
ex2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
ex2
:
SetCode
(
EVENT_FREE_CHAIN
)
ex2
:
SetCountLimit
(
1
,
500006
)
ex2
:
SetRange
(
LOCATION_SZONE
)
ex2
:
SetCost
(
c500006
.
scost
)
ex2
:
SetTarget
(
c500006
.
stg
)
ex2
:
SetOperation
(
c500006
.
sop
)
c
:
RegisterEffect
(
ex2
)
--sssss
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
500006
,
1
))
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetCountLimit
(
1
,
500106
)
e3
:
SetRange
(
LOCATION_GRAVE
+
LOCATION_REMOVED
)
e3
:
SetCost
(
c500006
.
scost2
)
e3
:
SetTarget
(
c500006
.
stg2
)
e3
:
SetOperation
(
c500006
.
sop2
)
c
:
RegisterEffect
(
e3
)
Duel
.
AddCustomActivityCounter
(
500006
,
ACTIVITY_CHAIN
,
c500006
.
chainfilter
)
c500006
.
noway
=
true
end
function
c500006
.
confilter
(
c
,
tp
)
return
c
:
IsPreviousLocation
(
LOCATION_DECK
+
LOCATION_GRAVE
)
and
c
:
IsReason
(
REASON_EFFECT
)
and
c
:
GetReasonPlayer
()
==
tp
end
function
c500006
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c500006
.
confilter
,
1
,
nil
,
1
-
tp
)
end
function
c500006
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
eg
:
Filter
(
c500006
.
confilter
,
nil
,
1
-
tp
):
Filter
(
Card
.
IsAbleToDeck
,
nil
)
if
chk
==
0
then
return
g
:
GetCount
()
>
0
end
Duel
.
SetTargetCard
(
g
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
g
,
g
:
GetCount
()
>
0
,
1
-
tp
,
0
)
end
function
c500006
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
):
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_EFFECT
)
end
end
function
c500006
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetCustomActivityCount
(
500006
,
tp
,
ACTIVITY_CHAIN
)
==
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_ACTIVATE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
c500006
.
aclimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
c500006
.
aclimit
(
e
,
re
,
tp
)
return
re
:
GetActivateLocation
()
==
LOCATION_MZONE
end
function
c500006
.
sop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c500006
.
setfilter3
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SSet
(
tp
,
tc
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
end
function
c500006
.
stg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c500006
.
setfilter3
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
tp
)
end
end
function
c500006
.
scost
(
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
c500006
.
cfilter
(
c
,
tp
,
rc
)
local
g
=
Group
.
FromCards
(
c
,
rc
)
return
c
:
IsType
(
TYPE_TRAP
+
TYPE_SPELL
)
and
(
c
:
IsSetCard
(
0xffac
)
or
c
:
IsSetCard
(
0xffad
))
and
c
:
IsAbleToDeckAsCost
()
and
c
:
IsFaceup
()
and
Duel
.
IsExistingMatchingCard
(
c500006
.
setfilter3
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
g
,
tp
)
end
function
c500006
.
scost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToDeckAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c500006
.
cfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
e
:
GetHandler
(),
tp
,
e
:
GetHandler
())
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c500006
.
cfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
e
:
GetHandler
(),
tp
,
e
:
GetHandler
())
g
:
AddCard
(
e
:
GetHandler
())
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_COST
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_SKIP_BP
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
0
)
local
ph
=
Duel
.
GetCurrentPhase
()
if
Duel
.
GetTurnPlayer
()
==
tp
then
e1
:
SetLabel
(
Duel
.
GetTurnCount
())
e1
:
SetCondition
(
c500005
.
skipcon
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
+
RESET_SELF_TURN
,
2
)
else
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
+
RESET_SELF_TURN
,
1
)
end
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
c500006
.
skipcon
(
e
)
return
Duel
.
GetTurnCount
()
~=
e
:
GetLabel
()
end
function
c500006
.
setfilter3
(
c
)
return
c
:
IsType
(
TYPE_TRAP
+
TYPE_SPELL
)
and
c
:
IsSSetable
()
and
(
c
:
IsSetCard
(
0xffac
)
or
c
:
IsSetCard
(
0xffad
))
end
function
c500006
.
stg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c500006
.
setfilter3
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
end
function
c500006
.
sop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c500006
.
setfilter3
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SSet
(
tp
,
tc
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
end
function
c500006
.
chainfilter
(
re
,
tp
,
cid
)
return
re
:
GetActivateLocation
()
~=
LOCATION_MZONE
end
\ No newline at end of file
expansions/script/c500007.lua
0 → 100644
View file @
52888c11
--Snow de Lapin
function
c500007
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
c500007
.
tg
)
e1
:
SetOperation
(
c500007
.
activate
)
c
:
RegisterEffect
(
e1
)
--set
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
500007
,
1
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCountLimit
(
1
,
500007
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCost
(
c500007
.
scost
)
e2
:
SetTarget
(
c500007
.
stg
)
e2
:
SetOperation
(
c500007
.
sop
)
c
:
RegisterEffect
(
e2
)
--sssss
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
500007
,
1
))
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetCountLimit
(
1
,
500107
)
e3
:
SetRange
(
LOCATION_GRAVE
+
LOCATION_REMOVED
)
e3
:
SetCost
(
c500007
.
scost2
)
e3
:
SetTarget
(
c500007
.
stg2
)
e3
:
SetOperation
(
c500007
.
sop2
)
c
:
RegisterEffect
(
e3
)
Duel
.
AddCustomActivityCounter
(
500007
,
ACTIVITY_CHAIN
,
c500007
.
chainfilter
)
end
function
c500007
.
chainfilter
(
re
,
tp
,
cid
)
return
re
:
GetActivateLocation
()
~=
LOCATION_MZONE
end
function
c500007
.
efilterx
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsFaceup
()
end
function
c500007
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
e
:
GetLabel
()
==
100
then
return
Duel
.
IsExistingMatchingCard
(
c500007
.
efilterx
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
else
return
true
end
end
end
function
c500007
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
c500007
.
efilterx
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
and
Duel
.
GetCustomActivityCount
(
500007
,
tp
,
ACTIVITY_CHAIN
)
==
0
and
(
e
:
GetLabel
()
==
100
or
(
Duel
.
GetFlagEffect
(
tp
,
500007
)
==
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
500007
,
0
))))
then
if
e
:
GetLabel
()
~=
100
then
Duel
.
RegisterFlagEffect
(
tp
,
500007
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
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_ACTIVATE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
c500007
.
aclimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
g
=
Duel
.
GetMatchingGroup
(
c500007
.
efilterx
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SELF
)
local
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
if
not
tc
then
return
end
Duel
.
HintSelection
(
Group
.
FromCards
(
tc
))
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
)
e1
:
SetValue
(
c500007
.
efilter
)
e1
:
SetOwnerPlayer
(
tp
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_ATKCHANGE
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e2
:
SetType
(
EFFECT_TYPE_TRIGGER_F
+
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EVENT_PRE_DAMAGE_CALCULATE
)
e2
:
SetCondition
(
c500007
.
atkcon
)
e2
:
SetOperation
(
c500007
.
atkop
)
tc
:
RegisterEffect
(
e2
)
end
end
function
c500007
.
atkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
bc
=
c
:
GetBattleTarget
()
return
bc
and
bc
:
IsControler
(
1
-
tp
)
end
function
c500007
.
atkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
bc
=
c
:
GetBattleTarget
()
if
c
:
IsRelateToBattle
()
and
c
:
IsFaceup
()
and
bc
:
IsRelateToBattle
()
and
bc
:
IsFaceup
()
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_DAMAGE_CAL
)
e1
:
SetValue
(
bc
:
GetAttack
())
c
:
RegisterEffect
(
e1
)
end
end
function
c500007
.
efilter
(
e
,
re
)
return
e
:
GetOwnerPlayer
()
~=
re
:
GetOwnerPlayer
()
end
function
c500007
.
aclimit
(
e
,
re
,
tp
)
return
re
:
GetActivateLocation
()
==
LOCATION_MZONE
end
function
c500007
.
cfilter
(
c
,
tp
,
rc
)
local
g
=
Group
.
FromCards
(
c
,
rc
)
return
c
:
IsType
(
TYPE_TRAP
+
TYPE_SPELL
)
and
(
c
:
IsSetCard
(
0xffac
)
or
c
:
IsSetCard
(
0xffad
))
and
c
:
IsAbleToDeckAsCost
()
and
c
:
IsFaceup
()
and
Duel
.
IsExistingMatchingCard
(
c500007
.
setfilter3
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
g
,
tp
)
end
function
c500007
.
scost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToDeckAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c500007
.
cfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
e
:
GetHandler
(),
tp
,
e
:
GetHandler
())
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c500007
.
cfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
e
:
GetHandler
(),
tp
,
e
:
GetHandler
())
g
:
AddCard
(
e
:
GetHandler
())
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_COST
)
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_SKIP_BP
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
0
)
local
ph
=
Duel
.
GetCurrentPhase
()
if
Duel
.
GetTurnPlayer
()
==
tp
then
e1
:
SetLabel
(
Duel
.
GetTurnCount
())
e1
:
SetCondition
(
c500005
.
skipcon
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
+
RESET_SELF_TURN
,
2
)
else
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
+
RESET_SELF_TURN
,
1
)
end
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
c500007
.
skipcon
(
e
)
return
Duel
.
GetTurnCount
()
~=
e
:
GetLabel
()
end
function
c500007
.
setfilter3
(
c
)
return
c
:
IsType
(
TYPE_TRAP
+
TYPE_SPELL
)
and
c
:
IsSSetable
()
and
(
c
:
IsSetCard
(
0xffac
)
or
c
:
IsSetCard
(
0xffad
))
end
function
c500007
.
stg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c500007
.
setfilter3
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
end
function
c500007
.
sop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c500007
.
setfilter3
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SSet
(
tp
,
tc
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
end
function
c500007
.
sop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c500007
.
setfilter3
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SSet
(
tp
,
tc
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
end
function
c500007
.
stg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c500007
.
setfilter3
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetFlagEffect
(
tp
,
500007
)
==
0
end
end
function
c500007
.
scost
(
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
\ No newline at end of file
expansions/script/c500008.lua
0 → 100644
View file @
52888c11
--Venery de Doe
function
c500008
.
initial_effect
(
c
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TOGRAVE
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e1
:
SetTarget
(
c500008
.
tg
)
e1
:
SetOperation
(
c500008
.
activate
)
c
:
RegisterEffect
(
e1
)
--set
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
500008
,
2
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCountLimit
(
1
,
500008
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCost
(
c500008
.
scost
)
e2
:
SetTarget
(
c500008
.
stg
)
e2
:
SetOperation
(
c500008
.
sop
)
c
:
RegisterEffect
(
e2
)
--set2
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
500008
,
2
))
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetCountLimit
(
1
,
500108
)
e3
:
SetRange
(
LOCATION_GRAVE
+
LOCATION_REMOVED
)
e3
:
SetCost
(
c500008
.
scost2
)
e3
:
SetTarget
(
c500008
.
stg2
)
e3
:
SetOperation
(
c500008
.
sop2
)
c
:
RegisterEffect
(
e3
)
Duel
.
AddCustomActivityCounter
(
500008
,
ACTIVITY_CHAIN
,
c500008
.
chainfilter
)
end
function
c500008
.
setfilter3
(
c
)
return
c
:
IsType
(
TYPE_TRAP
+
TYPE_SPELL
)
and
c
:
IsSSetable
()
and
(
c
:
IsSetCard
(
0xffac
)
or
c
:
IsSetCard
(
0xffad
))
end
function
c500008
.
sop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c500008
.
setfilter3
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SSet
(
tp
,
tc
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
end
function
c500008
.
stg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c500008
.
setfilter3
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetFlagEffect
(
tp
,
500008
)
==
0
end
end
function
c500008
.
scost
(
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
c500008
.
cfilter
(
c
,
tp
,
rc
)
local
g
=
Group
.
FromCards
(
c
,
rc
)
return
c
:
IsType
(
TYPE_TRAP
+
TYPE_SPELL
)
and
(
c
:
IsSetCard
(
0xffac
)
or
c
:
IsSetCard
(
0xffad
))
and
c
:
IsAbleToDeckAsCost
()
and
c
:
IsFaceup
()
and
Duel
.
IsExistingMatchingCard
(
c500008
.
setfilter3
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
g
,
tp
)
end
function
c500008
.
scost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToDeckAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c500008
.
cfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
e
:
GetHandler
(),
tp
,
e
:
GetHandler
())
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c500008
.
cfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
e
:
GetHandler
(),
tp
,
e
:
GetHandler
())
g
:
AddCard
(
e
:
GetHandler
())
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_COST
)
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_SKIP_BP
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
0
)
local
ph
=
Duel
.
GetCurrentPhase
()
if
Duel
.
GetTurnPlayer
()
==
tp
then
e1
:
SetLabel
(
Duel
.
GetTurnCount
())
e1
:
SetCondition
(
c500005
.
skipcon
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
+
RESET_SELF_TURN
,
2
)
else
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
+
RESET_SELF_TURN
,
1
)
end
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
c500008
.
skipcon
(
e
)
return
Duel
.
GetTurnCount
()
~=
e
:
GetLabel
()
end
function
c500008
.
stg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c500008
.
setfilter3
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
end
function
c500008
.
sop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c500008
.
setfilter3
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SSet
(
tp
,
tc
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
end
function
c500008
.
chainfilter
(
re
,
tp
,
cid
)
return
re
:
GetActivateLocation
()
~=
LOCATION_MZONE
end
function
c500008
.
filter
(
c
)
return
c
:
IsAbleToHand
()
or
c
:
IsAbleToGrave
()
end
function
c500008
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
e
:
GetLabel
()
==
100
then
return
Duel
.
IsExistingMatchingCard
(
c500008
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
else
return
true
end
end
end
function
c500008
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
c500008
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
c
)
if
g
:
GetCount
()
>
0
and
Duel
.
GetCustomActivityCount
(
500008
,
tp
,
ACTIVITY_CHAIN
)
==
0
and
(
e
:
GetLabel
()
==
100
or
(
Duel
.
GetFlagEffect
(
tp
,
500008
)
==
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
500008
,
0
))))
then
if
e
:
GetLabel
()
~=
100
then
Duel
.
RegisterFlagEffect
(
tp
,
500008
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
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_ACTIVATE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
c500008
.
aclimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
g
=
Duel
.
GetMatchingGroup
(
c500008
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
c
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
if
not
tc
then
return
end
Duel
.
HintSelection
(
Group
.
FromCards
(
tc
))
if
tc
:
IsAbleToHand
()
and
(
not
tc
:
IsAbleToGrave
()
or
not
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
500008
,
1
)))
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
else
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
end
end
end
function
c500008
.
aclimit
(
e
,
re
,
tp
)
return
re
:
GetActivateLocation
()
==
LOCATION_MZONE
end
\ No newline at end of file
expansions/script/c500009.lua
0 → 100644
View file @
52888c11
--Energetic de Doe
function
c500009
.
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
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e1
:
SetTarget
(
c500009
.
tg
)
e1
:
SetOperation
(
c500009
.
activate
)
c
:
RegisterEffect
(
e1
)
--set
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
500009
,
1
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCountLimit
(
1
,
500009
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCost
(
c500009
.
scost
)
e2
:
SetTarget
(
c500009
.
stg
)
e2
:
SetOperation
(
c500009
.
sop
)
c
:
RegisterEffect
(
e2
)
--set2
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
500009
,
1
))
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetCountLimit
(
1
,
500109
)
e3
:
SetRange
(
LOCATION_GRAVE
+
LOCATION_REMOVED
)
e3
:
SetCost
(
c500009
.
scost2
)
e3
:
SetTarget
(
c500009
.
stg2
)
e3
:
SetOperation
(
c500009
.
sop2
)
c
:
RegisterEffect
(
e3
)
Duel
.
AddCustomActivityCounter
(
500009
,
ACTIVITY_CHAIN
,
c500009
.
chainfilter
)
end
function
c500009
.
filter
(
c
,
e
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsReason
(
REASON_RELEASE
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c500009
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
e
:
GetLabel
()
==
100
then
return
Duel
.
IsExistingMatchingCard
(
c500009
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
1
,
nil
,
e
,
tp
)
else
return
true
end
end
end
function
c500009
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
c500009
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
and
Duel
.
GetCustomActivityCount
(
500009
,
tp
,
ACTIVITY_CHAIN
)
==
0
and
(
e
:
GetLabel
()
==
100
or
(
Duel
.
GetFlagEffect
(
tp
,
500009
)
==
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
500009
,
0
))))
then
if
e
:
GetLabel
()
~=
100
then
Duel
.
RegisterFlagEffect
(
tp
,
500009
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
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_ACTIVATE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
c500009
.
aclimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
g
=
Duel
.
GetMatchingGroup
(
c500009
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
nil
,
e
,
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
if
tc
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
end
function
c500009
.
setfilter3
(
c
)
return
c
:
IsType
(
TYPE_TRAP
+
TYPE_SPELL
)
and
c
:
IsSSetable
()
and
(
c
:
IsSetCard
(
0xffac
)
or
c
:
IsSetCard
(
0xffad
))
end
function
c500009
.
sop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c500009
.
setfilter3
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SSet
(
tp
,
tc
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
end
function
c500009
.
stg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c500009
.
setfilter3
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetFlagEffect
(
tp
,
500009
)
==
0
end
end
function
c500009
.
scost
(
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
c500009
.
cfilter
(
c
,
tp
,
rc
)
local
g
=
Group
.
FromCards
(
c
,
rc
)
return
c
:
IsType
(
TYPE_TRAP
+
TYPE_SPELL
)
and
(
c
:
IsSetCard
(
0xffac
)
or
c
:
IsSetCard
(
0xffad
))
and
c
:
IsAbleToDeckAsCost
()
and
c
:
IsFaceup
()
and
Duel
.
IsExistingMatchingCard
(
c500009
.
setfilter3
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
g
,
tp
)
end
function
c500009
.
scost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToDeckAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c500009
.
cfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
e
:
GetHandler
(),
tp
,
e
:
GetHandler
())
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c500009
.
cfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
e
:
GetHandler
(),
tp
,
e
:
GetHandler
())
g
:
AddCard
(
e
:
GetHandler
())
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_COST
)
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_SKIP_BP
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
0
)
local
ph
=
Duel
.
GetCurrentPhase
()
if
Duel
.
GetTurnPlayer
()
==
tp
then
e1
:
SetLabel
(
Duel
.
GetTurnCount
())
e1
:
SetCondition
(
c500005
.
skipcon
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
+
RESET_SELF_TURN
,
2
)
else
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
+
RESET_SELF_TURN
,
1
)
end
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
c500009
.
skipcon
(
e
)
return
Duel
.
GetTurnCount
()
~=
e
:
GetLabel
()
end
function
c500009
.
stg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c500009
.
setfilter3
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
end
function
c500009
.
sop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c500009
.
setfilter3
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SSet
(
tp
,
tc
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
end
function
c500009
.
chainfilter
(
re
,
tp
,
cid
)
return
re
:
GetActivateLocation
()
~=
LOCATION_MZONE
end
\ No newline at end of file
expansions/script/c500010.lua
0 → 100644
View file @
52888c11
--Energetic de Doe
function
c500010
.
initial_effect
(
c
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e1
:
SetTarget
(
c500010
.
tg
)
e1
:
SetOperation
(
c500010
.
activate
)
c
:
RegisterEffect
(
e1
)
e1
:
SetLabel
(
100
)
--set
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
500010
,
1
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCountLimit
(
1
,
500010
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCost
(
c500010
.
scost
)
e2
:
SetTarget
(
c500010
.
stg
)
e2
:
SetOperation
(
c500010
.
sop
)
c
:
RegisterEffect
(
e2
)
--set2
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
500010
,
1
))
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetCountLimit
(
1
,
500110
)
e3
:
SetRange
(
LOCATION_GRAVE
+
LOCATION_REMOVED
)
e3
:
SetCost
(
c500010
.
scost2
)
e3
:
SetTarget
(
c500010
.
stg2
)
e3
:
SetOperation
(
c500010
.
sop2
)
c
:
RegisterEffect
(
e3
)
Duel
.
AddCustomActivityCounter
(
500010
,
ACTIVITY_CHAIN
,
c500010
.
chainfilter
)
end
function
c500010
.
filter
(
c
,
e
,
tp
)
if
(
not
c
:
IsSetCard
(
0xffad
)
and
not
c
:
IsSetCard
(
0xffac
))
or
c
:
IsFacedown
()
or
c
:
IsCode
(
500010
)
then
return
false
end
local
tg
=
c
:
GetActivateEffect
():
GetTarget
()
return
not
c
.
noway
and
(
not
tg
or
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
0
,
false
,
true
))
end
function
c500010
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
oilolo
,
caca
)
if
chk
==
0
then
if
caca
then
return
Duel
.
IsExistingMatchingCard
(
c500010
.
filter
,
tp
,
LOCATION_SZONE
,
LOCATION_SZONE
,
1
,
e
:
GetHandler
(),
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
else
return
true
end
end
end
function
c500010
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
c500010
.
filter
,
tp
,
LOCATION_SZONE
,
LOCATION_SZONE
,
c
,
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
g
:
GetCount
()
>
0
and
Duel
.
GetCustomActivityCount
(
500010
,
tp
,
ACTIVITY_CHAIN
)
==
0
and
((
Duel
.
GetFlagEffect
(
tp
,
500010
)
==
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
500010
,
0
))))
then
Duel
.
RegisterFlagEffect
(
tp
,
500010
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_OATH
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
c500010
.
aclimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
g
=
Duel
.
GetMatchingGroup
(
c500010
.
filter
,
tp
,
LOCATION_SZONE
,
LOCATION_SZONE
,
c
,
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
local
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
HintSelection
(
Group
.
FromCards
(
tc
))
local
te
=
tc
:
GetActivateEffect
()
local
op
=
te
:
GetOperation
()
if
op
then
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
end
end
function
c500010
.
setfilter3
(
c
)
return
c
:
IsType
(
TYPE_TRAP
+
TYPE_SPELL
)
and
c
:
IsSSetable
()
and
(
c
:
IsSetCard
(
0xffac
)
or
c
:
IsSetCard
(
0xffad
))
end
function
c500010
.
sop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c500010
.
setfilter3
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SSet
(
tp
,
tc
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
end
function
c500010
.
stg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c500010
.
setfilter3
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetFlagEffect
(
tp
,
500010
)
==
0
end
end
function
c500010
.
scost
(
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
c500010
.
cfilter
(
c
,
tp
,
rc
)
local
g
=
Group
.
FromCards
(
c
,
rc
)
return
c
:
IsType
(
TYPE_TRAP
+
TYPE_SPELL
)
and
(
c
:
IsSetCard
(
0xffac
)
or
c
:
IsSetCard
(
0xffad
))
and
c
:
IsAbleToDeckAsCost
()
and
c
:
IsFaceup
()
and
Duel
.
IsExistingMatchingCard
(
c500010
.
setfilter3
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
g
,
tp
)
end
function
c500010
.
scost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToDeckAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c500010
.
cfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
e
:
GetHandler
(),
tp
,
e
:
GetHandler
())
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c500010
.
cfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
e
:
GetHandler
(),
tp
,
e
:
GetHandler
())
g
:
AddCard
(
e
:
GetHandler
())
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_COST
)
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_SKIP_BP
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
0
)
local
ph
=
Duel
.
GetCurrentPhase
()
if
Duel
.
GetTurnPlayer
()
==
tp
then
e1
:
SetLabel
(
Duel
.
GetTurnCount
())
e1
:
SetCondition
(
c500005
.
skipcon
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
+
RESET_SELF_TURN
,
2
)
else
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
+
RESET_SELF_TURN
,
1
)
end
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
c500010
.
skipcon
(
e
)
return
Duel
.
GetTurnCount
()
~=
e
:
GetLabel
()
end
function
c500010
.
stg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c500010
.
setfilter3
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
end
function
c500010
.
sop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c500010
.
setfilter3
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SSet
(
tp
,
tc
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
end
function
c500010
.
chainfilter
(
re
,
tp
,
cid
)
return
re
:
GetActivateLocation
()
~=
LOCATION_MZONE
end
\ No newline at end of file
expansions/script/c57300027.lua
0 → 100644
View file @
52888c11
--库拉丽丝-牡丹
local
m
=
57300027
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
aux
.
AddLinkProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsSetCard
,
0x570
),
2
,
2
)
c
:
EnableReviveLimit
()
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_SPSUMMON_PROC_G
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
m
)
e2
:
SetCondition
(
cm
.
rmcon
)
e2
:
SetOperation
(
cm
.
rmop
)
c
:
RegisterEffect
(
e2
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
57300021
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e1
:
SetTarget
(
function
(
e
,
c
)
return
e
:
GetHandler
():
GetLinkedGroup
():
IsContains
(
c
)
end
)
e1
:
SetValue
(
1
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
filter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x570
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
rmcon
(
e
,
c
,
og
)
local
tp
=
e
:
GetHandlerPlayer
()
local
c
=
e
:
GetHandler
()
return
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
and
c
:
IsFaceup
()
and
not
c
:
IsDisabled
()
and
Duel
.
GetMZoneCount
(
tp
)
>
0
end
function
cm
.
rmop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
,
sg
,
og
)
Duel
.
Hint
(
HINT_CARD
,
0
,
e
:
GetHandler
():
GetOriginalCode
())
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
sg
:
Merge
(
g
)
end
\ No newline at end of file
expansions/script/c580043.lua
deleted
100644 → 0
View file @
2ad74955
--红血莲
function
c580043
.
initial_effect
(
c
)
--destroy
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetTarget
(
c580043
.
target
)
e1
:
SetOperation
(
c580043
.
activate
)
c
:
RegisterEffect
(
e1
)
--destroy
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
580043
)
e2
:
SetTarget
(
c580043
.
target1
)
e2
:
SetOperation
(
c580043
.
activate1
)
c
:
RegisterEffect
(
e2
)
end
function
c580043
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsControler
(
1
-
tp
)
and
chkc
:
IsOnField
()
and
chkc
:
IsFaceup
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
Duel
.
GetMZoneCount
(
tp
)
>-
1
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
end
function
c580043
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
and
tc
:
IsRelateToEffect
(
e
)
and
c
:
IsRelateToEffect
(
e
)
then
if
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
==
1
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
end
function
c580043
.
target1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsControler
(
1
-
tp
)
and
chkc
:
IsOnField
()
and
chkc
:
IsFaceup
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsFaceup
,
tp
,
LOCATION_SZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsAbleToHand
()
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsFaceup
,
tp
,
LOCATION_SZONE
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c580043
.
activate1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
and
tc
:
IsRelateToEffect
(
e
)
and
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
if
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
==
1
then
Duel
.
SendtoHand
(
e
:
GetHandler
(),
nil
,
REASON_EFFECT
)
end
end
end
expansions/strings.conf
View file @
52888c11
#222DIY
#血迷 5
#鲶 5 0xfa0-0xfaf
!
setname
0
xffac
Lapin
!
setname
0
xffad
Doe
#芙兰 7
#is_named_with_WindWheel 风轮
...
...
@@ -15,6 +17,8 @@
#named_with_Ld 灵都
#named_with_Dw 蝶舞
#named_with_Fulan 芙兰
#named_with_Leimi 蕾米
#named_with_Leisp ???
#Mizuhashi Parsee 12 0xfb0-0xfbf
!
setname
0
xfb0
六曜
...
...
@@ -63,6 +67,7 @@
!
setname
0
x1233
纸上魔法使
!
setname
0
x2233
纸上台本
!
setname
0
x234
Island
!
setname
0
x235
星彩
#樱幕 111
...
...
lflist.conf
View file @
52888c11
...
...
@@ -20,6 +20,7 @@
01150037
0
--冬日的约会
01150041
1
--蓝色世界
#12
#21
02100008
1
--银屑照魂 梨涅莎
02100003
1
--圣辉的银屑 阿卡蒂亚
...
...
@@ -27,9 +28,7 @@
#52
05200010
0
--圣精灵 格奥基乌斯
#101
#炎龙剑
10173058
1
--恶魔科学塑型体
#连接融合者
#109
10970010
0
--搜寻魔术
#112
...
...
@@ -39,6 +38,8 @@
12001010
2
--六曜的先胜
12001021
1
--六曜的卡莲思特
12001022
2
--六曜的虹光丘儿
12003000
2
--水歌 原奏的希雅
12003001
1
--水歌 重奏的真由美
#132
13255402
2
--清者自清
#141
...
...
@@ -56,7 +57,7 @@
#337
33700081
2
--动物朋友 鲸头鹳
33700082
2
--动物朋友 东之青龙
#
动物朋友 西之白虎
33700085
1
--
动物朋友 西之白虎
33700103
1
--加帕里公园 - 神圣之山
33700181
2
--动物朋友 狞猫
33700186
1
--动物朋友 九州长尾林鸮
...
...
@@ -75,25 +76,22 @@
37564330
1
--源数网络
37564338
1
--恋色的舞姬·纱由里
37564505
1
--
Nanahira
&
Halozy
37564510
1
--
Koinomi
37564701
0
--邪眼之魔女-桑德莉佣
37564836
1
--邪符『不祥之兆』
37564848
2
--
3
L
·不可思议的梦幻
37564906
1
--
Sayuri
·
Amazing
one
more
37564914
1
--
Sayuri
&
3
L
#465
46564003
1
--蔚蓝的旋律·月与海
#500
50000061
2
--电光充能
50000054
1
--电光石火
#绝对条件 奇犽
#船长 奇犽
#573
#601
60151704
0
--天空的水晶部队 狡猾的女仆贼
#极夜的龙骑士
#怠惰的魅魔
#666
66619903
0
--
AIW
·指引者柴郡喵
...
...
@@ -101,12 +99,6 @@
66619913
1
--下午茶时间☆
66619914
2
--未眠的心之火
66619920
0
--
AIW
·绽放之蝶
#777-祈愿
#777-绽放之时的色彩
#777-风映之春
#777-夏空之映
#777-幻呓秋语
#777-圣夜凛冬
#986
98600002
0
--欧忒耳佩
#996
...
...
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