Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-222DIY-cards
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alstroemeria-silentlove
ygopro-222DIY-cards
Commits
fcf4fbbd
Commit
fcf4fbbd
authored
Aug 08, 2023
by
Huangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0808-Pre-1202
parent
53dfe8ab
Pipeline
#22965
passed with stages
in 23 minutes and 43 seconds
Changes
90
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
90 changed files
with
7778 additions
and
0 deletions
+7778
-0
expansions/script/c101202001.lua
expansions/script/c101202001.lua
+115
-0
expansions/script/c101202002.lua
expansions/script/c101202002.lua
+145
-0
expansions/script/c101202003.lua
expansions/script/c101202003.lua
+86
-0
expansions/script/c101202004.lua
expansions/script/c101202004.lua
+57
-0
expansions/script/c101202005.lua
expansions/script/c101202005.lua
+153
-0
expansions/script/c101202006.lua
expansions/script/c101202006.lua
+84
-0
expansions/script/c101202007.lua
expansions/script/c101202007.lua
+67
-0
expansions/script/c101202008.lua
expansions/script/c101202008.lua
+76
-0
expansions/script/c101202009.lua
expansions/script/c101202009.lua
+64
-0
expansions/script/c101202010.lua
expansions/script/c101202010.lua
+102
-0
expansions/script/c101202011.lua
expansions/script/c101202011.lua
+86
-0
expansions/script/c101202012.lua
expansions/script/c101202012.lua
+93
-0
expansions/script/c101202013.lua
expansions/script/c101202013.lua
+66
-0
expansions/script/c101202014.lua
expansions/script/c101202014.lua
+63
-0
expansions/script/c101202015.lua
expansions/script/c101202015.lua
+94
-0
expansions/script/c101202016.lua
expansions/script/c101202016.lua
+80
-0
expansions/script/c101202017.lua
expansions/script/c101202017.lua
+104
-0
expansions/script/c101202018.lua
expansions/script/c101202018.lua
+97
-0
expansions/script/c101202019.lua
expansions/script/c101202019.lua
+124
-0
expansions/script/c101202020.lua
expansions/script/c101202020.lua
+70
-0
expansions/script/c101202021.lua
expansions/script/c101202021.lua
+66
-0
expansions/script/c101202022.lua
expansions/script/c101202022.lua
+70
-0
expansions/script/c101202023.lua
expansions/script/c101202023.lua
+73
-0
expansions/script/c101202024.lua
expansions/script/c101202024.lua
+55
-0
expansions/script/c101202025.lua
expansions/script/c101202025.lua
+57
-0
expansions/script/c101202026.lua
expansions/script/c101202026.lua
+82
-0
expansions/script/c101202027.lua
expansions/script/c101202027.lua
+44
-0
expansions/script/c101202028.lua
expansions/script/c101202028.lua
+75
-0
expansions/script/c101202029.lua
expansions/script/c101202029.lua
+86
-0
expansions/script/c101202030.lua
expansions/script/c101202030.lua
+146
-0
expansions/script/c101202031.lua
expansions/script/c101202031.lua
+91
-0
expansions/script/c101202032.lua
expansions/script/c101202032.lua
+76
-0
expansions/script/c101202033.lua
expansions/script/c101202033.lua
+78
-0
expansions/script/c101202034.lua
expansions/script/c101202034.lua
+91
-0
expansions/script/c101202035.lua
expansions/script/c101202035.lua
+73
-0
expansions/script/c101202036.lua
expansions/script/c101202036.lua
+99
-0
expansions/script/c101202037.lua
expansions/script/c101202037.lua
+94
-0
expansions/script/c101202038.lua
expansions/script/c101202038.lua
+61
-0
expansions/script/c101202039.lua
expansions/script/c101202039.lua
+109
-0
expansions/script/c101202040.lua
expansions/script/c101202040.lua
+84
-0
expansions/script/c101202041.lua
expansions/script/c101202041.lua
+90
-0
expansions/script/c101202042.lua
expansions/script/c101202042.lua
+173
-0
expansions/script/c101202043.lua
expansions/script/c101202043.lua
+81
-0
expansions/script/c101202044.lua
expansions/script/c101202044.lua
+115
-0
expansions/script/c101202045.lua
expansions/script/c101202045.lua
+87
-0
expansions/script/c101202046.lua
expansions/script/c101202046.lua
+108
-0
expansions/script/c101202047.lua
expansions/script/c101202047.lua
+181
-0
expansions/script/c101202048.lua
expansions/script/c101202048.lua
+48
-0
expansions/script/c101202049.lua
expansions/script/c101202049.lua
+70
-0
expansions/script/c101202050.lua
expansions/script/c101202050.lua
+59
-0
expansions/script/c101202051.lua
expansions/script/c101202051.lua
+79
-0
expansions/script/c101202052.lua
expansions/script/c101202052.lua
+77
-0
expansions/script/c101202053.lua
expansions/script/c101202053.lua
+90
-0
expansions/script/c101202054.lua
expansions/script/c101202054.lua
+61
-0
expansions/script/c101202055.lua
expansions/script/c101202055.lua
+82
-0
expansions/script/c101202056.lua
expansions/script/c101202056.lua
+78
-0
expansions/script/c101202057.lua
expansions/script/c101202057.lua
+77
-0
expansions/script/c101202058.lua
expansions/script/c101202058.lua
+86
-0
expansions/script/c101202059.lua
expansions/script/c101202059.lua
+65
-0
expansions/script/c101202060.lua
expansions/script/c101202060.lua
+67
-0
expansions/script/c101202061.lua
expansions/script/c101202061.lua
+74
-0
expansions/script/c101202062.lua
expansions/script/c101202062.lua
+79
-0
expansions/script/c101202063.lua
expansions/script/c101202063.lua
+80
-0
expansions/script/c101202064.lua
expansions/script/c101202064.lua
+105
-0
expansions/script/c101202065.lua
expansions/script/c101202065.lua
+92
-0
expansions/script/c101202066.lua
expansions/script/c101202066.lua
+63
-0
expansions/script/c101202067.lua
expansions/script/c101202067.lua
+38
-0
expansions/script/c101202068.lua
expansions/script/c101202068.lua
+92
-0
expansions/script/c101202069.lua
expansions/script/c101202069.lua
+125
-0
expansions/script/c101202070.lua
expansions/script/c101202070.lua
+65
-0
expansions/script/c101202071.lua
expansions/script/c101202071.lua
+104
-0
expansions/script/c101202072.lua
expansions/script/c101202072.lua
+104
-0
expansions/script/c101202073.lua
expansions/script/c101202073.lua
+130
-0
expansions/script/c101202074.lua
expansions/script/c101202074.lua
+80
-0
expansions/script/c101202075.lua
expansions/script/c101202075.lua
+73
-0
expansions/script/c101202076.lua
expansions/script/c101202076.lua
+85
-0
expansions/script/c101202077.lua
expansions/script/c101202077.lua
+132
-0
expansions/script/c101202078.lua
expansions/script/c101202078.lua
+72
-0
expansions/script/c101202079.lua
expansions/script/c101202079.lua
+47
-0
expansions/script/c101202080.lua
expansions/script/c101202080.lua
+81
-0
expansions/script/c121999031.lua
expansions/script/c121999031.lua
+133
-0
expansions/script/c121999032.lua
expansions/script/c121999032.lua
+115
-0
expansions/script/c121999033.lua
expansions/script/c121999033.lua
+85
-0
expansions/script/c121999034.lua
expansions/script/c121999034.lua
+84
-0
expansions/script/c121999035.lua
expansions/script/c121999035.lua
+62
-0
expansions/script/c121999037.lua
expansions/script/c121999037.lua
+58
-0
expansions/script/c121999038.lua
expansions/script/c121999038.lua
+55
-0
expansions/script/c121999039.lua
expansions/script/c121999039.lua
+71
-0
expansions/script/c121999040.lua
expansions/script/c121999040.lua
+94
-0
expansions/script/c12461492.lua
expansions/script/c12461492.lua
+90
-0
No files found.
expansions/script/c101202001.lua
0 → 100644
View file @
fcf4fbbd
--覇王門の魔術師
--Supreme King Gate Magician
--Script by StupidStudiosN
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
13331639
)
--pendulum summon
aux
.
EnablePendulumAttribute
(
c
)
--Cannot Banish
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_REMOVE
)
e1
:
SetRange
(
LOCATION_PZONE
)
e1
:
SetTargetRange
(
LOCATION_ONFIELD
,
0
)
e1
:
SetTarget
(
s
.
indtg
)
e1
:
SetValue
(
s
.
indval
)
c
:
RegisterEffect
(
e1
)
--pendulum set
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_DESTROY
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_PZONE
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetTarget
(
s
.
pentg
)
e2
:
SetOperation
(
s
.
penop
)
c
:
RegisterEffect
(
e2
)
--summon self
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOGRAVE
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_HAND
)
e3
:
SetCountLimit
(
1
,
id
+
o
)
e3
:
SetCondition
(
s
.
spcon
)
e3
:
SetTarget
(
s
.
sptg
)
e3
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e3
)
--search
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e4
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e4
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e4
:
SetCountLimit
(
1
,
id
+
o
*
2
)
e4
:
SetTarget
(
s
.
thtg
)
e4
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e4
)
end
function
s
.
indtg
(
e
,
c
)
return
c
:
IsFaceup
()
and
c
:
IsCode
(
13331639
)
end
function
s
.
indval
(
e
,
re
,
tp
)
return
e
:
GetHandler
():
GetControler
()
~=
tp
end
function
s
.
penfilter
(
c
)
return
c
:
IsSetCard
(
0x10f8
)
and
c
:
IsType
(
TYPE_PENDULUM
)
and
not
c
:
IsCode
(
id
)
and
not
c
:
IsForbidden
()
end
function
s
.
pentg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsDestructable
()
and
Duel
.
IsExistingMatchingCard
(
s
.
penfilter
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
s
.
penop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
Destroy
(
e
:
GetHandler
(),
REASON_EFFECT
)
~=
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
penfilter
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
local
tc
=
g
:
GetFirst
()
if
tc
then
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
end
end
end
function
s
.
spfilter
(
c
)
return
c
:
IsSetCard
(
0x10f8
)
and
not
c
:
IsCode
(
id
)
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
tp
,
LOCATION_PZONE
,
0
,
1
,
e
:
GetHandler
())
end
function
s
.
spfilter2
(
c
,
tp
)
return
c
:
IsSetCard
(
0x10f2
,
0x2073
,
0x2017
,
0x1046
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToGrave
()
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
Duel
.
IsExistingMatchingCard
(
s
.
spfilter2
,
tp
,
LOCATION_HAND
+
LOCATION_EXTRA
,
0
,
1
,
nil
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
spfilter2
,
tp
,
LOCATION_HAND
+
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
,
tp
)
local
gc
=
g
:
GetFirst
()
if
gc
and
Duel
.
SendtoGrave
(
gc
,
REASON_EFFECT
)
~=
0
and
gc
:
IsLocation
(
LOCATION_GRAVE
)
then
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
end
function
s
.
thfilter
(
c
)
return
aux
.
IsCodeListed
(
c
,
13331639
)
and
not
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsAbleToHand
()
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
expansions/script/c101202002.lua
0 → 100644
View file @
fcf4fbbd
--覇王眷竜ライトヴルム
--
--Script by Trishula9
function
c101202002
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
13331639
)
--pendulum summon
aux
.
EnablePendulumAttribute
(
c
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
101202002
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetRange
(
LOCATION_PZONE
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCountLimit
(
1
,
101202002
)
e1
:
SetCondition
(
c101202002
.
spcon
)
e1
:
SetTarget
(
c101202002
.
sptg
)
e1
:
SetOperation
(
c101202002
.
spop
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
101202002
,
1
))
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
101202002
+
100
)
e2
:
SetTarget
(
c101202002
.
thtg1
)
e2
:
SetOperation
(
c101202002
.
thop1
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e3
)
--to hand
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
101202002
,
2
))
e4
:
SetCategory
(
CATEGORY_TOHAND
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetCode
(
EVENT_DESTROYED
)
e4
:
SetRange
(
LOCATION_EXTRA
)
e4
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e4
:
SetCountLimit
(
1
,
101202002
+
200
)
e4
:
SetCondition
(
c101202002
.
thcon2
)
e4
:
SetTarget
(
c101202002
.
thtg2
)
e4
:
SetOperation
(
c101202002
.
thop2
)
c
:
RegisterEffect
(
e4
)
end
function
c101202002
.
cfilter1
(
c
)
return
c
:
IsCode
(
13331639
)
and
c
:
IsFaceup
()
end
function
c101202002
.
cfilter2
(
c
)
return
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsFaceup
()
end
function
c101202002
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
c101202002
.
cfilter1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c101202002
.
cfilter2
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
c101202002
.
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
c101202002
.
filter
(
c
,
ec
)
return
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsFaceup
()
and
c
:
IsLevelAbove
(
0
)
and
(
not
c
:
IsAttribute
(
ec
:
GetAttribute
())
or
not
c
:
IsLevel
(
ec
:
GetLevel
()))
end
function
c101202002
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
>
0
then
local
g
=
Duel
.
GetMatchingGroup
(
c101202002
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
c
,
c
)
if
g
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
101202002
,
3
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
local
rc
=
g
:
Select
(
tp
,
1
,
1
,
c
):
GetFirst
()
local
rg
=
Group
.
FromCards
(
c
,
rc
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
101202002
,
4
))
local
sg
=
rg
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
sg
)
local
tc
=
sg
:
GetFirst
()
local
sc
=
(
rg
-
sg
):
GetFirst
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CHANGE_ATTRIBUTE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetValue
(
sc
:
GetAttribute
())
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_CHANGE_LEVEL
)
e2
:
SetValue
(
sc
:
GetLevel
())
tc
:
RegisterEffect
(
e2
)
end
end
end
function
c101202002
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x10f8
,
0x20f8
)
and
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsFaceup
()
and
c
:
IsAbleToHand
()
end
function
c101202002
.
thtg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c101202002
.
thfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
c101202002
.
scfilter
(
c
)
return
c
:
IsSetCard
(
0x20f8
)
and
c
:
IsSynchroSummonable
(
nil
)
end
function
c101202002
.
xyzfilter
(
c
)
return
c
:
IsSetCard
(
0x20f8
)
and
c
:
IsXyzSummonable
(
nil
)
end
function
c101202002
.
thop1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
c101202002
.
thfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
tc
and
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
and
tc
:
IsLocation
(
LOCATION_HAND
)
then
local
g1
=
Duel
.
GetMatchingGroup
(
c101202002
.
scfilter
,
tp
,
LOCATION_EXTRA
,
0
,
nil
)
local
g2
=
Duel
.
GetMatchingGroup
(
c101202002
.
xyzfilter
,
tp
,
LOCATION_EXTRA
,
0
,
nil
)
if
(
g1
:
GetCount
()
>
0
or
g2
:
GetCount
()
>
0
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
101202002
,
5
))
then
Duel
.
BreakEffect
()
local
g
=
g1
+
g2
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
if
g1
:
IsContains
(
sc
)
then
Duel
.
SynchroSummon
(
tp
,
sc
,
nil
)
else
Duel
.
XyzSummon
(
tp
,
sc
,
nil
)
end
end
end
end
function
c101202002
.
thfilter2
(
c
,
tp
)
return
c
:
IsReason
(
REASON_BATTLE
+
REASON_EFFECT
)
and
bit
.
band
(
c
:
GetPreviousTypeOnField
(),
TYPE_PENDULUM
)
~=
0
and
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
and
c
:
IsPreviousControler
(
tp
)
and
c
:
IsPreviousPosition
(
POS_FACEUP
)
end
function
c101202002
.
thcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c101202002
.
thfilter2
,
1
,
nil
,
tp
)
and
e
:
GetHandler
():
IsFaceup
()
end
function
c101202002
.
thtg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToHand
()
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c101202002
.
thop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoHand
(
c
,
nil
,
REASON_EFFECT
)
end
end
expansions/script/c101202003.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--T.G. Rocket Salamander
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--spsummon from Deck
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCost
(
s
.
cost
)
e1
:
SetTarget
(
s
.
dstg
)
e1
:
SetOperation
(
s
.
dsop
)
c
:
RegisterEffect
(
e1
)
--spsummon from grave
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCondition
(
s
.
condition
)
e2
:
SetTarget
(
s
.
gstg
)
e2
:
SetOperation
(
s
.
gsop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
tfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x27
)
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
,
c
:
GetOriginalCodeRule
())
end
function
s
.
filter
(
c
,
e
,
tp
,
...
)
return
c
:
IsSetCard
(
0x27
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
and
(
#
{
...
}
==
0
or
not
c
:
IsCode
(
...
))
end
function
s
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckReleaseGroup
(
tp
,
s
.
tfilter
,
1
,
nil
,
e
,
tp
)
end
local
g
=
Duel
.
SelectReleaseGroup
(
tp
,
s
.
tfilter
,
1
,
1
,
nil
,
e
,
tp
)
e
:
SetLabel
(
g
:
GetFirst
():
GetOriginalCodeRule
())
Duel
.
Release
(
g
,
REASON_COST
)
end
function
s
.
dstg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
IsCostChecked
()
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
s
.
dsop
(
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
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
e
:
GetLabel
())
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
function
s
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_MACHINE
)
and
c
:
IsSetCard
(
0x27
)
end
function
s
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
s
.
sfilter
(
c
,
e
,
tp
)
return
c
:
IsLevelBelow
(
4
)
and
c
:
IsSetCard
(
0x27
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP_DEFENSE
)
end
function
s
.
gstg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
s
.
sfilter
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingTarget
(
s
.
sfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
sfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
function
s
.
gsop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
SpecialSummonStep
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP_DEFENSE
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
,
true
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetValue
(
RESET_TURN_SET
)
tc
:
RegisterEffect
(
e2
)
end
Duel
.
SpecialSummonComplete
()
end
expansions/script/c101202004.lua
0 → 100644
View file @
fcf4fbbd
--ヴィサス=サンサーラ
--
--Script by Trishula9
function
c101202004
.
initial_effect
(
c
)
--change name
aux
.
EnableChangeCode
(
c
,
56099748
,
LOCATION_MZONE
+
LOCATION_GRAVE
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
101202004
,
0
))
e1
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCountLimit
(
1
,
101202004
)
e1
:
SetTarget
(
c101202004
.
sptg
)
e1
:
SetOperation
(
c101202004
.
spop
)
c
:
RegisterEffect
(
e1
)
--non tuner
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_NONTUNER
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e2
:
SetValue
(
c101202004
.
tnval
)
c
:
RegisterEffect
(
e2
)
end
function
c101202004
.
retfilter
(
c
,
e
)
return
c
:
IsSetCard
(
0x198
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsFaceupEx
()
and
c
:
IsAbleToDeck
()
and
c
:
IsCanBeEffectTarget
(
e
)
end
function
c101202004
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsControler
(
tp
)
and
chkc
:
IsLocation
(
LOCATION_MZONE
+
LOCATION_GRAVE
+
LOCATION_REMOVED
)
and
c101202004
.
retfilter
(
chkc
)
end
local
g
=
Duel
.
GetMatchingGroup
(
c101202004
.
retfilter
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
nil
,
e
)
if
chk
==
0
then
return
g
:
CheckSubGroup
(
aux
.
mzctcheck
,
1
,
#
g
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
tg
=
g
:
SelectSubGroup
(
tp
,
aux
.
mzctcheck
,
false
,
1
,
#
g
,
tp
)
Duel
.
SetTargetCard
(
tg
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
tg
,
#
tg
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c101202004
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
):
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
Duel
.
SendtoDeck
(
g
,
nil
,
SEQ_DECKSHUFFLE
,
REASON_EFFECT
)
local
atk
=
Duel
.
GetOperatedGroup
():
Filter
(
Card
.
IsLocation
,
nil
,
LOCATION_DECK
+
LOCATION_EXTRA
):
GetClassCount
(
Card
.
GetCode
)
*
400
if
atk
>
0
and
c
:
IsRelateToEffect
(
e
)
and
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
>
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
atk
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_DISABLE
)
c
:
RegisterEffect
(
e1
)
end
end
function
c101202004
.
tnval
(
e
,
c
)
return
e
:
GetHandler
():
IsControler
(
c
:
GetControler
())
end
expansions/script/c101202005.lua
0 → 100644
View file @
fcf4fbbd
--ヴェーダ=ウパニシャッド
--
--Script by Trishula9
function
c101202005
.
initial_effect
(
c
)
c
:
SetSPSummonOnce
(
101202005
)
c
:
EnableCounterPermit
(
0x169
,
LOCATION_PZONE
)
--pendulum summon
aux
.
EnablePendulumAttribute
(
c
)
c
:
EnableReviveLimit
()
--cannot special summon
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_SINGLE
)
e0
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e0
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
c
:
RegisterEffect
(
e0
)
--counter set
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_COUNTER
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetCode
(
EVENT_DESTROYED
)
e1
:
SetRange
(
LOCATION_PZONE
)
e1
:
SetCountLimit
(
1
,
EFFECT_COUNT_CODE_CHAIN
)
e1
:
SetCondition
(
c101202005
.
stcon
)
e1
:
SetTarget
(
c101202005
.
sttg
)
e1
:
SetOperation
(
c101202005
.
stop
)
c
:
RegisterEffect
(
e1
)
--change scale
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_UPDATE_LSCALE
)
e2
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e2
:
SetRange
(
LOCATION_PZONE
)
e2
:
SetValue
(
c101202005
.
scval
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EFFECT_UPDATE_RSCALE
)
c
:
RegisterEffect
(
e3
)
--spsummon
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
101202005
,
0
))
e4
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_PZONE
)
e4
:
SetCost
(
c101202005
.
spcost
)
e4
:
SetTarget
(
c101202005
.
sptg
)
e4
:
SetOperation
(
c101202005
.
spop
)
c
:
RegisterEffect
(
e4
)
--end turn
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
101202005
,
1
))
e5
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e5
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e5
:
SetRange
(
LOCATION_MZONE
)
e5
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e5
:
SetCountLimit
(
1
)
e5
:
SetCondition
(
c101202005
.
etcon
)
e5
:
SetCost
(
c101202005
.
etcost
)
e5
:
SetOperation
(
c101202005
.
etop
)
c
:
RegisterEffect
(
e5
)
--to hand
local
e6
=
Effect
.
CreateEffect
(
c
)
e6
:
SetDescription
(
aux
.
Stringid
(
101202005
,
2
))
e6
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SPECIAL_SUMMON
)
e6
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_F
)
e6
:
SetCode
(
EVENT_PHASE
+
PHASE_STANDBY
)
e6
:
SetRange
(
LOCATION_MZONE
)
e6
:
SetCountLimit
(
1
)
e6
:
SetCondition
(
c101202005
.
thcon
)
e6
:
SetTarget
(
c101202005
.
thtg
)
e6
:
SetOperation
(
c101202005
.
thop
)
c
:
RegisterEffect
(
e6
)
end
function
c101202005
.
stcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
Card
.
IsType
,
1
,
nil
,
TYPE_MONSTER
)
end
function
c101202005
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COUNTER
,
nil
,
3
,
0
,
0x169
)
end
function
c101202005
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
e
:
GetHandler
():
AddCounter
(
0x169
,
3
)
end
end
function
c101202005
.
scval
(
e
,
c
)
return
c
:
GetCounter
(
0x169
)
end
function
c101202005
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsCanRemoveCounter
(
tp
,
0x169
,
12
,
REASON_COST
)
end
e
:
GetHandler
():
RemoveCounter
(
tp
,
0x169
,
12
,
REASON_COST
)
end
function
c101202005
.
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
,
true
,
true
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c101202005
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
true
,
POS_FACEUP
)
end
end
function
c101202005
.
cfilter
(
c
,
tp
)
return
c
:
IsSummonLocation
(
LOCATION_EXTRA
)
and
c
:
IsSummonPlayer
(
1
-
tp
)
end
function
c101202005
.
etcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c101202005
.
cfilter
,
1
,
nil
,
tp
)
end
function
c101202005
.
etcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemoveAsCost
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
+
LOCATION_GRAVE
,
0
,
12
,
nil
,
POS_FACEDOWN
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemoveAsCost
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
+
LOCATION_GRAVE
,
0
,
12
,
12
,
nil
,
POS_FACEDOWN
)
Duel
.
Remove
(
g
,
POS_FACEDOWN
,
REASON_COST
)
end
function
c101202005
.
etop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
turnp
=
Duel
.
GetTurnPlayer
()
Duel
.
SkipPhase
(
turnp
,
PHASE_DRAW
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
turnp
,
PHASE_STANDBY
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
turnp
,
PHASE_MAIN1
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
turnp
,
PHASE_BATTLE
,
RESET_PHASE
+
PHASE_END
,
1
,
1
)
Duel
.
SkipPhase
(
turnp
,
PHASE_MAIN2
,
RESET_PHASE
+
PHASE_END
,
1
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_BP
)
e1
:
SetTargetRange
(
0
,
1
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
c101202005
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetTurnPlayer
()
==
tp
end
function
c101202005
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c101202005
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x29a
)
and
(
c
:
IsLocation
(
LOCATION_HAND
+
LOCATION_DECK
+
LOCATION_GRAVE
)
or
c
:
IsFaceup
())
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c101202005
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
SendtoHand
(
c
,
nil
,
REASON_EFFECT
)
>
0
and
c
:
IsLocation
(
LOCATION_HAND
)
then
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
local
g
=
Duel
.
GetMatchingGroup
(
c101202005
.
spfilter
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
+
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
nil
,
e
,
tp
)
if
ft
>
0
and
g
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
101202005
,
3
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SpecialSummon
(
sg
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
end
\ No newline at end of file
expansions/script/c101202006.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Diabellestarr the Dark Witch
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--spsummon rule
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetCondition
(
s
.
sprcon
)
e1
:
SetOperation
(
s
.
sprop
)
c
:
RegisterEffect
(
e1
)
--set s/t
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetTarget
(
s
.
settg
)
e2
:
SetOperation
(
s
.
setop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e3
)
--revive
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e4
:
SetCategory
(
CATEGORY_TOGRAVE
+
CATEGORY_SPECIAL_SUMMON
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetCode
(
EVENT_TO_GRAVE
)
e4
:
SetCountLimit
(
1
,
id
+
o
*
2
)
e4
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e4
:
SetCondition
(
s
.
rvcon
)
e4
:
SetTarget
(
s
.
rvtg
)
e4
:
SetOperation
(
s
.
rvop
)
c
:
RegisterEffect
(
e4
)
end
function
s
.
cfilter
(
c
,
tp
,
f
)
return
f
(
c
)
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
s
.
sprcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
c
,
tp
,
Card
.
IsAbleToGraveAsCost
)
end
function
s
.
sprop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cfilter
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
c
,
tp
,
Card
.
IsAbleToGraveAsCost
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
end
function
s
.
filter
(
c
)
return
c
:
IsSetCard
(
0x19a
)
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsSSetable
()
end
function
s
.
settg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
end
function
s
.
setop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
tc
then
Duel
.
SSet
(
tp
,
tc
)
end
end
function
s
.
rvcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsPreviousLocation
(
LOCATION_HAND
+
LOCATION_ONFIELD
)
and
Duel
.
GetTurnPlayer
()
==
1
-
tp
end
function
s
.
rvtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
nil
,
tp
,
Card
.
IsAbleToGrave
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
c
,
1
,
0
,
0
)
end
function
s
.
rvop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cfilter
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
,
tp
,
Card
.
IsAbleToGrave
)
local
tc
=
g
:
GetFirst
()
local
c
=
e
:
GetHandler
()
if
tc
and
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
>
0
and
tc
:
IsLocation
(
LOCATION_GRAVE
)
and
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
expansions/script/c101202007.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Snake-Eye Excel
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--to hand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetTarget
(
s
.
thtg
)
e1
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
--spsummon
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
,
id
+
o
)
e3
:
SetCost
(
s
.
cost
)
e3
:
SetTarget
(
s
.
sptg
)
e3
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
filter
(
c
)
return
c
:
IsLevel
(
1
)
and
c
:
IsAttribute
(
ATTRIBUTE_FIRE
)
and
c
:
IsAbleToHand
()
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
function
s
.
cfilter
(
c
,
tc
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsAbleToGraveAsCost
()
and
Duel
.
GetMZoneCount
(
tp
,
Group
.
CreateGroup
(
c
,
tc
))
>
0
end
function
s
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToGraveAsCost
()
and
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
c
,
c
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
c
,
c
,
tp
)
+
c
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
end
function
s
.
sfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x19c
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
not
c
:
IsCode
(
id
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
(
e
:
IsCostChecked
()
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
)
and
Duel
.
IsExistingMatchingCard
(
s
.
sfilter
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
)
end
function
s
.
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
,
s
.
sfilter
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
expansions/script/c101202008.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Snake-Eye Oark
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--revive
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetTarget
(
s
.
rvtg
)
e1
:
SetOperation
(
s
.
rvop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
--spsummon
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
,
id
+
o
)
e3
:
SetCost
(
s
.
cost
)
e3
:
SetTarget
(
s
.
sptg
)
e3
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
filter
(
c
,
e
,
tp
)
return
c
:
IsFaceupEx
()
and
c
:
IsLevel
(
1
)
and
c
:
IsAttribute
(
ATTRIBUTE_FIRE
)
and
(
c
:
IsAbleToHand
()
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
))
end
function
s
.
rvtg
(
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
s
.
filter
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
local
tc
=
Duel
.
SelectTarget
(
tp
,
s
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
,
e
,
tp
):
GetFirst
()
if
tc
:
IsLocation
(
LOCATION_GRAVE
)
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_LEAVE_GRAVE
,
tc
,
1
,
0
,
0
)
end
end
function
s
.
rvop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
not
tc
:
IsRelateToEffect
(
e
)
then
return
end
local
op
=
aux
.
SelectFromOptions
(
tp
,
{
tc
:
IsAbleToHand
(),
1190
},
{
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
tc
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
),
1152
})
if
op
==
1
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
elseif
op
==
2
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
s
.
cfilter
(
c
,
tc
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsAbleToGraveAsCost
()
and
Duel
.
GetMZoneCount
(
tp
,
Group
.
CreateGroup
(
c
,
tc
))
>
0
end
function
s
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToGraveAsCost
()
and
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
c
,
c
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
c
,
c
,
tp
)
+
c
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
end
function
s
.
sfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x19c
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
not
c
:
IsCode
(
id
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
(
e
:
IsCostChecked
()
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
)
and
Duel
.
IsExistingMatchingCard
(
s
.
sfilter
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
)
end
function
s
.
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
,
s
.
sfilter
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
expansions/script/c101202009.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Snake-Eye Wight Birch
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--spsummon self
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetCondition
(
s
.
spscon
)
c
:
RegisterEffect
(
e1
)
--spsummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetCondition
(
s
.
spcon
)
e2
:
SetCost
(
s
.
cost
)
e2
:
SetTarget
(
s
.
sptg
)
e2
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsAttribute
(
ATTRIBUTE_FIRE
)
end
function
s
.
spscon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetTurnPlayer
()
==
1
-
tp
end
function
s
.
cfilter
(
c
,
tc
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsAbleToGraveAsCost
()
and
Duel
.
GetMZoneCount
(
tp
,
Group
.
CreateGroup
(
c
,
tc
))
>
0
end
function
s
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToGraveAsCost
()
and
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
c
,
c
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
c
,
c
,
tp
)
+
c
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
end
function
s
.
sfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x19c
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
not
c
:
IsCode
(
id
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
(
e
:
IsCostChecked
()
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
)
and
Duel
.
IsExistingMatchingCard
(
s
.
sfilter
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
)
end
function
s
.
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
,
s
.
sfilter
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
expansions/script/c101202010.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Snake-Eyes Flamberge Dragon
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--move
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetTarget
(
s
.
mvtg
)
e1
:
SetOperation
(
s
.
mvop
)
c
:
RegisterEffect
(
e1
)
--spsummon spell
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCondition
(
s
.
spscon
)
e2
:
SetTarget
(
s
.
spstg
)
e2
:
SetOperation
(
s
.
spsop
)
c
:
RegisterEffect
(
e2
)
--spsummon from GY
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
id
+
o
*
2
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetCondition
(
s
.
spcon
)
e3
:
SetTarget
(
s
.
sptg
)
e3
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
filter
(
c
,
tp
)
local
r
=
LOCATION_REASON_TOFIELD
if
not
c
:
IsControler
(
c
:
GetOwner
())
then
r
=
LOCATION_REASON_CONTROL
end
return
(
c
:
IsType
(
TYPE_MONSTER
)
or
c
:
IsLocation
(
LOCATION_MZONE
))
and
Duel
.
GetLocationCount
(
c
:
GetOwner
(),
LOCATION_SZONE
,
tp
,
r
)
>
0
end
function
s
.
mvtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
+
LOCATION_MZONE
)
and
s
.
filter
(
chkc
,
tp
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_MZONE
,
LOCATION_GRAVE
+
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
Duel
.
SelectTarget
(
tp
,
s
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_MZONE
,
LOCATION_GRAVE
+
LOCATION_MZONE
,
1
,
1
,
nil
)
end
function
s
.
mvop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
not
tc
:
IsImmuneToEffect
(
e
)
and
Duel
.
MoveToField
(
tc
,
tp
,
tc
:
GetOwner
(),
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_SPELL
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e1
)
end
end
function
s
.
spscon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetTurnPlayer
()
==
1
-
tp
end
function
s
.
sfilter
(
c
,
e
,
tp
)
return
c
:
GetOriginalType
()
&
TYPE_MONSTER
>
0
and
c
:
GetType
()
&
TYPE_CONTINUOUS
+
TYPE_SPELL
==
TYPE_CONTINUOUS
+
TYPE_SPELL
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
s
.
spstg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsOnField
()
and
s
.
sfilter
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingTarget
(
s
.
sfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
sfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
function
s
.
spsop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsPreviousLocation
(
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
function
s
.
ffilter
(
c
,
e
,
tp
)
return
c
:
IsLevel
(
1
)
and
c
:
IsAttribute
(
ATTRIBUTE_FIRE
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
1
and
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
59822133
)
and
Duel
.
IsExistingMatchingCard
(
s
.
ffilter
,
tp
,
LOCATION_GRAVE
,
0
,
2
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
2
,
tp
,
LOCATION_GRAVE
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<
2
or
Duel
.
IsPlayerAffectedByEffect
(
tp
,
59822133
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
ffilter
,
tp
,
LOCATION_GRAVE
,
0
,
2
,
2
,
nil
,
e
,
tp
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
expansions/script/c101202011.lua
0 → 100644
View file @
fcf4fbbd
--ホルスの栄光-イムセティ
--Script by Ruby
function
c101202011
.
initial_effect
(
c
)
--special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e1
:
SetRange
(
LOCATION_GRAVE
)
e1
:
SetCountLimit
(
1
,
101202011
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
c101202011
.
sprcon
)
c
:
RegisterEffect
(
e1
)
--search
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
101202011
,
0
))
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
+
CATEGORY_DRAW
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_HAND
)
e2
:
SetCost
(
c101202011
.
tgcost
)
e2
:
SetCountLimit
(
1
,
101202111
)
e2
:
SetTarget
(
c101202011
.
target
)
e2
:
SetOperation
(
c101202011
.
operation
)
c
:
RegisterEffect
(
e2
)
--Leave Field
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
101202011
,
1
))
e3
:
SetCategory
(
CATEGORY_TOGRAVE
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetCode
(
EVENT_LEAVE_FIELD
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
,
101202211
)
e3
:
SetCondition
(
c101202011
.
descon
)
e3
:
SetOperation
(
c101202011
.
desop
)
c
:
RegisterEffect
(
e3
)
end
function
c101202011
.
sprfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCode
(
101202058
)
end
function
c101202011
.
sprcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
if
c
:
IsHasEffect
(
EFFECT_NECRO_VALLEY
)
then
return
false
end
local
tp
=
c
:
GetControler
()
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c101202011
.
sprfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
function
c101202011
.
costfilter
(
c
)
return
c
:
IsAbleToGraveAsCost
()
end
function
c101202011
.
tgcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c101202011
.
costfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
c
)
and
c
:
IsAbleToGraveAsCost
()
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c101202011
.
costfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
c
)
g
:
AddCard
(
c
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
end
function
c101202011
.
filter
(
c
)
return
c
:
IsCode
(
101202058
)
and
c
:
IsAbleToHand
()
end
function
c101202011
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c101202011
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c101202011
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tg
=
Duel
.
GetFirstMatchingCard
(
c101202011
.
filter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
tg
and
Duel
.
SendtoHand
(
tg
,
nil
,
REASON_EFFECT
)
~=
0
and
Duel
.
ConfirmCards
(
1
-
tp
,
tg
)
~=
0
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
101202011
,
2
))
then
Duel
.
BreakEffect
()
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
function
c101202011
.
cfilter
(
c
,
tp
)
return
c
:
IsPreviousControler
(
tp
)
and
c
:
GetReasonPlayer
()
==
1
-
tp
and
c
:
IsReason
(
REASON_EFFECT
)
end
function
c101202011
.
descon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c101202011
.
cfilter
,
1
,
nil
,
tp
)
and
not
eg
:
IsContains
(
e
:
GetHandler
())
end
function
c101202011
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
nil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
end
expansions/script/c101202012.lua
0 → 100644
View file @
fcf4fbbd
--ホルスの祝福-ドゥアムテフ
--Script by Ruby
function
c101202012
.
initial_effect
(
c
)
--special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e1
:
SetRange
(
LOCATION_GRAVE
)
e1
:
SetCountLimit
(
1
,
101202012
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
c101202012
.
sprcon
)
c
:
RegisterEffect
(
e1
)
--buff
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e2
:
SetValue
(
c101202012
.
atkval
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
c
:
RegisterEffect
(
e3
)
--Leave Field
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
101202012
,
1
))
e4
:
SetCategory
(
CATEGORY_DRAW
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e4
:
SetCode
(
EVENT_LEAVE_FIELD
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCountLimit
(
1
,
101202112
)
e4
:
SetCondition
(
c101202012
.
descon
)
e4
:
SetTarget
(
c101202012
.
destg
)
e4
:
SetOperation
(
c101202012
.
desop
)
c
:
RegisterEffect
(
e4
)
end
function
c101202012
.
sprfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCode
(
101202058
)
end
function
c101202012
.
sprcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
if
c
:
IsHasEffect
(
EFFECT_NECRO_VALLEY
)
then
return
false
end
local
tp
=
c
:
GetControler
()
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c101202012
.
sprfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
function
c101202012
.
bfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x29c
)
end
function
c101202012
.
atkval
(
e
,
c
)
return
Duel
.
GetMatchingGroupCount
(
c101202012
.
bfilter
,
c
:
GetControler
(),
LOCATION_MZONE
,
0
,
nil
)
*
1200
end
function
c101202012
.
cfilter
(
c
,
tp
)
return
c
:
IsPreviousControler
(
tp
)
and
c
:
GetReasonPlayer
()
==
1
-
tp
and
c
:
IsReason
(
REASON_EFFECT
)
end
function
c101202012
.
drfilter
(
c
,
tp
)
return
c
:
GetSequence
()
<
5
and
c
:
IsFaceup
()
end
function
c101202012
.
descon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c101202012
.
cfilter
,
1
,
nil
,
tp
)
and
not
eg
:
IsContains
(
e
:
GetHandler
())
end
function
c101202012
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c101202012
.
drfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
ct
=
c101202012
.
count_unique_code
(
g
)
Duel
.
Draw
(
tp
,
ct
,
REASON_EFFECT
)
end
function
c101202012
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
g
=
Duel
.
GetMatchingGroup
(
c101202012
.
drfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
ct
=
c101202012
.
count_unique_code
(
g
)
e
:
SetLabel
(
ct
)
return
ct
>
0
and
Duel
.
IsPlayerCanDraw
(
tp
,
ct
)
end
Duel
.
SetTargetParam
(
e
:
GetLabel
())
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
e
:
GetLabel
())
end
function
c101202012
.
count_unique_code
(
g
)
local
check
=
{}
local
count
=
0
local
tc
=
g
:
GetFirst
()
while
tc
do
for
i
,
code
in
ipairs
({
tc
:
GetCode
()})
do
if
not
check
[
code
]
then
check
[
code
]
=
true
count
=
count
+
1
end
end
tc
=
g
:
GetNext
()
end
return
count
end
expansions/script/c101202013.lua
0 → 100644
View file @
fcf4fbbd
--ホルスの先導-ハーピ
--Script by Ruby
function
c101202013
.
initial_effect
(
c
)
--special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e1
:
SetRange
(
LOCATION_GRAVE
)
e1
:
SetCountLimit
(
1
,
101202013
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
c101202013
.
sprcon
)
c
:
RegisterEffect
(
e1
)
--Leave Field
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
101202013
,
1
))
e2
:
SetCategory
(
CATEGORY_TOGRAVE
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_LEAVE_FIELD
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
101202113
)
e2
:
SetCondition
(
c101202013
.
descon
)
e2
:
SetOperation
(
c101202013
.
desop
)
e2
:
SetTarget
(
c101202013
.
destg
)
c
:
RegisterEffect
(
e2
)
end
function
c101202013
.
sprfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCode
(
101202058
)
end
function
c101202013
.
sprcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
if
c
:
IsHasEffect
(
EFFECT_NECRO_VALLEY
)
then
return
false
end
local
tp
=
c
:
GetControler
()
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c101202013
.
sprfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
function
c101202013
.
cfilter
(
c
,
tp
)
return
c
:
IsPreviousControler
(
tp
)
and
c
:
GetReasonPlayer
()
==
1
-
tp
and
c
:
IsReason
(
REASON_EFFECT
)
end
function
c101202013
.
descon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c101202013
.
cfilter
,
1
,
nil
,
tp
)
and
not
eg
:
IsContains
(
e
:
GetHandler
())
end
function
c101202013
.
tgfilter
(
c
,
tp
)
return
c
:
IsAbleToDeck
()
or
c
:
IsAbleToHand
()
end
function
c101202013
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
false
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c101202013
.
tgfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
2
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c101202013
.
tgfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
2
,
2
,
nil
)
if
not
g
:
FilterCount
(
Card
.
IsAbleToHand
,
nil
,
e
)
==
g
:
GetCount
()
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
g
,
2
,
0
,
0
)
elseif
not
g
:
FilterCount
(
Card
.
IsAbleToDeck
,
nil
,
e
)
==
g
:
GetCount
()
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
2
,
0
,
0
)
end
end
function
c101202013
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tg
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
):
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
if
tg
:
GetCount
()
==
2
and
tg
:
FilterCount
(
Card
.
IsAbleToHand
,
nil
,
e
)
==
tg
:
GetCount
()
and
(
not
tg
:
FilterCount
(
Card
.
IsAbleToDeck
,
nil
,
e
)
==
tg
:
GetCount
()
or
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
101202013
,
2
)))
then
Duel
.
SendtoHand
(
tg
,
nil
,
REASON_EFFECT
)
else
Duel
.
SendtoDeck
(
tg
,
nil
,
SEQ_DECKSHUFFLE
,
REASON_EFFECT
)
end
end
expansions/script/c101202014.lua
0 → 100644
View file @
fcf4fbbd
--ホルスの加護-ケベンセヌフ
--Script by Ruby
function
c101202014
.
initial_effect
(
c
)
--special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e1
:
SetRange
(
LOCATION_GRAVE
)
e1
:
SetCountLimit
(
1
,
101202014
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
c101202014
.
sprcon
)
c
:
RegisterEffect
(
e1
)
--Leave Field
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
101202014
,
1
))
e2
:
SetCategory
(
CATEGORY_TOGRAVE
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_LEAVE_FIELD
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
101202114
)
e2
:
SetCondition
(
c101202014
.
descon
)
e2
:
SetOperation
(
c101202014
.
desop
)
c
:
RegisterEffect
(
e2
)
end
function
c101202014
.
sprfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCode
(
101202058
)
end
function
c101202014
.
sprcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
if
c
:
IsHasEffect
(
EFFECT_NECRO_VALLEY
)
then
return
false
end
local
tp
=
c
:
GetControler
()
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c101202014
.
sprfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
function
c101202014
.
cfilter
(
c
,
tp
)
return
c
:
IsPreviousControler
(
tp
)
and
c
:
GetReasonPlayer
()
==
1
-
tp
and
c
:
IsReason
(
REASON_EFFECT
)
end
function
c101202014
.
descon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c101202014
.
cfilter
,
1
,
nil
,
tp
)
and
not
eg
:
IsContains
(
e
:
GetHandler
())
end
function
c101202014
.
atlimit
(
e
,
c
)
return
c
:
IsSetCard
(
0x29c
)
and
c
:
IsFaceup
()
end
function
c101202014
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_SELECT_BATTLE_TARGET
)
e1
:
SetTargetRange
(
0
,
LOCATION_MZONE
)
e1
:
SetValue
(
c101202014
.
atlimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_CANNOT_BE_EFFECT_TARGET
)
e2
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
)
e2
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e2
:
SetTarget
(
c101202014
.
atlimit
)
e2
:
SetValue
(
aux
.
tgoval
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
expansions/script/c101202015.lua
0 → 100644
View file @
fcf4fbbd
--エレキハダマグロ
--Wattuna
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--direct attack
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DIRECT_ATTACK
)
c
:
RegisterEffect
(
e1
)
--spsummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_DAMAGE_STEP_END
)
e2
:
SetRange
(
LOCATION_HAND
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetCondition
(
s
.
spcon
)
e2
:
SetTarget
(
s
.
sptg
)
e2
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
s
.
global_check
then
s
.
global_check
=
true
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_BATTLE_DAMAGE
)
e3
:
SetCondition
(
s
.
regcon
)
e3
:
SetOperation
(
s
.
regop
)
Duel
.
RegisterEffect
(
e3
,
0
)
end
--s summon
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e4
:
SetCategory
(
CATEGORY_RELEASE
+
CATEGORY_SPECIAL_SUMMON
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetCode
(
EVENT_BATTLE_DAMAGE
)
e4
:
SetCountLimit
(
1
,
id
+
o
)
e4
:
SetCondition
(
s
.
sscon
)
e4
:
SetTarget
(
s
.
sstg
)
e4
:
SetOperation
(
s
.
ssop
)
c
:
RegisterEffect
(
e4
)
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetFlagEffect
(
tp
,
id
)
>
0
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
c
,
1
,
0
,
0
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
s
.
regcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
ep
~=
rp
end
function
s
.
regop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
RegisterFlagEffect
(
rp
,
id
,
RESET_PHASE
+
PHASE_DAMAGE
,
0
,
1
)
end
function
s
.
sscon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
ep
==
1
-
tp
and
Duel
.
GetAttackTarget
()
==
nil
end
function
s
.
mfilter
(
c
)
return
not
c
:
IsType
(
TYPE_TUNER
)
and
c
:
IsFaceupEx
()
and
c
:
IsReleasableByEffect
()
and
c
:
GetLevel
()
>
0
end
function
s
.
spfilter
(
c
,
e
,
tp
,
g
)
return
c
:
IsSetCard
(
0xe
)
and
c
:
IsType
(
TYPE_SYNCHRO
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
g
:
CheckSubGroup
(
s
.
gcheck
,
1
,
#
g
,
tp
,
e
:
GetHandler
(),
c
)
end
function
s
.
gcheck
(
g
,
tp
,
ec
,
sc
)
return
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
g
+
ec
,
sc
)
>
0
and
g
:
GetSum
(
Card
.
GetLevel
)
+
ec
:
GetLevel
()
==
sc
:
GetLevel
()
end
function
s
.
sstg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetReleaseGroup
(
tp
,
true
):
Filter
(
s
.
mfilter
,
c
)
if
chk
==
0
then
return
c
:
IsReleasableByEffect
()
and
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
g
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_RELEASE
,
g
,
2
,
0
,
0
)
end
function
s
.
ssop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetReleaseGroup
(
tp
,
true
):
Filter
(
s
.
mfilter
,
c
)
if
not
(
c
:
IsRelateToEffect
(
e
)
and
c
:
IsReleasableByEffect
())
or
#
g
==
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
spfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
,
e
,
tp
,
g
):
GetFirst
()
if
tc
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
local
sg
=
g
:
SelectSubGroup
(
tp
,
s
.
gcheck
,
false
,
1
,
#
g
,
tp
,
c
,
tc
)
+
c
if
Duel
.
Release
(
sg
,
REASON_EFFECT
)
>
0
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
end
expansions/script/c101202016.lua
0 → 100644
View file @
fcf4fbbd
--溟界神-ネフェルアビス
--Neferabyss, the Ogdoadic Overlord
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--spsummon
local
e0
=
aux
.
AddThisCardInGraveAlreadyCheck
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_TO_GRAVE
)
e1
:
SetRange
(
LOCATION_GRAVE
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetLabelObject
(
e0
)
e1
:
SetCondition
(
s
.
spcon
)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
--grave spsummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCondition
(
s
.
gscon
)
e2
:
SetTarget
(
s
.
gstg
)
e2
:
SetOperation
(
s
.
gsop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
cfilter
(
c
,
se
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsPreviousLocation
(
LOCATION_DECK
+
LOCATION_HAND
)
and
(
se
==
nil
or
c
:
GetReasonEffect
()
~=
se
)
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
se
=
e
:
GetLabelObject
():
GetLabelObject
()
return
eg
:
IsExists
(
s
.
cfilter
,
1
,
e
:
GetHandler
(),
se
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
c
,
1
,
0
,
0
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
s
.
splim
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
,
2
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
s
.
splim
(
e
,
c
)
return
c
:
GetRace
()
~=
RACE_REPTILE
end
function
s
.
gscon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonLocation
(
LOCATION_GRAVE
)
end
function
s
.
filter
(
c
,
e
,
tp
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
not
c
:
IsCode
(
id
)
end
function
s
.
gstg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
s
.
filter
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
function
s
.
gsop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
expansions/script/c101202017.lua
0 → 100644
View file @
fcf4fbbd
--白银之城的执事 阿里亚斯
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--specialsummon/set
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
101202017
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_HAND
+
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
101202017
)
e1
:
SetCost
(
s
.
tfcost
)
e1
:
SetCondition
(
s
.
tfcon
)
e1
:
SetTarget
(
s
.
tftg
)
e1
:
SetOperation
(
s
.
tfop
)
c
:
RegisterEffect
(
e1
)
--spsummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
101202017
+
100
)
e2
:
SetCondition
(
s
.
spcon
)
e2
:
SetTarget
(
s
.
sptg
)
e2
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
tfcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetCurrentPhase
()
==
PHASE_MAIN1
or
Duel
.
GetCurrentPhase
()
==
PHASE_MAIN2
end
function
s
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x17e
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
s
.
setfilter
(
c
)
return
c
:
GetType
()
==
TYPE_TRAP
and
c
:
IsSSetable
()
end
function
s
.
tfcost
(
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
s
.
tftg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
b1
=
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
local
b2
=
Duel
.
IsExistingMatchingCard
(
s
.
setfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
if
chk
==
0
then
return
b1
or
b2
end
end
function
s
.
tfop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
b1
=
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
local
b2
=
Duel
.
IsExistingMatchingCard
(
s
.
setfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
if
not
(
b1
or
b2
)
then
return
end
local
off
=
1
local
ops
=
{}
local
opval
=
{}
if
b1
then
ops
[
off
]
=
2
opval
[
off
-
1
]
=
1
off
=
off
+
1
end
if
b2
then
ops
[
off
]
=
1153
opval
[
off
-
1
]
=
2
off
=
off
+
1
end
local
op
=
Duel
.
SelectOption
(
tp
,
table.unpack
(
ops
))
local
sel
=
opval
[
op
]
e
:
SetLabel
(
sel
)
if
sel
==
1
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
spfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
sg
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
sg
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
setfilter
),
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
local
tc
=
g
:
GetFirst
()
if
tc
and
Duel
.
SSet
(
tp
,
tc
)
~=
0
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_TRAP_ACT_IN_SET_TURN
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
end
end
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ct
=
Duel
.
GetCurrentChain
()
if
ct
<
2
then
return
end
local
te
,
p
=
Duel
.
GetChainInfo
(
ct
-
1
,
CHAININFO_TRIGGERING_EFFECT
,
CHAININFO_TRIGGERING_PLAYER
)
local
loc1
=
te
and
te
:
GetHandler
():
IsSetCard
(
0x17e
)
local
loc2
=
te
:
GetActiveType
()
==
TYPE_TRAP
and
te
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
return
(
loc1
or
loc2
)
and
p
==
tp
and
rp
==
1
-
tp
end
function
s
.
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
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
Duel
.
SpecialSummon
(
e
:
GetHandler
(),
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
\ No newline at end of file
expansions/script/c101202018.lua
0 → 100644
View file @
fcf4fbbd
--VS 蛟龍
--Vanquish Soul Jiaolong
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--spsummon
--! needs an event to be raised for Duel.ConfirmCards, plus maybe a reason parameter
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_CUSTOM
+
id
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCondition
(
s
.
spcon
)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
--position change
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_POSITION
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetLabel
(
1
)
e2
:
SetCost
(
s
.
cost
)
e2
:
SetTarget
(
s
.
postg
)
e2
:
SetOperation
(
s
.
posop
)
c
:
RegisterEffect
(
e2
)
--to hand
local
e3
=
e2
:
Clone
()
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e3
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e3
:
SetLabel
(
2
)
e3
:
SetTarget
(
s
.
thtg
)
e3
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
Card
.
IsLocation
,
1
,
nil
,
LOCATION_HAND
)
and
r
&
REASON_COST
>
0
and
re
:
IsActivated
()
and
re
:
GetHandler
():
IsSetCard
(
0x195
)
and
rp
==
tp
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
c
,
1
,
0
,
0
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
s
.
cfilter
(
c
)
return
c
:
IsAttribute
(
ATTRIBUTE_FIRE
)
and
not
c
:
IsPublic
()
end
function
s
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
ct
=
e
:
GetLabel
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_HAND
,
0
,
ct
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CONFIRM
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cfilter
,
tp
,
LOCATION_HAND
,
0
,
ct
,
ct
,
nil
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
RaiseEvent
(
g
,
EVENT_CUSTOM
+
id
,
e
,
REASON_COST
,
tp
,
tp
,
0
)
Duel
.
ShuffleHand
(
tp
)
end
function
s
.
postg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsCanChangePosition
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
)
if
chk
==
0
then
return
#
g
>
0
and
Duel
.
GetFlagEffect
(
tp
,
id
)
==
0
end
Duel
.
RegisterFlagEffect
(
tp
,
id
,
RESET_CHAIN
,
0
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_POSITION
,
g
,
1
,
0
,
0
)
end
function
s
.
posop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_POSCHANGE
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsCanChangePosition
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
):
GetFirst
()
if
tc
then
Duel
.
ChangePosition
(
tc
,
POS_FACEUP_DEFENSE
,
POS_FACEDOWN_DEFENSE
,
POS_FACEUP_ATTACK
,
POS_FACEUP_ATTACK
)
end
end
function
s
.
filter
(
c
)
return
c
:
IsSetCard
(
0x195
)
and
c
:
IsAbleToHand
()
and
not
c
:
IsCode
(
id
)
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetFlagEffect
(
tp
,
id
)
==
0
end
Duel
.
RegisterFlagEffect
(
tp
,
id
,
RESET_CHAIN
,
0
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
expansions/script/c101202019.lua
0 → 100644
View file @
fcf4fbbd
--ポワソニエル・ド・ヌーベルズ
--Poissoniere de Nouvelles
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
aux
.
EnablePendulumAttribute
(
c
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_POSITION
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_PZONE
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCondition
(
s
.
spcon
)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
--place in pzone
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_TO_DECK
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCondition
(
s
.
pzcon
)
e2
:
SetTarget
(
s
.
pztg
)
e2
:
SetOperation
(
s
.
pzop
)
c
:
RegisterEffect
(
e2
)
--on-summon
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e3
:
SetCountLimit
(
1
,
id
+
o
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetTarget
(
s
.
target
)
c
:
RegisterEffect
(
e3
)
local
e4
=
e3
:
Clone
()
e4
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e4
)
end
function
s
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_RITUAL
)
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsCanChangePosition
()
end
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsCanChangePosition
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_POSCHANGE
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsCanChangePosition
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_POSITION
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
c
,
1
,
0
,
0
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
or
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
<
1
then
return
end
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
BreakEffect
()
Duel
.
ChangePosition
(
tc
,
POS_FACEUP_DEFENSE
,
POS_FACEDOWN_DEFENSE
,
POS_FACEUP_ATTACK
,
POS_FACEUP_ATTACK
)
end
end
function
s
.
pzcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsPreviousLocation
(
LOCATION_ONFIELD
)
and
c
:
IsReason
(
REASON_RELEASE
)
and
c
:
IsLocation
(
LOCATION_EXTRA
)
and
c
:
IsFaceup
()
end
function
s
.
pztg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
or
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
)
end
end
function
s
.
pzop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
end
end
function
s
.
filter
(
c
)
return
(
c
:
IsLevel
(
1
)
and
c
:
IsType
(
TYPE_RITUAL
)
or
c
:
IsSetCard
(
0x197
))
and
c
:
IsAbleToHand
()
end
function
s
.
mfilter
(
c
)
return
c
:
IsSetCard
(
0x197
)
and
c
:
IsAbleToRemove
()
end
function
s
.
chk
(
g
,
e
,
tp
)
return
Duel
.
IsExistingMatchingCard
(
s
.
sfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
,
#
g
)
end
function
s
.
sfilter
(
c
,
e
,
tp
,
ct
)
return
c
:
IsSetCard
(
0x196
)
and
c
:
IsType
(
TYPE_RITUAL
)
and
c
:
IsLevel
(
ct
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
true
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
b1
=
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
mfilter
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
local
b2
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
g
:
CheckSubGroup
(
s
.
chk
,
1
,
99
,
e
,
tp
)
if
chk
==
0
then
return
b1
or
b2
end
local
op
=
aux
.
SelectFromOptions
(
tp
,{
b1
,
aux
.
Stringid
(
id
,
3
)},{
b2
,
aux
.
Stringid
(
id
,
4
)})
if
op
==
1
then
e
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e
:
SetOperation
(
s
.
search
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
else
e
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e
:
SetOperation
(
s
.
psrsum
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
end
end
function
s
.
search
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
function
s
.
psrsum
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
s
.
mfilter
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
mg
=
g
:
SelectSubGroup
(
tp
,
s
.
chk
,
false
,
1
,
99
,
e
,
tp
)
if
not
mg
then
return
end
local
ct
=
Duel
.
Remove
(
mg
,
POS_FACEUP
,
REASON_EFFECT
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
sfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
,
ct
)
Duel
.
SpecialSummon
(
sg
,
0
,
tp
,
tp
,
false
,
true
,
POS_FACEUP
)
end
expansions/script/c101202020.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Dark Hole Dragon
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--effect indes
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e1
:
SetValue
(
1
)
c
:
RegisterEffect
(
e1
)
--spsummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_DESTROYED
)
e2
:
SetRange
(
LOCATION_GRAVE
+
LOCATION_HAND
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCondition
(
s
.
spcon
)
e2
:
SetTarget
(
s
.
sptg
)
e2
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e2
)
--delayed search
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e3
:
SetCountLimit
(
1
,
id
+
o
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetOperation
(
s
.
regop
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
cfilter
(
c
)
return
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
and
c
:
IsReason
(
REASON_EFFECT
)
and
not
c
:
GetReasonEffect
():
IsHasProperty
(
EFFECT_FLAG_CARD_TARGET
)
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
s
.
cfilter
,
1
,
nil
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
s
.
regop
(
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
:
SetOperation
(
s
.
thop
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
s
.
filter
(
c
)
return
c
:
IsCode
(
53129443
)
and
c
:
IsAbleToHand
()
end
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_CARD
,
0
,
id
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
expansions/script/c101202021.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--UFOLight
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--untargetable
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_BE_EFFECT_TARGET
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetCondition
(
s
.
tgcon
)
e1
:
SetValue
(
aux
.
tgoval
)
c
:
RegisterEffect
(
e1
)
--indes
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e2
:
SetTarget
(
s
.
indtg
)
e2
:
SetValue
(
1
)
c
:
RegisterEffect
(
e2
)
--draw
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e3
:
SetCategory
(
CATEGORY_DRAW
+
CATEGORY_REMOVE
+
CATEGORY_ATKCHANGE
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
,
id
)
e3
:
SetTarget
(
s
.
drtg
)
e3
:
SetOperation
(
s
.
drop
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
tgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
return
ph
>=
PHASE_BATTLE_START
and
ph
<=
PHASE_BATTLE
end
function
s
.
indtg
(
e
,
c
)
local
tc
=
e
:
GetHandler
()
return
c
==
tc
or
c
==
tc
:
GetBattleTarget
()
end
function
s
.
drtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
IsPlayerCanRemove
(
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
if
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_HAND
,
0
)
>
0
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_HAND
)
end
end
function
s
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
<
1
then
return
end
Duel
.
ShuffleHand
(
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_HAND
,
0
,
1
,
99
,
nil
)
if
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
<
1
then
return
end
local
c
=
e
:
GetHandler
()
local
ct
=
Duel
.
GetOperatedGroup
():
FilterCount
(
Card
.
IsLocation
,
nil
,
LOCATION_REMOVED
)
if
c
:
IsRelateToEffect
(
e
)
and
c
:
IsFaceup
()
and
ct
>
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_DISABLE
)
e1
:
SetValue
(
ct
*
500
)
c
:
RegisterEffect
(
e1
)
end
end
expansions/script/c101202022.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Ooyatsu Tsumamuhime
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--token
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
EFFECT_COUNT_CODE_SINGLE
)
e1
:
SetCondition
(
s
.
tkecon
)
e1
:
SetTarget
(
s
.
tktg
)
e1
:
SetOperation
(
s
.
tkop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_BE_BATTLE_TARGET
)
e2
:
SetCondition
(
s
.
tkbcon
)
c
:
RegisterEffect
(
e2
)
--negate summon
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetCategory
(
CATEGORY_DISABLE_SUMMON
+
CATEGORY_DESTROY
)
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_SPSUMMON
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetCondition
(
s
.
negcon
)
e3
:
SetCost
(
s
.
negcost
)
e3
:
SetTarget
(
s
.
negtg
)
e3
:
SetOperation
(
s
.
negop
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
tkecon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
re
:
IsHasProperty
(
EFFECT_FLAG_CARD_TARGET
)
then
return
false
end
local
g
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
)
return
g
and
g
:
IsContains
(
e
:
GetHandler
())
end
function
s
.
tkbcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetAttackTarget
()
==
e
:
GetHandler
()
end
function
s
.
tktg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
id
+
id
,
0
,
TYPES_TOKEN_MONSTER
,
800
,
800
,
1
,
RACE_PLANT
,
ATTRIBUTE_LIGHT
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
end
function
s
.
tkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
id
+
id
,
0
,
TYPES_TOKEN_MONSTER
,
800
,
800
,
1
,
RACE_PLANT
,
ATTRIBUTE_LIGHT
)
then
return
end
local
tk
=
Duel
.
CreateToken
(
tp
,
id
+
id
)
Duel
.
SpecialSummon
(
tk
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
function
s
.
negcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetCurrentChain
()
==
0
end
function
s
.
negcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckReleaseGroup
(
tp
,
Card
.
IsType
,
1
,
nil
,
TYPE_NORMAL
)
end
local
g
=
Duel
.
SelectReleaseGroup
(
tp
,
Card
.
IsType
,
1
,
1
,
nil
,
TYPE_NORMAL
)
end
function
s
.
negtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DISABLE_SUMMON
,
eg
,
#
eg
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
eg
,
#
eg
,
0
,
0
)
end
function
s
.
negop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
NegateSummon
(
eg
)
Duel
.
Destroy
(
eg
,
REASON_EFFECT
)
end
expansions/script/c101202023.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Invasive Alien Species - I.A.S
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--indes
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetCondition
(
s
.
condition
)
e1
:
SetValue
(
1
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
c
:
RegisterEffect
(
e2
)
--destroy
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e3
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_ATKCHANGE
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
,
id
)
e3
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e3
:
SetCondition
(
s
.
condition
)
e3
:
SetTarget
(
s
.
destg
)
e3
:
SetOperation
(
s
.
desop
)
c
:
RegisterEffect
(
e3
)
--spsummon
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e4
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_GRAVE
)
e4
:
SetCountLimit
(
1
,
id
+
o
)
e4
:
SetCondition
(
s
.
condition
)
e4
:
SetTarget
(
s
.
sptg
)
e4
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e4
)
end
function
s
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
aux
.
GetValueType
(
tp
)
==
"Card"
then
tp
=
tp
:
GetControler
()
end
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_FZONE
,
1
,
nil
)
end
function
s
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
1
-
tp
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
nil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectTarget
(
tp
,
nil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
end
function
s
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
>
0
and
c
:
IsRelateToEffect
(
e
)
and
c
:
IsFaceup
()
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_DISABLE
)
e1
:
SetValue
(
1000
)
c
:
RegisterEffect
(
e1
)
end
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
c
,
1
,
0
,
0
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
expansions/script/c101202024.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Tarai
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
if
not
s
.
global_check
then
s
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAIN_SOLVED
)
ge1
:
SetOperation
(
s
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
s
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
if
not
rc
:
IsRelateToEffect
(
re
)
or
not
re
:
IsActiveType
(
TYPE_MONSTER
)
then
return
end
local
loc
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TRIGGERING_LOCATION
)
if
loc
==
LOCATION_MZONE
then
rc
:
RegisterFlagEffect
(
id
,
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
+
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
end
function
s
.
filter
(
c
,
e
,
tp
)
local
seq
=
c
:
GetSequence
()
if
seq
>
4
then
return
false
end
if
c
:
IsControler
(
1
-
tp
)
then
seq
=
seq
+
16
end
return
c
:
IsFaceup
()
and
c
:
GetFlagEffect
(
id
)
>
0
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
,
c
:
GetControler
(),
1
<<
seq
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
s
.
filter
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
local
p
,
seq
=
tc
:
GetControler
(),
tc
:
GetSequence
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
>
0
and
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
p
,
false
,
false
,
POS_FACEUP
,
1
<<
seq
)
end
end
expansions/script/c101202025.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Tao the Great Chanter
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--indes
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e1
:
SetTarget
(
s
.
indtg
)
e1
:
SetValue
(
1
)
c
:
RegisterEffect
(
e1
)
--spsummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_TO_GRAVE
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e2
:
SetTarget
(
s
.
sptg
)
e2
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
indtg
(
e
,
c
)
local
tc
=
e
:
GetHandler
()
return
c
==
tc
or
c
==
tc
:
GetBattleTarget
()
end
function
s
.
filter
(
c
,
e
,
tp
)
return
c
:
IsRace
(
RACE_ILLUSION
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP_DEFENSE
)
and
not
c
:
IsCode
(
id
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
s
.
filter
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP_DEFENSE
)
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
+
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
s
.
slim
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
s
.
slim
(
e
,
c
,
sp
,
st
,
spos
,
tp
,
se
)
return
c
:
IsLocation
(
LOCATION_GRAVE
)
and
not
c
:
IsRace
(
RACE_ILLUSION
)
end
expansions/script/c101202026.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Hanayome Ningyo
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_DRAW
)
e1
:
SetCost
(
s
.
spcost
)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
--atk up
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_ATKCHANGE
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_F
)
e2
:
SetCode
(
EVENT_PHASE
+
PHASE_BATTLE_START
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetOperation
(
s
.
atkop
)
c
:
RegisterEffect
(
e2
)
--to deck
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e3
:
SetOperation
(
s
.
regop
)
c
:
RegisterEffect
(
e3
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e4
:
SetCategory
(
CATEGORY_TODECK
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_F
)
e4
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e4
:
SetRange
(
LOCATION_GRAVE
)
e4
:
SetCountLimit
(
1
)
e4
:
SetCondition
(
s
.
tdcon
)
e4
:
SetTarget
(
s
.
tdtg
)
e4
:
SetOperation
(
s
.
tdop
)
c
:
RegisterEffect
(
e4
)
end
function
s
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
c
,
1
,
0
,
0
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
s
.
atkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
ct
=
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
-
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_DECK
)
if
c
:
IsRelateToEffect
(
e
)
and
c
:
IsFaceup
()
and
ct
>
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_DISABLE
+
RESET_PHASE
+
PHASE_END
)
e1
:
SetValue
(
ct
*
300
)
c
:
RegisterEffect
(
e1
)
end
end
function
s
.
regop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
e
:
GetHandler
():
RegisterFlagEffect
(
id
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
s
.
tdcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetFlagEffect
(
id
)
>
0
end
function
s
.
tdtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
s
.
tdop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoDeck
(
c
,
nil
,
SEQ_DECKTOP
,
REASON_EFFECT
)
end
end
expansions/script/c101202027.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Oriori no Kamigami
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--toss coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_COIN
+
CATEGORY_DRAW
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetTarget
(
s
.
cointg
)
e1
:
SetOperation
(
s
.
coinop
)
c
:
RegisterEffect
(
e1
)
--double atk
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_ATKCHANGE
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_F
)
e2
:
SetCode
(
EVENT_TOSS_COIN
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetOperation
(
s
.
datkop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
function
s
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ct
=
0
while
Duel
.
TossCoin
(
tp
,
1
)
>
0
do
ct
=
ct
+
1
end
if
ct
>
1
then
Duel
.
Draw
(
tp
,
ct
//
2
,
REASON_EFFECT
)
end
end
function
s
.
datkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
c
:
IsFaceup
()
then
for
i
,
res
in
ipairs
{
Duel
.
GetCoinResult
()}
do
if
res
==
1
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SET_ATTACK_FINAL
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_DISABLE
)
e1
:
SetValue
(
c
:
GetAttack
()
*
2
)
c
:
RegisterEffect
(
e1
)
end
end
end
end
expansions/script/c101202028.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Shinobaroness Shade Peacock
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--change name
aux
.
EnableChangeCode
(
c
,
25415052
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
--to hand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCondition
(
s
.
thcon
)
e1
:
SetTarget
(
s
.
thtg
)
e1
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e1
)
--spsummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetOperation
(
s
.
regop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_F
)
e3
:
SetCode
(
EVENT_PHASE
+
PHASE_STANDBY
)
e3
:
SetRange
(
LOCATION_REMOVED
)
e3
:
SetCountLimit
(
1
)
e3
:
SetCondition
(
s
.
spcon
)
e3
:
SetTarget
(
s
.
sptg
)
e3
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e3
)
--return
aux
.
EnableSpiritReturn
(
c
,
EVENT_SPSUMMON_SUCCESS
)
end
function
s
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_RITUAL
)
end
function
s
.
filter
(
c
)
return
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
(
aux
.
IsTypeInText
(
c
,
TYPE_SPIRIT
)
or
c
:
IsCode
(
73055622
,
9553721
,
276357
,
30461781
,
99173029
))
and
c
:
IsAbleToHand
()
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
function
s
.
regop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
e
:
GetHandler
():
RegisterFlagEffect
(
id
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_STANDBY
,
0
,
2
,
Duel
.
GetTurnCount
())
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
ct
=
c
:
GetFlagEffectLabel
(
id
)
local
tn
=
Duel
.
GetTurnCount
()
if
not
ct
or
tn
==
ct
then
return
false
end
c
:
ResetFlagEffect
(
id
)
return
tn
==
ct
+
1
end
function
s
.
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
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
expansions/script/c101202029.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Shinobaron Shade Peacock
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--change name
aux
.
EnableChangeCode
(
c
,
52900000
,
LOCATION_HAND
+
LOCATION_MZONE
)
--to hand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCondition
(
s
.
thcon
)
e1
:
SetCost
(
s
.
thcost
)
e1
:
SetTarget
(
s
.
thtg
)
e1
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e1
)
--spsummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetOperation
(
s
.
regop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_F
)
e3
:
SetCode
(
EVENT_PHASE
+
PHASE_STANDBY
)
e3
:
SetRange
(
LOCATION_REMOVED
)
e3
:
SetCountLimit
(
1
)
e3
:
SetCondition
(
s
.
spcon
)
e3
:
SetTarget
(
s
.
sptg
)
e3
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e3
)
--return
aux
.
EnableSpiritReturn
(
c
,
EVENT_SPSUMMON_SUCCESS
)
end
function
s
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_RITUAL
)
end
function
s
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsReleasable
()
end
Duel
.
Release
(
c
,
REASON_COST
)
end
function
s
.
filter
(
c
,
typ
)
return
c
:
GetType
()
&
typ
==
typ
and
c
:
IsAbleToHand
()
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
TYPE_SPIRIT
)
and
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
0x82
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
2
,
tp
,
LOCATION_DECK
)
end
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Group
.
CreateGroup
()
for
_
,
typ
in
ipairs
{
TYPE_SPIRIT
,
0x82
}
do
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
g
:
Merge
(
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
typ
))
end
if
#
g
==
2
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
s
.
regop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
e
:
GetHandler
():
RegisterFlagEffect
(
id
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_STANDBY
,
0
,
2
,
Duel
.
GetTurnCount
())
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
ct
=
c
:
GetFlagEffectLabel
(
id
)
local
tn
=
Duel
.
GetTurnCount
()
if
not
ct
or
tn
==
ct
then
return
false
end
c
:
ResetFlagEffect
(
id
)
return
tn
==
ct
+
1
end
function
s
.
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
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
expansions/script/c101202030.lua
0 → 100644
View file @
fcf4fbbd
--覇王天龍オッドアイズ・アークレイ・ドラゴン
--
--Script by Trishula9
function
c101202030
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
13331639
)
--fusion summon
c
:
EnableReviveLimit
()
aux
.
AddFusionProcMix
(
c
,
false
,
true
,
c101202030
.
fusfilter1
,
c101202030
.
fusfilter2
,
c101202030
.
fusfilter3
,
c101202030
.
fusfilter4
)
--pendulum summon
aux
.
EnablePendulumAttribute
(
c
,
false
)
--spsummon condition
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e1
:
SetValue
(
c101202030
.
splimit
)
c
:
RegisterEffect
(
e1
)
--spsummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e2
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e2
:
SetRange
(
LOCATION_EXTRA
)
e2
:
SetCondition
(
c101202030
.
hspcon
)
e2
:
SetOperation
(
c101202030
.
hspop
)
c
:
RegisterEffect
(
e2
)
--pzone effect
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
101202030
,
0
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TODECK
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_PZONE
)
e3
:
SetCountLimit
(
1
,
101202030
)
e3
:
SetCondition
(
c101202030
.
pcon
)
e3
:
SetTarget
(
c101202030
.
ptg
)
e3
:
SetOperation
(
c101202030
.
pop
)
c
:
RegisterEffect
(
e3
)
--set
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
101202030
,
3
))
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e4
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e4
:
SetCondition
(
c101202030
.
setcon
)
e4
:
SetTarget
(
c101202030
.
settg
)
e4
:
SetOperation
(
c101202030
.
setop
)
c
:
RegisterEffect
(
e4
)
--pendulum
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
101202030
,
4
))
e5
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e5
:
SetCode
(
EVENT_DESTROYED
)
e5
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e5
:
SetCondition
(
c101202030
.
pencon
)
e5
:
SetTarget
(
c101202030
.
pentg
)
e5
:
SetOperation
(
c101202030
.
penop
)
c
:
RegisterEffect
(
e5
)
end
c101202030
.
material_type
=
TYPE_SYNCHRO
function
c101202030
.
fusfilter1
(
c
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsFusionType
(
TYPE_FUSION
)
end
function
c101202030
.
fusfilter2
(
c
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsFusionType
(
TYPE_SYNCHRO
)
end
function
c101202030
.
fusfilter3
(
c
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsFusionType
(
TYPE_XYZ
)
end
function
c101202030
.
fusfilter4
(
c
)
return
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsFusionType
(
TYPE_PENDULUM
)
end
function
c101202030
.
splimit
(
e
,
se
,
sp
,
st
)
local
c
=
e
:
GetHandler
()
if
c
:
IsLocation
(
LOCATION_EXTRA
)
and
c
:
IsFacedown
()
then
return
st
&
SUMMON_TYPE_FUSION
==
SUMMON_TYPE_FUSION
end
return
true
end
function
c101202030
.
hspfilter
(
c
,
tp
,
sc
)
return
c
:
IsCode
(
13331639
)
and
c
:
IsAttribute
(
ATTRIBUTE_DARK
)
and
c
:
IsLevel
(
12
)
and
c
:
IsFaceup
()
and
c
:
IsControler
(
tp
)
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
c
,
sc
)
>
0
and
c
:
IsCanBeFusionMaterial
(
sc
,
SUMMON_TYPE_SPECIAL
)
end
function
c101202030
.
hspcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
return
c
:
IsFacedown
()
and
Duel
.
CheckReleaseGroup
(
c
:
GetControler
(),
c101202030
.
hspfilter
,
1
,
nil
,
c
:
GetControler
(),
c
)
end
function
c101202030
.
hspop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
g
=
Duel
.
SelectReleaseGroup
(
tp
,
c101202030
.
hspfilter
,
1
,
1
,
nil
,
tp
,
c
)
c
:
SetMaterial
(
g
)
Duel
.
Release
(
g
,
REASON_COST
)
end
function
c101202030
.
pcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_PZONE
,
0
)
>=
2
end
function
c101202030
.
ptg
(
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
c101202030
.
pop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
>
0
then
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
TRUE
,
tp
,
LOCATION_PZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
101202030
,
1
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
sc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
if
sc
and
Duel
.
SendtoDeck
(
sc
,
nil
,
SEQ_DECKSHUFFLE
,
REASON_EFFECT
)
>
0
and
sc
:
IsLocation
(
LOCATION_EXTRA
)
and
sc
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
nil
,
sc
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
101202030
,
2
))
then
Duel
.
BreakEffect
()
Duel
.
SpecialSummon
(
sc
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
end
end
end
end
function
c101202030
.
setcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonLocation
(
LOCATION_EXTRA
)
end
function
c101202030
.
setfilter
(
c
)
return
c
:
IsType
(
TYPE_PENDULUM
)
and
not
c
:
IsForbidden
()
end
function
c101202030
.
settg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
(
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
or
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
))
and
Duel
.
IsExistingMatchingCard
(
c101202030
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
end
function
c101202030
.
setop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
and
not
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c101202030
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
local
tc
=
g
:
GetFirst
()
if
not
tc
then
return
end
if
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
false
)
then
tc
:
SetStatus
(
STATUS_EFFECT_ENABLED
,
true
)
end
end
function
c101202030
.
pencon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
and
c
:
IsFaceup
()
end
function
c101202030
.
pentg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
or
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
)
end
end
function
c101202030
.
penop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
end
end
expansions/script/c101202031.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Earthbound Servant Geo Gremlina
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--material
aux
.
AddFusionProcFun2
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsSetCard
,
0x21
),
aux
.
FilterBoolFunction
(
Card
.
IsAttribute
,
ATTRIBUTE_DARK
),
true
)
--search
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetTarget
(
s
.
thtg
)
e1
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e1
)
--direct attack
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCondition
(
Duel
.
IsAbleToEnterBP
)
e2
:
SetTarget
(
s
.
dirtg
)
e2
:
SetOperation
(
s
.
dirop
)
c
:
RegisterEffect
(
e2
)
--damage
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e3
:
SetCategory
(
CATEGORY_DAMAGE
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EVENT_DESTROYED
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
,
id
+
o
*
2
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetTarget
(
s
.
damtg
)
e3
:
SetOperation
(
s
.
damop
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
filter
(
c
)
return
c
:
IsSetCard
(
0x21
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
function
s
.
dfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsAttribute
(
ATTRIBUTE_DARK
)
and
c
:
IsType
(
TYPE_SYNCHRO
)
end
function
s
.
dirtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
s
.
dfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
dfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
s
.
dfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
end
function
s
.
dirop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DIRECT_ATTACK
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
end
end
function
s
.
cfilter
(
c
,
e
,
tp
)
return
c
:
IsFaceupEx
()
and
c
:
IsPreviousLocation
(
LOCATION_ONFIELD
)
and
c
:
IsPreviousControler
(
1
-
tp
)
and
c
:
IsReason
(
REASON_EFFECT
)
and
c
:
GetReasonEffect
():
IsSetCard
(
0x21
)
and
c
:
GetTextAttack
()
>
0
and
c
:
IsCanBeEffectTarget
(
e
)
end
function
s
.
damtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
g
=
eg
:
Filter
(
s
.
cfilter
,
nil
,
e
,
tp
)
if
chk
==
0
then
return
#
g
>
0
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
local
tg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SetTargetCard
(
tg
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DAMAGE
,
nil
,
0
,
tp
,
tg
:
GetFirst
():
GetTextAttack
())
end
function
s
.
damop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
tc
:
GetTextAttack
()
>
0
then
Duel
.
Damage
(
1
-
tp
,
tc
:
GetTextAttack
(),
REASON_EFFECT
)
end
end
expansions/script/c101202032.lua
0 → 100644
View file @
fcf4fbbd
--幻兽魔王 巴风特
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--material
aux
.
AddFusionProcFunRep
(
c
,
s
.
ffilter
,
2
,
true
)
--change name
aux
.
EnableChangeCode
(
c
,
4796100
,
LOCATION_GRAVE
+
LOCATION_MZONE
)
--to grave
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCondition
(
s
.
tgcon
)
e1
:
SetTarget
(
s
.
tgtg
)
e1
:
SetOperation
(
s
.
tgop
)
c
:
RegisterEffect
(
e1
)
--spsummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCondition
(
s
.
spcon
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
s
.
sptg
)
e2
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e2
)
end
RACE_ILLUSION
=
0x2000000
function
s
.
ffilter
(
c
,
fc
,
sub
,
mg
,
sg
)
return
c
:
IsRace
(
RACE_BEAST
+
RACE_FIEND
+
RACE_ILLUSION
)
and
(
not
sg
or
not
sg
:
IsExists
(
Card
.
IsRace
,
1
,
c
,
c
:
GetRace
()))
end
function
s
.
tgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_FUSION
)
end
function
s
.
tgfilter
(
c
)
return
c
:
IsRace
(
RACE_BEAST
+
RACE_FIEND
+
RACE_ILLUSION
)
and
c
:
IsAbleToGrave
()
end
function
s
.
tgtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
s
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetTurnPlayer
()
==
1
-
tp
end
function
s
.
filter
(
c
,
e
,
tp
)
return
c
:
IsRace
(
RACE_BEAST
+
RACE_FIEND
+
RACE_ILLUSION
)
and
not
c
:
IsCode
(
id
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_REMOVED
)
and
chkc
:
IsControler
(
tp
)
and
s
.
filter
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
filter
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
\ No newline at end of file
expansions/script/c101202033.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Gaia Prominence, the Kindling Seraph
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--material
aux
.
AddFusionProcCodeFun
(
c
,
9709452
,
s
.
mfilter
,
1
,
true
,
true
)
--negate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_NEGATE
+
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCondition
(
s
.
negcon
)
e1
:
SetCost
(
s
.
negcost
)
e1
:
SetTarget
(
s
.
negtg
)
e1
:
SetOperation
(
s
.
negop
)
c
:
RegisterEffect
(
e1
)
--spsummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_BATTLE_DESTROYING
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetCondition
(
s
.
spcon
)
e2
:
SetTarget
(
s
.
sptg
)
e2
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
mfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
s
.
negcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
loc
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TRIGGERING_LOCATION
)
return
not
c
:
IsStatus
(
STATUS_BATTLE_DESTROYED
)
and
rp
==
1
-
tp
and
re
:
IsActiveType
(
TYPE_MONSTER
)
and
loc
&
LOCATION_HAND
+
LOCATION_ONFIELD
>
0
and
Duel
.
IsChainNegatable
(
ev
)
end
function
s
.
cfilter
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsDiscardable
()
end
function
s
.
negcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
Duel
.
DiscardHand
(
tp
,
s
.
cfilter
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
end
function
s
.
negtg
(
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
)
local
rc
=
re
:
GetHandler
()
if
rc
:
IsRelateToEffect
(
re
)
and
rc
:
IsDestructable
()
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
eg
,
1
,
0
,
0
)
end
end
function
s
.
negop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
if
Duel
.
NegateActivation
(
ev
)
and
rc
:
IsRelateToEffect
(
re
)
then
Duel
.
Destroy
(
eg
,
REASON_EFFECT
)
end
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsRelateToBattle
()
and
Duel
.
GetAttacker
()
==
c
end
function
s
.
filter
(
c
,
e
,
tp
)
return
c
:
IsAttribute
(
ATTRIBUTE_FIRE
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
s
.
filter
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
expansions/script/c101202034.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--T.G. Mighty Striker
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--material
aux
.
AddSynchroProcedure2
(
c
,
nil
,
aux
.
NonTuner
(
nil
))
--s summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCondition
(
s
.
scon
)
e1
:
SetTarget
(
s
.
stg
)
e1
:
SetOperation
(
s
.
sop
)
c
:
RegisterEffect
(
e1
)
--search
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCondition
(
s
.
thcon
)
e2
:
SetTarget
(
s
.
thtg
)
e2
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e2
)
--to grave
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e3
:
SetCategory
(
CATEGORY_TOGRAVE
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
id
+
o
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetCondition
(
s
.
tgcon
)
e3
:
SetTarget
(
s
.
tgtg
)
e3
:
SetOperation
(
s
.
tgop
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
scon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
return
Duel
.
GetTurnPlayer
()
==
1
-
tp
and
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
end
function
s
.
stg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsSynchroSummonable
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
c
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
s
.
sop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
or
c
:
IsControler
(
1
-
tp
)
or
c
:
IsFacedown
()
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsSynchroSummonable
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
,
c
):
GetFirst
()
if
tc
then
Duel
.
SynchroSummon
(
tp
,
tc
,
c
)
end
end
function
s
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_SYNCHRO
)
end
function
s
.
filter
(
c
)
return
c
:
IsSetCard
(
0x27
)
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsAbleToHand
()
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
function
s
.
tgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsPreviousLocation
(
LOCATION_MZONE
)
end
function
s
.
gfilter
(
c
)
return
c
:
IsSetCard
(
0x27
)
and
c
:
IsAbleToGrave
()
end
function
s
.
tgtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
gfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
s
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
gfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
expansions/script/c101202035.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--T.G. Over Dragner
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--material
aux
.
AddSynchroProcedure
(
c
,
nil
,
aux
.
NonTuner
(
nil
),
1
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCondition
(
s
.
spcon
)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
--draw
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_DRAW
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e2
:
SetCode
(
EVENT_DESTROYED
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCondition
(
s
.
drcon
)
e2
:
SetTarget
(
s
.
drtg
)
e2
:
SetOperation
(
s
.
drop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_SYNCHRO
)
end
function
s
.
filter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x27
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP_DEFENSE
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
if
ft
>
0
then
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
59822133
)
then
ft
=
1
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
ft
,
nil
,
e
,
tp
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP_DEFENSE
)
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
+
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
aux
.
TargetBoolFunction
(
aux
.
NOT
(
Card
.
IsSetCard
),
0x27
))
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
s
.
drcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsPreviousLocation
(
LOCATION_ONFIELD
)
end
function
s
.
drtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
s
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Draw
(
p
,
d
,
REASON_EFFECT
)
end
expansions/script/c101202036.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--T.G. Glaive Blaster
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--material
aux
.
AddSynchroProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsType
,
TYPE_SYNCHRO
),
aux
.
NonTuner
(
Card
.
IsType
,
TYPE_SYNCHRO
),
2
)
--spsum condition
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
c
:
RegisterEffect
(
e1
)
--banish
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_REMOVE
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
)
e2
:
SetCondition
(
s
.
rmcon
)
e2
:
SetTarget
(
s
.
rmtg
)
e2
:
SetOperation
(
s
.
rmop
)
c
:
RegisterEffect
(
e2
)
--spsummon
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e4
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetCode
(
EVENT_CUSTOM
+
id
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCountLimit
(
1
)
e4
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e4
:
SetTarget
(
s
.
sptg
)
e4
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e4
)
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e5
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e5
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e5
:
SetCondition
(
s
.
matcon
)
e5
:
SetOperation
(
s
.
matop
)
c
:
RegisterEffect
(
e5
)
local
e6
=
Effect
.
CreateEffect
(
c
)
e6
:
SetType
(
EFFECT_TYPE_SINGLE
)
e6
:
SetCode
(
EFFECT_MATERIAL_CHECK
)
e6
:
SetLabelObject
(
e5
)
e6
:
SetValue
(
s
.
matchk
)
c
:
RegisterEffect
(
e6
)
aux
.
RegisterMergedDelayedEvent
(
c
,
id
,
EVENT_REMOVE
)
end
function
s
.
rmcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsSummonType
(
SUMMON_TYPE_SYNCHRO
)
end
function
s
.
filter
(
c
)
return
c
:
IsSummonLocation
(
LOCATION_EXTRA
)
and
c
:
IsAbleToRemove
()
end
function
s
.
rmtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
s
.
filter
(
chkc
)
end
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
and
c
:
GetFlagEffect
(
id
)
<
c
:
GetFlagEffectLabel
(
id
+
id
)
end
e
:
GetHandler
():
RegisterFlagEffect
(
id
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
g
,
1
,
0
,
0
)
end
function
s
.
rmop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
s
.
matchk
(
e
,
c
)
local
ct
=
c
:
GetMaterial
():
FilterCount
(
Card
.
IsType
,
nil
,
TYPE_SYNCHRO
)
-
1
e
:
GetLabelObject
():
SetLabel
(
ct
)
end
function
s
.
sfilter
(
c
,
e
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
and
c
:
IsCanBeEffectTarget
(
e
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
g
=
eg
:
Filter
(
s
.
sfilter
,
nil
,
e
,
tp
)
if
chkc
then
return
g
:
IsContains
(
chkc
)
end
if
chk
==
0
then
return
#
g
>
0
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SetTargetCard
(
sg
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
sg
,
1
,
0
,
0
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
end
end
function
s
.
matcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_SYNCHRO
)
and
e
:
GetLabel
()
>
0
end
function
s
.
matop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
e
:
GetHandler
():
RegisterFlagEffect
(
id
+
id
,
RESET_EVENT
+
RESETS_STANDARD
,
0
,
1
,
e
:
GetLabel
())
end
\ No newline at end of file
expansions/script/c101202037.lua
0 → 100644
View file @
fcf4fbbd
--マナドゥム・トリロスークタ
--
--Script by Trishula9
function
c101202037
.
initial_effect
(
c
)
--synchro summon
aux
.
AddSynchroProcedure
(
c
,
nil
,
aux
.
NonTuner
(
nil
),
1
)
c
:
EnableReviveLimit
()
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
101202037
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e1
:
SetCountLimit
(
1
,
101202037
)
e1
:
SetCondition
(
c101202037
.
spcon
)
e1
:
SetTarget
(
c101202037
.
sptg
)
e1
:
SetOperation
(
c101202037
.
spop
)
c
:
RegisterEffect
(
e1
)
--level
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
101202037
,
1
))
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCountLimit
(
1
,
101202037
+
100
)
e2
:
SetTarget
(
c101202037
.
lvtg
)
e2
:
SetOperation
(
c101202037
.
lvop
)
c
:
RegisterEffect
(
e2
)
end
function
c101202037
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_SYNCHRO
)
end
function
c101202037
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsType
(
TYPE_TUNER
)
and
c
:
IsLevel
(
2
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c101202037
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
c101202037
.
spfilter
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c101202037
.
spfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c101202037
.
spfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
function
c101202037
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
SpecialSummonStep
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetValue
(
RESET_TURN_SET
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e2
)
end
Duel
.
SpecialSummonComplete
()
end
function
c101202037
.
lvfilter
(
c
)
return
c
:
IsType
(
TYPE_TUNER
)
and
not
c
:
IsLevel
(
2
)
and
c
:
IsFaceup
()
end
function
c101202037
.
lvtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsControler
(
tp
)
and
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
c101202037
.
lvfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c101202037
.
lvfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
c101202037
.
lvfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
99
,
nil
)
end
function
c101202037
.
lvop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
):
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
):
Filter
(
Card
.
IsFaceup
,
nil
)
local
tc
=
g
:
GetFirst
()
while
tc
do
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CHANGE_LEVEL
)
e1
:
SetValue
(
2
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
tc
=
g
:
GetNext
()
end
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetTarget
(
c101202037
.
splimit
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c101202037
.
splimit
(
e
,
c
)
return
not
c
:
IsType
(
TYPE_SYNCHRO
)
and
c
:
IsLocation
(
LOCATION_EXTRA
)
end
\ No newline at end of file
expansions/script/c101202038.lua
0 → 100644
View file @
fcf4fbbd
--エレキュウキ
--Wattaurus
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--material
aux
.
AddSynchroProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsSetCard
,
0xe
),
aux
.
NonTuner
(
Card
.
IsRace
,
RACE_THUNDER
),
1
)
--direct attack
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DIRECT_ATTACK
)
c
:
RegisterEffect
(
e1
)
--spsummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_BATTLE_DAMAGE
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetCondition
(
s
.
condition
)
e2
:
SetTarget
(
s
.
target
)
e2
:
SetOperation
(
s
.
operation
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
ep
==
1
-
tp
and
Duel
.
GetAttackTarget
()
==
nil
end
function
s
.
filter
(
c
,
e
,
tp
)
return
c
:
IsType
(
TYPE_SYNCHRO
)
and
c
:
IsSetCard
(
0xe
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
not
c
:
IsCode
(
id
)
end
function
s
.
tfilter
(
c
)
return
c
:
IsSetCard
(
0xe
)
and
c
:
IsType
(
TYPE_TUNER
)
and
c
:
IsAbleToDeck
()
end
function
s
.
nfilter
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_THUNDER
)
and
not
c
:
IsType
(
TYPE_TUNER
)
and
c
:
IsAbleToDeck
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
tfilter
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
if
chk
==
0
then
return
#
g
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
nfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
nil
,
2
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_LEAVE_GRAVE
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
s
.
chk
(
g
)
return
g
:
GetClassCount
(
Card
.
GetLocation
)
==#
g
end
function
s
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tg
=
Duel
.
GetMatchingGroup
(
s
.
tfilter
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
local
mg
=
Duel
.
GetMatchingGroup
(
s
.
nfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
,
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
dg
=
(
tg
+
mg
):
SelectSubGroup
(
tp
,
s
.
chk
,
false
,
2
,
2
)
if
not
dg
or
Duel
.
SendtoDeck
(
dg
,
nil
,
SEQ_DECKSHUFFLE
,
REASON_EFFECT
)
<
2
or
dg
:
IsExists
(
aux
.
NOT
(
Card
.
IsLocation
),
1
,
nil
,
LOCATION_DECK
+
LOCATION_EXTRA
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SpecialSummon
(
sg
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
expansions/script/c101202039.lua
0 → 100644
View file @
fcf4fbbd
--装甲超量鱼雷
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--xyz summon
aux
.
AddXyzProcedure
(
c
,
nil
,
3
,
2
)
c
:
EnableReviveLimit
()
--cannot direct attack
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_ATTACK
)
e1
:
SetCondition
(
s
.
attcon
)
c
:
RegisterEffect
(
e1
)
--draw
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_DRAW
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetCost
(
s
.
drawcost
)
e2
:
SetTarget
(
s
.
drawtarget
)
e2
:
SetOperation
(
s
.
drawoperation
)
c
:
RegisterEffect
(
e2
)
--actlimit
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e3
:
SetTargetRange
(
0
,
1
)
e3
:
SetCondition
(
s
.
actcon
)
e3
:
SetValue
(
1
)
c
:
RegisterEffect
(
e3
)
--disable
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e4
:
SetRange
(
LOCATION_SZONE
)
e4
:
SetCode
(
EVENT_ATTACK_ANNOUNCE
)
e4
:
SetCondition
(
s
.
actcon
)
e4
:
SetOperation
(
s
.
disop
)
c
:
RegisterEffect
(
e4
)
--cannot be target
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetType
(
EFFECT_TYPE_EQUIP
)
e5
:
SetCode
(
EFFECT_CANNOT_BE_EFFECT_TARGET
)
e5
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
)
e5
:
SetValue
(
aux
.
tgoval
)
e5
:
SetCondition
(
s
.
targetcon
)
c
:
RegisterEffect
(
e5
)
end
function
s
.
targetcon
(
e
)
return
e
:
GetHandler
():
GetEquipTarget
():
IsType
(
TYPE_XYZ
)
end
function
s
.
attcon
(
e
)
return
e
:
GetHandler
():
GetOverlayCount
()
==
0
end
function
s
.
drawcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
CheckRemoveOverlayCard
(
tp
,
2
,
REASON_COST
)
end
e
:
GetHandler
():
RemoveOverlayCard
(
tp
,
2
,
2
,
REASON_COST
)
end
function
s
.
drawtarget
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
s
.
drawoperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Draw
(
p
,
d
,
REASON_EFFECT
)
end
function
s
.
actcon
(
e
)
local
tc
=
e
:
GetHandler
():
GetEquipTarget
()
return
Duel
.
GetAttacker
()
==
tc
or
Duel
.
GetAttackTarget
()
==
tc
end
function
s
.
disfilter
(
c
)
return
aux
.
NegateAnyFilter
(
c
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsFaceup
()
end
function
s
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
s
.
disfilter
,
tp
,
0
,
LOCATION_MZONE
,
c
)
local
tc
=
g
:
GetFirst
()
while
tc
do
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_DAMAGE
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_DAMAGE
)
tc
:
RegisterEffect
(
e2
)
if
tc
:
IsType
(
TYPE_TRAPMONSTER
)
then
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_DISABLE_TRAPMONSTER
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_DAMAGE
)
tc
:
RegisterEffect
(
e3
)
end
tc
=
g
:
GetNext
()
end
end
expansions/script/c101202040.lua
0 → 100644
View file @
fcf4fbbd
--装甲超量要塞
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--xyz summon
aux
.
AddXyzProcedure
(
c
,
nil
,
5
,
2
,
s
.
ovfilter
,
aux
.
Stringid
(
id
,
0
),
2
,
s
.
xyzop
)
c
:
EnableReviveLimit
()
--xyzlimit
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetCondition
(
s
.
xyzcondition
)
e1
:
SetCode
(
EFFECT_CANNOT_BE_XYZ_MATERIAL
)
e1
:
SetValue
(
1
)
c
:
RegisterEffect
(
e1
)
--Search
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCost
(
s
.
thcost
)
e2
:
SetTarget
(
s
.
thtg
)
e2
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e2
)
--Damage
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_EQUIP
)
e3
:
SetCode
(
EFFECT_CHANGE_BATTLE_DAMAGE
)
e3
:
SetCondition
(
s
.
damcon
)
e3
:
SetValue
(
aux
.
ChangeBattleDamage
(
1
,
DOUBLE_DAMAGE
))
c
:
RegisterEffect
(
e3
)
end
function
s
.
damcon
(
e
)
return
e
:
GetHandler
():
GetEquipTarget
():
GetBattleTarget
()
~=
nil
end
function
s
.
ovfilter
(
c
)
return
c
:
IsFaceup
()
and
(
c
:
IsRank
(
3
)
or
c
:
IsRank
(
4
))
end
function
s
.
xyzop
(
e
,
tp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFlagEffect
(
tp
,
id
)
==
0
end
Duel
.
RegisterFlagEffect
(
tp
,
id
,
RESET_PHASE
+
PHASE_END
,
EFFECT_FLAG_OATH
,
1
)
end
function
s
.
xyzcondition
(
e
)
return
e
:
GetHandler
():
GetOverlayCount
()
>
0
end
function
s
.
thfilter
(
c
)
return
(
c
:
IsSetCard
(
0x4073
)
or
c
:
IsCode
(
73046708
))
and
c
:
IsAbleToHand
()
end
function
s
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
CheckRemoveOverlayCard
(
tp
,
1
,
REASON_COST
)
end
local
ct
=
0
local
g
=
Duel
.
GetMatchingGroup
(
s
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
,
e
,
tp
)
if
g
:
GetClassCount
(
Card
.
GetCode
)
==
0
then
return
false
end
if
g
:
GetClassCount
(
Card
.
GetCode
)
>=
2
then
ct
=
e
:
GetHandler
():
RemoveOverlayCard
(
tp
,
1
,
2
,
REASON_COST
)
else
ct
=
e
:
GetHandler
():
RemoveOverlayCard
(
tp
,
1
,
1
,
REASON_COST
)
end
e
:
SetLabel
(
ct
)
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
local
ct
=
e
:
GetLabel
()
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
ct
,
tp
,
LOCATION_DECK
)
end
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
ct
=
e
:
GetLabel
()
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
ct
,
ct
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sg
=
g
:
SelectSubGroup
(
tp
,
aux
.
dncheck
,
false
,
1
,
ct
)
if
sg
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
sg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
sg
)
end
end
end
expansions/script/c101202041.lua
0 → 100644
View file @
fcf4fbbd
--重铠装-暗黑骑士枪兵
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--xyz summon
aux
.
AddXyzProcedure
(
c
,
nil
,
7
,
3
,
s
.
ovfilter
,
aux
.
Stringid
(
id
,
0
),
7
,
s
.
xyzop
)
c
:
EnableReviveLimit
()
--atk
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
s
.
atkval
)
c
:
RegisterEffect
(
e1
)
--tohand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetTarget
(
s
.
thtg
)
e2
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e2
)
--Equip
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetCode
(
EVENT_EQUIP
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetTarget
(
s
.
eqtg
)
e3
:
SetOperation
(
s
.
eqop
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
ovfilter
(
c
)
return
c
:
IsFaceup
()
and
(
c
:
IsRank
(
5
)
or
c
:
IsRank
(
6
))
end
function
s
.
xyzop
(
e
,
tp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFlagEffect
(
tp
,
id
)
==
0
end
Duel
.
RegisterFlagEffect
(
tp
,
id
,
RESET_PHASE
+
PHASE_END
,
EFFECT_FLAG_OATH
,
1
)
end
function
s
.
atkval
(
e
,
c
)
return
(
c
:
GetOverlayCount
()
+
c
:
GetEquipCount
())
*
300
end
function
s
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x73
)
and
c
:
IsAbleToHand
()
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
s
.
thfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
thfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
thfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
0
)
end
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
end
end
function
s
.
ovfilter2
(
c
)
return
c
:
IsCanOverlay
()
end
function
s
.
eqtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
ovfilter2
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
,
e
:
GetHandler
())
end
end
function
s
.
eqop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
s
.
ovfilter2
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_XMATERIAL
)
local
tg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
tg
)
local
tc
=
tg
:
GetFirst
()
if
not
tc
:
IsImmuneToEffect
(
e
)
then
local
og
=
tc
:
GetOverlayGroup
()
if
og
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
og
,
REASON_RULE
)
end
Duel
.
Overlay
(
c
,
tg
)
end
end
end
expansions/script/c101202042.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris, Lanpa and beyond
--Stellar Nemesis T-PHON - Doomsday Star
local
s
,
id
,
o
=
GetID
()
local
special_count
=
{}
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--material
aux
.
AddXyzProcedure
(
c
,
nil
,
12
,
2
)
s
.
AddMaxXyzProcedure
(
c
)
if
not
s
.
global_check
then
s
.
global_check
=
true
local
ge1
=
Effect
.
GlobalEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
ge1
:
SetOperation
(
s
.
chcon
)
ge1
:
SetOperation
(
s
.
chop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
--limit effects
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetTargetRange
(
1
,
1
)
e2
:
SetCondition
(
s
.
lecon
)
e2
:
SetValue
(
s
.
actlimit
)
c
:
RegisterEffect
(
e2
)
--to hand
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetCategory
(
CATEGORY_TOHAND
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetCost
(
s
.
thcost
)
e3
:
SetTarget
(
s
.
thtg
)
e3
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
lsop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
3
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
e1
:
Clone
()
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
3
))
e2
:
SetCode
(
EFFECT_CANNOT_SUMMON
)
Duel
.
RegisterEffect
(
e2
,
tp
)
e
:
Reset
()
end
function
s
.
lecon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_XYZ
)
end
function
s
.
actlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
re
:
GetHandler
():
IsAttackAbove
(
3000
)
end
function
s
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
CheckRemoveOverlayCard
(
tp
,
1
,
REASON_COST
)
end
c
:
RemoveOverlayCard
(
tp
,
1
,
1
,
REASON_COST
)
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToHand
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
)
if
chk
==
0
then
return
#
g
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
0
)
end
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToHand
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
end
function
s
.
chcon
(
e
,
tp
,
eg
,
ev
,
ep
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
s
.
cf
,
1
,
nil
,
1
-
tp
)
end
function
s
.
cf
(
c
,
tp
)
return
c
:
IsPreviousLocation
(
LOCATION_EXTRA
)
end
function
s
.
chop
(
e
,
tp
,
eg
,
ev
,
ep
,
re
,
r
,
rp
)
if
eg
:
IsExists
(
s
.
cf
,
1
,
nil
,
1
-
tp
)
then
local
turn
=
Duel
.
GetTurnCount
()
if
not
special_count
[
1
-
ep
]
then
special_count
[
1
-
ep
]
=
{}
end
if
not
special_count
[
1
-
ep
][
turn
]
then
special_count
[
1
-
ep
][
turn
]
=
0
end
special_count
[
1
-
ep
][
turn
]
=
special_count
[
1
-
ep
][
turn
]
+
1
end
end
function
s
.
AddMaxXyzProcedure
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
1165
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetRange
(
LOCATION_EXTRA
)
e1
:
SetCondition
(
s
.
xyzcon
)
e1
:
SetTarget
(
s
.
xyztg
)
e1
:
SetOperation
(
s
.
xyzop
)
e1
:
SetValue
(
SUMMON_TYPE_XYZ
)
c
:
RegisterEffect
(
e1
)
return
e1
end
function
s
.
xyzcon
(
e
,
c
,
og
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
local
turn
=
Duel
.
GetTurnCount
()
if
not
special_count
[
tp
]
then
return
false
end
if
not
special_count
[
tp
][
turn
]
and
not
special_count
[
tp
][
turn
-
1
]
then
return
false
end
local
the_true
=
2
if
(
special_count
[
tp
][
turn
]
and
special_count
[
tp
][
turn
]
<
2
)
or
not
special_count
[
tp
][
turn
]
then
the_true
=
the_true
-
1
end
if
(
special_count
[
tp
][
turn
-
1
]
and
special_count
[
tp
][
turn
-
1
]
<
2
)
or
not
special_count
[
tp
][
turn
-
1
]
then
the_true
=
the_true
-
1
end
if
the_true
==
0
then
return
false
else
the_true
=
nil
end
local
g
=
nil
if
og
then
g
=
og
else
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_MZONE
,
0
)
end
local
ct
=
0
if
#
g
>
0
then
a
,
ct
=
g
:
GetMaxGroup
(
Card
.
GetAttack
)
end
return
g
:
CheckSubGroup
(
s
.
MaxXyzGoal
,
1
,
1
,
tp
,
c
,
ct
)
end
function
s
.
xyztg
(
e
,
tp
,
og
)
local
c
=
e
:
GetHandler
()
local
turn
=
Duel
.
GetTurnCount
()
if
not
special_count
[
tp
]
then
return
false
end
if
not
special_count
[
tp
][
turn
]
and
not
special_count
[
tp
][
turn
-
1
]
then
return
false
end
local
the_true
=
2
if
(
special_count
[
tp
][
turn
]
and
special_count
[
tp
][
turn
]
<
2
)
or
not
special_count
[
tp
][
turn
]
then
the_true
=
the_true
-
1
end
if
(
special_count
[
tp
][
turn
-
1
]
and
special_count
[
tp
][
turn
-
1
]
<
2
)
or
not
special_count
[
tp
][
turn
-
1
]
then
the_true
=
the_true
-
1
end
if
the_true
==
0
then
return
false
else
the_true
=
nil
end
local
g
=
nil
if
og
then
g
=
og
else
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_MZONE
,
0
)
end
local
cancel
=
Duel
.
IsSummonCancelable
()
aux
.
GCheckAdditional
=
aux
.
TuneMagicianCheckAdditionalX
(
EFFECT_TUNE_MAGICIAN_X
)
Duel
.
Hint
(
3
,
tp
,
513
)
local
ct
=
0
if
#
g
>
0
then
a
,
ct
=
g
:
GetMaxGroup
(
Card
.
GetAttack
)
end
local
mg
=
g
:
SelectSubGroup
(
tp
,
s
.
MaxXyzGoal
,
cancel
,
1
,
1
,
tp
,
c
,
ct
)
aux
.
GCheckAdditional
=
nil
if
mg
and
mg
:
GetCount
()
>
0
then
mg
:
KeepAlive
()
e
:
SetLabelObject
(
mg
)
return
true
else
return
false
end
end
function
s
.
xyzop
(
e
,
tp
,
og
)
local
c
=
e
:
GetHandler
()
local
g
=
e
:
GetLabelObject
()
local
sg
=
g
:
Filter
(
Card
.
IsType
,
nil
,
TYPE_XYZ
)
if
#
g
>
0
then
local
tc
=
sg
:
GetFirst
()
while
tc
do
local
ag
=
tc
:
GetOverlayGroup
()
if
#
ag
>
0
then
g
:
Merge
(
ag
)
end
tc
=
sg
:
GetNext
()
end
end
c
:
SetMaterial
(
g
)
Duel
.
Overlay
(
c
,
g
)
g
:
DeleteGroup
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetOperation
(
s
.
lsop
)
c
:
RegisterEffect
(
e1
)
end
function
s
.
MaxXyzGoal
(
g
,
tp
,
xyzc
,
ct
)
local
sg
=
Duel
.
GetMustMaterial
(
tp
,
EFFECT_MUST_BE_XMATERIAL
)
if
sg
:
IsExists
(
aux
.
MustMaterialCounterFilter
,
1
,
nil
,
g
)
or
g
:
IsExists
(
function
(
c
)
return
not
c
:
IsCanBeXyzMaterial
(
xyzc
)
end
,
1
,
nil
)
then
return
false
end
return
g
:
IsExists
(
Card
.
IsAttack
,
nil
,
1
,
ct
)
end
\ No newline at end of file
expansions/script/c101202043.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Infernal Flame Banshee
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--material
aux
.
AddXyzProcedure
(
c
,
nil
,
4
,
2
)
--search
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCost
(
s
.
scost
)
e1
:
SetTarget
(
s
.
stg
)
e1
:
SetOperation
(
s
.
sop
)
c
:
RegisterEffect
(
e1
)
--spsummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCondition
(
s
.
spcon
)
e2
:
SetTarget
(
s
.
sptg
)
e2
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
scost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
CheckRemoveOverlayCard
(
tp
,
1
,
REASON_COST
)
end
c
:
RemoveOverlayCard
(
tp
,
1
,
1
,
REASON_COST
)
end
function
s
.
filter
(
c
)
return
c
:
IsRace
(
RACE_PYRO
)
and
(
c
:
IsAbleToHand
()
or
c
:
IsAbleToGrave
())
end
function
s
.
stg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
end
function
s
.
sop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_OPERATECARD
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
not
tc
then
return
end
local
op
=
aux
.
SelectFromOptions
(
tp
,{
tc
:
IsAbleToHand
(),
1190
},{
tc
:
IsAbleToGrave
(),
1191
})
if
op
==
1
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
else
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
end
end
function
s
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_PYRO
)
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
c
,
1
,
0
,
0
)
end
function
s
.
afilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
(
c
:
IsRelateToEffect
(
e
)
and
Duel
.
SpecialSummonStep
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
))
then
return
end
local
ct
=
Duel
.
GetMatchingGroupCount
(
s
.
afilter
,
tp
,
LOCATION_REMOVED
,
0
,
nil
)
if
ct
>
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_DISABLE
+
RESET_PHASE
+
PHASE_END
)
e1
:
SetValue
(
ct
*
100
)
c
:
RegisterEffect
(
e1
)
end
Duel
.
SpecialSummonComplete
()
end
expansions/script/c101202044.lua
0 → 100644
View file @
fcf4fbbd
--超越竜エグザラプトル
--Transcendosaurus Exaraptor
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--material
aux
.
AddLinkProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsLinkRace
,
RACE_DINOSAUR
),
2
,
99
,
s
.
chk
)
--hand spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetTarget
(
s
.
hsptg
)
e1
:
SetOperation
(
s
.
hspop
)
c
:
RegisterEffect
(
e1
)
--draw
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_BATTLE_DESTROYED
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetCondition
(
s
.
drcon
)
e2
:
SetOperation
(
s
.
regop
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCondition
(
s
.
regcon
)
c
:
RegisterEffect
(
e3
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e4
:
SetCategory
(
CATEGORY_DRAW
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetCode
(
EVENT_CUSTOM
+
id
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCountLimit
(
1
,
id
+
o
)
e4
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e4
:
SetTarget
(
s
.
drtg
)
e4
:
SetOperation
(
s
.
drop
)
c
:
RegisterEffect
(
e4
)
--self spsummon
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e5
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_SPECIAL_SUMMON
)
e5
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e5
:
SetCode
(
EVENT_DESTROYED
)
e5
:
SetCountLimit
(
1
,
id
+
o
*
2
)
e5
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e5
:
SetTarget
(
s
.
ssptg
)
e5
:
SetOperation
(
s
.
sspop
)
c
:
RegisterEffect
(
e5
)
end
function
s
.
chk
(
g
)
return
g
:
IsExists
(
Card
.
IsLevelAbove
,
1
,
nil
,
6
)
end
function
s
.
filter
(
c
,
e
,
tp
)
return
c
:
IsRace
(
RACE_DINOSAUR
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
s
.
hsptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
end
function
s
.
hspop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
function
s
.
cfilter
(
c
,
tp
,
lc
)
local
seq
=
c
:
GetPreviousSequence
()
if
c
:
IsPreviousControler
(
1
-
tp
)
then
seq
=
seq
+
16
end
return
c
:
IsPreviousPosition
(
POS_FACEUP
)
and
c
:
GetPreviousRaceOnField
()
&
RACE_DINOSAUR
>
0
and
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
and
bit
.
extract
(
lc
:
GetLinkedZone
(),
seq
)
>
0
end
function
s
.
drcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
s
.
cfilter
,
1
,
nil
,
tp
,
e
:
GetHandler
())
end
function
s
.
rfilter
(
c
,
tp
,
lc
)
return
not
c
:
IsReason
(
REASON_BATTLE
)
and
s
.
cfilter
(
c
,
tp
,
lc
)
end
function
s
.
regcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
s
.
rfilter
,
1
,
nil
,
tp
,
e
:
GetHandler
())
end
function
s
.
regop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
RaiseSingleEvent
(
e
:
GetHandler
(),
EVENT_CUSTOM
+
id
,
e
,
0
,
tp
,
0
,
0
)
end
function
s
.
drtg
(
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
s
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
function
s
.
sfilter
(
c
)
return
c
:
IsType
(
TYPE_NORMAL
)
and
c
:
IsAbleToDeck
()
end
function
s
.
ssptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
sfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
end
function
s
.
sspop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
sfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
not
(
tc
and
Duel
.
SendtoDeck
(
tc
,
nil
,
SEQ_DECKSHUFFLE
,
REASON_EFFECT
)
>
0
and
tc
:
IsLocation
(
LOCATION_DECK
+
LOCATION_EXTRA
))
then
return
end
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
3
))
then
Duel
.
BreakEffect
()
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
expansions/script/c101202045.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Exceed the Pendulum
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--material
aux
.
AddLinkProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsType
,
TYPE_EFFECT
),
2
,
99
,
s
.
gchk
)
--atk up
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetValue
(
s
.
val
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCondition
(
s
.
thcon
)
e2
:
SetTarget
(
s
.
thtg
)
e2
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e2
)
--spsummon
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
,
id
+
o
)
e3
:
SetCondition
(
s
.
spcon
)
e3
:
SetTarget
(
s
.
sptg
)
e3
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
gchk
(
g
)
return
g
:
IsExists
(
Card
.
IsType
,
1
,
nil
,
TYPE_PENDULUM
)
end
function
s
.
afilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_PENDULUM
)
end
function
s
.
val
(
e
,
c
)
return
Duel
.
GetMatchingGroupCount
(
s
.
afilter
,
c
:
GetControler
(),
LOCATION_ONFIELD
,
0
,
nil
)
*
100
end
function
s
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_LINK
)
end
function
s
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsAbleToHand
()
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
return
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
end
function
s
.
sfilter
(
c
,
e
,
tp
)
local
l
,
r
=
Duel
.
GetFieldCard
(
tp
,
LOCATION_PZONE
,
0
),
Duel
.
GetFieldCard
(
tp
,
LOCATION_PZONE
,
1
)
if
not
(
l
and
r
)
then
return
false
end
local
ls
,
rs
,
lv
=
l
:
GetCurrentScale
(),
r
:
GetCurrentScale
(),
c
:
GetLevel
()
return
c
:
IsType
(
TYPE_PENDULUM
)
and
(
lv
>
ls
and
lv
<
rs
or
lv
>
rs
and
lv
<
ls
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP_DEFENSE
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
sfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_GRAVE
+
LOCATION_HAND
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
sfilter
),
tp
,
LOCATION_GRAVE
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP_DEFENSE
)
end
expansions/script/c101202046.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--S:P Little Night
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--material
aux
.
AddLinkProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsType
,
TYPE_EFFECT
),
2
,
2
)
--banish 1 card
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_REMOVE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e1
:
SetCondition
(
s
.
srmcon
)
e1
:
SetTarget
(
s
.
srmtg
)
e1
:
SetOperation
(
s
.
srmop
)
c
:
RegisterEffect
(
e1
)
--banish 2 cards
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_REMOVE
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCondition
(
s
.
drmcon
)
e2
:
SetTarget
(
s
.
drmtg
)
e2
:
SetOperation
(
s
.
drmop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
srmcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsSummonType
(
SUMMON_TYPE_LINK
)
and
c
:
GetMaterial
():
IsExists
(
Card
.
IsType
,
1
,
nil
,
TYPE_FUSION
+
TYPE_SYNCHRO
+
TYPE_XYZ
+
TYPE_LINK
)
end
function
s
.
srmtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
+
LOCATION_ONFIELD
)
and
chkc
:
IsAbleToRemove
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_GRAVE
+
LOCATION_ONFIELD
,
LOCATION_GRAVE
+
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_GRAVE
+
LOCATION_ONFIELD
,
LOCATION_GRAVE
+
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
g
,
1
,
0
,
0
)
end
function
s
.
srmop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_DIRECT_ATTACK
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
+
EFFECT_FLAG_IGNORE_IMMUNE
)
e1
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
s
.
drmcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
ep
==
1
-
tp
end
function
s
.
cfilter
(
c
,
tp
)
return
c
:
IsAbleToRemove
()
and
Duel
.
IsExistingTarget
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
c
)
end
function
s
.
drmtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
false
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
sg
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
g
)
g
:
Merge
(
sg
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
g
,
2
,
0
,
0
)
end
function
s
.
drmop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetTargetsRelateToChain
()
if
#
g
~=
2
or
Duel
.
Remove
(
g
,
0
,
REASON_EFFECT
+
REASON_TEMPORARY
)
==
0
or
not
g
:
IsExists
(
Card
.
IsLocation
,
1
,
nil
,
LOCATION_REMOVED
)
then
return
end
local
og
=
Duel
.
GetOperatedGroup
():
Filter
(
Card
.
IsLocation
,
nil
,
LOCATION_REMOVED
)
for
tc
in
aux
.
Next
(
og
)
do
tc
:
RegisterFlagEffect
(
id
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
og
:
KeepAlive
()
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetLabelObject
(
og
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCondition
(
s
.
retcon
)
e1
:
SetOperation
(
s
.
retop
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
s
.
retfilter
(
c
)
return
c
:
GetFlagEffect
(
id
)
~=
0
end
function
s
.
retcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetLabelObject
():
IsExists
(
s
.
retfilter
,
1
,
nil
)
then
e
:
GetLabelObject
():
DeleteGroup
()
e
:
Reset
()
return
false
end
return
true
end
function
s
.
retop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
e
:
GetLabelObject
():
Filter
(
s
.
retfilter
,
nil
)
for
tc
in
aux
.
Next
(
g
)
do
Duel
.
ReturnToField
(
tc
)
end
end
expansions/script/c101202047.lua
0 → 100644
View file @
fcf4fbbd
--ペンデュラム・エボリューション
--
--script by Trishula9
function
c101202047
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
13331639
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
101202047
,
0
))
e2
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCountLimit
(
1
,
101202047
)
e2
:
SetTarget
(
c101202047
.
thtg
)
e2
:
SetOperation
(
c101202047
.
thop
)
c
:
RegisterEffect
(
e2
)
--pendulum summon
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
101202047
,
1
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCountLimit
(
1
,
101202047
+
100
)
e3
:
SetCondition
(
c101202047
.
pcon
)
e3
:
SetOperation
(
c101202047
.
pop
)
c
:
RegisterEffect
(
e3
)
--multi attack
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
101202047
,
2
))
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_SZONE
)
e4
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e4
:
SetCountLimit
(
1
,
101202047
+
200
)
e4
:
SetCondition
(
c101202047
.
atkcon
)
e4
:
SetTarget
(
c101202047
.
atktg
)
e4
:
SetOperation
(
c101202047
.
atkop
)
c
:
RegisterEffect
(
e4
)
if
not
c101202047
.
global_check
then
c101202047
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
ge1
:
SetOperation
(
c101202047
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c101202047
.
checkfilter
(
c
)
return
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsPreviousPosition
(
POS_FACEDOWN
)
and
c
:
IsSummonLocation
(
LOCATION_EXTRA
)
end
function
c101202047
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
eg
:
Filter
(
c101202047
.
checkfilter
,
nil
)
local
tc
=
g
:
GetFirst
()
while
tc
do
Duel
.
RegisterFlagEffect
(
tc
:
GetSummonPlayer
(),
101202047
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
tc
=
g
:
GetNext
()
end
end
function
c101202047
.
cfilter
(
c
,
tp
)
return
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsAbleToDeckAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c101202047
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
c
:
GetCode
())
end
function
c101202047
.
thfilter
(
c
,
code
)
return
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
GetAttack
()
==
2500
and
not
c
:
IsCode
(
code
)
and
c
:
IsAbleToHand
()
end
function
c101202047
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
IsCostChecked
()
and
Duel
.
IsExistingMatchingCard
(
c101202047
.
cfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c101202047
.
cfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
tp
)
e
:
SetLabel
(
g
:
GetFirst
():
GetCode
())
Duel
.
SendtoDeck
(
g
,
nil
,
SEQ_DECKSHUFFLE
,
REASON_COST
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c101202047
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c101202047
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
:
GetLabel
())
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
c101202047
.
pcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetFlagEffect
(
tp
,
101202047
)
<=
0
then
return
false
end
local
c
=
e
:
GetHandler
()
local
lpz
=
Duel
.
GetFieldCard
(
tp
,
LOCATION_PZONE
,
0
)
local
rpz
=
Duel
.
GetFieldCard
(
tp
,
LOCATION_PZONE
,
1
)
if
lpz
==
nil
or
rpz
==
nil
then
return
false
end
local
loc
=
0
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
loc
=
loc
+
LOCATION_HAND
end
if
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
nil
,
TYPE_PENDULUM
)
>
0
then
loc
=
loc
+
LOCATION_EXTRA
end
if
loc
==
0
then
return
false
end
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_EXTRA_PENDULUM_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
aux
.
TRUE
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
eset
=
{
e1
}
local
lscale
=
lpz
:
GetLeftScale
()
local
rscale
=
rpz
:
GetRightScale
()
if
lscale
>
rscale
then
lscale
,
rscale
=
rscale
,
lscale
end
local
g
=
Duel
.
GetFieldGroup
(
tp
,
loc
,
0
)
local
res
=
g
:
IsExists
(
aux
.
PConditionFilter
,
1
,
nil
,
e
,
tp
,
lscale
,
rscale
,
eset
)
e1
:
Reset
()
return
res
end
function
c101202047
.
pop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_EXTRA_PENDULUM_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
aux
.
TRUE
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
eset
=
{
e1
}
local
lpz
=
Duel
.
GetFieldCard
(
tp
,
LOCATION_PZONE
,
0
)
local
rpz
=
Duel
.
GetFieldCard
(
tp
,
LOCATION_PZONE
,
1
)
local
lscale
=
lpz
:
GetLeftScale
()
local
rscale
=
rpz
:
GetRightScale
()
if
lscale
>
rscale
then
lscale
,
rscale
=
rscale
,
lscale
end
local
loc
=
0
local
ft1
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
local
ft2
=
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
nil
,
TYPE_PENDULUM
)
local
ft
=
Duel
.
GetUsableMZoneCount
(
tp
)
local
ect
=
c29724053
and
Duel
.
IsPlayerAffectedByEffect
(
tp
,
29724053
)
and
c29724053
[
tp
]
if
ect
and
ect
<
ft2
then
ft2
=
ect
end
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
59822133
)
then
if
ft1
>
0
then
ft1
=
1
end
if
ft2
>
0
then
ft2
=
1
end
ft
=
1
end
if
ft1
>
0
then
loc
=
loc
|
LOCATION_HAND
end
if
ft2
>
0
then
loc
=
loc
|
LOCATION_EXTRA
end
local
tg
=
Duel
.
GetMatchingGroup
(
aux
.
PConditionFilter
,
tp
,
loc
,
0
,
nil
,
e
,
tp
,
lscale
,
rscale
,
eset
)
tg
=
tg
:
Filter
(
aux
.
PConditionExtraFilterSpecific
,
nil
,
e
,
tp
,
lscale
,
rscale
,
e1
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
aux
.
GCheckAdditional
=
aux
.
PendOperationCheck
(
ft1
,
ft2
,
ft
)
local
g
=
tg
:
SelectSubGroup
(
tp
,
aux
.
TRUE
,
true
,
1
,
math.min
(
#
tg
,
ft
))
aux
.
GCheckAdditional
=
nil
if
not
g
then
e1
:
Reset
()
return
end
local
sg
=
Group
.
CreateGroup
()
sg
:
Merge
(
g
)
Duel
.
HintSelection
(
Group
.
FromCards
(
lpz
))
Duel
.
HintSelection
(
Group
.
FromCards
(
rpz
))
Duel
.
SpecialSummon
(
sg
,
SUMMON_TYPE_PENDULUM
,
tp
,
tp
,
true
,
true
,
POS_FACEUP
)
e1
:
Reset
()
end
function
c101202047
.
atkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsAbleToEnterBP
()
end
function
c101202047
.
atkfilter
(
c
)
return
c
:
IsCode
(
13331639
)
and
c
:
IsFaceup
()
end
function
c101202047
.
atktg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
chkc
:
IsCode
(
13331639
)
and
chkc
:
IsFaceup
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c101202047
.
atkfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
c101202047
.
atkfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
end
function
c101202047
.
atkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_ATTACK_ALL
)
e1
:
SetValue
(
aux
.
TRUE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
end
end
expansions/script/c101202048.lua
0 → 100644
View file @
fcf4fbbd
--光翼の竜
--
--Script by Trishula9
function
c101202048
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
13331639
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
101202048
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
c101202048
.
condition
)
e1
:
SetTarget
(
c101202048
.
target
)
e1
:
SetOperation
(
c101202048
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c101202048
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetCurrentPhase
()
==
PHASE_MAIN1
or
Duel
.
GetCurrentPhase
()
==
PHASE_MAIN2
end
function
c101202048
.
cfilter
(
c
)
return
c
:
IsCode
(
13331639
)
and
c
:
IsFaceup
()
end
function
c101202048
.
filter
(
c
,
e
,
tp
,
check
)
return
c
:
IsSetCard
(
0x10f8
,
0x20f8
)
and
c
:
IsType
(
TYPE_PENDULUM
)
and
(
c
:
IsAbleToHand
()
or
check
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
))
end
function
c101202048
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
check
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c101202048
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
return
Duel
.
IsExistingMatchingCard
(
c101202048
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
,
check
)
end
end
function
c101202048
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
check
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c101202048
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_OPERATECARD
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c101202048
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
check
)
if
g
:
GetCount
()
<=
0
then
return
end
local
tc
=
g
:
GetFirst
()
local
b
=
check
and
tc
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
if
tc
:
IsAbleToHand
()
and
(
not
b
or
Duel
.
SelectOption
(
tp
,
1190
,
1152
)
==
0
)
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
else
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
expansions/script/c101202049.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--T.G. - Break Limiter
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCost
(
s
.
cost
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
--return from grave
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
s
.
rttg
)
e2
:
SetOperation
(
s
.
rtop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
)
end
function
s
.
filter
(
c
)
return
c
:
IsSetCard
(
0x27
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetMatchingGroup
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
nil
):
GetClassCount
(
Card
.
GetCode
)
>
1
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
nil
):
SelectSubGroup
(
tp
,
aux
.
dncheck
,
false
,
2
,
2
)
if
g
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
s
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_MACHINE
)
and
c
:
IsSetCard
(
0x27
)
end
function
s
.
rfilter
(
c
,
chk
)
return
c
:
IsSetCard
(
0x27
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
(
c
:
IsAbleToDeck
()
or
chk
and
c
:
IsAbleToHand
())
end
function
s
.
rttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
check
=
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
s
.
rfilter
(
chkc
,
check
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
rfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
check
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
rfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
check
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
g
,
1
,
0
,
0
)
end
function
s
.
rtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
not
tc
:
IsRelateToEffect
(
e
)
then
return
end
local
check
=
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
tc
:
IsAbleToHand
()
if
check
and
Duel
.
SelectEffectYesNo
(
tp
,
tc
,
aux
.
Stringid
(
id
,
2
))
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
else
Duel
.
SendtoDeck
(
tc
,
nil
,
SEQ_DECKSHUFFLE
,
REASON_EFFECT
)
end
end
expansions/script/c101202050.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--T.G. - All Clear
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
--change race
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_CHANGE_RACE
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x27
))
e2
:
SetValue
(
RACE_MACHINE
)
c
:
RegisterEffect
(
e2
)
--extra normal summon
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EFFECT_EXTRA_SUMMON_COUNT
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
LOCATION_HAND
+
LOCATION_MZONE
,
0
)
e3
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x27
))
c
:
RegisterEffect
(
e3
)
--search
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e4
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_SZONE
)
e4
:
SetCountLimit
(
1
,
id
)
e4
:
SetTarget
(
s
.
target
)
e4
:
SetOperation
(
s
.
operation
)
c
:
RegisterEffect
(
e4
)
end
function
s
.
cfilter
(
c
,
tp
)
return
c
:
IsFaceupEx
()
and
c
:
IsSetCard
(
0x27
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
nil
,
c
:
GetCode
())
end
function
s
.
filter
(
c
,
...
)
return
c
:
IsSetCard
(
0x27
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
and
(
#
{
...
}
==
0
or
not
c
:
IsCode
(
...
))
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
cfilter
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
,
0
,
nil
,
tp
)
if
chk
==
0
then
return
#
g
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
)
end
function
s
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cfilter
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
tp
)
if
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
==
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
filter
),
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
g
:
GetFirst
():
GetCode
())
Duel
.
SendtoHand
(
sg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
sg
)
end
expansions/script/c101202051.lua
0 → 100644
View file @
fcf4fbbd
--超量信托
local
s
,
id
,
o
=
GetID
()
function
s
.
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
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
--spsum
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCondition
(
aux
.
exccon
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
s
.
sptg
)
e2
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
filter
(
c
)
return
(
c
:
IsSetCard
(
0x4073
)
or
c
:
IsCode
(
73046708
))
and
c
:
IsAbleToHand
()
end
function
s
.
lvfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
GetLevel
()
>
0
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
NecroValleyFilter
(
s
.
lvfilter
),
tp
,
LOCATION_MZONE
,
0
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SELECT
)
local
lv
=
0
local
sg
=
g
:
Select
(
tp
,
1
,
2
,
nil
)
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
1
))
then
lv
=
5
else
lv
=
3
end
local
tc
=
sg
:
GetFirst
()
while
tc
do
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CHANGE_LEVEL
)
e1
:
SetValue
(
lv
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
tc
=
sg
:
GetNext
()
end
end
end
end
function
s
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_EQUIP
)
and
c
:
GetOriginalType
()
&
TYPE_XYZ
~=
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_SZONE
)
and
chkc
:
IsControler
(
tp
)
and
s
.
spfilter
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
spfilter
,
tp
,
LOCATION_SZONE
,
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
,
s
.
spfilter
,
tp
,
LOCATION_SZONE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
\ No newline at end of file
expansions/script/c101202052.lua
0 → 100644
View file @
fcf4fbbd
--世壊挽歌
--
--Script by Trishula9
function
c101202052
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
56099748
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
101202052
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
c101202052
.
target
)
e1
:
SetOperation
(
c101202052
.
activate
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
101202052
,
1
))
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_DESTROYED
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
101202052
)
e2
:
SetCondition
(
c101202052
.
thcon
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
c101202052
.
thtg
)
e2
:
SetOperation
(
c101202052
.
thop
)
c
:
RegisterEffect
(
e2
)
end
function
c101202052
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x29a
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
c101202052
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c101202052
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c101202052
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c101202052
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
c101202052
.
filter
(
c
)
return
c
:
IsCode
(
56099748
)
and
c
:
IsFaceup
()
end
function
c101202052
.
cfilter
(
c
,
tp
)
return
c
:
IsPreviousPosition
(
POS_FACEUP
)
and
c
:
IsPreviousControler
(
tp
)
and
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
and
bit
.
band
(
c
:
GetPreviousTypeOnField
(),
TYPE_TUNER
)
~=
0
and
not
c
:
IsType
(
TYPE_TOKEN
)
and
c
:
IsReason
(
REASON_BATTLE
+
REASON_EFFECT
)
end
function
c101202052
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
c101202052
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
and
eg
:
IsExists
(
c101202052
.
cfilter
,
1
,
nil
,
tp
)
and
not
eg
:
IsContains
(
e
:
GetHandler
())
end
function
c101202052
.
tgfilter
(
c
,
e
)
return
c
:
IsCanBeEffectTarget
(
e
)
and
c
:
IsAbleToHand
()
end
function
c101202052
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
mg
=
eg
:
Filter
(
c101202052
.
cfilter
,
nil
,
tp
):
Filter
(
c101202052
.
tgfilter
,
nil
,
e
)
if
chkc
then
return
mg
:
IsContains
(
chkc
)
end
if
chk
==
0
then
return
mg
:
GetCount
()
>
0
end
local
g
=
mg
if
mg
:
GetCount
()
>
1
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
g
=
mg
:
Select
(
tp
,
1
,
1
,
nil
)
end
Duel
.
SetTargetCard
(
g
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
0
)
end
function
c101202052
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c101202053.lua
0 → 100644
View file @
fcf4fbbd
--世壊賛歌
--
--Script by Trishula9
function
c101202053
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
56099748
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
101202053
,
0
))
e1
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_DISABLE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCountLimit
(
1
,
101202053
)
e1
:
SetTarget
(
c101202053
.
target
)
e1
:
SetOperation
(
c101202053
.
activate
)
c
:
RegisterEffect
(
e1
)
--destroy
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
101202053
,
1
))
e2
:
SetCategory
(
CATEGORY_DESTROY
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
101202053
+
100
)
e2
:
SetCondition
(
c101202053
.
descon
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
c101202053
.
destg
)
e2
:
SetOperation
(
c101202053
.
desop
)
c
:
RegisterEffect
(
e2
)
end
function
c101202053
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
false
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
aux
.
TRUE
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
Duel
.
IsExistingTarget
(
aux
.
NegateEffectMonsterFilter
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g1
=
Duel
.
SelectTarget
(
tp
,
aux
.
TRUE
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
e
:
SetLabelObject
(
g1
:
GetFirst
())
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DISABLE
)
local
g2
=
Duel
.
SelectTarget
(
tp
,
aux
.
NegateEffectMonsterFilter
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g1
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DISABLE
,
g2
,
1
,
0
,
0
)
end
function
c101202053
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCode
(
56099748
)
end
function
c101202053
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
hc
=
e
:
GetLabelObject
()
local
g
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
)
local
tc
=
g
:
GetFirst
()
if
tc
==
hc
then
tc
=
g
:
GetNext
()
end
if
hc
:
IsRelateToEffect
(
e
)
and
hc
:
IsControler
(
tp
)
and
Duel
.
Destroy
(
hc
,
REASON_EFFECT
)
>
0
and
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
and
tc
:
IsControler
(
1
-
tp
)
and
tc
:
IsCanBeDisabledByEffect
(
e
)
then
Duel
.
NegateRelatedChain
(
tc
,
RESET_TURN_SET
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetValue
(
RESET_TURN_SET
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e2
)
Duel
.
AdjustInstantly
(
c
)
if
Duel
.
IsExistingMatchingCard
(
c101202053
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
101202053
,
2
))
then
Duel
.
BreakEffect
()
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
end
end
function
c101202053
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x29a
)
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
>
0
end
function
c101202053
.
descon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
c101202053
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
function
c101202053
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
aux
.
TRUE
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
end
function
c101202053
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
TRUE
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c101202054.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--"The Tainted Treasure Hunter Fiend"
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
--draw
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_DRAW
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
s
.
drtg
)
e2
:
SetOperation
(
s
.
drop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
filter
(
c
)
return
c
:
IsSetCard
(
0x19b
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
filter
),
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
function
s
.
cfilter
(
c
)
return
c
:
IsFaceupEx
()
and
c
:
IsSetCard
(
0x19a
)
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsAbleToDeck
()
and
not
c
:
IsCode
(
id
)
end
function
s
.
drtg
(
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
s
.
cfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
cfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
)
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
cfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
s
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
SendtoDeck
(
tc
,
nil
,
SEQ_DECKBOTTOM
,
REASON_EFFECT
)
>
0
and
tc
:
IsLocation
(
LOCATION_DECK
)
then
Duel
.
BreakEffect
()
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
expansions/script/c101202055.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Tainted Treasure of Doom - Luciela
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_ATKCHANGE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
s
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsLevelAbove
(
7
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
s
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
s
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
end
function
s
.
dfilter
(
c
)
return
c
:
IsFaceup
()
and
aux
.
nzatk
(
c
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
local
chk
if
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
and
not
tc
:
IsImmuneToEffect
(
e
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e1
:
SetValue
(
s
.
efilter
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_PHASE
+
PHASE_STANDBY
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetLabel
(
Duel
.
GetTurnCount
())
e2
:
SetCondition
(
s
.
tgcon
)
e2
:
SetOperation
(
s
.
tgop
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_STANDBY
,
2
)
tc
:
RegisterEffect
(
e2
)
chk
=
true
end
local
g
=
Duel
.
GetMatchingGroup
(
s
.
dfilter
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
if
#
g
>
0
then
if
chk
then
Duel
.
BreakEffect
()
end
local
dg
=
Group
.
CreateGroup
()
for
sc
in
aux
.
Next
(
g
)
do
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
-
tc
:
GetAttack
())
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
sc
:
RegisterEffect
(
e1
)
if
sc
:
IsAttack
(
0
)
then
dg
:
AddCard
(
sc
)
end
end
if
#
dg
>
0
then
Duel
.
BreakEffect
()
Duel
.
Destroy
(
dg
,
REASON_EFFECT
)
end
end
end
function
s
.
efilter
(
e
,
te
)
return
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
()
~=
e
:
GetHandler
()
end
function
s
.
tgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetTurnCount
()
~=
e
:
GetLabel
()
end
function
s
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
e
:
Reset
()
if
Duel
.
GetTurnCount
()
~=
e
:
GetLabel
()
+
1
then
return
end
Duel
.
Hint
(
HINT_CARD
,
0
,
id
)
Duel
.
SendtoGrave
(
e
:
GetHandler
(),
REASON_EFFECT
)
end
expansions/script/c101202056.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--The Shrine of Serpentine Sight - Snake-Eye
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
--atk up
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e2
:
SetTarget
(
s
.
atktg
)
e2
:
SetValue
(
1100
)
c
:
RegisterEffect
(
e2
)
--spsummon
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e3
:
SetRange
(
LOCATION_FZONE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_CARD_TARGET
)
e3
:
SetCondition
(
s
.
spcon
)
e3
:
SetTarget
(
s
.
sptg
)
e3
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e3
)
local
e4
=
e3
:
Clone
()
e4
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e4
)
end
function
s
.
filter
(
c
,
tp
)
return
c
:
IsSetCard
(
0x19c
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
Duel
.
GetLocationCount
(
c
:
GetOwner
(),
LOCATION_SZONE
,
tp
)
>
0
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
s
.
filter
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
+
LOCATION_HAND
,
0
,
1
,
nil
,
tp
)
if
#
g
==
0
or
not
Duel
.
SelectEffectYesNo
(
tp
,
c
,
aux
.
Stringid
(
id
,
1
))
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
if
Duel
.
MoveToField
(
tc
,
tp
,
tc
:
GetOwner
(),
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_SPELL
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e1
)
end
end
function
s
.
atktg
(
e
,
c
)
return
c
:
IsLevel
(
1
)
and
c
:
IsAttribute
(
ATTRIBUTE_FIRE
)
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
Card
.
IsSummonPlayer
,
1
,
nil
,
1
-
tp
)
end
function
s
.
sfilter
(
c
,
e
,
tp
)
return
c
:
GetOriginalType
()
&
TYPE_MONSTER
>
0
and
c
:
GetType
()
&
TYPE_CONTINUOUS
+
TYPE_SPELL
==
TYPE_CONTINUOUS
+
TYPE_SPELL
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsOnField
()
and
s
.
sfilter
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingTarget
(
s
.
sfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
sfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
expansions/script/c101202057.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--The Original Tainted Treasure - Snake-Eye
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCost
(
s
.
cost
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
+
CATEGORY_TODECK
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
s
.
thtg
)
e2
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
cfilter
(
c
,
e
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsAbleToGraveAsCost
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
end
function
s
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
c
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
c
,
e
,
tp
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
end
function
s
.
filter
(
c
,
e
,
tp
)
return
c
:
IsLevel
(
1
)
and
c
:
IsAttribute
(
ATTRIBUTE_FIRE
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
)
end
function
s
.
activate
(
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
,
s
.
filter
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
function
s
.
rfilter
(
c
)
return
c
:
IsSetCard
(
0x19c
,
0x19b
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToDeck
()
end
function
s
.
sfilter
(
c
)
return
c
:
IsLevel
(
1
)
and
c
:
IsAttribute
(
ATTRIBUTE_FIRE
)
and
c
:
IsAbleToHand
()
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
s
.
rfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
rfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
s
.
sfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
rfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
g
,
1
,
0
,
0
)
end
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
sfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
not
(
tc
and
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
>
0
and
tc
:
IsLocation
(
LOCATION_HAND
))
then
return
end
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
local
rc
=
Duel
.
GetFirstTarget
()
if
rc
:
IsRelateToEffect
(
e
)
then
Duel
.
BreakEffect
()
Duel
.
SendtoDeck
(
rc
,
nil
,
SEQ_DECKBOTTOM
,
REASON_EFFECT
)
end
end
expansions/script/c101202058.lua
0 → 100644
View file @
fcf4fbbd
--王の棺
--Script by Ruby
function
c101202058
.
initial_effect
(
c
)
--Activate
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e0
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e0
)
--indes
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetValue
(
c101202058
.
efilter
)
e1
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e1
:
SetTarget
(
c101202058
.
intg
)
c
:
RegisterEffect
(
e1
)
--Activate
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_TOGRAVE
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCountLimit
(
4
,
101202058
)
e2
:
SetCost
(
c101202058
.
cost
)
e2
:
SetTarget
(
c101202058
.
target
)
e2
:
SetOperation
(
c101202058
.
activate
)
c
:
RegisterEffect
(
e2
)
--destroy
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
101202058
,
1
))
e3
:
SetCategory
(
CATEGORY_TOGRAVE
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetCode
(
EVENT_BATTLE_START
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetCondition
(
c101202058
.
descon
)
e3
:
SetTarget
(
c101202058
.
destg
)
e3
:
SetOperation
(
c101202058
.
desop
)
c
:
RegisterEffect
(
e3
)
end
function
c101202058
.
intg
(
e
,
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x29c
)
end
function
c101202058
.
efilter
(
e
,
re
,
rp
,
c
)
if
not
re
:
IsHasProperty
(
EFFECT_FLAG_CARD_TARGET
)
then
return
true
end
local
g
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
)
return
not
g
or
not
g
:
IsContains
(
c
)
end
function
c101202058
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToGraveAsCost
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsAbleToGraveAsCost
,
1
,
1
,
REASON_COST
)
end
function
c101202058
.
filter
(
c
)
return
c
:
IsSetCard
(
0x29c
)
and
c
:
IsAbleToGrave
()
end
function
c101202058
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c101202058
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c101202058
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c101202058
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
end
function
c101202058
.
descon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ac
=
Duel
.
GetBattleMonster
(
tp
)
if
not
(
ac
and
ac
:
IsFaceup
()
and
ac
:
IsSetCard
(
0x29c
))
then
return
false
end
local
bc
=
ac
:
GetBattleTarget
()
e
:
SetLabelObject
(
bc
)
return
bc
and
bc
:
IsControler
(
1
-
tp
)
and
bc
:
IsRelateToBattle
()
end
function
c101202058
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
bc
=
e
:
GetLabelObject
()
if
chk
==
0
then
return
bc
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
bc
,
1
,
0
,
0
)
end
function
c101202058
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
bc
=
e
:
GetLabelObject
()
if
bc
and
bc
:
IsControler
(
1
-
tp
)
and
bc
:
IsRelateToBattle
()
then
Duel
.
SendtoGrave
(
bc
,
REASON_EFFECT
)
end
end
expansions/script/c101202059.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Fire Recovery
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_HANDES
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
--draw
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_DRAW
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
s
.
drtg
)
e2
:
SetOperation
(
s
.
drop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
filter
(
c
,
e
,
tp
)
return
c
:
IsAttribute
(
ATTRIBUTE_FIRE
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
s
.
filter
(
chkc
,
e
,
tp
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
if
Duel
.
DiscardHand
(
tp
,
Card
.
IsAbleToGrave
,
1
,
1
,
REASON_EFFECT
)
<
1
then
return
end
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
s
.
cfilter
(
c
)
return
c
:
IsFaceupEx
()
and
c
:
IsAttribute
(
ATTRIBUTE_FIRE
)
and
c
:
IsAbleToDeck
()
end
function
s
.
drtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
false
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
cfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
3
,
nil
)
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
cfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
3
,
3
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
g
,
3
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
s
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetTargetsRelateToChain
()
if
Duel
.
SendtoDeck
(
g
,
nil
,
SEQ_DECKSHUFFLE
,
REASON_EFFECT
)
<
1
or
not
g
:
IsExists
(
Card
.
IsLocation
,
1
,
nil
,
LOCATION_DECK
+
LOCATION_EXTRA
)
then
return
end
if
g
:
IsExists
(
Card
.
IsLocation
,
1
,
nil
,
LOCATION_DECK
)
then
Duel
.
ShuffleDeck
(
tp
)
end
Duel
.
BreakEffect
()
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
expansions/script/c101202060.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Synchro Rumble
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
63436931
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
--destroy replace
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EFFECT_DESTROY_REPLACE
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetTarget
(
s
.
reptg
)
e2
:
SetOperation
(
s
.
repop
)
e2
:
SetValue
(
aux
.
TargetBoolFunction
(
s
.
cfilter
,
e2
))
c
:
RegisterEffect
(
e2
)
end
function
s
.
filter
(
c
,
e
,
tp
)
return
c
:
IsType
(
TYPE_TUNER
)
or
(
c
:
IsLevel
(
7
,
8
)
and
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsType
(
TYPE_SYNCHRO
))
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP_DEFENSE
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
s
.
filter
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP_DEFENSE
)
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
+
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
s
.
limit
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
s
.
limit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
and
not
c
:
IsType
(
TYPE_SYNCHRO
)
end
function
s
.
cfilter
(
c
,
e
)
local
tp
=
e
:
GetHandlerPlayer
()
return
c
:
IsFaceup
()
and
(
c
:
IsCode
(
63436931
)
or
c
:
IsLevel
(
7
,
8
)
and
c
:
IsRace
(
RACE_DRAGON
)
and
c
:
IsType
(
TYPE_SYNCHRO
))
and
c
:
IsLocation
(
LOCATION_MZONE
)
and
c
:
IsControler
(
tp
)
and
c
:
IsReason
(
REASON_BATTLE
+
REASON_EFFECT
)
and
not
c
:
IsReason
(
REASON_REPLACE
)
end
function
s
.
reptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToRemove
()
and
eg
:
IsExists
(
s
.
cfilter
,
1
,
nil
,
e
)
end
return
Duel
.
SelectEffectYesNo
(
tp
,
c
,
96
)
end
function
s
.
repop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Remove
(
e
:
GetHandler
(),
POS_FACEUP
,
REASON_EFFECT
)
end
expansions/script/c101202061.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--The Himorogi where Stars Align
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
--ritual summon
local
t
=
{
aux
.
FilterBoolFunction
(
Card
.
IsAttribute
,
ATTRIBUTE_WIND
),
Card
.
GetOriginalLevel
,
"Greater"
,
LOCATION_DECK
,
nil
,
s
.
mfilter
}
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetTarget
(
aux
.
RitualUltimateTarget
(
table.unpack
(
t
)))
e2
:
SetOperation
(
aux
.
RitualUltimateOperation
(
table.unpack
(
t
)))
c
:
RegisterEffect
(
e2
)
--retrieve/sset, on bounce
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetCode
(
EVENT_TO_HAND
)
e3
:
SetRange
(
LOCATION_FZONE
)
e3
:
SetCountLimit
(
2
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetCondition
(
s
.
condition
)
e3
:
SetTarget
(
s
.
target
)
c
:
RegisterEffect
(
e3
)
end
s
.
has_text_type
=
TYPE_SPIRIT
function
s
.
mfilter
(
c
,
tp
)
return
(
c
:
IsType
(
TYPE_SPIRIT
)
or
c
:
IsCode
(
25415053
))
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
s
.
cfilter
(
c
,
tp
)
return
c
:
IsPreviousPosition
(
POS_FACEUP
)
and
c
:
IsAttribute
(
ATTRIBUTE_WIND
)
and
c
:
IsPreviousControler
(
tp
)
and
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
and
c
:
IsControler
(
tp
)
end
function
s
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
s
.
cfilter
,
1
,
nil
,
tp
)
end
function
s
.
filter
(
c
)
return
c
:
IsFaceupEx
()
and
(
c
:
IsType
(
TYPE_SPIRIT
)
or
c
:
GetType
()
&
0x82
==
0x82
)
and
c
:
IsAbleToHand
()
end
function
s
.
sfilter
(
c
)
return
c
:
IsCode
(
20417688
)
and
c
:
IsSSetable
()
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
b1
=
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
)
local
b2
=
Duel
.
IsExistingMatchingCard
(
s
.
sfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
if
chk
==
0
then
return
b1
or
b2
end
local
op
=
aux
.
SelectFromOptions
(
tp
,{
b1
,
1190
},{
b2
,
1159
})
if
op
==
1
then
e
:
SetCategory
(
CATEGORY_TOHAND
)
e
:
SetOperation
(
s
.
retrieve
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
)
else
e
:
SetCategory
(
0
)
e
:
SetOperation
(
s
.
ssettrap
)
end
end
function
s
.
retrieve
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
filter
),
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
function
s
.
ssettrap
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
sfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
tc
then
Duel
.
SSet
(
tp
,
tc
)
end
end
expansions/script/c101202062.lua
0 → 100644
View file @
fcf4fbbd
--エレキングダム
--Wattkingdom
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e0
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e0
)
--activate limit
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
0
,
1
)
e1
:
SetValue
(
s
.
actlim
)
c
:
RegisterEffect
(
e1
)
--spsummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetTarget
(
s
.
target
)
e2
:
SetOperation
(
s
.
operation
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
lfilter
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0xe
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
and
c
:
IsControler
(
tp
)
end
function
s
.
actlim
(
e
,
re
,
tp
)
if
not
re
:
IsActivated
()
or
re
:
GetCode
()
~=
EVENT_SUMMON_SUCCESS
and
re
:
GetCode
()
~=
EVENT_SPSUMMON_SUCCESS
then
return
end
local
rc
=
re
:
GetHandler
()
local
rg
=
rc
:
GetColumnGroup
()
local
p
=
e
:
GetHandlerPlayer
()
return
rc
:
IsControler
(
1
-
p
)
and
rg
:
IsContains
(
e
:
GetHandler
())
or
rg
:
IsExists
(
s
.
lfilter
,
1
,
nil
,
p
)
end
function
s
.
cfilter
(
c
,
e
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0xe
)
and
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
,
c
:
GetCode
())
end
function
s
.
filter
(
c
,
e
,
tp
,
...
)
return
c
:
IsSetCard
(
0xe
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
not
c
:
IsCode
(
...
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
chkc
:
IsFaceup
()
and
chkc
:
IsSetCard
(
0xe
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingTarget
(
s
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
s
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
s
.
splim
(
e
,
c
)
return
c
:
GetRace
()
~=
RACE_THUNDER
end
function
s
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
s
.
splim
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
not
tc
:
IsRelateToEffect
(
e
)
or
tc
:
IsFacedown
()
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
tc
:
GetCode
()):
GetFirst
()
if
sc
and
Duel
.
SpecialSummon
(
sc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
>
0
and
aux
.
nzatk
(
sc
)
then
local
lp
=
Duel
.
GetLP
(
tp
)
Duel
.
SetLP
(
tp
,
lp
-
sc
:
GetAttack
())
end
end
expansions/script/c101202063.lua
0 → 100644
View file @
fcf4fbbd
--黎溟界闢
--Ogdoadic Dawn of Creation
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--token
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCost
(
s
.
cost
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
--to deck
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_TOGRAVE
+
CATEGORY_DECKDES
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
s
.
tdtg
)
e2
:
SetOperation
(
s
.
tdop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
cfilter
(
c
,
tp
)
return
c
:
IsRace
(
RACE_REPTILE
)
and
c
:
IsLevelAbove
(
2
)
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
s
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckReleaseGroup
(
tp
,
s
.
cfilter
,
1
,
nil
,
tp
)
end
local
tc
=
Duel
.
SelectReleaseGroup
(
tp
,
s
.
cfilter
,
1
,
1
,
nil
,
tp
):
GetFirst
()
e
:
SetLabel
(
tc
:
GetLevel
()
//
2
)
Duel
.
Release
(
tc
,
REASON_COST
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
IsCostChecked
()
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
id
+
o
,
0x161
,
TYPES_TOKEN_MONSTER
,
0
,
0
,
2
,
RACE_REPTILE
,
ATTRIBUTE_DARK
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ct
=
math.min
(
e
:
GetLabel
(),
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
))
if
ct
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
id
+
o
,
0x161
,
TYPES_TOKEN_MONSTER
,
0
,
0
,
2
,
RACE_REPTILE
,
ATTRIBUTE_DARK
)
then
return
end
repeat
local
tk
=
Duel
.
CreateToken
(
tp
,
id
+
o
)
Duel
.
SpecialSummonStep
(
tk
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
ct
=
ct
-
1
until
ct
<=
0
or
Duel
.
IsPlayerAffectedByEffect
(
tp
,
59822133
)
or
not
Duel
.
SelectYesNo
(
tp
,
210
)
Duel
.
SpecialSummonComplete
()
end
function
s
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_REPTILE
)
and
c
:
IsAbleToDeck
()
end
function
s
.
tdtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_REMOVED
)
and
chkc
:
IsControler
(
tp
)
and
s
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
filter
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
g
,
1
,
0
,
0
)
end
function
s
.
gfilter
(
c
)
return
c
:
IsRace
(
RACE_REPTILE
)
and
c
:
IsAbleToGrave
()
end
function
s
.
tdop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
not
(
tc
and
tc
:
IsRelateToEffect
(
e
))
or
Duel
.
SendtoDeck
(
tc
,
nil
,
SEQ_DECKSHUFFLE
,
REASON_EFFECT
)
==
0
or
not
tc
:
IsLocation
(
LOCATION_DECK
+
LOCATION_EXTRA
)
then
return
end
Duel
.
ShuffleDeck
(
tp
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
gfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
2
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
BreakEffect
()
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
expansions/script/c101202064.lua
0 → 100644
View file @
fcf4fbbd
--Concours de Cuisine~菓冷なる料理対決~
--Concours de Cuisine (Confectionery Contest)
--coded by Lyris & Mercury233
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
--atk up
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_ATKCHANGE
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
s
.
atktg
)
e2
:
SetOperation
(
s
.
atkop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
filter
(
c
)
return
c
:
IsSetCard
(
0x196
,
0x29d
)
and
c
:
IsType
(
TYPE_PENDULUM
)
end
function
s
.
sfilter1
(
c
,
e
,
tp
,
g
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
(
not
c
:
IsLocation
(
LOCATION_EXTRA
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
or
c
:
IsLocation
(
LOCATION_EXTRA
)
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
nil
,
c
)
>
0
)
and
g
:
IsExists
(
s
.
sfilter2
,
1
,
c
,
e
,
tp
,
c
)
end
function
s
.
sfilter2
(
c
,
e
,
tp
,
oc
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
,
1
-
tp
)
and
(
not
c
:
IsLocation
(
LOCATION_EXTRA
)
and
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
,
tp
)
>
0
or
c
:
IsLocation
(
LOCATION_EXTRA
)
and
Duel
.
GetLocationCountFromEx
(
1
-
tp
,
tp
,
nil
,
c
)
>
0
)
and
aux
.
gfcheck
(
Group
.
FromCards
(
c
,
oc
),
Card
.
IsSetCard
,
0x196
,
0x29d
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
filter
,
tp
,
LOCATION_DECK
+
LOCATION_EXTRA
+
LOCATION_HAND
,
0
,
1
,
nil
)
if
chk
==
0
then
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
59822133
)
and
g
:
IsExists
(
s
.
sfilter1
,
1
,
nil
,
e
,
tp
,
g
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
2
,
PLAYER_ALL
,
LOCATION_DECK
+
LOCATION_EXTRA
+
LOCATION_HAND
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
filter
,
tp
,
LOCATION_DECK
+
LOCATION_EXTRA
+
LOCATION_HAND
,
0
,
1
,
nil
)
if
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
59822133
)
and
g
:
IsExists
(
s
.
sfilter1
,
1
,
nil
,
e
,
tp
,
g
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
id
,
2
))
local
sc
=
g
:
FilterSelect
(
tp
,
s
.
sfilter1
,
1
,
1
,
nil
,
e
,
tp
,
g
):
GetFirst
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
id
,
3
))
local
oc
=
g
:
FilterSelect
(
tp
,
s
.
sfilter2
,
1
,
1
,
sc
,
e
,
tp
,
sc
):
GetFirst
()
Duel
.
SpecialSummonStep
(
sc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummonStep
(
oc
,
0
,
tp
,
1
-
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummonComplete
()
end
local
c
=
e
:
GetHandler
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_BE_FUSION_MATERIAL
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
+
EFFECT_FLAG_IGNORE_IMMUNE
)
e1
:
SetTargetRange
(
0xff
,
0xff
)
e1
:
SetTarget
(
aux
.
TargetBoolFunction
(
aux
.
NOT
(
Card
.
IsSetCard
),
0x196
,
0x29d
))
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetValue
(
s
.
lim
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_CANNOT_BE_SYNCHRO_MATERIAL
)
Duel
.
RegisterEffect
(
e2
,
tp
)
local
e3
=
e1
:
Clone
()
e3
:
SetCode
(
EFFECT_CANNOT_BE_XYZ_MATERIAL
)
Duel
.
RegisterEffect
(
e3
,
tp
)
local
e4
=
e1
:
Clone
()
e4
:
SetCode
(
EFFECT_CANNOT_BE_LINK_MATERIAL
)
Duel
.
RegisterEffect
(
e4
,
tp
)
end
function
s
.
lim
(
e
,
c
)
if
not
c
then
return
false
end
return
c
:
IsControler
(
e
:
GetHandlerPlayer
())
end
function
s
.
atktg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsFaceup
()
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsSetCard
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
,
0x197
)
and
Duel
.
IsExistingTarget
(
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
end
function
s
.
atkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
ct
=
Duel
.
GetMatchingGroupCount
(
Card
.
IsSetCard
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
nil
,
0x197
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetValue
(
ct
*
200
)
tc
:
RegisterEffect
(
e1
)
end
end
expansions/script/c101202065.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Angel Ring
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetValue
(
s
.
eqlimit
)
c
:
RegisterEffect
(
e2
)
--highlander clause
c
:
SetUniqueOnField
(
1
,
0
,
id
)
--disable
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_CHAIN_SOLVING
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetCondition
(
s
.
discon
)
e3
:
SetOperation
(
s
.
disop
)
c
:
RegisterEffect
(
e3
)
--recover, destroy & prevent target
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e4
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_DESTROY
)
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_SZONE
)
e4
:
SetCountLimit
(
1
)
e4
:
SetTarget
(
s
.
rdptg
)
e4
:
SetOperation
(
s
.
rdpop
)
c
:
RegisterEffect
(
e4
)
end
function
s
.
filter
(
c
)
return
c
:
GetEquipCount
()
>
0
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
s
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
s
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
c
:
IsRelateToEffect
(
e
)
and
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
Duel
.
Equip
(
tp
,
c
,
tc
)
end
end
function
s
.
eqlimit
(
e
,
c
)
return
c
:
IsControler
(
e
:
GetHandlerPlayer
())
and
#
(
c
:
GetEquipGroup
()
-
e
:
GetHandler
())
>
0
end
function
s
.
discon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
==
1
-
tp
and
re
:
IsActiveType
(
TYPE_SPELL
)
end
function
s
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_CARD
,
0
,
id
)
Duel
.
NegateEffect
(
ev
,
true
)
end
function
s
.
rdptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_RECOVER
,
nil
,
0
,
tp
,
500
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
s
.
rdpop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
c
:
GetEquipTarget
()
if
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
>
0
then
Duel
.
BreakEffect
()
if
Duel
.
Destroy
(
c
,
REASON_EFFECT
)
<=
0
then
return
end
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_BE_EFFECT_TARGET
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
+
EFFECT_FLAG_IGNORE_IMMUNE
)
e1
:
SetOwnerPlayer
(
tp
)
e1
:
SetValue
(
s
.
tgval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
,
true
)
end
end
function
s
.
tgval
(
e
,
re
,
rp
)
return
rp
==
1
-
e
:
GetOwnerPlayer
()
end
expansions/script/c101202066.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Card Scanner
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetTarget
(
s
.
thtg
)
e2
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e2
)
--to deck
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetCategory
(
CATEGORY_TODECK
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetCode
(
EVENT_DESTROYED
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetCondition
(
s
.
tdcon
)
e3
:
SetTarget
(
s
.
tdtg
)
e3
:
SetOperation
(
s
.
tdop
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToHand
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToHand
,
tp
,
0
,
LOCATION_DECK
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CARDTYPE
)
Duel
.
SetTargetParam
(
Duel
.
AnnounceType
(
tp
))
end
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
==
0
or
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_DECK
)
==
0
then
return
end
local
sc
=
Duel
.
GetFieldCard
(
tp
,
LOCATION_DECK
,
0
)
local
oc
=
Duel
.
GetFieldCard
(
1
-
tp
,
LOCATION_DECK
,
0
)
Duel
.
ConfirmCards
(
1
-
tp
,
sc
)
Duel
.
ConfirmCards
(
tp
,
oc
)
local
op
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PARAM
)
if
sc
:
IsType
(
1
<<
op
)
then
Duel
.
SendtoHand
(
sc
,
nil
,
REASON_EFFECT
)
else
Duel
.
MoveSequence
(
sc
,
SEQ_DECKTOP
)
end
if
oc
:
IsType
(
1
<<
op
)
then
Duel
.
SendtoHand
(
oc
,
nil
,
REASON_EFFECT
)
else
Duel
.
MoveSequence
(
oc
,
SEQ_DECKTOP
)
end
end
function
s
.
tdcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsPreviousPosition
(
POS_FACEUP
)
and
c
:
IsPreviousControler
(
tp
)
and
c
:
IsPreviousLocation
(
LOCATION_SZONE
)
and
rp
==
1
-
tp
and
c
:
IsReason
(
REASON_EFFECT
)
end
function
s
.
tdtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_HAND
)
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
nil
,
1
,
1
-
tp
,
LOCATION_HAND
)
end
function
s
.
tdop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_HAND
):
Select
(
1
-
tp
,
1
,
1
,
nil
)
Duel
.
SendtoDeck
(
g
,
nil
,
SEQ_DECKBOTTOM
,
REASON_RULE
)
end
expansions/script/c101202067.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Lament of the Immortal Bushi
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
--change race
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_CHANGE_RACE
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetTargetRange
(
LOCATION_GRAVE
,
0
)
e2
:
SetValue
(
RACE_WARRIOR
)
c
:
RegisterEffect
(
e2
)
--destroy
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e3
:
SetCategory
(
CATEGORY_DESTROY
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetTarget
(
s
.
target
)
e3
:
SetOperation
(
s
.
operation
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_MZONE
,
0
)
if
chk
==
0
then
return
#
g
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
#
g
,
0
,
0
)
end
function
s
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_MZONE
,
0
)
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
expansions/script/c101202068.lua
0 → 100644
View file @
fcf4fbbd
--覇王龍の奇跡
--
--Script by Trishula9 & mercury233
function
c101202068
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
13331639
)
--select effect
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
101202068
,
0
))
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e1
:
SetCondition
(
c101202068
.
condition
)
e1
:
SetTarget
(
c101202068
.
target
)
c
:
RegisterEffect
(
e1
)
end
function
c101202068
.
cfilter
(
c
)
return
c
:
IsCode
(
13331639
)
and
c
:
IsFaceup
()
end
function
c101202068
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
c101202068
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
function
c101202068
.
desfilter
(
c
)
return
c
:
IsCode
(
13331639
)
and
c
:
IsFaceup
()
end
function
c101202068
.
spfilter
(
c
,
e
,
tp
)
return
((
c
:
IsSetCard
(
0x99
)
and
c
:
IsType
(
TYPE_PENDULUM
))
or
(
c
:
IsCode
(
13331639
)
and
c
:
IsAttribute
(
ATTRIBUTE_LIGHT
)))
and
((
c
:
IsLocation
(
LOCATION_DECK
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
)
or
(
c
:
IsLocation
(
LOCATION_EXTRA
)
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
nil
,
c
)
>
0
))
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
function
c101202068
.
psfilter
(
c
)
return
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsFaceup
()
and
not
c
:
IsForbidden
()
end
function
c101202068
.
ssfilter
(
c
)
return
c
:
IsType
(
TYPE_QUICKPLAY
)
and
c
:
IsSSetable
()
end
function
c101202068
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g1
=
Duel
.
GetMatchingGroup
(
c101202068
.
desfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
nil
)
local
g2
=
Duel
.
GetMatchingGroup
(
c101202068
.
spfilter
,
tp
,
LOCATION_DECK
+
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
)
local
b1
=
Duel
.
GetFlagEffect
(
tp
,
101202068
+
1
)
==
0
and
g1
:
GetCount
()
>
0
and
g2
:
GetCount
()
>
0
local
b2
=
Duel
.
GetFlagEffect
(
tp
,
101202068
+
2
)
==
0
and
(
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
or
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
))
and
Duel
.
IsExistingMatchingCard
(
c101202068
.
psfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
)
local
b3
=
Duel
.
GetFlagEffect
(
tp
,
101202068
+
3
)
==
0
and
Duel
.
IsExistingMatchingCard
(
c101202068
.
ssfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
if
chk
==
0
then
return
b1
or
b2
or
b3
end
local
op
=
aux
.
SelectFromOptions
(
tp
,
{
b1
,
aux
.
Stringid
(
101202068
,
1
)},
{
b2
,
aux
.
Stringid
(
101202068
,
2
)},
{
b3
,
aux
.
Stringid
(
101202068
,
3
)})
Duel
.
RegisterFlagEffect
(
tp
,
101202068
+
op
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
if
op
==
1
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g1
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
+
LOCATION_EXTRA
)
e
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_SPECIAL_SUMMON
)
e
:
SetOperation
(
c101202068
.
spop
)
elseif
op
==
2
then
e
:
SetCategory
(
0
)
e
:
SetOperation
(
c101202068
.
psop
)
else
e
:
SetCategory
(
0
)
e
:
SetOperation
(
c101202068
.
ssop
)
end
end
function
c101202068
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c101202068
.
desfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
local
g2
=
Duel
.
GetMatchingGroup
(
c101202068
.
spfilter
,
tp
,
LOCATION_DECK
+
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
)
if
Duel
.
Destroy
(
g1
,
REASON_EFFECT
)
>
0
and
g2
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sc
=
g2
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SpecialSummon
(
sc
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
end
end
function
c101202068
.
psop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
and
not
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c101202068
.
psfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
)
local
tc
=
g
:
GetFirst
()
if
not
tc
then
return
end
if
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
false
)
then
tc
:
SetStatus
(
STATUS_EFFECT_ENABLED
,
true
)
end
end
function
c101202068
.
ssop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c101202068
.
ssfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SSet
(
tp
,
g
:
GetFirst
())
end
end
expansions/script/c101202069.lua
0 → 100644
View file @
fcf4fbbd
--覇王天龍の魂
--
--Script by Trishula9
function
c101202069
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
13331639
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_FUSION_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
)
e1
:
SetCountLimit
(
1
,
101202069
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCost
(
c101202069
.
cost
)
e1
:
SetTarget
(
c101202069
.
target
)
e1
:
SetOperation
(
c101202069
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c101202069
.
rfilter
(
c
,
tp
)
return
c
:
GetBaseAttack
()
==
2500
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsFaceup
()
end
function
c101202069
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckReleaseGroup
(
tp
,
c101202069
.
rfilter
,
1
,
nil
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
local
g
=
Duel
.
SelectReleaseGroup
(
tp
,
c101202069
.
rfilter
,
1
,
1
,
nil
,
tp
)
Duel
.
Release
(
g
,
REASON_COST
)
end
function
c101202069
.
filter0
(
c
)
return
c
:
IsAbleToRemove
()
end
function
c101202069
.
filter1
(
c
,
e
)
return
c
:
IsAbleToRemove
()
and
not
c
:
IsImmuneToEffect
(
e
)
end
function
c101202069
.
filter2
(
c
,
e
,
tp
,
m
,
f
,
chkf
)
return
c
:
IsType
(
TYPE_FUSION
)
and
c
:
IsCode
(
13331639
)
and
(
not
f
or
f
(
c
))
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_FUSION
,
tp
,
false
,
false
)
and
c
:
CheckFusionMaterial
(
m
,
nil
,
chkf
)
end
function
c101202069
.
filter3
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeFusionMaterial
()
and
c
:
IsAbleToRemove
()
end
function
c101202069
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
chkf
=
tp
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
):
Filter
(
c101202069
.
filter0
,
nil
)
local
mg2
=
Duel
.
GetMatchingGroup
(
c101202069
.
filter3
,
tp
,
LOCATION_DECK
+
LOCATION_EXTRA
+
LOCATION_GRAVE
,
0
,
nil
)
mg1
:
Merge
(
mg2
)
local
res
=
Duel
.
IsExistingMatchingCard
(
c101202069
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg1
,
nil
,
chkf
)
if
not
res
then
local
ce
=
Duel
.
GetChainMaterial
(
tp
)
if
ce
~=
nil
then
local
fgroup
=
ce
:
GetTarget
()
local
mg3
=
fgroup
(
ce
,
e
,
tp
)
local
mf
=
ce
:
GetValue
()
res
=
Duel
.
IsExistingMatchingCard
(
c101202069
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg3
,
mf
,
chkf
)
end
end
return
res
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
+
LOCATION_EXTRA
+
LOCATION_ONFIELD
+
LOCATION_GRAVE
)
end
function
c101202069
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
chkf
=
tp
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
):
Filter
(
c101202069
.
filter1
,
nil
,
e
)
local
mg2
=
Duel
.
GetMatchingGroup
(
c101202069
.
filter3
,
tp
,
LOCATION_DECK
+
LOCATION_EXTRA
+
LOCATION_GRAVE
,
0
,
nil
)
mg1
:
Merge
(
mg2
)
local
sg1
=
Duel
.
GetMatchingGroup
(
c101202069
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
,
mg1
,
nil
,
chkf
)
local
mg3
=
nil
local
sg2
=
nil
local
ce
=
Duel
.
GetChainMaterial
(
tp
)
if
ce
~=
nil
then
local
fgroup
=
ce
:
GetTarget
()
mg3
=
fgroup
(
ce
,
e
,
tp
)
local
mf
=
ce
:
GetValue
()
sg2
=
Duel
.
GetMatchingGroup
(
c101202069
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
,
mg3
,
mf
,
chkf
)
end
if
sg1
:
GetCount
()
>
0
or
(
sg2
~=
nil
and
sg2
:
GetCount
()
>
0
)
then
local
sg
=
sg1
:
Clone
()
if
sg2
then
sg
:
Merge
(
sg2
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
tg
=
sg
:
Select
(
tp
,
1
,
1
,
nil
)
local
tc
=
tg
:
GetFirst
()
if
sg1
:
IsContains
(
tc
)
and
(
sg2
==
nil
or
not
sg2
:
IsContains
(
tc
)
or
not
Duel
.
SelectYesNo
(
tp
,
ce
:
GetDescription
()))
then
local
mat1
=
Duel
.
SelectFusionMaterial
(
tp
,
tc
,
mg1
,
nil
,
chkf
)
tc
:
SetMaterial
(
mat1
)
Duel
.
Remove
(
mat1
,
POS_FACEUP
,
REASON_EFFECT
+
REASON_MATERIAL
+
REASON_FUSION
)
Duel
.
BreakEffect
()
Duel
.
SpecialSummon
(
tc
,
SUMMON_TYPE_FUSION
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
else
local
mat2
=
Duel
.
SelectFusionMaterial
(
tp
,
tc
,
mg3
,
nil
,
chkf
)
local
fop
=
ce
:
GetOperation
()
fop
(
ce
,
e
,
tp
,
tc
,
mat2
)
end
local
b1
=
Duel
.
IsExistingMatchingCard
(
c101202069
.
efilter1
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
nil
)
local
b2
=
Duel
.
IsExistingMatchingCard
(
c101202069
.
efilter2
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
nil
)
local
b3
=
Duel
.
IsExistingMatchingCard
(
c101202069
.
efilter3
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
nil
)
local
b4
=
Duel
.
IsExistingMatchingCard
(
c101202069
.
efilter4
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
nil
)
if
not
b1
or
not
b2
or
not
b3
or
not
b4
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
,
true
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetValue
(
RESET_TURN_SET
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e2
,
true
)
end
tc
:
CompleteProcedure
()
end
end
function
c101202069
.
efilter1
(
c
)
return
c
:
IsSetCard
(
0x10f2
)
and
c
:
IsFaceup
()
end
function
c101202069
.
efilter2
(
c
)
return
c
:
IsSetCard
(
0x2073
)
and
c
:
IsFaceup
()
end
function
c101202069
.
efilter3
(
c
)
return
c
:
IsSetCard
(
0x2017
)
and
c
:
IsFaceup
()
end
function
c101202069
.
efilter4
(
c
)
return
c
:
IsSetCard
(
0x1046
)
and
c
:
IsFaceup
()
end
\ No newline at end of file
expansions/script/c101202070.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--T.G. - Close
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_NEGATE
+
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCondition
(
s
.
condition
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
--set
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCondition
(
s
.
setcon
)
e2
:
SetTarget
(
s
.
settg
)
e2
:
SetOperation
(
s
.
setop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_MACHINE
)
and
c
:
IsSetCard
(
0x27
)
end
function
s
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
(
re
:
IsActiveType
(
TYPE_MONSTER
)
or
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
))
and
Duel
.
IsChainNegatable
(
ev
)
end
function
s
.
target
(
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
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
eg
,
1
,
0
,
0
)
end
end
function
s
.
activate
(
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
s
.
cfilter
(
c
)
if
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
and
c
:
GetPreviousTypeOnField
()
&
TYPE_SYNCHRO
==
0
then
return
false
end
return
c
:
IsFaceup
()
and
c
:
IsPreviousPosition
(
POS_FACEUP
)
and
c
:
IsType
(
TYPE_SYNCHRO
)
end
function
s
.
setcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
s
.
cfilter
,
1
,
nil
)
end
function
s
.
settg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsSSetable
()
end
end
function
s
.
setop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
SSet
(
tp
,
c
)
>
0
then
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
+
RESETS_REDIRECT
)
e1
:
SetValue
(
LOCATION_REMOVED
)
c
:
RegisterEffect
(
e1
,
true
)
end
end
expansions/script/c101202071.lua
0 → 100644
View file @
fcf4fbbd
--重铠装超量
local
s
,
id
,
o
=
GetID
()
function
s
.
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
,
TIMINGS_CHECK_MONSTER
)
e1
:
SetCondition
(
s
.
xyzcond
)
e1
:
SetTarget
(
s
.
xyztg
)
e1
:
SetOperation
(
s
.
xyzop
)
c
:
RegisterEffect
(
e1
)
--equip
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_EQUIP
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
s
.
eqtg
)
e2
:
SetOperation
(
s
.
eqop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
xyzfilter
(
c
)
return
c
:
IsXyzSummonable
(
nil
)
end
function
s
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_XYZ
)
end
function
s
.
xyzcond
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
function
s
.
xyztg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
xyzfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
s
.
xyzop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
xyzfilter
,
tp
,
LOCATION_EXTRA
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
tg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
XyzSummon
(
tp
,
tg
:
GetFirst
(),
nil
)
end
end
function
s
.
tgfilter
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_XYZ
)
and
Duel
.
IsExistingMatchingCard
(
s
.
eqfilter
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
0
,
1
,
c
)
end
function
s
.
eqfilter
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_XYZ
)
and
c
:
CheckUniqueOnField
(
tp
)
and
not
c
:
IsForbidden
()
end
function
s
.
eqtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
s
.
tgfilter
(
chkc
,
tp
)
end
if
chk
==
0
then
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
return
ft
>
0
and
Duel
.
IsExistingTarget
(
s
.
tgfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
Duel
.
SelectTarget
(
tp
,
s
.
tgfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
g
,
1
,
0
,
0
)
end
function
s
.
eqop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
end
local
c
=
e
:
GetHandler
()
local
tg
=
Duel
.
GetTargetsRelateToChain
()
local
tc
=
tg
:
Filter
(
Card
.
IsLocation
,
nil
,
LOCATION_MZONE
):
GetFirst
()
local
ec
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
eqfilter
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
0
,
1
,
1
,
tc
,
tp
):
GetFirst
()
if
tc
and
ec
and
ec
:
CheckUniqueOnField
(
tp
)
and
not
ec
:
IsForbidden
()
then
if
not
Duel
.
Equip
(
tp
,
ec
,
tc
)
then
return
end
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetLabelObject
(
tc
)
e1
:
SetValue
(
s
.
eqlimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
ec
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_EQUIP
)
e2
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e2
:
SetValue
(
ec
:
GetAttack
())
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
ec
:
RegisterEffect
(
e2
)
--substitute
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_EQUIP
)
e3
:
SetCode
(
EFFECT_DESTROY_SUBSTITUTE
)
e3
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e3
:
SetValue
(
s
.
desrepval
)
ec
:
RegisterEffect
(
e3
,
true
)
end
end
function
s
.
eqlimit
(
e
,
c
)
return
c
==
e
:
GetLabelObject
()
end
function
s
.
desrepval
(
e
,
re
,
r
,
rp
)
return
r
&
(
REASON_BATTLE
|
REASON_EFFECT
)
~=
0
end
expansions/script/c101202072.lua
0 → 100644
View file @
fcf4fbbd
--新世廻
--
--Script by Trishula9
function
c101202072
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
56099748
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
101202072
,
0
))
e1
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCountLimit
(
1
,
101202072
)
e1
:
SetCondition
(
c101202072
.
condition
)
e1
:
SetTarget
(
c101202072
.
target
)
e1
:
SetOperation
(
c101202072
.
activate
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
101202072
,
1
))
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
101202072
+
100
)
e2
:
SetCondition
(
c101202072
.
thcon
)
e2
:
SetTarget
(
c101202072
.
thtg
)
e2
:
SetOperation
(
c101202072
.
thop
)
c
:
RegisterEffect
(
e2
)
end
function
c101202072
.
cfilter
(
c
)
return
c
:
IsCode
(
56099748
)
and
c
:
IsFaceup
()
end
function
c101202072
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
c101202072
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
function
c101202072
.
filter
(
c
)
return
c
:
IsType
(
TYPE_EFFECT
)
and
c
:
IsFaceup
()
and
c
:
IsAbleToDeck
()
end
function
c101202072
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
c101202072
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c101202072
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c101202072
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
g
,
1
,
0
,
0
)
end
function
c101202072
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
SendtoDeck
(
tc
,
nil
,
SEQ_DECKSHUFFLE
,
REASON_EFFECT
)
>
0
and
tc
:
IsLocation
(
LOCATION_DECK
+
LOCATION_EXTRA
)
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCondition
(
c101202072
.
srcon
)
e1
:
SetOperation
(
c101202072
.
srop
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetLabelObject
(
tc
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
function
c101202072
.
srfilter
(
c
,
race
,
lv
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsRace
(
race
)
and
c
:
IsLevelBelow
(
lv
)
and
c
:
IsAbleToHand
()
end
function
c101202072
.
srcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
if
not
tc
then
return
false
end
local
op
=
tc
:
GetOwner
()
local
race
=
tc
:
GetRace
()
local
lv
=
tc
:
GetLevel
()
|
tc
:
GetRank
()
|
tc
:
GetLink
()
return
Duel
.
IsExistingMatchingCard
(
c101202072
.
srfilter
,
op
,
LOCATION_DECK
,
0
,
1
,
nil
,
race
,
lv
)
end
function
c101202072
.
srop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
if
not
tc
then
return
end
Duel
.
Hint
(
HINT_CARD
,
0
,
101202072
)
local
op
=
tc
:
GetOwner
()
local
race
=
tc
:
GetRace
()
local
lv
=
tc
:
GetLevel
()
|
tc
:
GetRank
()
|
tc
:
GetLink
()
if
Duel
.
SelectYesNo
(
op
,
aux
.
Stringid
(
101202072
,
2
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
op
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
op
,
c101202072
.
srfilter
,
op
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
race
,
lv
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
op
,
g
)
end
end
end
function
c101202072
.
thfilter
(
c
,
tp
)
return
c
:
IsSetCard
(
0x29a
)
and
c
:
IsFaceup
()
end
function
c101202072
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c101202072
.
thfilter
,
1
,
nil
,
tp
)
end
function
c101202072
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToHand
()
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c101202072
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoHand
(
c
,
nil
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c101202073.lua
0 → 100644
View file @
fcf4fbbd
--世壊輪廻
--
--Script by Trishula9
function
c101202073
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
56099748
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
101202073
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
101202073
)
e1
:
SetCost
(
c101202073
.
cost
)
e1
:
SetTarget
(
c101202073
.
target
)
e1
:
SetOperation
(
c101202073
.
activate
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
101202073
,
1
))
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
101202073
+
100
)
e2
:
SetCondition
(
c101202073
.
thcon
)
e2
:
SetTarget
(
c101202073
.
thtg
)
e2
:
SetOperation
(
c101202073
.
thop
)
c
:
RegisterEffect
(
e2
)
end
function
c101202073
.
costfilter
(
c
,
e
,
tp
)
return
c
:
IsCode
(
56099748
)
and
c
:
IsFaceup
()
and
c
:
IsAbleToRemoveAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c101202073
.
spfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
c
)
end
function
c101202073
.
spfilter
(
c
,
e
,
tp
,
sc
)
return
c
:
IsSetCard
(
0x29b
)
and
c
:
IsAttack
(
3000
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
sc
,
c
)
>
0
end
function
c101202073
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c101202073
.
costfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c101202073
.
costfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
Duel
.
Remove
(
g
,
0
,
REASON_COST
+
REASON_TEMPORARY
)
~=
0
then
local
rc
=
g
:
GetFirst
()
if
rc
:
IsType
(
TYPE_TOKEN
)
then
return
end
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
(
rc
)
e1
:
SetCountLimit
(
1
)
e1
:
SetOperation
(
c101202073
.
retop
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
function
c101202073
.
retop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
ReturnToField
(
e
:
GetLabelObject
())
end
function
c101202073
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
IsCostChecked
()
or
Duel
.
IsExistingMatchingCard
(
c101202073
.
spfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
c101202073
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
c101202073
.
spfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
,
e
,
tp
,
nil
):
GetFirst
()
if
tc
and
Duel
.
SpecialSummonStep
(
tc
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
then
tc
:
RegisterFlagEffect
(
101202073
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
,
0
,
1
,
fid
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetLabel
(
fid
)
e1
:
SetLabelObject
(
tc
)
e1
:
SetCondition
(
c101202073
.
rmcon
)
e1
:
SetOperation
(
c101202073
.
rmop
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetOperation
(
c101202073
.
aclimit
)
tc
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e3
:
SetCondition
(
c101202073
.
econ
)
e3
:
SetValue
(
c101202073
.
elimit
)
tc
:
RegisterEffect
(
e3
)
end
Duel
.
SpecialSummonComplete
()
end
function
c101202073
.
rmcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
return
tc
:
GetFlagEffectLabel
(
101202073
)
==
e
:
GetLabel
()
end
function
c101202073
.
rmop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
Duel
.
Remove
(
tc
,
POS_FACEDOWN
,
REASON_EFFECT
)
end
function
c101202073
.
aclimit
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
re
:
GetHandler
()
~=
e
:
GetHandler
()
then
return
end
e
:
GetHandler
():
RegisterFlagEffect
(
101202073
+
100
,
RESET_EVENT
+
RESETS_STANDARD
,
0
,
1
)
end
function
c101202073
.
econ
(
e
)
return
e
:
GetHandler
():
GetFlagEffect
(
101202073
+
100
)
~=
0
end
function
c101202073
.
elimit
(
e
,
te
,
tp
)
return
te
:
GetHandler
()
==
e
:
GetHandler
()
end
function
c101202073
.
cfilter
(
c
,
tp
)
return
c
:
IsSummonLocation
(
LOCATION_EXTRA
)
and
c
:
IsSummonPlayer
(
1
-
tp
)
end
function
c101202073
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c101202073
.
cfilter
,
1
,
nil
,
tp
)
end
function
c101202073
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToHand
()
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c101202073
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoHand
(
c
,
nil
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c101202074.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Tainted Treasure of Betrayal - Silvia
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_DISABLE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCost
(
s
.
cost
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
--disable
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_DISABLE
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetCondition
(
s
.
discon
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
s
.
distg
)
e2
:
SetOperation
(
s
.
disop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
filter
(
c
,
tp
)
return
c
:
IsFaceupEx
()
and
c
:
IsSetCard
(
0x19b
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToGraveAsCost
()
and
Duel
.
IsExistingTarget
(
aux
.
NegateAnyFilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
c
)
end
function
s
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsOnField
()
and
aux
.
NegateAnyFilter
(
chkc
)
end
if
chk
==
0
then
return
e
:
IsCostChecked
()
or
Duel
.
IsExistingTarget
(
aux
.
NegateAnyFilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
aux
.
NegateAnyFilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
and
tc
:
IsCanBeDisabledByEffect
(
e
)
then
local
c
=
e
:
GetHandler
()
Duel
.
NegateRelatedChain
(
tc
,
RESET_TURN_SET
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetValue
(
RESET_TURN_SET
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e2
)
end
end
function
s
.
discon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
Duel
.
IsChainDisablable
(
ev
)
or
rp
~=
1
-
tp
then
return
false
end
local
te
,
p
=
Duel
.
GetChainInfo
(
ev
-
1
,
CHAININFO_TRIGGERING_EFFECT
,
CHAININFO_TRIGGERING_PLAYER
)
if
not
te
or
p
~=
tp
then
return
false
end
local
tc
=
te
:
GetHandler
()
return
tc
:
IsSetCard
(
0x29f
)
and
te
:
IsActiveType
(
TYPE_MONSTER
)
or
tc
:
IsSetCard
(
0x29e
)
and
te
:
IsActiveType
(
TYPE_SPELL
+
TYPE_TRAP
)
end
function
s
.
distg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DISABLE
,
eg
,
1
,
0
,
0
)
end
function
s
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
NegateEffect
(
ev
)
end
expansions/script/c101202075.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--The Glaring Ruler Snake-Eyes
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCondition
(
s
.
condition
)
e1
:
SetTarget
(
s
.
target
)
c
:
RegisterEffect
(
e1
)
end
function
s
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x19c
)
and
c
:
IsLevelAbove
(
1
)
end
function
s
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetMatchingGroup
(
s
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
):
GetSum
(
Card
.
GetLevel
)
>
1
end
function
s
.
mfilter
(
c
,
tp
,
ft
)
local
r
=
LOCATION_REASON_TOFIELD
if
not
c
:
IsControler
(
c
:
GetOwner
())
then
r
=
LOCATION_REASON_CONTROL
end
return
Duel
.
GetLocationCount
(
c
:
GetOwner
(),
LOCATION_SZONE
,
tp
,
r
)
>
0
end
function
s
.
sfilter
(
c
,
e
,
tp
)
return
c
:
GetOriginalType
()
&
TYPE_MONSTER
>
0
and
c
:
GetType
()
&
TYPE_CONTINUOUS
+
TYPE_SPELL
==
TYPE_CONTINUOUS
+
TYPE_SPELL
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
if
e
:
GetLabel
()
==
1
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
+
LOCATION_MZONE
)
and
chkc
:
IsControler
(
1
-
tp
)
and
s
.
mfilter
(
chkc
,
tp
,
0
)
else
return
chkc
:
IsOnField
()
and
s
.
sfilter
(
chkc
,
e
,
tp
)
end
end
local
ft
=
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
and
e
:
GetHandler
():
IsLocation
(
LOCATION_HAND
)
and
1
or
0
local
b1
=
Duel
.
IsExistingTarget
(
s
.
mfilter
,
tp
,
0
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
1
,
nil
,
tp
,
ft
)
local
b2
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
sfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
,
e
,
tp
)
if
chk
==
0
then
return
b1
or
b2
end
local
op
=
aux
.
SelectFromOptions
(
tp
,{
b1
,
aux
.
Stringid
(
id
,
1
)},{
b2
,
aux
.
Stringid
(
id
,
2
)})
e
:
SetLabel
(
op
)
if
op
==
1
then
e
:
SetCategory
(
0
)
e
:
SetOperation
(
s
.
mvop
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
Duel
.
SelectTarget
(
tp
,
s
.
mfilter
,
tp
,
0
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
1
,
1
,
nil
,
tp
,
ft
)
else
e
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e
:
SetOperation
(
s
.
spop
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
sfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
end
function
s
.
mvop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
not
tc
:
IsImmuneToEffect
(
e
)
and
Duel
.
MoveToField
(
tc
,
tp
,
tc
:
GetOwner
(),
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_SPELL
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e1
)
end
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
expansions/script/c101202076.lua
0 → 100644
View file @
fcf4fbbd
--カノプスの守護者
--Script by Ruby
function
c101202076
.
initial_effect
(
c
)
--Activate
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e0
:
SetCode
(
EVENT_FREE_CHAIN
)
e0
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
c
:
RegisterEffect
(
e0
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
101202076
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCountLimit
(
1
,
EFFECT_COUNT_CODE_CHAIN
)
e1
:
SetCondition
(
c101202076
.
con
)
e1
:
SetTarget
(
c101202076
.
tg
)
e1
:
SetOperation
(
c101202076
.
op
)
c
:
RegisterEffect
(
e1
)
--set
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
101202076
,
1
))
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_TO_GRAVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
101202076
)
e2
:
SetCondition
(
c101202076
.
stcon
)
e2
:
SetTarget
(
c101202076
.
sttg
)
e2
:
SetOperation
(
c101202076
.
stop
)
c
:
RegisterEffect
(
e2
)
end
function
c101202076
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
==
1
-
tp
end
function
c101202076
.
filter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x29c
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
end
function
c101202076
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c101202076
.
filter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
)
end
function
c101202076
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<
1
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
c101202076
.
filter
),
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
#
g
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
e
:
SetLabel
(
g
:
GetFirst
():
GetOriginalCode
())
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c101202076
.
splimit
)
e1
:
SetLabel
(
e
:
GetLabel
())
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
c101202076
.
splimit
(
e
,
c
,
sump
,
sumtype
,
sumpos
,
targetp
,
se
)
return
e
:
GetHandler
()
==
se
:
GetHandler
()
and
c
:
IsCode
(
e
:
GetLabel
())
end
function
c101202076
.
stcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsPreviousLocation
(
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
function
c101202076
.
sttg
(
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
c101202076
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
SSet
(
tp
,
c
)
~=
0
then
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
+
RESETS_REDIRECT
)
e1
:
SetValue
(
LOCATION_REMOVED
)
c
:
RegisterEffect
(
e1
)
end
end
expansions/script/c101202077.lua
0 → 100644
View file @
fcf4fbbd
--Nemleria Repette
--scripted by Raye
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
--search
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetCondition
(
s
.
effcon
)
e2
:
SetCost
(
s
.
effcost
)
e2
:
SetTarget
(
s
.
thtg
)
e2
:
SetOperation
(
s
.
thop
)
e2
:
SetLabel
(
1
)
c
:
RegisterEffect
(
e2
)
--change damage
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCountLimit
(
1
,
id
)
e3
:
SetCost
(
s
.
effcost
)
e3
:
SetOperation
(
s
.
changeop
)
e3
:
SetLabel
(
2
)
c
:
RegisterEffect
(
e3
)
--to grave
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e4
:
SetCategory
(
CATEGORY_TOGRAVE
)
e4
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e4
:
SetCode
(
EVENT_FREE_CHAIN
)
e4
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e4
:
SetRange
(
LOCATION_SZONE
)
e4
:
SetCountLimit
(
1
,
id
)
e4
:
SetCost
(
s
.
effcost
)
e4
:
SetTarget
(
s
.
tgtg
)
e4
:
SetOperation
(
s
.
tgop
)
e4
:
SetLabel
(
3
)
c
:
RegisterEffect
(
e4
)
end
function
s
.
cfilter
(
c
)
return
c
:
IsSetCard
(
0x191
)
end
function
s
.
effcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
e
:
GetHandler
())
end
function
s
.
rmfilter
(
c
)
return
c
:
IsAbleToRemoveAsCost
()
and
not
c
:
IsCode
(
70155677
)
end
function
s
.
effcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
ct
=
e
:
GetLabel
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
rmfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
rmfilter
,
tp
,
LOCATION_EXTRA
,
0
,
ct
,
ct
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEDOWN
,
REASON_COST
)
end
function
s
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x191
)
and
c
:
IsAbleToHand
()
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
thfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
end
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
thfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
#
g
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
s
.
changeop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
--half damage
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CHANGE_DAMAGE
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
s
.
damval
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
s
.
damval
(
e
,
re
,
val
,
r
,
rp
,
rc
)
return
math.floor
(
val
/
2
)
end
function
s
.
tgfilter
(
c
)
return
c
:
IsRace
(
RACE_BEAST
)
and
c
:
IsLevel
(
10
)
and
c
:
IsAbleToGrave
()
end
function
s
.
tgtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
tgfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
aux
.
NegateEffectMonsterFilter
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
end
function
s
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
res
=
nil
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
tgfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
res
=
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
local
dg
=
Duel
.
GetMatchingGroup
(
aux
.
NegateEffectMonsterFilter
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
if
#
dg
>
0
and
res
~=
0
then
local
dc
=
dg
:
GetFirst
()
while
dc
do
Duel
.
NegateRelatedChain
(
dc
,
RESET_TURN_SET
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
dc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetValue
(
RESET_TURN_SET
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
dc
:
RegisterEffect
(
e2
)
dc
=
dg
:
GetNext
()
end
end
end
expansions/script/c101202078.lua
0 → 100644
View file @
fcf4fbbd
--VS 裏螺旋流雪風
--Vanquish Soul Snow Devil
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_DAMAGE
+
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCost
(
s
.
cost
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
s
.
cfilter
(
c
)
return
c
:
IsAttribute
(
ATTRIBUTE_DARK
+
ATTRIBUTE_EARTH
+
ATTRIBUTE_FIRE
)
and
not
c
:
IsPublic
()
end
function
s
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
cfilter
,
tp
,
LOCATION_HAND
,
0
,
nil
)
if
chk
==
0
then
return
#
g
>
0
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CONFIRM
)
local
sg
=
g
:
SelectSubGroup
(
tp
,
aux
.
dabcheck
,
false
,
1
,
3
)
Duel
.
ConfirmCards
(
1
-
tp
,
sg
)
Duel
.
RaiseEvent
(
sg
,
EVENT_CUSTOM
+
101202018
,
e
,
REASON_COST
,
tp
,
tp
,
0
)
Duel
.
ShuffleHand
(
tp
)
e
:
SetLabel
(
#
sg
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
IsCostChecked
()
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DAMAGE
,
nil
,
0
,
1
-
tp
,
400
)
end
function
s
.
sfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x195
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ct
=
e
:
GetLabel
()
if
ct
>
0
and
Duel
.
Damage
(
1
-
tp
,
400
,
REASON_EFFECT
)
>
0
and
Duel
.
GetLP
(
1
-
tp
)
>
0
then
local
g
=
Duel
.
GetMatchingGroup
(
s
.
sfilter
,
tp
,
LOCATION_HAND
,
0
,
nil
,
e
,
tp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
1
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
BreakEffect
()
Duel
.
SpecialSummon
(
sg
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
if
ct
>
1
then
Duel
.
BreakEffect
()
if
Duel
.
Damage
(
1
-
tp
,
600
,
REASON_EFFECT
)
>
0
and
Duel
.
GetLP
(
1
-
tp
)
>
0
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e1
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e1
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x195
))
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetValue
(
1
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
if
ct
>
2
then
Duel
.
BreakEffect
()
if
Duel
.
Damage
(
1
-
tp
,
800
,
REASON_EFFECT
)
>
0
and
Duel
.
GetLP
(
1
-
tp
)
>
0
then
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
)
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
2
))
then
Duel
.
BreakEffect
()
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
end
end
end
expansions/script/c101202079.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Seishou Ruten
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_TOEXTRA
+
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_GRAVE_SPSUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
s
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_FUSION
+
TYPE_SYNCHRO
+
TYPE_XYZ
+
TYPE_LINK
)
and
c
:
IsAbleToExtra
()
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
s
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOEXTRA
,
g
,
1
,
0
,
0
)
end
function
s
.
sfilter
(
c
,
e
,
tp
,
f
)
return
f
(
c
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
not
(
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
SendtoDeck
(
tc
,
nil
,
SEQ_DECKTOP
,
REASON_EFFECT
)
>
0
and
tc
:
IsLocation
(
LOCATION_EXTRA
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
)
then
return
end
local
f
=
aux
.
FALSE
local
typ
=
tc
:
GetType
()
&
TYPE_FUSION
+
TYPE_SYNCHRO
+
TYPE_XYZ
+
TYPE_LINK
if
typ
==
TYPE_FUSION
then
f
=
aux
.
FilterEqualFunction
(
Card
.
GetAttribute
,
tc
:
GetAttribute
())
elseif
typ
==
TYPE_SYNCHRO
then
f
=
aux
.
FilterBoolFunction
(
Card
.
IsLevelBelow
,
tc
:
GetLevel
())
elseif
typ
==
TYPE_XYZ
then
f
=
aux
.
FilterBoolFunction
(
Card
.
IsLevel
,
tc
:
GetRank
())
elseif
typ
==
TYPE_LINK
then
f
=
aux
.
FilterEqualFunction
(
Card
.
GetRace
,
tc
:
GetRace
())
end
local
g
=
Duel
.
GetMatchingGroup
(
s
.
sfilter
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
nil
,
e
,
tp
,
f
)
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
1
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
BreakEffect
()
Duel
.
SpecialSummon
(
sg
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
expansions/script/c101202080.lua
0 → 100644
View file @
fcf4fbbd
--coded by Lyris
--Escapegoat
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
--token
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCondition
(
s
.
tkcon
)
e2
:
SetCost
(
s
.
tkcost
)
e2
:
SetTarget
(
s
.
tktg
)
e2
:
SetOperation
(
s
.
tkop
)
c
:
RegisterEffect
(
e2
)
--destroy replace
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EFFECT_DESTROY_REPLACE
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTarget
(
s
.
reptg
)
e3
:
SetOperation
(
s
.
repop
)
e3
:
SetValue
(
aux
.
TargetBoolFunction
(
s
.
filter
,
e3
))
c
:
RegisterEffect
(
e3
)
end
function
s
.
tfilter
(
c
,
tp
)
return
not
c
:
IsType
(
TYPE_TOKEN
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
and
c
:
IsControler
(
tp
)
end
function
s
.
tkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
re
:
IsHasProperty
(
EFFECT_FLAG_CARD_TARGET
)
then
return
false
end
local
g
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TARGET_CARDS
)
return
g
and
g
:
IsExists
(
s
.
tfilter
,
1
,
nil
,
tp
)
end
function
s
.
cfilter
(
c
)
return
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
s
.
tkcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckReleaseGroup
(
tp
,
s
.
cfilter
,
1
,
nil
)
end
local
g
=
Duel
.
SelectReleaseGroup
(
tp
,
s
.
cfilter
,
1
,
1
,
nil
)
Duel
.
Release
(
g
,
REASON_COST
)
end
function
s
.
tktg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
IsCostChecked
()
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
id
+
o
,
0
,
TYPES_TOKEN_MONSTER
,
0
,
0
,
1
,
RACE_BEAST
,
ATTRIBUTE_EARTH
,
POS_FACEUP_DEFENSE
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
end
function
s
.
tkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
id
+
o
,
0
,
TYPES_TOKEN_MONSTER
,
0
,
0
,
1
,
RACE_BEAST
,
ATTRIBUTE_EARTH
,
POS_FACEUP_DEFENSE
)
then
return
end
local
tk
=
Duel
.
CreateToken
(
tp
,
id
+
o
)
Duel
.
SpecialSummon
(
tk
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP_DEFENSE
)
end
function
s
.
filter
(
c
,
e
)
local
tp
=
e
:
GetHandlerPlayer
()
return
not
c
:
IsType
(
TYPE_TOKEN
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
and
c
:
IsReason
(
REASON_BATTLE
+
REASON_EFFECT
)
and
not
c
:
IsReason
(
REASON_REPLACE
)
end
function
s
.
rfilter
(
c
,
e
)
return
c
:
IsType
(
TYPE_TOKEN
)
and
c
:
IsDestructable
(
e
)
and
not
c
:
IsStatus
(
STATUS_DESTROY_CONFIRMED
)
end
function
s
.
reptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
eg
:
IsExists
(
s
.
filter
,
1
,
nil
,
e
)
and
Duel
.
IsExistingMatchingCard
(
s
.
rfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
,
e
)
end
if
Duel
.
SelectEffectYesNo
(
tp
,
c
,
96
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESREPLACE
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
rfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
,
e
):
GetFirst
()
e
:
SetLabelObject
(
tc
)
tc
:
SetStatus
(
STATUS_DESTROY_CONFIRMED
,
true
)
return
true
else
return
false
end
end
function
s
.
repop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
tc
:
SetStatus
(
STATUS_DESTROY_CONFIRMED
,
false
)
Duel
.
Destroy
(
tc
,
REASON_EFFECT
+
REASON_REPLACE
)
end
expansions/script/c121999031.lua
0 → 100644
View file @
fcf4fbbd
--天使の聲
local
s
,
id
=
GetID
()
function
s
.
initial_effect
(
c
)
--Pendulum procedure
aux
.
EnablePendulumAttribute
(
c
)
--Can place Resonance Counters on it
c
:
EnableCounterPermit
(
0x69
,
LOCATION_PZONE
)
--Place 1 Resonance Counter on this card each time you gain LP
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_RECOVER
)
e1
:
SetRange
(
LOCATION_PZONE
)
e1
:
SetCondition
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
ep
==
tp
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsRace
,
tp
,
LOCATION_PZONE
,
0
,
1
,
e
:
GetHandler
(),
RACE_FIEND
)
end
)
e1
:
SetOperation
(
s
.
ctop
)
c
:
RegisterEffect
(
e1
)
--Link Summon 1 "Valmonica" monster
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_ATTACK_ANNOUNCE
)
e2
:
SetRange
(
LOCATION_PZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCondition
(
function
(
e
,
tp
)
return
Duel
.
GetAttacker
():
IsControler
(
1
-
tp
)
end
)
e2
:
SetTarget
(
s
.
linksptg
)
e2
:
SetOperation
(
s
.
linkspop
)
c
:
RegisterEffect
(
e2
)
--Place both this card and 1 "Demone Valmonica" from your Deck in your Pendulum Zone
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_HAND
)
e3
:
SetCountLimit
(
1
,
121999031
)
e3
:
SetCost
(
s
.
pzcost
)
e3
:
SetTarget
(
s
.
pztg
)
e3
:
SetOperation
(
s
.
pzop
)
c
:
RegisterEffect
(
e3
)
--Apply the LP gain effect of 1 "Valmonica" Normal Spell/Trap
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCountLimit
(
1
,
121900031
)
e4
:
SetCondition
(
function
(
e
)
return
e
:
GetHandler
():
GetFlagEffect
(
id
)
>
0
end
)
e4
:
SetCost
(
s
.
cpcost
)
e4
:
SetTarget
(
s
.
cptg
)
e4
:
SetOperation
(
s
.
cpop
)
c
:
RegisterEffect
(
e4
)
-- Register flag on summon
if
not
c121999031
.
global_check
then
c121999031
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
ge1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
ge1
:
SetLabel
(
id
)
ge1
:
SetOperation
(
aux
.
sumreg
)
Duel
.
RegisterEffect
(
ge1
,
0
)
local
ge2
=
ge1
:
Clone
()
ge2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
Duel
.
RegisterEffect
(
ge2
,
0
)
end
end
function
s
.
ctop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
s
.
addcounter
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
function
s
.
addcounter
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
c
:
AddCounter
(
0x69
,
1
)
Duel
.
RaiseEvent
(
c
,
EVENT_CUSTOM
+
121999035
,
e
,
0
,
tp
,
tp
,
1
)
end
function
s
.
linkfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
c
:
IsSpecialSummonable
(
SUMMON_TYPE_LINK
)
end
function
s
.
linksptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
linkfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
s
.
linkspop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
linkfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
sc
then
Duel
.
LinkSummon
(
tp
,
sc
,
nil
)
end
end
function
s
.
pzcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
c
)
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
|
REASON_DISCARD
,
c
)
end
function
s
.
pzfilter
(
c
)
return
c
:
IsCode
(
121999032
)
and
not
c
:
IsForbidden
()
end
function
s
.
pztg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
and
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
)
and
Duel
.
IsExistingMatchingCard
(
s
.
pzfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
end
function
s
.
pzop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
(
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
and
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
)
and
c
:
IsRelateToEffect
(
e
))
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
pzfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
not
tc
then
return
end
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
end
function
s
.
cpcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
e
:
SetLabel
(
1
)
return
true
end
function
s
.
cpfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
(
c
:
GetType
()
==
TYPE_TRAP
or
c
:
GetType
()
==
TYPE_SPELL
)
and
c
:
IsAbleToRemoveAsCost
()
and
c
:
CheckActivateEffect
(
false
,
true
,
false
)
end
function
s
.
cptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
e
:
GetLabel
()
==
0
then
return
false
end
e
:
SetLabel
(
0
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_COST
)
e
:
SetLabelObject
(
tc
)
end
function
s
.
cpop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
if
not
tc
then
return
end
local
eff
=
tc
:
GetActivateEffect
()
local
op
=
eff
:
GetOperation
()
--Additional parameter checked in the script of "Valmonica" Normal Spells/Traps to correctly apply the LP gain effect
if
op
then
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
0
)
end
end
\ No newline at end of file
expansions/script/c121999032.lua
0 → 100644
View file @
fcf4fbbd
--悪魔の聲
local
s
,
id
=
GetID
()
function
s
.
initial_effect
(
c
)
--Pendulum procedure
aux
.
EnablePendulumAttribute
(
c
)
--Can place Resonance Counters on it
c
:
EnableCounterPermit
(
0x69
,
LOCATION_PZONE
)
--Place 1 Resonance Counter on this card each time you take effect damage
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_DAMAGE
)
e1
:
SetRange
(
LOCATION_PZONE
)
e1
:
SetCondition
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
ep
==
tp
and
r
&
REASON_EFFECT
>
0
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsRace
,
tp
,
LOCATION_PZONE
,
0
,
1
,
e
:
GetHandler
(),
RACE_FAIRY
)
end
)
e1
:
SetOperation
(
s
.
ctop
)
c
:
RegisterEffect
(
e1
)
--Opponent's monsters lose 100 ATK for each Resonance Counter on your field
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e2
:
SetRange
(
LOCATION_PZONE
)
e2
:
SetTargetRange
(
0
,
LOCATION_MZONE
)
e2
:
SetValue
(
function
(
e
)
return
Duel
.
GetCounter
(
e
:
GetHandlerPlayer
(),
LOCATION_ONFIELD
,
0
,
0x69
)
*-
100
end
)
c
:
RegisterEffect
(
e2
)
--Place both this card and 1 "Angelo Valmonica" from your Deck in your Pendulum Zone
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_HAND
)
e3
:
SetCountLimit
(
1
,
121999032
)
e3
:
SetCost
(
s
.
pzcost
)
e3
:
SetTarget
(
s
.
pztg
)
e3
:
SetOperation
(
s
.
pzop
)
c
:
RegisterEffect
(
e3
)
--Apply the damage-inflicting effect of 1 "Valmonica" Normal Spell/Trap
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCountLimit
(
1
,
121900032
)
e4
:
SetCondition
(
function
(
e
)
return
e
:
GetHandler
():
GetFlagEffect
(
id
)
>
0
end
)
e4
:
SetCost
(
s
.
cpcost
)
e4
:
SetTarget
(
s
.
cptg
)
e4
:
SetOperation
(
s
.
cpop
)
c
:
RegisterEffect
(
e4
)
-- Register flag on summon
if
not
c121999032
.
global_check
then
c121999032
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
ge1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
ge1
:
SetLabel
(
id
)
ge1
:
SetOperation
(
aux
.
sumreg
)
Duel
.
RegisterEffect
(
ge1
,
0
)
local
ge2
=
ge1
:
Clone
()
ge2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
Duel
.
RegisterEffect
(
ge2
,
0
)
end
end
function
s
.
ctop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
s
.
addcounter
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
function
s
.
addcounter
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
c
:
AddCounter
(
0x69
,
1
)
Duel
.
RaiseEvent
(
c
,
EVENT_CUSTOM
+
121999035
,
e
,
0
,
tp
,
tp
,
1
)
end
function
s
.
pzcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
c
)
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
|
REASON_DISCARD
,
c
)
end
function
s
.
pzfilter
(
c
)
return
c
:
IsCode
(
121999031
)
and
not
c
:
IsForbidden
()
end
function
s
.
pztg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
and
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
)
and
Duel
.
IsExistingMatchingCard
(
s
.
pzfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
end
function
s
.
pzop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
(
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
and
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
)
and
c
:
IsRelateToEffect
(
e
))
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
pzfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
not
tc
then
return
end
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
end
function
s
.
cpcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
e
:
SetLabel
(
1
)
return
true
end
function
s
.
cpfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
(
c
:
GetType
()
==
TYPE_TRAP
or
c
:
GetType
()
==
TYPE_SPELL
)
and
c
:
IsAbleToRemoveAsCost
()
and
c
:
CheckActivateEffect
(
false
,
true
,
false
)
end
function
s
.
cptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
e
:
GetLabel
()
==
0
then
return
false
end
e
:
SetLabel
(
0
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_COST
)
e
:
SetLabelObject
(
tc
)
end
function
s
.
cpop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
if
not
tc
then
return
end
local
eff
=
tc
:
GetActivateEffect
()
local
op
=
eff
:
GetOperation
()
--Additional parameter checked in the script of "Valmonica" Normal Spells/Traps to correctly apply the damage-inflicting effect
if
op
then
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
1
)
end
end
expansions/script/c121999033.lua
0 → 100644
View file @
fcf4fbbd
--ヴァルモニカの異神-ジュラルメ
local
s
,
id
=
GetID
()
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
c
:
SetSPSummonOnce
(
id
)
--Link Summon procedure
aux
.
AddLinkProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsLinkType
,
TYPE_EFFECT
),
1
)
--Cannot be Link Summoned unless you have a Fairy Monster Card with 3 or more Resonance Counters in your Pendulum Zone
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_SINGLE
)
e0
:
SetCode
(
EFFECT_SPSUMMON_COST
)
e0
:
SetCost
(
s
.
spcost
)
c
:
RegisterEffect
(
e0
)
--Destroy opponent's monsters up to the number of Resonance Counters in your Pendulum Zone
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCondition
(
function
(
e
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_LINK
)
end
)
e1
:
SetTarget
(
s
.
destg
)
e1
:
SetOperation
(
s
.
desop
)
c
:
RegisterEffect
(
e1
)
--This card can make a 2nd and 3rd attack this turn
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCondition
(
function
()
return
Duel
.
IsAbleToEnterBP
()
end
)
e2
:
SetCost
(
s
.
tripleatkcost
)
e2
:
SetTarget
(
s
.
tripleatktg
)
e2
:
SetOperation
(
s
.
tripleatkop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
spcfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_FAIRY
)
and
c
:
GetCounter
(
0x69
)
>=
3
end
function
s
.
spcost
(
e
,
c
,
tp
,
st
)
if
(
st
&
SUMMON_TYPE_LINK
)
~=
SUMMON_TYPE_LINK
then
return
true
end
return
Duel
.
IsExistingMatchingCard
(
s
.
spcfilter
,
tp
,
LOCATION_PZONE
,
0
,
1
,
nil
)
end
function
s
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsControler
(
1
-
tp
)
and
chkc
:
IsLocation
(
LOCATION_MZONE
)
end
local
ct
=
Duel
.
GetCounter
(
tp
,
1
,
0
,
0x69
)
if
chk
==
0
then
return
ct
>
0
and
Duel
.
IsExistingTarget
(
nil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
tg
=
Duel
.
SelectTarget
(
tp
,
nil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
ct
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
tg
,
#
tg
,
tp
,
0
)
end
function
s
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tg
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
):
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
if
#
tg
>
0
then
Duel
.
Destroy
(
tg
,
REASON_EFFECT
)
end
end
function
s
.
tripleatkcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
0
,
0x69
,
3
,
REASON_COST
)
end
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x69
,
3
,
REASON_COST
)
end
function
s
.
tripleatktg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
effs
=
{
e
:
GetHandler
():
IsHasEffect
(
EFFECT_EXTRA_ATTACK
)}
for
_
,
eff
in
ipairs
(
effs
)
do
if
eff
:
GetValue
()
>=
2
then
return
false
end
end
return
true
end
end
function
s
.
tripleatkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
--Can make a 2nd and 3rd attack this turn
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_EXTRA_ATTACK
)
e1
:
SetValue
(
2
)
e1
:
SetReset
(
RESET_EVENT
|
RESETS_STANDARD
|
RESET_PHASE
|
PHASE_END
)
c
:
RegisterEffect
(
e1
)
end
end
\ No newline at end of file
expansions/script/c121999034.lua
0 → 100644
View file @
fcf4fbbd
--ヴァルモニカの神異-ゼブフェーラ
local
s
,
id
=
GetID
()
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
c
:
SetSPSummonOnce
(
id
)
--Link Summon procedure
aux
.
AddLinkProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsLinkType
,
TYPE_EFFECT
),
1
)
--Cannot be Link Summoned unless you have a Fiend Monster Card with 3 or more Resonance Counters in your Pendulum Zone
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_SINGLE
)
e0
:
SetCode
(
EFFECT_SPSUMMON_COST
)
e0
:
SetCost
(
s
.
spcost
)
c
:
RegisterEffect
(
e0
)
--Remove 3 Resonance Counters from your Pendulum Zone instead of destroying this card
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EFFECT_DESTROY_REPLACE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTarget
(
s
.
reptg
)
e1
:
SetValue
(
s
.
repval
)
e1
:
SetOperation
(
s
.
repop
)
c
:
RegisterEffect
(
e1
)
--Apply the effect of 1 "Valmonica" Normal Spell/Trap that is banished or in your GY
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetHintTiming
(
0
,
TIMING_STANDBY_PHASE
+
TIMING_MAIN_END
+
TIMINGS_CHECK_MONSTER
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCondition
(
function
(
e
,
tp
)
return
Duel
.
GetTurnPlayer
()
==
1
-
tp
end
)
e2
:
SetTarget
(
s
.
cptg
)
e2
:
SetOperation
(
s
.
cpop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
spcfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_FIEND
)
and
c
:
GetCounter
(
0x69
)
>=
3
end
function
s
.
spcost
(
e
,
c
,
tp
,
st
)
if
(
st
&
SUMMON_TYPE_LINK
)
~=
SUMMON_TYPE_LINK
then
return
true
end
return
Duel
.
IsExistingMatchingCard
(
s
.
spcfilter
,
tp
,
LOCATION_PZONE
,
0
,
1
,
nil
)
end
function
s
.
filter1
(
c
,
tp
)
return
not
c
:
IsReason
(
REASON_REPLACE
)
and
c
:
IsLocation
(
LOCATION_ONFIELD
)
and
c
:
IsControler
(
tp
)
and
c
:
IsReason
(
REASON_EFFECT
+
REASON_BATTLE
)
end
function
s
.
reptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
g
=
eg
:
Filter
(
s
.
filter1
,
nil
,
tp
)
if
chk
==
0
then
return
#
g
>
0
and
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
0
,
0x69
,
3
,
REASON_EFFECT
)
end
return
Duel
.
SelectEffectYesNo
(
tp
,
c
,
96
)
end
function
s
.
repval
(
e
,
c
)
return
s
.
filter1
(
c
,
e
:
GetHandlerPlayer
())
end
function
s
.
repop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x69
,
3
,
REASON_EFFECT
)
end
function
s
.
cpfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
(
c
:
GetType
()
==
TYPE_TRAP
or
c
:
GetType
()
==
TYPE_SPELL
)
and
c
:
IsFaceup
()
and
c
:
CheckActivateEffect
(
false
,
true
,
false
)
end
function
s
.
cptg
(
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
s
.
cpfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
|
LOCATION_REMOVED
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
local
tc
=
Duel
.
SelectTarget
(
tp
,
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
|
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
):
GetFirst
()
local
eff
=
tc
:
CheckActivateEffect
(
false
,
true
,
false
)
e
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
|
eff
:
GetProperty
())
local
tg
=
eff
:
GetTarget
()
if
tg
then
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
1
)
end
Duel
.
ClearOperationInfo
(
0
)
end
function
s
.
cpop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
not
tc
:
IsRelateToEffect
(
e
)
then
return
end
local
eff
=
tc
:
CheckActivateEffect
(
false
,
true
,
false
)
if
not
eff
then
return
end
local
op
=
eff
:
GetOperation
()
if
op
then
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
end
\ No newline at end of file
expansions/script/c121999035.lua
0 → 100644
View file @
fcf4fbbd
--天魔の聲選器-『ヴァルモニカ』
local
s
,
id
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
,
EFFECT_COUNT_CODE_OATH
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
--Take control of 1 opponent's monster
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCode
(
EVENT_CUSTOM
+
id
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetCountLimit
(
1
,{
id
,
1
})
e2
:
SetCondition
(
s
.
ctrlcon
)
e2
:
SetTarget
(
s
.
ctrltg
)
e2
:
SetOperation
(
s
.
ctrlop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
thfilter
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsSetCard
(
0x19e
)
and
c
:
IsAbleToHand
()
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
0
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
sg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
sg
)
end
end
function
s
.
ctrlcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
ep
==
tp
and
eg
:
GetFirst
():
GetCounter
(
0x69
)
==
3
end
function
s
.
ctrltg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
1
-
tp
)
and
chkc
:
IsControlerCanBeChanged
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CONTROL
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_CONTROL
,
g
,
1
,
tp
,
0
)
end
function
s
.
ctrlop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
GetControl
(
tc
,
tp
,
PHASE_END
,
1
)
>
0
then
--It cannot declare an attack
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetDescription
(
3206
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_ATTACK
)
e1
:
SetCondition
(
function
(
e
)
return
e
:
GetHandler
():
IsControler
(
tp
)
end
)
e1
:
SetReset
(
RESET_EVENT
|
(
RESETS_STANDARD
&~
RESET_TURN_SET
)
|
RESET_PHASE
|
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
end
end
expansions/script/c121999037.lua
0 → 100644
View file @
fcf4fbbd
--ヴァルモニカ・ヴェルサーレ
local
s
,
id
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_TOHAND
+
CATEGORY_SEARCH
+
CATEGORY_DAMAGE
+
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
,
EFFECT_COUNT_CODE_OATH
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
s
.
tgfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
not
c
:
IsCode
(
id
)
and
c
:
IsAbleToGrave
()
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
angle_or_delvin
)
--Additional parameter used by "Angelo Valmonica" and "Demone Valmonica"
local
op
=
nil
if
angle_or_delvin
then
op
=
angle_or_delvin
else
local
sel_player
=
Duel
.
IsExistingMatchingCard
(
Card
.
IsSetCard
,
tp
,
LOCATION_PZONE
,
0
,
1
,
nil
,
0x19e
)
and
tp
or
1
-
tp
local
offset
=
sel_player
==
1
-
tp
and
2
or
0
op
=
Duel
.
SelectOption
(
sel_player
,
aux
.
Stringid
(
id
,
1
+
offset
),
aux
.
Stringid
(
id
,
2
+
offset
))
end
if
op
==
0
then
--Gain 500 LP and excavate cards from the top of your Deck
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsSetCard
,
tp
,
LOCATION_DECK
,
0
,
nil
,
0x19e
)
if
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
5
))
then
local
spcard
,
seq
=
g
:
GetMaxGroup
(
Card
.
GetSequence
)
spcard
=
spcard
:
GetFirst
()
if
not
spcard
then
return
end
Duel
.
BreakEffect
()
Duel
.
ConfirmDecktop
(
tp
,
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
-
seq
)
if
spcard
:
IsAbleToHand
()
then
Duel
.
SendtoHand
(
spcard
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
spcard
)
else
Duel
.
SendtoGrave
(
spcard
,
REASON_RULE
)
end
end
elseif
op
==
1
then
--Take 500 damage and send 1 "Valmonica" card from your Deck to the GY
local
g
=
Duel
.
GetMatchingGroup
(
s
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
Duel
.
Damage
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
6
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
BreakEffect
()
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
end
\ No newline at end of file
expansions/script/c121999038.lua
0 → 100644
View file @
fcf4fbbd
--ヴァルモニカ・イントナーレ
local
s
,
id
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_DAMAGE
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
,
EFFECT_COUNT_CODE_OATH
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
s
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
s
.
thfilter
(
c
)
return
c
:
IsLevel
(
4
)
and
c
:
IsAbleToHand
()
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
angle_or_delvin
)
--Additional parameter used by "Angelo Valmonica" and "Demone Valmonica"
local
op
=
nil
if
angle_or_delvin
then
op
=
angle_or_delvin
else
local
sel_player
=
Duel
.
IsExistingMatchingCard
(
Card
.
IsSetCard
,
tp
,
LOCATION_PZONE
,
0
,
1
,
nil
,
0x19e
)
and
tp
or
1
-
tp
local
offset
=
sel_player
==
1
-
tp
and
2
or
0
op
=
Duel
.
SelectOption
(
sel_player
,
aux
.
Stringid
(
id
,
1
+
offset
),
aux
.
Stringid
(
id
,
2
+
offset
))
end
if
op
==
0
then
--Gain 500 LP and Special Summon 1 monster from your GY
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
NecroValleyFilter
(
s
.
spfilter
),
tp
,
LOCATION_GRAVE
,
0
,
nil
,
e
,
tp
)
if
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
1
-
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
Select
(
1
-
tp
,
1
,
1
,
nil
)
Duel
.
BreakEffect
()
Duel
.
SpecialSummon
(
sg
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
elseif
op
==
1
then
--Take 500 damage and add 1 Level 4 monster from your GY to your hand
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
NecroValleyFilter
(
s
.
thfilter
),
tp
,
LOCATION_GRAVE
,
0
,
nil
)
if
Duel
.
Damage
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
5
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
hg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
BreakEffect
()
Duel
.
SendtoHand
(
hg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
hg
)
end
end
end
\ No newline at end of file
expansions/script/c121999039.lua
0 → 100644
View file @
fcf4fbbd
--律導のヴァルモニカ
local
s
,
id
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_DESTROY
+
CATEGORY_DAMAGE
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMING_MAIN_END
+
TIMINGS_CHECK_MONSTER
)
e1
:
SetCountLimit
(
1
,
id
,
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
s
.
condition
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
s
.
cfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
c
:
IsFaceup
()
and
(
c
:
IsType
(
TYPE_MONSTER
)
or
c
:
IsType
(
TYPE_PENDULUM
))
end
function
s
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
s
.
linkfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_LINK
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
angle_or_delvin
)
--Additional parameter used by "Angelo Valmonica" and "Demone Valmonica"
local
op
=
nil
if
angle_or_delvin
then
op
=
angle_or_delvin
else
local
both
=
Duel
.
IsExistingMatchingCard
(
s
.
linkfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
if
both
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
id
,
1
),
aux
.
Stringid
(
id
,
2
),
aux
.
Stringid
(
id
,
3
))
else
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
id
,
1
),
aux
.
Stringid
(
id
,
2
))
end
end
local
break_chk
=
nil
if
op
==
0
or
op
==
2
then
--Gain 500 LP and Destroy 1 Spell/Trap on the field
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsType
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
(),
TYPE_SPELL
+
TYPE_TRAP
)
if
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
4
))
then
break_chk
=
true
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
dg
,
true
)
Duel
.
BreakEffect
()
Duel
.
Destroy
(
dg
,
REASON_EFFECT
)
end
end
if
op
==
1
or
op
==
2
then
--Take 500 damage and return 1 monster on the field to the hand
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToHand
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
)
if
break_chk
then
Duel
.
BreakEffect
()
end
if
Duel
.
Damage
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
5
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
hg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
hg
,
true
)
Duel
.
BreakEffect
()
Duel
.
SendtoHand
(
hg
,
nil
,
REASON_EFFECT
)
end
end
end
expansions/script/c121999040.lua
0 → 100644
View file @
fcf4fbbd
--選律のヴァルモニカ
local
s
,
id
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_DAMAGE
+
CATEGORY_DISABLE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMING_STANDBY_PHASE
+
TIMING_MAIN_END
+
TIMINGS_CHECK_MONSTER
)
e1
:
SetCountLimit
(
1
,
id
,
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
s
.
condition
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
s
.
cfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
c
:
IsFaceup
()
and
(
c
:
IsType
(
TYPE_MONSTER
)
or
c
:
IsType
(
TYPE_PENDULUM
))
end
function
s
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
s
.
target1
(
e
,
c
)
return
c
:
IsSetCard
(
0x19e
)
and
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
s
.
linkfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_LINK
)
end
function
s
.
disfilter
(
c
)
return
c
:
IsType
(
TYPE_EFFECT
)
and
c
:
IsFaceup
()
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
angle_or_delvin
)
--Additional parameter used by "Angelo Valmonica" and "Demone Valmonica"
local
op
=
nil
if
angle_or_delvin
then
op
=
angle_or_delvin
else
local
both
=
Duel
.
IsExistingMatchingCard
(
s
.
linkfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
if
both
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
id
,
1
),
aux
.
Stringid
(
id
,
2
),
aux
.
Stringid
(
id
,
3
))
else
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
id
,
1
),
aux
.
Stringid
(
id
,
2
))
end
end
local
break_chk
=
nil
local
c
=
e
:
GetHandler
()
if
op
==
0
or
op
==
2
then
--Gain 500 LP and apply the targeting procetion effect
if
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
>
0
then
break_chk
=
true
Duel
.
RegisterFlagEffect
(
tp
,
id
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
,
0
,
1
)
--Your opponent cannot target "Valmonica" Monster Cards you control with card effects
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
)
e1
:
SetCode
(
EFFECT_CANNOT_BE_EFFECT_TARGET
)
e1
:
SetTargetRange
(
LOCATION_ONFIELD
,
0
)
e1
:
SetTarget
(
s
.
target1
)
e1
:
SetValue
(
aux
.
tgoval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
if
op
==
1
or
op
==
2
then
--Take 500 damage and negate the effects of 1 opponent's Effect Monster
local
g
=
Duel
.
GetMatchingGroup
(
s
.
disfilter
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
if
break_chk
then
Duel
.
BreakEffect
()
end
if
Duel
.
Damage
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
4
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DISABLE
)
local
nc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
if
nc
:
IsCanBeDisabledByEffect
(
e
)
then
Duel
.
NegateRelatedChain
(
nc
,
RESET_TURN_SET
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
nc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetValue
(
RESET_TURN_SET
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
nc
:
RegisterEffect
(
e2
)
end
end
end
end
\ No newline at end of file
expansions/script/c12461492.lua
0 → 100644
View file @
fcf4fbbd
--救援刺猬
function
c12461492
.
initial_effect
(
c
)
--special summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
12461492
,
0
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
12461492
)
e2
:
SetCost
(
c12461492
.
spcost
)
e2
:
SetTarget
(
c12461492
.
sptg
)
e2
:
SetOperation
(
c12461492
.
spop
)
c
:
RegisterEffect
(
e2
)
end
function
c12461492
.
spcost
(
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
c12461492
.
filter1
(
c
,
e
,
tp
)
return
c
:
IsLevelBelow
(
3
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c12461492
.
fselect
(
g
)
return
g
:
GetClassCount
(
Card
.
GetRace
)
==
1
and
g
:
GetClassCount
(
Card
.
GetLevel
)
==
1
and
g
:
GetClassCount
(
Card
.
GetAttribute
)
==
1
and
g
:
GetClassCount
(
Card
.
GetType
)
==
2
end
function
c12461492
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
g
=
Duel
.
GetMatchingGroup
(
c12461492
.
filter1
,
tp
,
LOCATION_DECK
,
0
,
nil
,
e
,
tp
)
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>=
2
and
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
59822133
)
and
g
:
CheckSubGroup
(
c12461492
.
fselect
,
2
,
2
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
2
,
tp
,
LOCATION_DECK
)
end
function
c12461492
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<
2
or
Duel
.
IsPlayerAffectedByEffect
(
tp
,
59822133
)
then
return
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c12461492
.
filter1
,
tp
,
LOCATION_DECK
,
0
,
nil
,
e
,
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
SelectSubGroup
(
tp
,
c12461492
.
fselect
,
false
,
2
,
2
)
local
tc
=
sg
:
GetFirst
()
while
tc
do
Duel
.
SpecialSummonStep
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetValue
(
RESET_TURN_SET
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e2
)
tc
:
RegisterFlagEffect
(
12461492
,
RESET_EVENT
+
RESETS_STANDARD
,
0
,
1
,
fid
)
tc
=
sg
:
GetNext
()
end
Duel
.
SpecialSummonComplete
()
sg
:
KeepAlive
()
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetCountLimit
(
1
)
e1
:
SetLabel
(
fid
)
e1
:
SetLabelObject
(
sg
)
e1
:
SetCondition
(
c12461492
.
descon
)
e1
:
SetOperation
(
c12461492
.
desop
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
c12461492
.
desfilter
(
c
,
fid
)
return
c
:
GetFlagEffectLabel
(
12461492
)
==
fid
end
function
c12461492
.
descon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
e
:
GetLabelObject
()
if
not
g
:
IsExists
(
c12461492
.
desfilter
,
1
,
nil
,
e
:
GetLabel
())
then
g
:
DeleteGroup
()
e
:
Reset
()
return
false
else
return
true
end
end
function
c12461492
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
e
:
GetLabelObject
()
local
tg
=
g
:
Filter
(
c12461492
.
desfilter
,
nil
,
e
:
GetLabel
())
Duel
.
Destroy
(
tg
,
REASON_EFFECT
)
end
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