Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro-2pick
Commits
cbb95e3a
Commit
cbb95e3a
authored
Oct 04, 2017
by
Momobako
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
灵依bug修复
parent
de65c36b
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1177 additions
and
1041 deletions
+1177
-1041
expansions/script/c50000200.lua
expansions/script/c50000200.lua
+171
-170
expansions/script/c50000201.lua
expansions/script/c50000201.lua
+188
-187
expansions/script/c50000202.lua
expansions/script/c50000202.lua
+53
-53
expansions/script/c50000203.lua
expansions/script/c50000203.lua
+129
-128
expansions/script/c50000204.lua
expansions/script/c50000204.lua
+113
-113
expansions/script/c50000205.lua
expansions/script/c50000205.lua
+88
-88
expansions/script/c50000206.lua
expansions/script/c50000206.lua
+87
-87
expansions/script/c50000207.lua
expansions/script/c50000207.lua
+125
-125
expansions/script/c50000208.lua
expansions/script/c50000208.lua
+90
-90
expansions/script/c50000209.lua
expansions/script/c50000209.lua
+133
-0
No files found.
expansions/script/c50000200.lua
View file @
cbb95e3a
This diff is collapsed.
Click to expand it.
expansions/script/c50000201.lua
View file @
cbb95e3a
This diff is collapsed.
Click to expand it.
expansions/script/c50000202.lua
View file @
cbb95e3a
--灵依魔法·增援
--灵依魔法·增援
function
c50000202
.
initial_effect
(
c
)
function
c50000202
.
initial_effect
(
c
)
--Activate
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
50000202
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCountLimit
(
1
,
50000202
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCost
(
c50000202
.
cost
)
e1
:
SetCost
(
c50000202
.
cost
)
e1
:
SetTarget
(
c50000202
.
target
)
e1
:
SetTarget
(
c50000202
.
target
)
e1
:
SetOperation
(
c50000202
.
operation
)
e1
:
SetOperation
(
c50000202
.
operation
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
c50000202
.
is_named_with_Rely
=
1
c50000202
.
is_named_with_Rely
=
1
function
c50000202
.
IsRely
(
c
)
function
c50000202
.
IsRely
(
c
)
local
code
=
c
:
GetCode
()
local
code
=
c
:
GetCode
()
local
mt
=
_G
[
"c"
..
code
]
local
mt
=
_G
[
"c"
..
code
]
if
not
mt
then
if
not
mt
then
_G
[
"c"
..
code
]
=
{}
_G
[
"c"
..
code
]
=
{}
if
pcall
(
function
()
dofile
(
"expansions/script/c"
..
code
..
".lua"
)
end
)
or
pcall
(
function
()
dofile
(
"script/c"
..
code
..
".lua"
)
end
)
then
if
pcall
(
function
()
dofile
(
"expansions/script/c"
..
code
..
".lua"
)
end
)
or
pcall
(
function
()
dofile
(
"script/c"
..
code
..
".lua"
)
end
)
then
mt
=
_G
[
"c"
..
code
]
mt
=
_G
[
"c"
..
code
]
_G
[
"c"
..
code
]
=
nil
_G
[
"c"
..
code
]
=
nil
else
else
_G
[
"c"
..
code
]
=
nil
_G
[
"c"
..
code
]
=
nil
return
false
return
false
end
end
end
end
return
mt
and
mt
.
is_named_with_Rely
return
mt
and
mt
.
is_named_with_Rely
end
end
function
c50000202
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c50000202
.
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
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
+
REASON_DISCARD
,
e
:
GetHandler
())
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
,
e
:
GetHandler
())
end
end
function
c50000202
.
filter1
(
c
)
function
c50000202
.
filter1
(
c
)
return
c
:
IsType
(
TYPE_RITUAL
)
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsAbleToHand
()
return
c
:
IsType
(
TYPE_RITUAL
)
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsAbleToHand
()
end
end
function
c50000202
.
filter2
(
c
)
function
c50000202
.
filter2
(
c
)
return
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsAbleToHand
()
return
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsAbleToHand
()
end
end
function
c50000202
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c50000202
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c50000202
.
filter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c50000202
.
filter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c50000202
.
filter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c50000202
.
filter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
2
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
2
,
tp
,
LOCATION_DECK
)
end
end
function
c50000202
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000202
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c50000202
.
filter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c50000202
.
filter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c50000202
.
filter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c50000202
.
filter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
g
:
Merge
(
g1
)
g
:
Merge
(
g1
)
if
g
:
GetCount
()
>
0
then
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
end
end
\ No newline at end of file
expansions/script/c50000203.lua
View file @
cbb95e3a
--灵依法师-灵灭
--灵依法师-灵灭
function
c50000203
.
initial_effect
(
c
)
function
c50000203
.
initial_effect
(
c
)
--pendulum summon
--pendulum summon
aux
.
EnablePendulumAttribute
(
c
)
aux
.
EnablePendulumAttribute
(
c
)
--tohand
--tohand
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_TRIGGER_O
+
EFFECT_TYPE_FIELD
)
e1
:
SetType
(
EFFECT_TYPE_TRIGGER_O
+
EFFECT_TYPE_FIELD
)
e1
:
SetDescription
(
aux
.
Stringid
(
50000203
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
50000203
,
0
))
e1
:
SetCode
(
EVENT_TO_DECK
)
e1
:
SetCode
(
EVENT_TO_DECK
)
e1
:
SetRange
(
LOCATION_PZONE
)
e1
:
SetRange
(
LOCATION_PZONE
)
e1
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e1
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCondition
(
c50000203
.
thcon
)
e1
:
SetCondition
(
c50000203
.
thcon
)
e1
:
SetTarget
(
c50000203
.
thtg
)
e1
:
SetTarget
(
c50000203
.
thtg
)
e1
:
SetOperation
(
c50000203
.
thop
)
e1
:
SetOperation
(
c50000203
.
thop
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--Remove Monster
--Remove Monster
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_REMOVE
)
e2
:
SetCategory
(
CATEGORY_REMOVE
)
e2
:
SetDescription
(
aux
.
Stringid
(
50000203
,
1
))
e2
:
SetDescription
(
aux
.
Stringid
(
50000203
,
1
))
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_PZONE
)
e2
:
SetRange
(
LOCATION_PZONE
)
e2
:
SetCountLimit
(
1
,
50000203
)
e2
:
SetCountLimit
(
1
,
50000203
)
e2
:
SetCost
(
c50000203
.
cost
)
e2
:
SetCost
(
c50000203
.
cost
)
e2
:
SetTarget
(
c50000203
.
target
)
e2
:
SetTarget
(
c50000203
.
target
)
e2
:
SetOperation
(
c50000203
.
activate
)
e2
:
SetOperation
(
c50000203
.
activate
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--ritual level
--ritual level
local
e3
=
Effect
.
CreateEffect
(
c
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_RITUAL_LEVEL
)
e3
:
SetCode
(
EFFECT_RITUAL_LEVEL
)
e3
:
SetValue
(
c50000203
.
rlevel
)
e3
:
SetValue
(
c50000203
.
rlevel
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
--Remove
--Remove
local
e4
=
Effect
.
CreateEffect
(
c
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetCategory
(
CATEGORY_REMOVE
)
e4
:
SetCategory
(
CATEGORY_REMOVE
)
e4
:
SetDescription
(
aux
.
Stringid
(
50000203
,
2
))
e4
:
SetDescription
(
aux
.
Stringid
(
50000203
,
2
))
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetCode
(
EVENT_RELEASE
)
e4
:
SetCode
(
EVENT_RELEASE
)
e4
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e4
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e4
:
SetCountLimit
(
1
,
500002031
)
e4
:
SetCountLimit
(
1
,
500002031
)
e4
:
SetTarget
(
c50000203
.
retg
)
e4
:
SetTarget
(
c50000203
.
retg
)
e4
:
SetOperation
(
c50000203
.
reop
)
e4
:
SetOperation
(
c50000203
.
reop
)
c
:
RegisterEffect
(
e4
)
c
:
RegisterEffect
(
e4
)
end
end
c50000203
.
is_named_with_Rely
=
1
c50000203
.
is_named_with_Rely
=
1
function
c50000203
.
IsRely
(
c
)
function
c50000203
.
IsRely
(
c
)
local
code
=
c
:
GetCode
()
local
code
=
c
:
GetCode
()
local
mt
=
_G
[
"c"
..
code
]
local
mt
=
_G
[
"c"
..
code
]
if
not
mt
then
if
not
mt
then
_G
[
"c"
..
code
]
=
{}
_G
[
"c"
..
code
]
=
{}
if
pcall
(
function
()
dofile
(
"expansions/script/c"
..
code
..
".lua"
)
end
)
or
pcall
(
function
()
dofile
(
"script/c"
..
code
..
".lua"
)
end
)
then
if
pcall
(
function
()
dofile
(
"expansions/script/c"
..
code
..
".lua"
)
end
)
or
pcall
(
function
()
dofile
(
"script/c"
..
code
..
".lua"
)
end
)
then
mt
=
_G
[
"c"
..
code
]
mt
=
_G
[
"c"
..
code
]
_G
[
"c"
..
code
]
=
nil
_G
[
"c"
..
code
]
=
nil
else
else
_G
[
"c"
..
code
]
=
nil
_G
[
"c"
..
code
]
=
nil
return
false
return
false
end
end
end
end
return
mt
and
mt
.
is_named_with_Rely
return
mt
and
mt
.
is_named_with_Rely
end
end
function
c50000203
.
thfilter
(
c
,
tp
)
function
c50000203
.
thfilter
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsControler
(
tp
)
and
c
:
IsLocation
(
LOCATION_EXTRA
)
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
return
c
:
IsFaceup
()
and
c
:
IsControler
(
tp
)
and
c
:
IsLocation
(
LOCATION_EXTRA
)
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsPreviousLocation
(
LOCATION_ONFIELD
)
and
c
:
IsPreviousLocation
(
LOCATION_ONFIELD
)
end
end
function
c50000203
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000203
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c50000203
.
thfilter
,
1
,
nil
,
tp
)
return
eg
:
IsExists
(
c50000203
.
thfilter
,
1
,
nil
,
tp
)
end
end
function
c50000203
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c50000203
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
chk
==
0
then
return
true
end
local
g
=
eg
:
Filter
(
c50000203
.
thfilter
,
nil
,
tp
)
local
g
=
eg
:
Filter
(
c50000203
.
thfilter
,
nil
,
tp
)
Duel
.
SetTargetCard
(
g
)
Duel
.
SetTargetCard
(
g
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
0
)
end
end
function
c50000203
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000203
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
):
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
local
g
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
):
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
rg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
local
rg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
if
rg
:
GetCount
()
>
0
then
if
rg
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
rg
,
nil
,
REASON_EFFECT
)
Duel
.
SendtoHand
(
rg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
rg
)
Duel
.
ConfirmCards
(
1
-
tp
,
rg
)
end
end
end
end
--remove
--remove
function
c50000203
.
cfilter
(
c
)
function
c50000203
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
return
c
:
IsFaceup
()
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
end
end
function
c50000203
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c50000203
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckReleaseGroup
(
tp
,
c50000203
.
cfilter
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
CheckReleaseGroup
(
tp
,
c50000203
.
cfilter
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
local
g
=
Duel
.
SelectReleaseGroup
(
tp
,
c50000203
.
cfilter
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectReleaseGroup
(
tp
,
c50000203
.
cfilter
,
1
,
1
,
nil
)
Duel
.
Release
(
g
,
REASON_COST
)
Duel
.
Release
(
g
,
REASON_COST
)
end
end
function
c50000203
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
function
c50000203
.
target
(
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
:
IsAbleToRemove
()
end
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
1
-
tp
)
and
chkc
:
IsAbleToRemove
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
g
,
1
,
0
,
0
)
end
end
function
c50000203
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000203
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
if
tc
:
IsRelateToEffect
(
e
)
then
local
tc
=
Duel
.
GetFirstTarget
()
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
if
tc
:
IsRelateToEffect
(
e
)
then
end
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
--ritual level
end
function
c50000203
.
rlevel
(
e
,
c
)
--ritual level
local
lv
=
e
:
GetHandler
():
GetLevel
()
function
c50000203
.
rlevel
(
e
,
c
)
if
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
then
local
lv
=
e
:
GetHandler
():
GetLevel
()
local
clv
=
c
:
GetLevel
()
if
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
then
return
lv
*
65536
+
clv
local
clv
=
c
:
GetLevel
()
else
return
lv
end
return
lv
*
65536
+
clv
end
else
return
lv
end
--remove s+t
end
function
c50000203
.
retg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
--remove s+t
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_SZONE
)
and
chkc
:
IsControler
(
1
-
tp
)
and
chkc
:
IsAbleToRemove
()
end
function
c50000203
.
retg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_SZONE
,
1
,
nil
)
end
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_SZONE
)
and
chkc
:
IsControler
(
1
-
tp
)
and
chkc
:
IsAbleToRemove
()
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_SZONE
,
1
,
nil
)
end
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_SZONE
,
1
,
1
,
nil
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
g
,
1
,
0
,
0
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_SZONE
,
1
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
g
,
1
,
0
,
0
)
function
c50000203
.
reop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
local
tc
=
Duel
.
GetFirstTarget
()
function
c50000203
.
reop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
tc
:
IsRelateToEffect
(
e
)
then
local
tc
=
Duel
.
GetFirstTarget
()
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
if
tc
:
IsRelateToEffect
(
e
)
then
end
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
end
\ No newline at end of file
expansions/script/c50000204.lua
View file @
cbb95e3a
--灵依魔法·灵依
--灵依魔法·灵依
function
c50000204
.
initial_effect
(
c
)
function
c50000204
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
c50000204
.
target
)
e1
:
SetTarget
(
c50000204
.
target
)
e1
:
SetOperation
(
c50000204
.
operation
)
e1
:
SetOperation
(
c50000204
.
operation
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--to hand
--to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_DESTROYED
)
e2
:
SetCode
(
EVENT_DESTROYED
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCondition
(
c50000204
.
thcon
)
e2
:
SetCondition
(
c50000204
.
thcon
)
e2
:
SetTarget
(
c50000204
.
thtg
)
e2
:
SetTarget
(
c50000204
.
thtg
)
e2
:
SetOperation
(
c50000204
.
thop
)
e2
:
SetOperation
(
c50000204
.
thop
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
end
end
c50000204
.
is_named_with_Rely
=
1
c50000204
.
is_named_with_Rely
=
1
function
c50000204
.
IsRely
(
c
)
function
c50000204
.
IsRely
(
c
)
local
code
=
c
:
GetCode
()
local
code
=
c
:
GetCode
()
local
mt
=
_G
[
"c"
..
code
]
local
mt
=
_G
[
"c"
..
code
]
if
not
mt
then
if
not
mt
then
_G
[
"c"
..
code
]
=
{}
_G
[
"c"
..
code
]
=
{}
if
pcall
(
function
()
dofile
(
"expansions/script/c"
..
code
..
".lua"
)
end
)
or
pcall
(
function
()
dofile
(
"script/c"
..
code
..
".lua"
)
end
)
then
if
pcall
(
function
()
dofile
(
"expansions/script/c"
..
code
..
".lua"
)
end
)
or
pcall
(
function
()
dofile
(
"script/c"
..
code
..
".lua"
)
end
)
then
mt
=
_G
[
"c"
..
code
]
mt
=
_G
[
"c"
..
code
]
_G
[
"c"
..
code
]
=
nil
_G
[
"c"
..
code
]
=
nil
else
else
_G
[
"c"
..
code
]
=
nil
_G
[
"c"
..
code
]
=
nil
return
false
return
false
end
end
end
end
return
mt
and
mt
.
is_named_with_Rely
return
mt
and
mt
.
is_named_with_Rely
end
end
function
c50000204
.
ritual_filter
(
c
)
function
c50000204
.
ritual_filter
(
c
)
return
c
:
IsType
(
TYPE_RITUAL
)
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
return
c
:
IsType
(
TYPE_RITUAL
)
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
end
end
function
c50000204
.
filter
(
c
,
e
,
tp
,
m
,
ft
)
function
c50000204
.
filter
(
c
,
e
,
tp
,
m
,
ft
)
if
not
c50000204
.
ritual_filter
(
c
)
or
not
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_RITUAL
,
tp
,
false
,
true
)
then
return
false
end
if
not
c50000204
.
ritual_filter
(
c
)
or
not
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_RITUAL
,
tp
,
false
,
true
)
then
return
false
end
local
mg
=
m
:
Filter
(
Card
.
IsCanBeRitualMaterial
,
c
,
c
)
local
mg
=
m
:
Filter
(
Card
.
IsCanBeRitualMaterial
,
c
,
c
)
if
c
:
IsCode
(
21105106
)
then
return
c
:
ritual_custom_condition
(
mg
,
ft
)
end
if
c
:
IsCode
(
21105106
)
then
return
c
:
ritual_custom_condition
(
mg
,
ft
)
end
if
ft
>
0
then
if
ft
>
0
then
return
mg
:
CheckWithSumEqual
(
Card
.
GetRitualLevel
,
c
:
GetLevel
(),
1
,
99
,
c
)
return
mg
:
CheckWithSumEqual
(
Card
.
GetRitualLevel
,
c
:
GetLevel
(),
1
,
99
,
c
)
else
else
return
mg
:
IsExists
(
c50000204
.
mfilterf
,
1
,
nil
,
tp
,
mg
,
c
)
return
mg
:
IsExists
(
c50000204
.
mfilterf
,
1
,
nil
,
tp
,
mg
,
c
)
end
end
end
end
function
c50000204
.
mfilterf
(
c
,
tp
,
mg
,
rc
)
function
c50000204
.
mfilterf
(
c
,
tp
,
mg
,
rc
)
if
c
:
IsControler
(
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
then
if
c
:
IsControler
(
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
then
Duel
.
SetSelectedCard
(
c
)
Duel
.
SetSelectedCard
(
c
)
return
mg
:
CheckWithSumEqual
(
Card
.
GetRitualLevel
,
rc
:
GetLevel
(),
0
,
99
,
rc
)
return
mg
:
CheckWithSumEqual
(
Card
.
GetRitualLevel
,
rc
:
GetLevel
(),
0
,
99
,
rc
)
else
return
false
end
else
return
false
end
end
end
function
c50000204
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c50000204
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
chk
==
0
then
local
mg
=
Duel
.
GetRitualMaterial
(
tp
)
local
mg
=
Duel
.
GetRitualMaterial
(
tp
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
return
ft
>-
1
and
Duel
.
IsExistingMatchingCard
(
c50000204
.
filter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
,
mg
,
ft
)
return
ft
>-
1
and
Duel
.
IsExistingMatchingCard
(
c50000204
.
filter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
,
mg
,
ft
)
end
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
)
end
end
function
c50000204
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000204
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
mg
=
Duel
.
GetRitualMaterial
(
tp
)
local
mg
=
Duel
.
GetRitualMaterial
(
tp
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
c50000204
.
filter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
,
mg
,
ft
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
c50000204
.
filter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
,
mg
,
ft
)
local
tc
=
tg
:
GetFirst
()
local
tc
=
tg
:
GetFirst
()
if
tc
then
if
tc
then
mg
=
mg
:
Filter
(
Card
.
IsCanBeRitualMaterial
,
tc
,
tc
)
mg
=
mg
:
Filter
(
Card
.
IsCanBeRitualMaterial
,
tc
,
tc
)
if
tc
:
IsCode
(
21105106
)
then
if
tc
:
IsCode
(
21105106
)
then
tc
:
ritual_custom_operation
(
mg
)
tc
:
ritual_custom_operation
(
mg
)
local
mat
=
tc
:
GetMaterial
()
local
mat
=
tc
:
GetMaterial
()
Duel
.
ReleaseRitualMaterial
(
mat
)
Duel
.
ReleaseRitualMaterial
(
mat
)
else
else
local
mat
=
nil
local
mat
=
nil
if
ft
>
0
then
if
ft
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
mat
=
mg
:
SelectWithSumEqual
(
tp
,
Card
.
GetRitualLevel
,
tc
:
GetLevel
(),
1
,
99
,
tc
)
mat
=
mg
:
SelectWithSumEqual
(
tp
,
Card
.
GetRitualLevel
,
tc
:
GetLevel
(),
1
,
99
,
tc
)
else
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
mat
=
mg
:
FilterSelect
(
tp
,
c50000204
.
mfilterf
,
1
,
1
,
nil
,
tp
,
mg
,
tc
)
mat
=
mg
:
FilterSelect
(
tp
,
c50000204
.
mfilterf
,
1
,
1
,
nil
,
tp
,
mg
,
tc
)
Duel
.
SetSelectedCard
(
mat
)
Duel
.
SetSelectedCard
(
mat
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
local
mat2
=
mg
:
SelectWithSumEqual
(
tp
,
Card
.
GetRitualLevel
,
tc
:
GetLevel
(),
0
,
99
,
tc
)
local
mat2
=
mg
:
SelectWithSumEqual
(
tp
,
Card
.
GetRitualLevel
,
tc
:
GetLevel
(),
0
,
99
,
tc
)
mat
:
Merge
(
mat2
)
mat
:
Merge
(
mat2
)
end
end
tc
:
SetMaterial
(
mat
)
tc
:
SetMaterial
(
mat
)
Duel
.
ReleaseRitualMaterial
(
mat
)
Duel
.
ReleaseRitualMaterial
(
mat
)
end
end
Duel
.
BreakEffect
()
Duel
.
BreakEffect
()
Duel
.
SpecialSummon
(
tc
,
SUMMON_TYPE_RITUAL
,
tp
,
tp
,
false
,
true
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
tc
,
SUMMON_TYPE_RITUAL
,
tp
,
tp
,
false
,
true
,
POS_FACEUP
)
tc
:
CompleteProcedure
()
tc
:
CompleteProcedure
()
end
end
end
end
function
c50000204
.
thfilter
(
c
,
tp
)
function
c50000204
.
thfilter
(
c
,
tp
)
return
c
:
IsReason
(
REASON_BATTLE
+
REASON_EFFECT
)
return
c
:
IsReason
(
REASON_BATTLE
+
REASON_EFFECT
)
and
c
:
IsPreviousLocation
(
LOCATION_ONFIELD
)
and
c
:
GetPreviousControler
()
==
tp
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsPreviousLocation
(
LOCATION_ONFIELD
)
and
c
:
GetPreviousControler
()
==
tp
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
end
end
function
c50000204
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000204
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c50000204
.
thfilter
,
1
,
nil
,
tp
)
return
eg
:
IsExists
(
c50000204
.
thfilter
,
1
,
nil
,
tp
)
end
end
function
c50000204
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c50000204
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToHand
()
end
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToHand
()
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
e
:
GetHandler
(),
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
end
function
c50000204
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000204
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
if
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
Duel
.
SendtoHand
(
e
:
GetHandler
(),
nil
,
REASON_EFFECT
)
Duel
.
SendtoHand
(
e
:
GetHandler
(),
nil
,
REASON_EFFECT
)
end
end
end
end
\ No newline at end of file
expansions/script/c50000205.lua
View file @
cbb95e3a
--灵依法师-幻灵
--灵依法师-幻灵
function
c50000205
.
initial_effect
(
c
)
function
c50000205
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
c
:
EnableReviveLimit
()
--cannot special summon
--cannot special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e1
:
SetValue
(
aux
.
ritlimit
)
e1
:
SetValue
(
aux
.
ritlimit
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--special summon
--special summon
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
50000205
,
0
))
e2
:
SetDescription
(
aux
.
Stringid
(
50000205
,
0
))
e2
:
SetCategory
(
CATEGORY_TODECK
)
e2
:
SetCategory
(
CATEGORY_TODECK
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetCountLimit
(
1
,
50000205
)
e2
:
SetCountLimit
(
1
,
50000205
)
e2
:
SetCondition
(
c50000205
.
tdcon
)
e2
:
SetCondition
(
c50000205
.
tdcon
)
e2
:
SetTarget
(
c50000205
.
tdtg
)
e2
:
SetTarget
(
c50000205
.
tdtg
)
e2
:
SetOperation
(
c50000205
.
tdop
)
e2
:
SetOperation
(
c50000205
.
tdop
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--search
--search
local
e3
=
Effect
.
CreateEffect
(
c
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
50000205
,
1
))
e3
:
SetDescription
(
aux
.
Stringid
(
50000205
,
1
))
e3
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e3
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
500002051
)
e3
:
SetCountLimit
(
1
,
500002051
)
e3
:
SetCondition
(
c50000205
.
thcon
)
e3
:
SetCondition
(
c50000205
.
thcon
)
e3
:
SetTarget
(
c50000205
.
thtg
)
e3
:
SetTarget
(
c50000205
.
thtg
)
e3
:
SetOperation
(
c50000205
.
thop
)
e3
:
SetOperation
(
c50000205
.
thop
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
end
end
c50000205
.
is_named_with_Rely
=
1
c50000205
.
is_named_with_Rely
=
1
function
c50000205
.
IsRely
(
c
)
function
c50000205
.
IsRely
(
c
)
local
code
=
c
:
GetCode
()
local
code
=
c
:
GetCode
()
local
mt
=
_G
[
"c"
..
code
]
local
mt
=
_G
[
"c"
..
code
]
if
not
mt
then
if
not
mt
then
_G
[
"c"
..
code
]
=
{}
_G
[
"c"
..
code
]
=
{}
if
pcall
(
function
()
dofile
(
"expansions/script/c"
..
code
..
".lua"
)
end
)
or
pcall
(
function
()
dofile
(
"script/c"
..
code
..
".lua"
)
end
)
then
if
pcall
(
function
()
dofile
(
"expansions/script/c"
..
code
..
".lua"
)
end
)
or
pcall
(
function
()
dofile
(
"script/c"
..
code
..
".lua"
)
end
)
then
mt
=
_G
[
"c"
..
code
]
mt
=
_G
[
"c"
..
code
]
_G
[
"c"
..
code
]
=
nil
_G
[
"c"
..
code
]
=
nil
else
else
_G
[
"c"
..
code
]
=
nil
_G
[
"c"
..
code
]
=
nil
return
false
return
false
end
end
end
end
return
mt
and
mt
.
is_named_with_Rely
return
mt
and
mt
.
is_named_with_Rely
end
end
--ritual effect
--ritual effect
function
c50000205
.
tdcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000205
.
tdcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_RITUAL
)
return
e
:
GetHandler
():
GetSummonType
()
==
SUMMON_TYPE_RITUAL
end
end
function
c50000205
.
filter
(
c
)
function
c50000205
.
filter
(
c
)
return
c
:
GetSummonLocation
()
==
LOCATION_EXTRA
and
c
:
IsAbleToDeck
()
return
c
:
GetSummonLocation
()
==
LOCATION_EXTRA
and
c
:
IsAbleToDeck
()
end
end
function
c50000205
.
tdtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c50000205
.
tdtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c50000205
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c50000205
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
local
g
=
Duel
.
GetMatchingGroup
(
c50000205
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
c50000205
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
g
,
g
:
GetCount
(),
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
g
,
g
:
GetCount
(),
0
,
0
)
end
end
function
c50000205
.
tdop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000205
.
tdop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c50000205
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
c50000205
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
)
if
g
:
GetCount
()
>
0
then
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoDeck
(
g
,
nil
,
0
,
REASON_EFFECT
)
Duel
.
SendtoDeck
(
g
,
nil
,
0
,
REASON_EFFECT
)
end
end
end
end
--tohand
--tohand
function
c50000205
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000205
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
return
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
and
c
:
IsSummonType
(
SUMMON_TYPE_RITUAL
)
return
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
and
c
:
GetSummonType
()
==
SUMMON_TYPE_RITUAL
end
end
function
c50000205
.
thfilter
(
c
)
function
c50000205
.
thfilter
(
c
)
return
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsAbleToHand
()
return
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsAbleToHand
()
end
end
function
c50000205
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c50000205
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c50000205
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c50000205
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
end
function
c50000205
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000205
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c50000205
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c50000205
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
end
end
\ No newline at end of file
expansions/script/c50000206.lua
View file @
cbb95e3a
--灵依法师-解灵
--灵依法师-解灵
function
c50000206
.
initial_effect
(
c
)
function
c50000206
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
c
:
EnableReviveLimit
()
--cannot special summon
--cannot special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e1
:
SetValue
(
aux
.
ritlimit
)
e1
:
SetValue
(
aux
.
ritlimit
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--special summon
--special summon
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
50000206
,
0
))
e2
:
SetDescription
(
aux
.
Stringid
(
50000206
,
0
))
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetCountLimit
(
1
,
50000206
)
e2
:
SetCountLimit
(
1
,
50000206
)
e2
:
SetCondition
(
c50000206
.
thcon
)
e2
:
SetCondition
(
c50000206
.
thcon
)
e2
:
SetTarget
(
c50000206
.
thtg
)
e2
:
SetTarget
(
c50000206
.
thtg
)
e2
:
SetOperation
(
c50000206
.
thop
)
e2
:
SetOperation
(
c50000206
.
thop
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--search
--search
local
e3
=
Effect
.
CreateEffect
(
c
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
50000206
,
1
))
e3
:
SetDescription
(
aux
.
Stringid
(
50000206
,
1
))
e3
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e3
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
500002061
)
e3
:
SetCountLimit
(
1
,
500002061
)
e3
:
SetCondition
(
c50000206
.
secon
)
e3
:
SetCondition
(
c50000206
.
secon
)
e3
:
SetTarget
(
c50000206
.
setg
)
e3
:
SetTarget
(
c50000206
.
setg
)
e3
:
SetOperation
(
c50000206
.
seop
)
e3
:
SetOperation
(
c50000206
.
seop
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
end
end
c50000206
.
is_named_with_Rely
=
1
c50000206
.
is_named_with_Rely
=
1
function
c50000206
.
IsRely
(
c
)
function
c50000206
.
IsRely
(
c
)
local
code
=
c
:
GetCode
()
local
code
=
c
:
GetCode
()
local
mt
=
_G
[
"c"
..
code
]
local
mt
=
_G
[
"c"
..
code
]
if
not
mt
then
if
not
mt
then
_G
[
"c"
..
code
]
=
{}
_G
[
"c"
..
code
]
=
{}
if
pcall
(
function
()
dofile
(
"expansions/script/c"
..
code
..
".lua"
)
end
)
or
pcall
(
function
()
dofile
(
"script/c"
..
code
..
".lua"
)
end
)
then
if
pcall
(
function
()
dofile
(
"expansions/script/c"
..
code
..
".lua"
)
end
)
or
pcall
(
function
()
dofile
(
"script/c"
..
code
..
".lua"
)
end
)
then
mt
=
_G
[
"c"
..
code
]
mt
=
_G
[
"c"
..
code
]
_G
[
"c"
..
code
]
=
nil
_G
[
"c"
..
code
]
=
nil
else
else
_G
[
"c"
..
code
]
=
nil
_G
[
"c"
..
code
]
=
nil
return
false
return
false
end
end
end
end
return
mt
and
mt
.
is_named_with_Rely
return
mt
and
mt
.
is_named_with_Rely
end
end
--ritual effect
--ritual effect
function
c50000206
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000206
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_RITUAL
)
return
e
:
GetHandler
():
GetSummonType
()
==
SUMMON_TYPE_RITUAL
end
end
function
c50000206
.
filter
(
c
)
function
c50000206
.
filter
(
c
)
return
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsAbleToHand
()
return
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsAbleToHand
()
end
end
function
c50000206
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c50000206
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c50000206
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
c
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c50000206
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
c
)
end
local
sg
=
Duel
.
GetMatchingGroup
(
c50000206
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
c
)
local
sg
=
Duel
.
GetMatchingGroup
(
c50000206
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
c
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
sg
,
sg
:
GetCount
(),
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
sg
,
sg
:
GetCount
(),
0
,
0
)
end
end
function
c50000206
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000206
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
sg
=
Duel
.
GetMatchingGroup
(
c50000206
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
local
sg
=
Duel
.
GetMatchingGroup
(
c50000206
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
Duel
.
SendtoHand
(
sg
,
nil
,
REASON_EFFECT
)
Duel
.
SendtoHand
(
sg
,
nil
,
REASON_EFFECT
)
end
end
--tohand
--tohand
function
c50000206
.
secon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000206
.
secon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
return
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
and
c
:
IsSummonType
(
SUMMON_TYPE_RITUAL
)
return
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
and
c
:
GetSummonType
()
==
SUMMON_TYPE_RITUAL
end
end
function
c50000206
.
sefilter
(
c
)
function
c50000206
.
sefilter
(
c
)
return
c
:
IsType
(
TYPE_SPELL
)
and
c50000206
.
IsRely
(
c
)
and
c
:
IsAbleToHand
()
return
c
:
IsType
(
TYPE_SPELL
)
and
c50000206
.
IsRely
(
c
)
and
c
:
IsAbleToHand
()
end
end
function
c50000206
.
setg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c50000206
.
setg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c50000206
.
sefilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c50000206
.
sefilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
end
function
c50000206
.
seop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000206
.
seop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c50000206
.
sefilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c50000206
.
sefilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
end
end
\ No newline at end of file
expansions/script/c50000207.lua
View file @
cbb95e3a
--灵依法师-涂灵
--灵依法师-涂灵
function
c50000207
.
initial_effect
(
c
)
function
c50000207
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
c
:
EnableReviveLimit
()
--cannot special summon
--cannot special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e1
:
SetValue
(
aux
.
ritlimit
)
e1
:
SetValue
(
aux
.
ritlimit
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--special summon
--special summon
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
50000207
,
0
))
e2
:
SetDescription
(
aux
.
Stringid
(
50000207
,
0
))
e2
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_DAMAGE
)
e2
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_DAMAGE
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetCountLimit
(
1
,
50000207
)
e2
:
SetCountLimit
(
1
,
50000207
)
e2
:
SetCondition
(
c50000207
.
tdcon
)
e2
:
SetCondition
(
c50000207
.
tdcon
)
e2
:
SetTarget
(
c50000207
.
tdtg
)
e2
:
SetTarget
(
c50000207
.
tdtg
)
e2
:
SetOperation
(
c50000207
.
tdop
)
e2
:
SetOperation
(
c50000207
.
tdop
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--search or sp
--search or sp
local
e3
=
Effect
.
CreateEffect
(
c
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
50000207
,
1
))
e3
:
SetDescription
(
aux
.
Stringid
(
50000207
,
1
))
e3
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
+
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
+
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCondition
(
c50000207
.
con
)
e3
:
SetCondition
(
c50000207
.
con
)
e3
:
SetCountLimit
(
1
,
500002071
)
e3
:
SetCountLimit
(
1
,
500002071
)
e3
:
SetTarget
(
c50000207
.
tg
)
e3
:
SetTarget
(
c50000207
.
tg
)
e3
:
SetOperation
(
c50000207
.
op
)
e3
:
SetOperation
(
c50000207
.
op
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
--immune
--immune
local
e4
=
Effect
.
CreateEffect
(
c
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
)
e4
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e4
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e4
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e4
:
SetValue
(
c50000207
.
efilter
)
e4
:
SetValue
(
c50000207
.
efilter
)
c
:
RegisterEffect
(
e4
)
c
:
RegisterEffect
(
e4
)
--indes
--indes
local
e5
=
Effect
.
CreateEffect
(
c
)
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetType
(
EFFECT_TYPE_SINGLE
)
e5
:
SetType
(
EFFECT_TYPE_SINGLE
)
e5
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e5
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e5
:
SetValue
(
c50000207
.
indval
)
e5
:
SetValue
(
c50000207
.
indval
)
c
:
RegisterEffect
(
e5
)
c
:
RegisterEffect
(
e5
)
end
end
c50000207
.
is_named_with_Rely
=
1
c50000207
.
is_named_with_Rely
=
1
function
c50000207
.
IsRely
(
c
)
function
c50000207
.
IsRely
(
c
)
local
code
=
c
:
GetCode
()
local
code
=
c
:
GetCode
()
local
mt
=
_G
[
"c"
..
code
]
local
mt
=
_G
[
"c"
..
code
]
if
not
mt
then
if
not
mt
then
_G
[
"c"
..
code
]
=
{}
_G
[
"c"
..
code
]
=
{}
if
pcall
(
function
()
dofile
(
"expansions/script/c"
..
code
..
".lua"
)
end
)
or
pcall
(
function
()
dofile
(
"script/c"
..
code
..
".lua"
)
end
)
then
if
pcall
(
function
()
dofile
(
"expansions/script/c"
..
code
..
".lua"
)
end
)
or
pcall
(
function
()
dofile
(
"script/c"
..
code
..
".lua"
)
end
)
then
mt
=
_G
[
"c"
..
code
]
mt
=
_G
[
"c"
..
code
]
_G
[
"c"
..
code
]
=
nil
_G
[
"c"
..
code
]
=
nil
else
else
_G
[
"c"
..
code
]
=
nil
_G
[
"c"
..
code
]
=
nil
return
false
return
false
end
end
end
end
return
mt
and
mt
.
is_named_with_Rely
return
mt
and
mt
.
is_named_with_Rely
end
end
--ritual effect
--ritual effect
function
c50000207
.
tdcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000207
.
tdcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_RITUAL
)
return
e
:
GetHandler
():
GetSummonType
()
==
SUMMON_TYPE_RITUAL
end
end
function
c50000207
.
filter
(
c
)
function
c50000207
.
filter
1
(
c
)
return
c
:
IsSummonType
(
SUMMON_TYPE_SPECIAL
)
and
c
:
IsAbleToDeck
()
return
c
:
GetSummonType
()
==
SUMMON_TYPE_SPECIAL
and
c
:
IsAbleToDeck
()
end
end
function
c50000207
.
tdtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c50000207
.
tdtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c50000207
.
filter
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c50000207
.
filter1
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
local
g
=
Duel
.
GetMatchingGroup
(
c50000207
.
filter
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
c50000207
.
filter1
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
g
,
g
:
GetCount
(),
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
g
,
g
:
GetCount
(),
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DAMAGE
,
nil
,
0
,
1
-
tp
,
1500
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DAMAGE
,
nil
,
0
,
1
-
tp
,
1500
)
end
end
function
c50000207
.
tdop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000207
.
tdop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c50000207
.
filter
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
c50000207
.
filter1
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
if
g
:
GetCount
()
>
0
then
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoDeck
(
g
,
nil
,
0
,
REASON_EFFECT
)
Duel
.
SendtoDeck
(
g
,
nil
,
3
,
REASON_EFFECT
)
Duel
.
BreakEffect
()
Duel
.
BreakEffect
()
Duel
.
Damage
(
1
-
tp
,
1500
,
REASON_EFFECT
)
Duel
.
Damage
(
1
-
tp
,
1500
,
REASON_EFFECT
)
end
end
end
end
--se or sp
--se or sp
function
c50000207
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000207
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
return
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
and
c
:
IsSummonType
(
SUMMON_TYPE_RITUAL
)
return
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
and
c
:
GetSummonType
()
==
SUMMON_TYPE_RITUAL
end
end
function
c50000207
.
filter
(
c
,
ft
,
e
,
tp
)
function
c50000207
.
filter
(
c
,
ft
,
e
,
tp
)
return
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
(
c
:
IsAbleToHand
()
or
(
ft
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)))
return
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
(
c
:
IsAbleToHand
()
or
(
ft
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)))
end
end
function
c50000207
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c50000207
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
chk
==
0
then
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
return
Duel
.
IsExistingMatchingCard
(
c50000207
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
ft
,
e
,
tp
)
return
Duel
.
IsExistingMatchingCard
(
c50000207
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
ft
,
e
,
tp
)
end
end
end
end
function
c50000207
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000207
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
0
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
0
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c50000207
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
ft
,
e
,
tp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c50000207
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
ft
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
if
g
:
GetCount
()
>
0
then
local
th
=
g
:
GetFirst
():
IsAbleToHand
()
local
th
=
g
:
GetFirst
():
IsAbleToHand
()
local
sp
=
ft
>
0
and
g
:
GetFirst
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
local
sp
=
ft
>
0
and
g
:
GetFirst
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
local
op
=
0
local
op
=
0
if
th
and
sp
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
50000207
,
2
),
aux
.
Stringid
(
50000207
,
3
))
if
th
and
sp
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
50000207
,
2
),
aux
.
Stringid
(
50000207
,
3
))
elseif
th
then
op
=
0
elseif
th
then
op
=
0
else
op
=
1
end
else
op
=
1
end
if
op
==
0
then
if
op
==
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
else
else
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
end
end
end
end
--
--
function
c50000207
.
indval
(
e
,
c
)
function
c50000207
.
indval
(
e
,
c
)
return
c
:
GetSummonLocation
()
==
LOCATION_EXTRA
return
c
:
GetSummonLocation
()
==
LOCATION_EXTRA
end
end
function
c50000207
.
efilter
(
e
,
te
)
function
c50000207
.
efilter
(
e
,
te
)
return
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetHandler
():
GetSummonLocation
()
==
LOCATION_EXTRA
return
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetHandler
():
GetSummonLocation
()
==
LOCATION_EXTRA
end
end
\ No newline at end of file
expansions/script/c50000208.lua
View file @
cbb95e3a
--灵依魔法·唤灵
--灵依魔法·唤灵
function
c50000208
.
initial_effect
(
c
)
function
c50000208
.
initial_effect
(
c
)
--activate
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_FUSION_SUMMON
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_FUSION_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCondition
(
c50000208
.
condition
)
e1
:
SetCondition
(
c50000208
.
condition
)
e1
:
SetCost
(
c50000208
.
cost
)
e1
:
SetCost
(
c50000208
.
cost
)
e1
:
SetTarget
(
c50000208
.
target
)
e1
:
SetTarget
(
c50000208
.
target
)
e1
:
SetOperation
(
c50000208
.
activate
)
e1
:
SetOperation
(
c50000208
.
activate
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
c50000208
.
is_named_with_Rely
=
1
c50000208
.
is_named_with_Rely
=
1
function
c50000208
.
IsRely
(
c
)
function
c50000208
.
IsRely
(
c
)
local
code
=
c
:
GetCode
()
local
code
=
c
:
GetCode
()
local
mt
=
_G
[
"c"
..
code
]
local
mt
=
_G
[
"c"
..
code
]
if
not
mt
then
if
not
mt
then
_G
[
"c"
..
code
]
=
{}
_G
[
"c"
..
code
]
=
{}
if
pcall
(
function
()
dofile
(
"expansions/script/c"
..
code
..
".lua"
)
end
)
or
pcall
(
function
()
dofile
(
"script/c"
..
code
..
".lua"
)
end
)
then
if
pcall
(
function
()
dofile
(
"expansions/script/c"
..
code
..
".lua"
)
end
)
or
pcall
(
function
()
dofile
(
"script/c"
..
code
..
".lua"
)
end
)
then
mt
=
_G
[
"c"
..
code
]
mt
=
_G
[
"c"
..
code
]
_G
[
"c"
..
code
]
=
nil
_G
[
"c"
..
code
]
=
nil
else
else
_G
[
"c"
..
code
]
=
nil
_G
[
"c"
..
code
]
=
nil
return
false
return
false
end
end
end
end
return
mt
and
mt
.
is_named_with_Rely
return
mt
and
mt
.
is_named_with_Rely
end
end
function
c50000208
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000208
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_MZONE
,
0
)
==
0
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_MZONE
,
0
)
==
0
end
end
function
c50000208
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c50000208
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetActivityCount
(
tp
,
ACTIVITY_SUMMON
)
==
0
and
Duel
.
GetActivityCount
(
tp
,
ACTIVITY_SPSUMMON
)
==
0
end
if
chk
==
0
then
return
Duel
.
GetActivityCount
(
tp
,
ACTIVITY_SUMMON
)
==
0
and
Duel
.
GetActivityCount
(
tp
,
ACTIVITY_SPSUMMON
)
==
0
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_SUMMON
)
e1
:
SetCode
(
EFFECT_CANNOT_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_OATH
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_OATH
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
e1
:
Clone
()
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e2
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e2
:
SetLabelObject
(
e
)
e2
:
SetLabelObject
(
e
)
e2
:
SetTarget
(
c50000208
.
splimit
)
e2
:
SetTarget
(
c50000208
.
splimit
)
Duel
.
RegisterEffect
(
e2
,
tp
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
end
function
c50000208
.
splimit
(
e
,
c
,
sump
,
sumtype
,
sumpos
,
targetp
,
se
)
function
c50000208
.
splimit
(
e
,
c
,
sump
,
sumtype
,
sumpos
,
targetp
,
se
)
return
se
~=
e
:
GetLabelObject
()
return
se
~=
e
:
GetLabelObject
()
end
end
function
c50000208
.
filter
(
c
,
e
,
tp
)
function
c50000208
.
filter
(
c
,
e
,
tp
)
return
c
:
IsType
(
TYPE_RITUAL
)
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_RITUAL
,
tp
,
true
,
true
)
return
c
:
IsType
(
TYPE_RITUAL
)
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_RITUAL
,
tp
,
true
,
true
)
end
end
function
c50000208
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c50000208
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c50000208
.
filter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
and
Duel
.
IsExistingMatchingCard
(
c50000208
.
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
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
)
end
end
function
c50000208
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000208
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
c50000208
.
filter
),
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
c50000208
.
filter
),
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
tc
=
g
:
GetFirst
()
local
tc
=
g
:
GetFirst
()
if
not
tc
then
return
end
if
not
tc
then
return
end
if
Duel
.
SpecialSummon
(
g
,
SUMMON_TYPE_RITUAL
,
tp
,
tp
,
true
,
true
,
POS_FACEUP
)
~=
0
then
if
Duel
.
SpecialSummon
(
g
,
SUMMON_TYPE_RITUAL
,
tp
,
tp
,
true
,
true
,
POS_FACEUP
)
~=
0
then
tc
:
RegisterFlagEffect
(
50000208
,
RESET_EVENT
+
0x1fe0000
,
0
,
1
)
tc
:
RegisterFlagEffect
(
50000208
,
RESET_EVENT
+
0x1fe0000
,
0
,
1
)
tc
:
CompleteProcedure
()
tc
:
CompleteProcedure
()
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e2
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCountLimit
(
1
)
e2
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
)
e2
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
)
e2
:
SetLabelObject
(
tc
)
e2
:
SetLabelObject
(
tc
)
e2
:
SetCondition
(
c50000208
.
descon
)
e2
:
SetCondition
(
c50000208
.
descon
)
e2
:
SetOperation
(
c50000208
.
desop
)
e2
:
SetOperation
(
c50000208
.
desop
)
Duel
.
RegisterEffect
(
e2
,
tp
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
end
end
end
function
c50000208
.
descon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000208
.
descon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
local
tc
=
e
:
GetLabelObject
()
if
tc
:
GetFlagEffect
(
50000208
)
~=
0
then
if
tc
:
GetFlagEffect
(
50000208
)
~=
0
then
return
true
return
true
else
else
e
:
Reset
()
e
:
Reset
()
return
false
return
false
end
end
end
end
function
c50000208
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50000208
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
local
tc
=
e
:
GetLabelObject
()
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c50000209.lua
0 → 100644
View file @
cbb95e3a
--灵依法师-灵璇
local
m
=
50000209
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--pendulum summon
aux
.
EnablePendulumAttribute
(
c
)
--tohand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_DRAW
)
e1
:
SetType
(
EFFECT_TYPE_TRIGGER_O
+
EFFECT_TYPE_FIELD
)
e1
:
SetDescription
(
aux
.
Stringid
(
50000209
,
0
))
e1
:
SetCode
(
EVENT_TO_DECK
)
e1
:
SetRange
(
LOCATION_PZONE
)
e1
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCondition
(
c50000209
.
drcon
)
e1
:
SetTarget
(
c50000209
.
drtg
)
e1
:
SetOperation
(
c50000209
.
drop
)
c
:
RegisterEffect
(
e1
)
--search
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
50000209
,
1
))
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_PZONE
)
e2
:
SetCountLimit
(
1
,
50000209
)
e2
:
SetCost
(
c50000209
.
cost
)
e2
:
SetTarget
(
c50000209
.
thtg
)
e2
:
SetOperation
(
c50000209
.
thop
)
c
:
RegisterEffect
(
e2
)
--ritual level
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_RITUAL_LEVEL
)
e3
:
SetValue
(
c50000209
.
rlevel
)
c
:
RegisterEffect
(
e3
)
--Remove
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetCategory
(
CATEGORY_TOHAND
)
e4
:
SetDescription
(
aux
.
Stringid
(
50000209
,
2
))
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetCode
(
EVENT_RELEASE
)
e4
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e4
:
SetCountLimit
(
1
,
500002091
)
e4
:
SetTarget
(
c50000209
.
thtg1
)
e4
:
SetOperation
(
c50000209
.
thop1
)
c
:
RegisterEffect
(
e4
)
end
c50000209
.
is_named_with_Rely
=
1
function
c50000209
.
IsRely
(
c
)
local
code
=
c
:
GetCode
()
local
mt
=
_G
[
"c"
..
code
]
if
not
mt
then
_G
[
"c"
..
code
]
=
{}
if
pcall
(
function
()
dofile
(
"expansions/script/c"
..
code
..
".lua"
)
end
)
or
pcall
(
function
()
dofile
(
"script/c"
..
code
..
".lua"
)
end
)
then
mt
=
_G
[
"c"
..
code
]
_G
[
"c"
..
code
]
=
nil
else
_G
[
"c"
..
code
]
=
nil
return
false
end
end
return
mt
and
mt
.
is_named_with_Rely
end
function
c50000209
.
drfilter
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsControler
(
tp
)
and
c
:
IsLocation
(
LOCATION_EXTRA
)
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsPreviousLocation
(
LOCATION_ONFIELD
)
end
function
c50000209
.
drcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c50000209
.
drfilter
,
1
,
nil
,
tp
)
end
function
c50000209
.
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
c50000209
.
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
---
function
c50000209
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
end
function
c50000209
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckReleaseGroup
(
tp
,
c50000209
.
cfilter
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
local
g
=
Duel
.
SelectReleaseGroup
(
tp
,
c50000209
.
cfilter
,
1
,
1
,
nil
)
Duel
.
Release
(
g
,
REASON_COST
)
end
function
c50000209
.
filter
(
c
)
return
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsAbleToHand
()
end
function
c50000209
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
c50000209
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c50000209
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c50000209
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
0
)
end
function
c50000209
.
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
--ritual level
function
c50000209
.
rlevel
(
e
,
c
)
local
lv
=
e
:
GetHandler
():
GetLevel
()
if
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsRace
(
RACE_SPELLCASTER
)
then
local
clv
=
c
:
GetLevel
()
return
lv
*
65536
+
clv
else
return
lv
end
end
---
function
c50000209
.
thfilter
(
c
)
return
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c50000209
.
IsRely
(
c
)
and
c
:
IsAbleToHand
()
end
function
c50000209
.
thtg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
c50000209
.
thfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c50000209
.
thfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c50000209
.
thfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
0
)
end
function
c50000209
.
thop1
(
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
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