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
Soulgamer
ygopro-222DIY-cards
Commits
6c72c127
Commit
6c72c127
authored
Sep 06, 2023
by
Huangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update pre 0906
parent
1cdf9bc3
Changes
48
Hide whitespace changes
Inline
Side-by-side
Showing
48 changed files
with
1985 additions
and
1299 deletions
+1985
-1299
expansions/222pre-AOGV.cdb
expansions/222pre-AOGV.cdb
+0
-0
expansions/222pre-DBVS.cdb
expansions/222pre-DBVS.cdb
+0
-0
expansions/222pre.cdb
expansions/222pre.cdb
+0
-0
expansions/script/c100200242.lua
expansions/script/c100200242.lua
+1
-1
expansions/script/c100314001.lua
expansions/script/c100314001.lua
+84
-0
expansions/script/c100314002.lua
expansions/script/c100314002.lua
+1
-1
expansions/script/c100314003.lua
expansions/script/c100314003.lua
+69
-0
expansions/script/c100314024.lua
expansions/script/c100314024.lua
+102
-0
expansions/script/c100314025.lua
expansions/script/c100314025.lua
+62
-0
expansions/script/c100314033.lua
expansions/script/c100314033.lua
+122
-0
expansions/script/c100314051.lua
expansions/script/c100314051.lua
+2
-2
expansions/script/c100421003.lua
expansions/script/c100421003.lua
+7
-3
expansions/script/c100421004.lua
expansions/script/c100421004.lua
+42
-48
expansions/script/c100421005.lua
expansions/script/c100421005.lua
+3
-3
expansions/script/c100421008.lua
expansions/script/c100421008.lua
+3
-2
expansions/script/c100421009.lua
expansions/script/c100421009.lua
+3
-3
expansions/script/c100421010.lua
expansions/script/c100421010.lua
+2
-2
expansions/script/c100421011.lua
expansions/script/c100421011.lua
+5
-4
expansions/script/c100421012.lua
expansions/script/c100421012.lua
+2
-2
expansions/script/c100421016.lua
expansions/script/c100421016.lua
+48
-44
expansions/script/c100421017.lua
expansions/script/c100421017.lua
+73
-64
expansions/script/c100421018.lua
expansions/script/c100421018.lua
+49
-43
expansions/script/c100421019.lua
expansions/script/c100421019.lua
+56
-43
expansions/script/c100421020.lua
expansions/script/c100421020.lua
+88
-69
expansions/script/c100421021.lua
expansions/script/c100421021.lua
+83
-0
expansions/script/c100421022.lua
expansions/script/c100421022.lua
+52
-46
expansions/script/c100421023.lua
expansions/script/c100421023.lua
+53
-46
expansions/script/c100421024.lua
expansions/script/c100421024.lua
+23
-23
expansions/script/c100421031.lua
expansions/script/c100421031.lua
+74
-63
expansions/script/c100421032.lua
expansions/script/c100421032.lua
+63
-50
expansions/script/c100421033.lua
expansions/script/c100421033.lua
+78
-63
expansions/script/c100421034.lua
expansions/script/c100421034.lua
+90
-59
expansions/script/c100421035.lua
expansions/script/c100421035.lua
+29
-30
expansions/script/c100421036.lua
expansions/script/c100421036.lua
+46
-0
expansions/script/c100421037.lua
expansions/script/c100421037.lua
+39
-38
expansions/script/c100421038.lua
expansions/script/c100421038.lua
+22
-33
expansions/script/c100421039.lua
expansions/script/c100421039.lua
+26
-42
expansions/script/c100421040.lua
expansions/script/c100421040.lua
+47
-72
expansions/script/c101201084.lua
expansions/script/c101201084.lua
+1
-0
expansions/script/c101201086.lua
expansions/script/c101201086.lua
+1
-1
expansions/script/c101203001.lua
expansions/script/c101203001.lua
+37
-39
expansions/script/c101203002.lua
expansions/script/c101203002.lua
+56
-57
expansions/script/c101203003.lua
expansions/script/c101203003.lua
+59
-39
expansions/script/c101203038.lua
expansions/script/c101203038.lua
+49
-59
expansions/script/c101203054.lua
expansions/script/c101203054.lua
+49
-41
expansions/script/c101203055.lua
expansions/script/c101203055.lua
+104
-97
expansions/script/c101203073.lua
expansions/script/c101203073.lua
+76
-66
expansions/strings.conf
expansions/strings.conf
+4
-1
No files found.
expansions/222pre-AOGV.cdb
View file @
6c72c127
No preview for this file type
expansions/222pre-DBVS.cdb
0 → 100644
View file @
6c72c127
File added
expansions/222pre.cdb
View file @
6c72c127
No preview for this file type
expansions/script/c100200242.lua
View file @
6c72c127
...
@@ -83,4 +83,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp)
...
@@ -83,4 +83,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp)
local
tg
=
g
:
Filter
(
s
.
desfilter
,
nil
,
e
:
GetLabel
())
local
tg
=
g
:
Filter
(
s
.
desfilter
,
nil
,
e
:
GetLabel
())
Duel
.
Destroy
(
tg
,
REASON_EFFECT
)
Duel
.
Destroy
(
tg
,
REASON_EFFECT
)
--end snip 1
--end snip 1
end
end
\ No newline at end of file
expansions/script/c100314001.lua
0 → 100644
View file @
6c72c127
--聖炎王 ガルドニクス
--Script by mercury233
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
local
e0
=
aux
.
AddThisCardInGraveAlreadyCheck
(
c
)
--special summon
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
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
)
e1
:
SetCode
(
EVENT_DESTROYED
)
e1
:
SetRange
(
LOCATION_HAND
+
LOCATION_GRAVE
)
e1
:
SetLabelObject
(
e0
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCondition
(
s
.
spcon
)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
--destroy
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_ATKCHANGE
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetTarget
(
s
.
destg
)
e2
:
SetOperation
(
s
.
desop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
cfilter
(
c
,
tp
,
se
)
return
c
:
IsControler
(
tp
)
and
c
:
IsPreviousControler
(
tp
)
and
c
:
GetOriginalAttribute
()
==
ATTRIBUTE_FIRE
and
c
:
IsReason
(
REASON_BATTLE
+
REASON_EFFECT
)
and
(
se
==
nil
or
c
:
GetReasonEffect
()
~=
se
)
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
se
=
e
:
GetLabelObject
():
GetLabelObject
()
if
c
:
IsLocation
(
LOCATION_HAND
)
then
se
=
nil
end
return
eg
:
IsExists
(
s
.
cfilter
,
1
,
c
,
tp
,
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
end
function
s
.
desfilter
(
c
)
return
c
:
IsFaceupEx
()
and
not
c
:
IsCode
(
id
)
and
c
:
IsRace
(
RACE_BEAST
+
RACE_BEASTWARRIOR
+
RACE_WINDBEAST
)
and
c
:
IsAttribute
(
ATTRIBUTE_FIRE
)
end
function
s
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
desfilter
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
+
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
+
LOCATION_DECK
)
end
function
s
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
desfilter
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
+
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
if
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
>
0
then
local
tc
=
g
:
GetFirst
()
local
atk
=
tc
:
GetAttack
()
local
c
=
e
:
GetHandler
()
if
c
:
IsFaceup
()
and
c
:
IsRelateToEffect
(
e
)
and
atk
>
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
atk
//
2
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_DISABLE
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
end
end
end
end
expansions/script/c100314002.lua
View file @
6c72c127
...
@@ -64,7 +64,7 @@ end
...
@@ -64,7 +64,7 @@ end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
sfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
sfilter
)
,
tp
,
LOCATION_GRAVE
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
<
1
if
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
<
1
or
not
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
2
))
then
return
end
or
not
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
2
))
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
...
...
expansions/script/c100314003.lua
0 → 100644
View file @
6c72c127
--炎王獣 ハヌマーン
--Script by beyond
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
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
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCode
(
EVENT_DESTROYED
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCondition
(
s
.
spcon
)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
--negate
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_NEGATE
+
CATEGORY_DESTROY
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
id
+
id
)
e2
:
SetCondition
(
s
.
negcon
)
e2
:
SetTarget
(
s
.
negtg
)
e2
:
SetOperation
(
s
.
negop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
cfilter
(
c
,
tp
)
return
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
and
c
:
IsPreviousPosition
(
POS_FACEUP
)
and
c
:
IsPreviousControler
(
tp
)
and
c
:
IsReason
(
REASON_EFFECT
)
and
c
:
IsSetCard
(
0x81
)
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
s
.
cfilter
,
1
,
nil
,
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
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
function
s
.
negcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
rc
=
re
:
GetHandler
()
return
re
:
IsActiveType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
not
c
:
IsStatus
(
STATUS_BATTLE_DESTROYED
)
and
Duel
.
IsChainNegatable
(
ev
)
end
function
s
.
desfilter
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAttribute
(
ATTRIBUTE_FIRE
)
end
function
s
.
negtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
desfilter
,
tp
,
LOCATION_MZONE
+
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_NEGATE
,
eg
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
nil
,
1
,
tp
,
LOCATION_MZONE
+
LOCATION_HAND
)
end
function
s
.
negop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
NegateActivation
(
ev
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
desfilter
,
tp
,
LOCATION_MZONE
+
LOCATION_HAND
,
0
,
1
,
1
,
e
:
GetHandler
())
if
g
:
GetCount
()
>
0
then
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
end
end
\ No newline at end of file
expansions/script/c100314024.lua
0 → 100644
View file @
6c72c127
--炎王の聖域
--Script by beyond
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
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_DESTROY_REPLACE
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetTarget
(
s
.
desreptg
)
e2
:
SetValue
(
s
.
desrepval
)
e2
:
SetOperation
(
s
.
desrepop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetCountLimit
(
1
)
e3
:
SetCondition
(
s
.
spcon
)
e3
:
SetTarget
(
s
.
sptg
)
e3
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
stfilter
(
c
,
tp
)
return
c
:
IsCode
(
57554544
)
and
not
c
:
IsForbidden
()
and
c
:
CheckUniqueOnField
(
tp
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
stfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
g
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
0
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
stfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
tp
):
GetFirst
()
if
tc
then
local
fc
=
Duel
.
GetFieldCard
(
tp
,
LOCATION_SZONE
,
5
)
if
fc
then
Duel
.
SendtoGrave
(
fc
,
REASON_RULE
)
Duel
.
BreakEffect
()
end
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_FZONE
,
POS_FACEUP
,
true
)
end
end
end
function
s
.
repfilter
(
c
,
tp
)
return
c
:
IsControler
(
tp
)
and
c
:
IsOnField
()
and
c
:
IsLocation
(
LOCATION_FZONE
)
and
c
:
IsReason
(
REASON_EFFECT
)
and
not
c
:
IsReason
(
REASON_REPLACE
)
end
function
s
.
desfilter
(
c
,
e
,
tp
)
return
c
:
IsControler
(
tp
)
and
(
c
:
IsLocation
(
LOCATION_HAND
)
or
c
:
IsFaceup
())
and
c
:
IsAttribute
(
ATTRIBUTE_FIRE
)
and
c
:
IsDestructable
(
e
)
and
not
c
:
IsStatus
(
STATUS_DESTROY_CONFIRMED
+
STATUS_BATTLE_DESTROYED
)
end
function
s
.
desreptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
eg
:
IsExists
(
s
.
repfilter
,
1
,
nil
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
s
.
desfilter
,
tp
,
LOCATION_MZONE
+
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
end
if
Duel
.
SelectEffectYesNo
(
tp
,
e
:
GetHandler
(),
96
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESREPLACE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
desfilter
,
tp
,
LOCATION_MZONE
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
e
:
SetLabelObject
(
g
:
GetFirst
())
g
:
GetFirst
():
SetStatus
(
STATUS_DESTROY_CONFIRMED
,
true
)
return
true
end
return
false
end
function
s
.
desrepval
(
e
,
c
)
return
s
.
repfilter
(
c
,
e
:
GetHandlerPlayer
())
end
function
s
.
desrepop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_CARD
,
0
,
id
)
local
tc
=
e
:
GetLabelObject
()
tc
:
SetStatus
(
STATUS_DESTROY_CONFIRMED
,
false
)
Duel
.
Destroy
(
tc
,
REASON_EFFECT
+
REASON_REPLACE
)
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
Card
.
IsSummonPlayer
,
1
,
nil
,
1
-
tp
)
end
function
s
.
mfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x81
)
and
not
c
:
IsType
(
TYPE_TOKEN
)
end
function
s
.
xyzfilter
(
c
,
mg
)
return
c
:
IsAttribute
(
ATTRIBUTE_FIRE
)
and
c
:
IsXyzSummonable
(
mg
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
g
=
Duel
.
GetMatchingGroup
(
s
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
return
Duel
.
IsExistingMatchingCard
(
s
.
xyzfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
g
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
xyzg
=
Duel
.
GetMatchingGroup
(
s
.
xyzfilter
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
g
)
if
xyzg
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
xyz
=
xyzg
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
XyzSummon
(
tp
,
xyz
,
g
,
1
,
5
)
end
end
\ No newline at end of file
expansions/script/c100314025.lua
0 → 100644
View file @
6c72c127
--炎王神天焼
--Script by beyond
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EFFECT_DESTROY_REPLACE
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetTarget
(
s
.
reptg
)
e2
:
SetValue
(
s
.
repval
)
e2
:
SetOperation
(
s
.
repop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
filter
(
c
,
e
)
return
c
:
IsSetCard
(
0x81
)
and
c
:
IsFaceup
()
and
c
:
IsCanBeEffectTarget
(
e
)
end
function
s
.
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
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
and
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
e
)
end
local
ct1
=
Duel
.
GetMatchingGroupCount
(
s
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
nil
,
e
)
local
ct2
=
Duel
.
GetMatchingGroupCount
(
Card
.
IsCanBeEffectTarget
,
tp
,
0
,
LOCATION_ONFIELD
,
nil
,
e
)
local
mc
=
math.min
(
ct1
,
ct2
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g1
=
Duel
.
SelectTarget
(
tp
,
s
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
mc
,
nil
,
e
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g2
=
Duel
.
SelectTarget
(
tp
,
aux
.
TRUE
,
tp
,
0
,
LOCATION_ONFIELD
,
#
g1
,
#
g1
,
nil
)
g1
:
Merge
(
g2
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g1
,
#
g1
,
0
,
0
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
)
local
sg
=
g
:
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
if
sg
:
GetCount
()
>
0
then
Duel
.
Destroy
(
sg
,
REASON_EFFECT
)
end
end
function
s
.
repfilter
(
c
,
tp
)
return
not
c
:
IsReason
(
REASON_REPLACE
)
and
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x81
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
and
c
:
IsControler
(
tp
)
and
c
:
IsReason
(
REASON_EFFECT
)
end
function
s
.
reptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToRemove
()
and
eg
:
IsExists
(
s
.
repfilter
,
1
,
nil
,
tp
)
end
return
Duel
.
SelectEffectYesNo
(
tp
,
e
:
GetHandler
(),
96
)
end
function
s
.
repval
(
e
,
c
)
return
s
.
repfilter
(
c
,
e
:
GetHandlerPlayer
())
end
function
s
.
repop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Remove
(
e
:
GetHandler
(),
POS_FACEUP
,
REASON_EFFECT
+
REASON_REPLACE
)
end
expansions/script/c100314033.lua
0 → 100644
View file @
6c72c127
--炎王の結襲
--Script by beyond
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
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
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
id
+
id
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetOperation
(
s
.
operation
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
filter0
(
c
,
e
,
tp
)
return
c
:
IsAttribute
(
ATTRIBUTE_FIRE
)
and
c
:
IsRace
(
RACE_BEAST
+
RACE_BEASTWARRIOR
+
RACE_WINDBEAST
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
Duel
.
IsExistingMatchingCard
(
s
.
filter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
,
c
:
GetRace
())
end
function
s
.
filter1
(
c
,
e
,
tp
,
race1
)
return
c
:
IsAttribute
(
ATTRIBUTE_FIRE
)
and
c
:
IsRace
(
RACE_BEAST
+
RACE_BEASTWARRIOR
+
RACE_WINDBEAST
)
and
not
c
:
IsRace
(
race1
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
Duel
.
IsExistingMatchingCard
(
s
.
filter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
,
c
:
GetRace
(),
race1
)
end
function
s
.
filter2
(
c
,
e
,
tp
,
race1
,
race2
)
return
c
:
IsAttribute
(
ATTRIBUTE_FIRE
)
and
c
:
IsRace
(
RACE_BEAST
+
RACE_BEASTWARRIOR
+
RACE_WINDBEAST
)
and
not
c
:
IsRace
(
race1
)
and
not
c
:
IsRace
(
race2
)
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
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
59822133
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
2
and
Duel
.
IsExistingMatchingCard
(
s
.
filter0
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
+
LOCATION_GRAVE
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
59822133
)
then
return
end
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<
3
then
return
end
local
g1
=
Duel
.
GetMatchingGroup
(
aux
.
NecroValleyFilter
(
s
.
filter0
),
tp
,
LOCATION_GRAVE
,
0
,
nil
,
e
,
tp
)
if
g1
:
GetCount
()
==
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg1
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
filter0
),
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
tc1
=
sg1
:
GetFirst
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg2
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter1
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
,
tc1
:
GetRace
())
local
tc2
=
sg2
:
GetFirst
()
sg1
:
Merge
(
sg2
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg3
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
tc1
:
GetRace
(),
tc2
:
GetRace
())
sg1
:
Merge
(
sg3
)
local
fid
=
c
:
GetFieldID
()
local
tc
=
sg1
:
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
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
)
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
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetValue
(
RESET_TURN_SET
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e2
,
true
)
tc
:
RegisterFlagEffect
(
id
,
RESET_EVENT
+
RESETS_STANDARD
,
0
,
1
,
fid
)
tc
=
sg1
:
GetNext
()
end
Duel
.
SpecialSummonComplete
()
sg1
:
KeepAlive
()
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e3
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetLabel
(
fid
)
e3
:
SetLabelObject
(
sg1
)
e3
:
SetCondition
(
s
.
descon
)
e3
:
SetOperation
(
s
.
desop
)
Duel
.
RegisterEffect
(
e3
,
tp
)
end
function
s
.
desfilter
(
c
,
fid
)
return
c
:
GetFlagEffectLabel
(
id
)
==
fid
end
function
s
.
descon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
e
:
GetLabelObject
()
if
not
g
:
IsExists
(
s
.
desfilter
,
1
,
nil
,
e
:
GetLabel
())
then
g
:
DeleteGroup
()
e
:
Reset
()
return
false
else
return
true
end
end
function
s
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
e
:
GetLabelObject
()
local
tg
=
g
:
Filter
(
s
.
desfilter
,
nil
,
e
:
GetLabel
())
Duel
.
Destroy
(
tg
,
REASON_EFFECT
)
end
function
s
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCondition
(
s
.
sumcon
)
e1
:
SetOperation
(
s
.
sumsuc
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
s
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0xb3
)
end
function
s
.
sumcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
s
.
filter
,
1
,
nil
)
end
function
s
.
sumsuc
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
SetChainLimitTillChainEnd
(
s
.
efun
)
end
\ No newline at end of file
expansions/script/c100314051.lua
View file @
6c72c127
...
@@ -69,7 +69,7 @@ end
...
@@ -69,7 +69,7 @@ end
function
s
.
dstg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
function
s
.
dstg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsOnField
()
and
chkc
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
end
if
chkc
then
return
chkc
:
IsOnField
()
and
chkc
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsType
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
,
TYPE_SPELL
+
TYPE_TRAP
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsType
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
,
TYPE_SPELL
+
TYPE_TRAP
)
end
Duel
.
Hint
*
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsType
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
,
TYPE_SPELL
+
TYPE_TRAP
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsType
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
,
TYPE_SPELL
+
TYPE_TRAP
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
end
end
...
@@ -96,7 +96,7 @@ end
...
@@ -96,7 +96,7 @@ end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
e
:
GetLabel
()
,
nil
,
e
,
tp
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
s
.
chk
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
chk
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
...
...
expansions/script/c100421003.lua
View file @
6c72c127
...
@@ -52,8 +52,10 @@ function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
...
@@ -52,8 +52,10 @@ function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
end
function
s
.
chk
(
g
,
lv
)
function
s
.
gcheck
(
lv
)
return
aux
.
dncheck
(
g
)
and
g
:
GetSum
(
Card
.
GetLevel
)
<=
lv
return
function
(
g
)
return
aux
.
dncheck
(
g
)
and
g
:
GetSum
(
Card
.
GetLevel
)
<=
lv
end
end
end
function
s
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
...
@@ -62,6 +64,8 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp)
...
@@ -62,6 +64,8 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local
lv
=
tc
:
GetOriginalLevel
()
local
lv
=
tc
:
GetOriginalLevel
()
local
g
=
Duel
.
GetMatchingGroup
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
nil
,
lv
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
nil
,
lv
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g
:
SelectSubGroup
(
tp
,
s
.
chk
,
false
,
1
,
99
,
lv
)
aux
.
GCheckAdditional
=
s
.
gcheck
(
lv
)
local
sg
=
g
:
SelectSubGroup
(
tp
,
aux
.
TRUE
,
false
,
1
,
lv
)
aux
.
GCheckAdditional
=
nil
if
sg
then
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
if
sg
then
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
end
expansions/script/c100421004.lua
View file @
6c72c127
--莫忘 暗黑之剑
--メメント・ダークソード
function
c100421004
.
initial_effect
(
c
)
--Memento Dark Blade
--coded by TemplarWK
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--destroy
--destroy
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
100421004
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_DESTROY
)
e1
:
SetCategory
(
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
100421004
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCost
(
c100421004
.
descost
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetTarget
(
c100421004
.
destg
)
e1
:
SetCost
(
s
.
cost
)
e1
:
SetOperation
(
c100421004
.
desop
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--spsummon
--sp
ecial
summon
local
e3
=
Effect
.
CreateEffect
(
c
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
100421004
,
1
))
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
,
110421004
)
e3
:
SetCountLimit
(
1
,
id
+
o
)
e3
:
SetTarget
(
c100421004
.
sptg
)
e3
:
SetTarget
(
s
.
sptg
)
e3
:
SetOperation
(
c100421004
.
spop
)
e3
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
end
end
function
c100421004
.
descost
filter
(
c
)
function
s
.
c
filter
(
c
)
return
c
:
IsSetCard
(
0x2a1
)
and
c
:
IsDiscardable
()
return
c
:
IsSetCard
(
0x2a1
)
and
c
:
IsDiscardable
()
end
end
function
c100421004
.
descost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c100421004
.
descostfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
Duel
.
DiscardHand
(
tp
,
c100421004
.
descostfilter
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
Duel
.
DiscardHand
(
tp
,
s
.
cfilter
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
end
function
s
.
filter
(
c
)
return
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
end
end
function
c100421004
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
Is
Controler
(
1
-
tp
)
and
chkc
:
IsOnField
()
and
chkc
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
end
if
chkc
then
return
chkc
:
Is
OnField
()
and
chkc
:
IsControler
(
1
-
tp
)
and
s
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsType
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
,
TYPE_SPELL
+
TYPE_TRAP
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsType
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
,
TYPE_SPELL
+
TYPE_TRAP
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
filter
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
if
e
:
GetHandler
():
GetMutualLinkedGroupCount
()
>
0
then
e
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_DRAW
)
e
:
SetLabel
(
1
)
else
e
:
SetCategory
(
CATEGORY_DESTROY
)
e
:
SetLabel
(
0
)
end
end
end
function
c100421004
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
~=
0
if
tc
:
IsRelateToEffect
(
e
)
then
and
e
:
GetLabel
()
==
1
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
100421004
,
1
))
then
Duel
.
BreakEffect
()
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
end
end
function
c100421004
.
c
filter
(
c
,
tp
)
function
s
.
d
filter
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x2a1
)
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x2a1
)
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
end
function
c100421004
.
s
filter
(
c
,
e
,
tp
)
function
s
.
sp
filter
(
c
,
e
,
tp
)
return
c
:
Is
LevelBelow
(
3
)
and
c
:
IsSetCard
(
0x2a1
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
return
c
:
Is
SetCard
(
0x2a1
)
and
c
:
IsLevelBelow
(
3
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
end
function
c100421004
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c100421004
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
tp
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
dfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
if
chk
==
0
then
return
#
g
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
end
and
Duel
.
IsExistingMatchingCard
(
c100421004
.
sfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
end
function
c100421004
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c100421004
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
tp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
dfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
tp
)
if
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
<
1
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
c100421004
.
sfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
>
0
and
tc
then
Duel
.
SpecialSummon
(
sg
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
end
expansions/script/c100421005.lua
View file @
6c72c127
...
@@ -42,7 +42,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
...
@@ -42,7 +42,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
s
.
cfilter
(
c
)
function
s
.
cfilter
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x2a1
)
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x2a1
)
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
end
function
s
.
sfilter
(
c
,
e
,
tp
)
function
s
.
sfilter
(
c
,
e
,
tp
)
...
@@ -50,7 +50,7 @@ function s.sfilter(c,e,tp)
...
@@ -50,7 +50,7 @@ function s.sfilter(c,e,tp)
end
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
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
.
sfilter
(
chkc
,
e
,
tp
)
end
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
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingTarget
(
s
.
sfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
and
Duel
.
IsExistingTarget
(
s
.
sfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
...
@@ -60,7 +60,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
...
@@ -60,7 +60,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
tp
)
local
tc
=
Duel
.
GetFirstTarget
()
local
tc
=
Duel
.
GetFirstTarget
()
if
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
>
0
and
tc
:
IsRelateToEffect
(
e
)
then
if
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
>
0
and
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
...
...
expansions/script/c100421008.lua
View file @
6c72c127
...
@@ -52,10 +52,11 @@ end
...
@@ -52,10 +52,11 @@ end
function
s
.
lecon
(
e
)
function
s
.
lecon
(
e
)
local
a
=
Duel
.
GetAttacker
()
local
a
=
Duel
.
GetAttacker
()
local
d
=
Duel
.
GetAttackTarget
()
local
d
=
Duel
.
GetAttackTarget
()
local
tp
=
e
:
GetHandlerPlayer
()
return
a
and
s
.
lfilter
(
a
,
tp
)
or
d
and
s
.
lfilter
(
d
,
tp
)
return
a
and
s
.
lfilter
(
a
,
tp
)
or
d
and
s
.
lfilter
(
d
,
tp
)
end
end
function
s
.
cfilter
(
c
,
e
,
tp
)
function
s
.
cfilter
(
c
,
e
,
tp
)
return
c
:
IsPreviousControler
(
tp
)
and
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
return
c
:
IsPreviousControler
(
tp
)
and
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
and
not
c
:
IsType
(
TYPE_TOKEN
)
and
c
:
IsReason
(
REASON_BATTLE
+
REASON_EFFECT
)
and
c
:
IsCanBeEffectTarget
(
e
)
and
c
:
IsFaceupEx
()
and
c
:
IsReason
(
REASON_BATTLE
+
REASON_EFFECT
)
and
c
:
IsCanBeEffectTarget
(
e
)
and
c
:
IsFaceupEx
()
and
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
,
c
:
GetLevel
())
and
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
,
c
:
GetLevel
())
end
end
...
@@ -86,7 +87,7 @@ function s.sfilter(c)
...
@@ -86,7 +87,7 @@ function s.sfilter(c)
return
c
:
IsSetCard
(
0x2a1
)
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsSSetable
()
return
c
:
IsSetCard
(
0x2a1
)
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsSSetable
()
end
end
function
s
.
settg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
function
s
.
settg
(
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
(
c
)
end
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
s
.
sfilter
(
c
hkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
sfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
sfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
sfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
sfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
...
...
expansions/script/c100421009.lua
View file @
6c72c127
...
@@ -40,11 +40,11 @@ end
...
@@ -40,11 +40,11 @@ end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
dc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
dfilter
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
e
,
tp
):
GetFirst
()
local
dc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
dfilter
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
e
,
tp
):
GetFirst
()
if
Duel
.
Destroy
(
dc
,
REASON_EFFECT
)
<
1
then
return
end
if
dc
==
nil
or
Duel
.
Destroy
(
dc
,
REASON_EFFECT
)
<
1
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_OPERATECARD
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_OPERATECARD
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
dc
):
GetFirst
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
dc
):
GetFirst
()
if
tc
then
if
tc
then
local
op
=
aux
.
SelectFromOptions
(
tp
,{
tc
:
IsAbleToHand
(),
119
2
},{
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
local
op
=
aux
.
SelectFromOptions
(
tp
,{
tc
:
IsAbleToHand
(),
119
0
},{
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
tc
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP_DEFENSE
),
1152
})
and
tc
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP_DEFENSE
),
1152
})
if
op
==
1
then
if
op
==
1
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
...
@@ -70,4 +70,4 @@ function s.prcop(e,tp,eg,ep,ev,re,r,rp)
...
@@ -70,4 +70,4 @@ function s.prcop(e,tp,eg,ep,ev,re,r,rp)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
tc
:
RegisterEffect
(
e1
)
end
end
end
end
\ No newline at end of file
expansions/script/c100421010.lua
View file @
6c72c127
...
@@ -10,7 +10,7 @@ function s.initial_effect(c)
...
@@ -10,7 +10,7 @@ function s.initial_effect(c)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_LEAVE_FIELD
)
e1
:
SetCode
(
EVENT_LEAVE_FIELD
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCondition
(
s
.
condition
)
e1
:
SetCondition
(
s
.
condition
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
e1
:
SetOperation
(
s
.
activate
)
...
@@ -58,7 +58,7 @@ function s.spcon(e,tp,eg,ep,ev,re,r,rp)
...
@@ -58,7 +58,7 @@ function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return
rp
==
1
-
tp
and
eg
:
IsExists
(
s
.
mfilter
,
1
,
nil
)
return
rp
==
1
-
tp
and
eg
:
IsExists
(
s
.
mfilter
,
1
,
nil
)
end
end
function
s
.
sfilter
(
c
,
e
,
tp
)
function
s
.
sfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x2a1
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
tru
e
,
false
)
return
c
:
IsSetCard
(
0x2a1
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
fals
e
,
false
)
end
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
...
...
expansions/script/c100421011.lua
View file @
6c72c127
...
@@ -35,10 +35,11 @@ function s.condition(e,tp,eg,ep,ev,re,r,rp)
...
@@ -35,10 +35,11 @@ function s.condition(e,tp,eg,ep,ev,re,r,rp)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsOnField
()
end
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
nil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
if
chkc
then
return
chkc
:
IsOnField
()
and
chkc
~=
c
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
nil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
c
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectTarget
(
tp
,
nil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectTarget
(
tp
,
nil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
c
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
end
end
function
s
.
filter
(
c
)
function
s
.
filter
(
c
)
...
@@ -48,7 +49,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
...
@@ -48,7 +49,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
local
tc
=
Duel
.
GetFirstTarget
()
local
tc
=
Duel
.
GetFirstTarget
()
if
not
tc
:
IsRelateToEffect
(
e
)
or
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
<
1
if
not
tc
:
IsRelateToEffect
(
e
)
or
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
<
1
or
not
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
then
return
end
or
not
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
then
return
end
local
g
=
Duel
.
Get
FieldGroup
(
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
)
local
g
=
Duel
.
Get
MatchingGroup
(
nil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
aux
.
ExceptThisCard
(
e
)
)
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
2
))
then
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
2
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
...
...
expansions/script/c100421012.lua
View file @
6c72c127
...
@@ -18,7 +18,7 @@ function s.initial_effect(c)
...
@@ -18,7 +18,7 @@ function s.initial_effect(c)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EFFECT_MUST_ATTACK_MONSTER
)
e3
:
SetCode
(
EFFECT_MUST_ATTACK_MONSTER
)
e3
:
Set
Target
(
s
.
matg
)
e3
:
Set
Value
(
s
.
atklimit
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
--disable
--disable
local
e4
=
Effect
.
CreateEffect
(
c
)
local
e4
=
Effect
.
CreateEffect
(
c
)
...
@@ -40,7 +40,7 @@ end
...
@@ -40,7 +40,7 @@ end
function
s
.
macon
(
e
)
function
s
.
macon
(
e
)
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
e
:
GetHandlerPlayer
(),
LOCATION_MZONE
,
0
,
1
,
nil
)
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
e
:
GetHandlerPlayer
(),
LOCATION_MZONE
,
0
,
1
,
nil
)
end
end
function
s
.
matg
(
e
,
c
)
function
s
.
atklimit
(
e
,
c
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
filter
,
e
:
GetHandlerPlayer
(),
LOCATION_MZONE
,
0
,
nil
):
GetMaxGroup
(
Card
.
GetAttack
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
filter
,
e
:
GetHandlerPlayer
(),
LOCATION_MZONE
,
0
,
nil
):
GetMaxGroup
(
Card
.
GetAttack
)
return
g
and
g
:
IsContains
(
c
)
return
g
and
g
:
IsContains
(
c
)
end
end
...
...
expansions/script/c100421016.lua
View file @
6c72c127
local
cm
,
m
=
GetID
()
--重騎士プリメラ
cm
.
name
=
"百夫长战旗重骑士 芙莉美娜"
--Script by passingDio0
function
cm
.
initial_effect
(
c
)
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--to hand
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_
TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetCategory
(
CATEGORY_
SEARCH
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_
TRIGGER_O
+
EFFECT_TYPE_SINGLE
)
e1
:
SetType
(
EFFECT_TYPE_
SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetTarget
(
cm
.
tg
)
e1
:
SetTarget
(
s
.
th
tg
)
e1
:
SetOperation
(
cm
.
op
)
e1
:
SetOperation
(
s
.
th
op
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--effect destory
local
e3
=
Effect
.
CreateEffect
(
c
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e3
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e3
:
SetCo
de
(
cm
.
con
)
e3
:
SetCo
ndition
(
s
.
ed
con
)
e3
:
SetTarget
(
cm
.
tg1
)
e3
:
SetTarget
(
s
.
edtg
)
e3
:
SetValue
(
1
)
e3
:
SetValue
(
1
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
--spsummon from szone
local
e4
=
Effect
.
CreateEffect
(
c
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e4
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e4
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e4
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e4
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e4
:
SetRange
(
LOCATION_SZONE
)
e4
:
SetRange
(
LOCATION_SZONE
)
e4
:
SetCode
(
EVENT_FREE_CHAIN
)
e4
:
SetCode
(
EVENT_FREE_CHAIN
)
e4
:
SetCountLimit
(
1
,
m
+
100
)
e4
:
SetCountLimit
(
1
,
id
+
o
)
e4
:
SetCondition
(
cm
.
con1
)
e4
:
SetHintTiming
(
0
,
TIMING_MAIN_END
)
e4
:
SetTarget
(
cm
.
tg2
)
e4
:
SetCondition
(
s
.
spcon
)
e4
:
SetOperation
(
cm
.
op1
)
e4
:
SetTarget
(
s
.
sptg
)
e4
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e4
)
c
:
RegisterEffect
(
e4
)
end
function
cm
.
f
(
c
)
return
c
:
IsSetCard
(
0x2c4
)
and
not
c
:
IsCode
(
m
)
and
c
:
IsAbleToHand
()
end
end
function
cm
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
thfilter
(
c
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
f
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
return
c
:
IsSetCard
(
0x2a5
)
and
not
c
:
IsCode
(
id
)
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
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
th
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
f
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
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
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_OATH
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
cm
.
splimit
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
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
(
s
.
splimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
function
cm
.
splimit
(
e
,
c
,
sump
,
sumtype
,
sumpos
,
targetp
,
se
)
function
s
.
splimit
(
e
,
c
)
return
c
:
IsCode
(
m
)
return
c
:
IsCode
(
id
)
end
end
function
cm
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
edcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
e
:
GetHandler
():
GetType
()
==
TYPE_TRAP
+
TYPE_CONTINUOUS
return
c
:
GetType
()
&
TYPE_TRAP
+
TYPE_CONTINUOUS
==
TYPE_TRAP
+
TYPE_CONTINUOUS
end
end
function
cm
.
tg1
(
e
,
c
)
function
s
.
edtg
(
e
,
c
)
return
c
:
IsSetCard
(
0x2
c4
)
return
c
:
IsSetCard
(
0x2
a5
)
and
c
:
IsLevelAbove
(
5
)
end
end
function
cm
.
con1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
local
ph
=
Duel
.
GetCurrentPhase
()
local
c
=
e
:
GetHandler
()
return
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
and
e
:
GetHandler
():
GetType
()
==
TYPE_TRAP
+
TYPE_CONTINUOUS
return
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
and
c
:
GetType
()
&
TYPE_TRAP
+
TYPE_CONTINUOUS
==
TYPE_TRAP
+
TYPE_CONTINUOUS
end
end
function
cm
.
tg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
m
,
0x2c4
,
TYPE_MONSTER
+
TYPE_EFFECT
+
TYPE_TUNER
,
1600
,
1600
,
4
,
RACE_SPELLCASTER
,
ATTRIBUTE_LIGHT
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
id
,
0x2a5
,
TYPE_MONSTER
+
TYPE_EFFECT
+
TYPE_TUNER
,
1600
,
1600
,
4
,
RACE_SPELLCASTER
,
ATTRIBUTE_LIGHT
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
end
function
cm
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
...
...
expansions/script/c100421017.lua
View file @
6c72c127
local
cm
,
m
=
GetID
()
--従騎士トゥルーデア
cm
.
name
=
"百夫长战旗从骑士 图卢蒂娅"
--Script by passingDio0
function
cm
.
initial_effect
(
c
)
local
s
,
id
,
o
=
GetID
()
local
e1
=
Effect
.
CreateEffect
(
c
)
function
s
.
initial_effect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
--set
e1
:
SetCategory
(
CATEGORY_TOGRAVE
+
CATEGORY_TOEXTRA
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
tg
)
e1
:
SetOperation
(
cm
.
op
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetTarget
(
s
.
settg
)
e2
:
SetCountLimit
(
1
,
m
+
100
)
e2
:
SetOperation
(
s
.
setop
)
e2
:
SetCondition
(
cm
.
con
)
e2
:
SetTarget
(
cm
.
tg1
)
e2
:
SetOperation
(
cm
.
op1
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--spsummon from szone
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetCountLimit
(
1
,
id
+
o
)
e3
:
SetHintTiming
(
0
,
TIMING_MAIN_END
)
e3
:
SetCondition
(
s
.
spcon
)
e3
:
SetTarget
(
s
.
sptg
)
e3
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e3
)
end
end
function
cm
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
filter
(
c
)
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_MZONE
+
LOCATION_DECK
+
LOCATION_HAND
,
0
)
return
c
:
IsSetCard
(
0x2a5
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsForbidden
()
and
not
c
:
IsCode
(
id
)
if
chk
==
0
then
return
g
:
CheckSubGroup
(
cm
.
f
,
2
,
2
,
e
:
GetHandler
())
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
1
end
end
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
settg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<
2
then
return
false
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
nil
)
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_MZONE
+
LOCATION_DECK
+
LOCATION_HAND
,
0
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
1
end
Duel
.
Hint
(
3
,
tp
,
HINTMSG_SELECT
)
local
sg
=
g
:
SelectSubGroup
(
tp
,
cm
.
f
,
true
,
2
,
2
,
e
:
GetHandler
())
if
#
sg
==
0
then
return
false
end
for
tc
in
aux
.
Next
(
sg
)
do
if
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
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_TRAP
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e1
)
end
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_OATH
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
cm
.
splimit
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
cm
.
splimit
(
e
,
c
,
sump
,
sumtype
,
sumpos
,
targetp
,
se
)
return
c
:
IsCode
(
m
)
end
end
function
cm
.
f
(
g
,
c
)
function
s
.
setop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
g
:
IsContains
(
c
)
and
g
:
IsExists
(
cm
.
f1
,
1
,
nil
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
1
or
not
c
:
IsRelateToEffect
(
e
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
local
tc
=
g
:
GetFirst
()
if
tc
then
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_CONTINUOUS
)
c
:
RegisterEffect
(
e1
)
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e2
:
SetValue
(
TYPE_TRAP
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e2
)
end
local
e3
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e3
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e3
:
SetTargetRange
(
1
,
0
)
e3
:
SetTarget
(
s
.
splimit
)
e3
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e3
,
tp
)
end
end
function
cm
.
f1
(
c
)
function
s
.
splimit
(
e
,
c
)
return
c
:
Is
Type
(
TYPE_MONSTER
)
and
c
:
IsSetCard
(
0x2c4
)
and
c
:
IsLocation
(
LOCATION_HAND
+
LOCATION_DECK
)
and
not
c
:
IsCode
(
m
)
return
c
:
Is
Code
(
id
)
end
end
function
cm
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
sp
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
local
ph
=
Duel
.
GetCurrentPhase
()
local
c
=
e
:
GetHandler
()
return
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
and
e
:
GetHandler
():
GetType
()
==
TYPE_TRAP
+
TYPE_CONTINUOUS
return
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
and
c
:
GetType
()
&
TYPE_TRAP
+
TYPE_CONTINUOUS
==
TYPE_TRAP
+
TYPE_CONTINUOUS
end
end
function
cm
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
m
,
0x2c4
,
TYPE_MONSTER
+
TYPE_EFFECT
,
1000
,
2000
,
4
,
RACE_PYRO
,
ATTRIBUTE_DARK
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
id
,
0x2a5
,
TYPE_MONSTER
+
TYPE_EFFECT
,
1000
,
2000
,
4
,
RACE_PYRO
,
ATTRIBUTE_DARK
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
end
function
cm
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
2
))
then
if
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
1
))
then
Duel
.
BreakEffect
()
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_LEVEL
)
e1
:
SetCode
(
EFFECT_UPDATE_LEVEL
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetValue
(
4
)
e1
:
SetValue
(
4
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
end
end
\ No newline at end of file
expansions/script/c100421018.lua
View file @
6c72c127
local
cm
,
m
=
GetID
()
--重騎兵エメトVI
cm
.
name
=
"百夫长战旗重骑兵 艾梅特VI"
--Script by passingDio0
function
cm
.
initial_effect
(
c
)
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--spcial from hand or grave
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetRange
(
LOCATION_HAND
+
LOCATION_GRAVE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCondition
(
cm
.
con
)
e1
:
SetRange
(
LOCATION_HAND
+
LOCATION_GRAVE
)
e1
:
SetTarget
(
cm
.
tg
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetOperation
(
cm
.
op
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e1
:
SetCondition
(
s
.
spcon1
)
e1
:
SetTarget
(
s
.
sptg1
)
e1
:
SetOperation
(
s
.
spop1
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--spsummon from szone
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCountLimit
(
1
,
m
+
100
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetCondition
(
cm
.
con1
)
e2
:
SetHintTiming
(
0
,
TIMING_MAIN_END
)
e2
:
SetTarget
(
cm
.
tg1
)
e2
:
SetCondition
(
s
.
spcon2
)
e2
:
SetOperation
(
cm
.
op1
)
e2
:
SetTarget
(
s
.
sptg2
)
e2
:
SetOperation
(
s
.
spop2
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
end
end
function
cm
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
spcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetTurnPlayer
()
==
1
-
tp
return
Duel
.
GetTurnPlayer
()
==
1
-
tp
end
end
function
cm
.
f
(
c
)
function
s
.
filter
(
c
,
tp
)
return
c
:
Is
SetCard
(
0x2c4
)
and
not
c
:
IsCode
(
m
)
return
c
:
Is
Faceup
()
and
c
:
IsSetCard
(
0x2a5
)
and
not
c
:
IsCode
(
id
)
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
end
function
cm
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
function
s
.
sptg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsSetCard
(
0x2c4
)
end
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
s
.
filter
(
chkc
,
tp
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsSetCard
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
0x2c4
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
Duel
.
Hint
(
3
,
tp
,
HINTMSG_SELECT
)
and
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
tp
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsSetCard
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
0x2c4
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
c
,
1
,
0
,
0
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
Duel
.
SelectTarget
(
tp
,
s
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
spop1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
not
tc
:
IsRelateToEffect
(
e
)
then
return
false
end
local
tc
=
Duel
.
GetFirstTarget
()
if
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
tc
:
IsRelateToEffect
(
e
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
and
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
...
@@ -52,32 +58,32 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
...
@@ -52,32 +58,32 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_CONTINUOUS
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e1
)
tc
:
RegisterEffect
(
e1
)
if
c
:
IsRelateToEffect
(
e
)
then
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
end
end
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_OATH
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
Set
Reset
(
RESET_PHASE
+
PHASE_END
)
e1
:
Set
Property
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
cm
.
splimit
)
e1
:
SetTarget
(
s
.
splimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
function
cm
.
splimit
(
e
,
c
,
sump
,
sumtype
,
sumpos
,
targetp
,
se
)
function
s
.
splimit
(
e
,
c
)
return
c
:
IsCode
(
m
)
return
c
:
IsCode
(
id
)
end
end
function
cm
.
con1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
spcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
local
ph
=
Duel
.
GetCurrentPhase
()
local
c
=
e
:
GetHandler
()
return
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
and
e
:
GetHandler
():
GetType
()
==
TYPE_TRAP
+
TYPE_CONTINUOUS
return
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
and
c
:
GetType
()
&
TYPE_TRAP
+
TYPE_CONTINUOUS
==
TYPE_TRAP
+
TYPE_CONTINUOUS
end
end
function
cm
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
sptg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
m
,
0x2c4
,
TYPE_MONSTER
+
TYPE_EFFECT
,
2000
,
3000
,
8
,
RACE_MACHINE
,
ATTRIBUTE_EARTH
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
id
,
0x2a5
,
TYPE_MONSTER
+
TYPE_EFFECT
,
1000
,
2000
,
4
,
RACE_PYRO
,
ATTRIBUTE_DARK
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
end
function
cm
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
spop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
\ No newline at end of file
expansions/script/c100421019.lua
View file @
6c72c127
local
cm
,
m
=
GetID
()
--騎士皇レガーティア
cm
.
name
=
"百夫长战旗骑士皇 蕾伽蒂娅"
--Script by passingDio0
function
cm
.
initial_effect
(
c
)
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--synchro summon
aux
.
AddSynchroProcedure
(
c
,
nil
,
aux
.
NonTuner
(
nil
),
1
)
aux
.
AddSynchroProcedure
(
c
,
nil
,
aux
.
NonTuner
(
nil
),
1
)
c
:
EnableReviveLimit
()
c
:
EnableReviveLimit
()
--draw and destory
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_
DRAW
+
CATEGORY_DESTROY
)
e1
:
SetCategory
(
CATEGORY_
SEARCH
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_
PLAYER_TARGET
+
EFFECT_FLAG_
DELAY
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetTarget
(
cm
.
tg
)
e1
:
SetTarget
(
s
.
dd
tg
)
e1
:
SetOperation
(
cm
.
op
)
e1
:
SetOperation
(
s
.
dd
op
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--avoid battle destory
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e2
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e2
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsAttackBelow
,
2000
)
)
e2
:
SetTarget
(
s
.
bdtg
)
e2
:
SetValue
(
1
)
e2
:
SetValue
(
1
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--set
local
e3
=
Effect
.
CreateEffect
(
c
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e3
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e3
:
SetCountLimit
(
1
,
m
+
100
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetTarget
(
cm
.
tg1
)
e3
:
SetCountLimit
(
1
,
id
+
o
)
e3
:
SetOperation
(
cm
.
op1
)
e3
:
SetTarget
(
s
.
settg
)
e3
:
SetOperation
(
s
.
setop
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
end
end
function
cm
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
dd
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
dd
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
if
Duel
.
Draw
(
p
,
d
,
REASON_EFFECT
)
>
0
then
if
Duel
.
Draw
(
p
,
d
,
REASON_EFFECT
)
>
0
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
2
))
then
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
if
#
g
==
0
then
return
false
end
if
#
g
>
0
then
g
=
g
:
GetMaxGroup
(
Card
.
GetAttack
)
local
tg
=
g
:
GetMaxGroup
(
Card
.
GetAttack
)
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
1
))
then
if
#
tg
>
1
then
Duel
.
Hint
(
3
,
tp
,
HINTMSG_DESTROY
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
local
sg
=
tg
:
Select
(
tp
,
1
,
1
,
nil
)
if
#
g
==
0
then
return
false
end
Duel
.
HintSelection
(
sg
)
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
Duel
.
Destroy
(
sg
,
REASON_EFFECT
)
else
Duel
.
Destroy
(
tg
,
REASON_EFFECT
)
end
end
end
end
end
end
end
function
cm
.
f
(
c
)
function
s
.
bdtg
(
e
,
c
)
return
c
:
Is
SetCard
(
0x2c4
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsType
(
TYPE_SYNCHRO
)
return
c
:
Is
Faceup
()
and
c
:
IsAttackBelow
(
2000
)
end
end
function
cm
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
filter
(
c
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
f
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
return
c
:
IsSetCard
(
0x2a5
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsForbidden
()
and
not
c
:
IsType
(
TYPE_SYNCHRO
)
end
end
function
cm
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
settg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
Duel
.
Hint
(
3
,
tp
,
HINTMSG_SELECT
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_HAND
,
0
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
f
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
for
tc
in
aux
.
Next
(
g
)
do
end
if
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
function
s
.
setop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
local
c
=
e
:
GetHandler
()
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
end
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
filter
),
tp
,
LOCATION_GRAVE
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
local
tc
=
g
:
GetFirst
()
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_CONTINUOUS
)
if
tc
then
tc
:
RegisterEffect
(
e1
)
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
end
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_TRAP
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e1
)
end
end
end
end
\ No newline at end of file
expansions/script/c100421020.lua
View file @
6c72c127
local
cm
,
m
=
GetID
()
--スタンドアップ・センチュリオン!
cm
.
name
=
"站起来吧百夫长战旗!"
--Script by passingDio0
function
cm
.
initial_effect
(
c
)
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
)
e0
:
SetCost
(
s
.
reg
)
c
:
RegisterEffect
(
e0
)
--indestructable
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetOperation
(
cm
.
op
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e1
:
SetRange
(
LOCATION_FZONE
)
e1
:
SetValue
(
aux
.
indoval
)
e1
:
SetCondition
(
s
.
con
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--set
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_TOGRAVE
+
CATEGORY_TOEXTRA
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetCountLimit
(
1
,
m
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetCondition
(
cm
.
con
)
e2
:
SetCondition
(
s
.
set
con
)
e2
:
SetCost
(
cm
.
cost
)
e2
:
SetCost
(
s
.
set
cost
)
e2
:
SetTarget
(
cm
.
tg
)
e2
:
SetTarget
(
s
.
set
tg
)
e2
:
SetOperation
(
cm
.
op1
)
e2
:
SetOperation
(
s
.
setop
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--synchro summon
local
e3
=
Effect
.
CreateEffect
(
c
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetRange
(
LOCATION_FZONE
)
e3
:
SetRange
(
LOCATION_FZONE
)
e3
:
SetCountLimit
(
1
,
m
+
100
)
e3
:
SetCountLimit
(
1
,
id
+
o
)
e3
:
SetTarget
(
cm
.
tg1
)
e3
:
SetCondition
(
s
.
sccon
)
e3
:
SetOperation
(
cm
.
op2
)
e3
:
SetTarget
(
s
.
sctg
)
e3
:
SetOperation
(
s
.
scop
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
end
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
reg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
true
end
c
:
RegisterFlagEffect
(
m
,
RESET_PHASE
+
PHASE_END
,
EFFECT_FLAG_CLIENT_HINT
,
1
,
0
,
aux
.
Stringid
(
m
,
2
))
e
:
GetHandler
():
RegisterFlagEffect
(
id
,
RESET_PHASE
+
PHASE_END
,
EFFECT_FLAG_OATH
,
1
)
end
function
s
.
confilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x2a5
)
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
~=
0
end
function
s
.
con
(
e
)
local
tp
=
e
:
GetHandlerPlayer
()
return
Duel
.
IsExistingMatchingCard
(
s
.
confilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
end
function
cm
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
set
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetFlagEffect
(
m
)
>
0
return
e
:
GetHandler
():
GetFlagEffect
(
id
)
~=
0
end
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
setcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToGraveAsCost
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
c
=
e
:
GetHandler
()
Duel
.
Hint
(
3
,
tp
,
HINTMSG_TOGRAVE
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToGraveAsCost
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToGraveAsCost
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
DiscardHand
(
tp
,
Card
.
IsAbleToGraveAsCost
,
1
,
1
,
REASON_COST
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
end
function
s
.
filter
(
c
)
return
c
:
IsSetCard
(
0x2a5
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsForbidden
()
end
end
function
cm
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
settg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
f
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
end
function
cm
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
setop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
3
,
tp
,
HINTMSG_SELECT
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
f
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
end
for
tc
in
aux
.
Next
(
g
)
do
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
if
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
local
tc
=
g
:
GetFirst
()
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
if
tc
then
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_CONTINUOUS
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
tc
:
RegisterEffect
(
e1
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
end
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e1
)
end
end
end
end
function
cm
.
f
(
c
)
function
s
.
scconfilter
(
c
,
tp
)
return
c
:
Is
SetCard
(
0x2c4
)
and
c
:
IsType
(
TYPE_MONSTER
)
return
c
:
Is
Faceup
(
)
end
end
function
cm
.
f1
(
c
)
function
s
.
sccon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
c
:
IsSetCard
(
0x2c4
)
and
c
:
IsType
(
TYPE_MONSTER
)
return
eg
:
IsExists
(
s
.
scconfilter
,
1
,
nil
,
tp
)
end
end
function
cm
.
f2
(
c
)
function
s
.
mfilter
(
c
)
return
c
:
Is
HasEffect
(
EFFECT_HAND_SYNCHRO
)
and
c
:
IsType
(
TYPE_MONSTER
)
return
c
:
Is
SetCard
(
0x2a5
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsFaceup
(
)
end
end
function
cm
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
cfilter
(
c
,
syn
)
return
syn
:
IsSynchroSummonable
(
c
)
end
function
s
.
scfilter
(
c
,
mg
)
return
mg
:
IsExists
(
s
.
cfilter
,
1
,
nil
,
c
)
end
function
s
.
sctg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
chk
==
0
then
local
mg
=
Duel
.
GetMatchingGroup
(
cm
.
f1
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
mg
=
Duel
.
GetMatchingGroup
(
s
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
exg
=
Duel
.
GetMatchingGroup
(
cm
.
f2
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
return
Duel
.
IsExistingMatchingCard
(
s
.
scfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
mg
)
mg
:
Merge
(
exg
)
return
Duel
.
IsExistingMatchingCard
(
cm
.
f4
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
mg
)
end
end
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
end
function
cm
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
scop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
mg
=
Duel
.
GetMatchingGroup
(
cm
.
f1
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
mg
=
Duel
.
GetMatchingGroup
(
s
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
exg
=
Duel
.
GetMatchingGroup
(
cm
.
f2
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
scfilter
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
mg
)
mg
:
Merge
(
exg
)
local
g
=
Duel
.
GetMatchingGroup
(
cm
.
f4
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
mg
)
if
g
:
GetCount
()
>
0
then
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SMATERIAL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SMATERIAL
)
local
tg
=
mg
:
FilterSelect
(
tp
,
cm
.
f3
,
1
,
1
,
nil
,
sg
:
GetFirst
())
local
tg
=
mg
:
FilterSelect
(
tp
,
s
.
cfilter
,
1
,
1
,
nil
,
sg
:
GetFirst
())
Duel
.
SynchroSummon
(
tp
,
sg
:
GetFirst
(),
tg
:
GetFirst
())
Duel
.
SynchroSummon
(
tp
,
sg
:
GetFirst
(),
tg
:
GetFirst
())
end
end
end
function
cm
.
f3
(
c
,
syn
)
local
b1
=
true
if
c
:
IsHasEffect
(
EFFECT_HAND_SYNCHRO
)
then
b1
=
Duel
.
CheckTunerMaterial
(
syn
,
c
,
nil
,
cm
.
f1
,
1
,
99
)
end
return
b1
and
syn
:
IsSynchroSummonable
(
c
)
end
function
cm
.
f4
(
c
,
mg
)
return
mg
:
IsExists
(
cm
.
f3
,
1
,
nil
,
c
)
end
end
\ No newline at end of file
expansions/script/c100421021.lua
0 → 100644
View file @
6c72c127
--誓いのエンブレーマ
--Script by passingDio0
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate1
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
:
SetTarget
(
s
.
target1
)
e1
:
SetOperation
(
s
.
activate1
)
c
:
RegisterEffect
(
e1
)
--Activate2
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e2
:
SetTarget
(
s
.
target2
)
e2
:
SetOperation
(
s
.
activate2
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
filter1
(
c
)
return
c
:
IsSetCard
(
0x2a5
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsForbidden
()
end
function
s
.
target1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
ct
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
and
not
e
:
GetHandler
():
IsLocation
(
LOCATION_SZONE
)
then
ct
=
ct
-
1
end
return
Duel
.
IsExistingMatchingCard
(
s
.
filter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
ct
>
0
end
end
function
s
.
activate1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
local
tc
=
g
:
GetFirst
()
if
tc
then
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e1
)
--splimit
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_FIELD
)
e0
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e0
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e0
:
SetTargetRange
(
1
,
0
)
e0
:
SetLabel
(
tc
:
GetOriginalCodeRule
())
e0
:
SetCondition
(
s
.
splimitcon
)
e0
:
SetTarget
(
s
.
splimit
)
e0
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e0
,
tp
)
end
end
function
s
.
filter2
(
c
,
e
)
return
c
:
IsOriginalCodeRule
(
e
:
GetLabel
())
and
c
:
IsFaceup
()
end
function
s
.
splimitcon
(
e
)
return
Duel
.
IsExistingMatchingCard
(
s
.
filter2
,
e
:
GetHandlerPlayer
(),
LOCATION_ONFIELD
,
0
,
1
,
nil
,
e
)
end
function
s
.
splimit
(
e
,
c
)
return
not
c
:
IsSetCard
(
0x2a5
)
and
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
s
.
setfilter
(
c
)
return
c
:
IsSetCard
(
0x2a5
)
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsSSetable
()
end
function
s
.
target2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
end
function
s
.
activate2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SSet
(
tp
,
g
:
GetFirst
())
end
end
\ No newline at end of file
expansions/script/c100421022.lua
View file @
6c72c127
local
cm
,
m
=
GetID
()
--騎士の絆
cm
.
name
=
"百夫长战旗骑士的牵绊"
--Faith of Centurion
function
cm
.
initial_effect
(
c
)
--coded by Lyris & DIO0passing
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
local
e0
=
aux
.
AddThisCardInGraveAlreadyCheck
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetTarget
(
cm
.
tg
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
cm
.
op
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--place trap
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
m
+
100
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetCondition
(
cm
.
con
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e2
:
SetLabelObject
(
e0
)
e2
:
SetCondition
(
s
.
ptcon
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
cm
.
tg1
)
e2
:
SetTarget
(
s
.
pttg
)
e2
:
SetOperation
(
cm
.
op1
)
e2
:
SetOperation
(
s
.
ptop
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
end
end
function
cm
.
f
(
c
)
function
s
.
filter
(
c
)
return
c
:
IsSetCard
(
0x2
c4
)
and
c
:
IsType
(
TYPE_MONSTER
)
return
c
:
IsSetCard
(
0x2
a5
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsForbidden
(
)
end
end
function
cm
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
f
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
local
ft
=
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
and
e
:
GetHandler
():
IsLocation
(
LOCATION_HAND
)
and
1
or
0
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
ft
and
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_HAND
,
0
,
1
,
nil
)
end
end
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
3
,
tp
,
HINTMSG_SELECT
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
f
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
for
tc
in
aux
.
Next
(
g
)
do
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
filter
),
tp
,
LOCATION_GRAVE
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
if
tc
and
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_CONTINUOUS
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e1
)
tc
:
RegisterEffect
(
e1
)
end
end
end
end
end
function
cm
.
f1
(
c
,
tp
)
function
s
.
cfilter
(
c
,
tp
,
se
)
return
c
:
IsType
(
TYPE_SYNCHRO
)
and
c
:
IsSummonPlayer
(
tp
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x2a5
)
and
c
:
IsType
(
TYPE_SYNCHRO
)
and
c
:
IsControler
(
tp
)
and
(
se
==
nil
or
c
:
GetReasonEffect
()
~=
se
)
end
end
function
cm
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
pt
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
cm
.
f1
,
1
,
nil
,
tp
)
return
eg
:
IsExists
(
s
.
cfilter
,
1
,
nil
,
tp
,
e
:
GetLabelObject
():
GetLabelObject
()
)
end
end
function
cm
.
f2
(
c
)
function
s
.
pttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsSetCard
(
0x2c4
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
s
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_LEAVE_GRAVE
,
g
,
1
,
0
,
0
)
end
end
function
cm
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
function
s
.
ptop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsSetCard
(
0x2c4
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
f2
,
tp
,
LOCATION_GZONE
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
Duel
.
Hint
(
3
,
tp
,
HINTMSG_SELECT
)
local
g
=
Duel
.
SelectTarget
(
tp
,
cm
.
f2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
ni
)
end
function
cm
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
local
tc
=
Duel
.
GetFirstTarget
()
if
not
tc
:
IsRelateToEffect
(
e
)
then
return
false
end
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
if
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
...
@@ -70,4 +76,4 @@ function cm.op1(e,tp,eg,ep,ev,re,r,rp)
...
@@ -70,4 +76,4 @@ function cm.op1(e,tp,eg,ep,ev,re,r,rp)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_CONTINUOUS
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e1
)
tc
:
RegisterEffect
(
e1
)
end
end
end
end
\ No newline at end of file
expansions/script/c100421023.lua
View file @
6c72c127
local
cm
,
m
=
GetID
()
--騎士魔防陣
cm
.
name
=
"百夫长战旗骑士魔防阵"
--Centurion Phalanx
function
cm
.
initial_effect
(
c
)
--coded by Lyris & DIO0passing
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_REMOVE
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetTarget
(
cm
.
tg
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetOperation
(
cm
.
op
)
e1
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--spsummon
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
m
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
cm
.
tg1
)
e2
:
SetTarget
(
s
.
sptg
)
e2
:
SetOperation
(
cm
.
op2
)
e2
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
end
end
function
cm
.
f
(
c
)
function
s
.
filter
(
c
)
return
c
:
Is
AbleToRemove
()
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
==
TYPE_MONSTER
and
c
:
IsFaceup
()
return
c
:
Is
Faceup
()
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
>
0
and
c
:
IsAbleToRemove
()
end
end
function
cm
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
Is
Location
(
LOCATION_ONFIELD
)
and
chkc
:
GetOriginalType
()
&
TYPE_MONSTER
==
TYPE_MONSTER
and
chkc
.
IsAbleToRemove
()
and
chkc
:
IsFaceup
(
)
end
if
chkc
then
return
chkc
:
Is
OnField
()
and
s
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
f
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectTarget
(
tp
,
cm
.
f
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
g
,
1
,
0
,
0
)
end
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
Remove
(
tc
,
0
,
REASON_EFFECT
+
REASON_TEMPORARY
)
~=
0
then
if
not
tc
:
IsRelateToEffect
(
e
)
or
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
<
1
local
ct
=
Duel
.
GetCurrentPhase
()
<=
PHASE_STANDBY
and
2
or
1
or
not
tc
:
IsLocation
(
LOCATION_REMOVED
)
then
return
end
tc
:
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_STANDBY
,
0
,
ct
)
tc
:
RegisterFlagEffect
(
id
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_STANDBY
,
0
,
2
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_PHASE
+
PHASE_STANDBY
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_STANDBY
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_STANDBY
,
ct
)
e1
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
)
e2
:
SetLabelObject
(
tc
)
e1
:
SetCountLimit
(
1
)
e2
:
SetCountLimit
(
1
)
e1
:
SetLabel
(
Duel
.
GetTurnCount
()
)
e2
:
SetCondition
(
cm
.
con
)
e1
:
SetLabelObject
(
tc
)
e2
:
SetOperation
(
cm
.
op1
)
e1
:
SetCondition
(
s
.
retcon
)
e2
:
SetLabel
(
Duel
.
GetTurnCount
()
)
e1
:
SetOperation
(
s
.
retop
)
Duel
.
RegisterEffect
(
e2
,
tp
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_STANDBY
,
2
)
end
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
function
cm
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
ret
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
local
tc
=
e
:
GetLabelObject
()
return
Duel
.
GetTurnCount
()
~=
e
:
GetLabel
()
and
tc
:
GetFlagEffect
(
m
)
~=
0
return
Duel
.
GetTurnCount
()
==
e
:
GetLabel
()
+
1
and
tc
:
GetFlagEffect
(
id
)
>
0
end
end
function
cm
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
retop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
ReturnToField
(
e
:
GetLabelObject
())
local
tc
=
e
:
GetLabelObject
()
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tc
:
GetOwner
(),
false
,
false
,
POS_FACEUP
)
end
end
function
cm
.
f1
(
c
,
e
,
tp
)
function
s
.
sfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x2
c4
)
and
c
:
IsType
(
TYPE_SYNCHRO
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
return
c
:
IsSetCard
(
0x2
a5
)
and
c
:
IsType
(
TYPE_SYNCHRO
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
end
function
cm
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
Is
Controler
(
tp
)
and
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
cm
.
f1
(
chkc
,
e
,
tp
)
end
if
chkc
then
return
chkc
:
Is
Location
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
s
.
sfilter
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingTarget
(
cm
.
f1
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
e
:
GetHandler
()
,
e
,
tp
)
end
and
Duel
.
IsExistingTarget
(
s
.
sfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
cm
.
f1
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
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
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
end
function
cm
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
SpecialSummonStep
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
SpecialSummonStep
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
...
@@ -80,4 +87,4 @@ function cm.op2(e,tp,eg,ep,ev,re,r,rp)
...
@@ -80,4 +87,4 @@ function cm.op2(e,tp,eg,ep,ev,re,r,rp)
tc
:
RegisterEffect
(
e1
)
tc
:
RegisterEffect
(
e1
)
end
end
Duel
.
SpecialSummonComplete
()
Duel
.
SpecialSummonComplete
()
end
end
\ No newline at end of file
expansions/script/c100421024.lua
View file @
6c72c127
local
cm
,
m
=
GetID
()
--騎士皇爆誕
cm
.
name
=
"百夫长战旗骑士皇爆诞"
--Truth Centurion
function
cm
.
initial_effect
(
c
)
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_NEGATE
+
CATEGORY_DESTROY
)
e1
:
SetCategory
(
CATEGORY_NEGATE
+
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCountLimit
(
1
,
m
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
cm
.
c
on
)
e1
:
SetCondition
(
s
.
conditi
on
)
e1
:
SetCost
(
cm
.
cost
)
e1
:
SetCost
(
s
.
cost
)
e1
:
SetTarget
(
cm
.
tg
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
cm
.
op
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
function
cm
.
c
on
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
conditi
on
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
(
re
:
Is
ActiveType
(
TYPE_MONSTER
)
or
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
))
and
Duel
.
IsChainNegatable
(
ev
)
return
(
re
:
Is
HasType
(
EFFECT_TYPE_ACTIVATE
)
or
re
:
IsActiveType
(
TYPE_MONSTER
))
and
Duel
.
IsChainNegatable
(
ev
)
end
end
function
cm
.
f
(
c
)
function
s
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
==
TYPE_MONSTER
and
c
:
IsAbleToGraveAsCost
()
return
c
:
IsFaceup
()
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
>
0
and
c
:
GetSequence
()
<
5
and
c
:
IsAbleToGraveAsCost
()
end
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
f
,
tp
,
LOCATION_SZONE
,
0
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_SZONE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
f
,
tp
,
LOCATION_SZONE
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_SZONE
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
end
end
function
cm
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_NEGATE
,
eg
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_NEGATE
,
eg
,
1
,
0
,
0
)
if
re
:
GetHandler
():
IsDestructable
()
and
re
:
GetHandler
():
IsRelateToEffect
(
re
)
then
if
re
:
GetHandler
():
IsDestructable
()
and
re
:
GetHandler
():
IsRelateToEffect
(
re
)
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
eg
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
eg
,
1
,
0
,
0
)
end
end
end
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
Duel
.
NegateActivation
(
ev
)
then
return
end
if
Duel
.
NegateActivation
(
ev
)
and
re
:
GetHandler
():
IsRelateToEffect
(
re
)
then
Duel
.
Destroy
(
eg
,
REASON_EFFECT
)
end
if
re
:
GetHandler
():
IsRelateToEffect
(
re
)
then
Duel
.
Destroy
(
eg
,
REASON_EFFECT
)
end
end
end
expansions/script/c100421031.lua
View file @
6c72c127
--天使の聲
--天使の聲
local
s
,
id
=
GetID
()
--Angelo Valmonica
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
function
s
.
initial_effect
(
c
)
--Pendulum procedure
aux
.
EnablePendulumAttribute
(
c
)
aux
.
EnablePendulumAttribute
(
c
)
--Can place Resonance Counters on it
c
:
EnableCounterPermit
(
0x170
,
LOCATION_PZONE
)
c
:
EnableCounterPermit
(
0x69
,
LOCATION_PZONE
)
--counter
--Place 1 Resonance Counter on this card each time you gain LP
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_RECOVER
)
e1
:
SetCode
(
EVENT_RECOVER
)
e1
:
SetRange
(
LOCATION_PZONE
)
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
:
SetCondition
(
s
.
ctcon
)
e1
:
SetOperation
(
s
.
ctop
)
e1
:
SetOperation
(
s
.
ctop
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--
Link Summon 1 "Valmonica" monster
--
link summon
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
...
@@ -21,113 +21,124 @@ function s.initial_effect(c)
...
@@ -21,113 +21,124 @@ function s.initial_effect(c)
e2
:
SetCode
(
EVENT_ATTACK_ANNOUNCE
)
e2
:
SetCode
(
EVENT_ATTACK_ANNOUNCE
)
e2
:
SetRange
(
LOCATION_PZONE
)
e2
:
SetRange
(
LOCATION_PZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCondition
(
function
(
e
,
tp
)
return
Duel
.
GetAttacker
():
IsControler
(
1
-
tp
)
end
)
e2
:
SetCondition
(
s
.
lscon
)
e2
:
SetTarget
(
s
.
l
inksp
tg
)
e2
:
SetTarget
(
s
.
l
s
tg
)
e2
:
SetOperation
(
s
.
l
inksp
op
)
e2
:
SetOperation
(
s
.
l
s
op
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--
Place both this card and 1 "Demone Valmonica" from your Deck in your Pendulum Z
one
--
to pz
one
local
e3
=
Effect
.
CreateEffect
(
c
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_HAND
)
e3
:
SetRange
(
LOCATION_HAND
)
e3
:
SetCountLimit
(
1
,
121999031
)
e3
:
SetCountLimit
(
1
,
id
)
e3
:
SetCost
(
s
.
pzcost
)
e3
:
SetCost
(
s
.
pzcost
)
e3
:
SetTarget
(
s
.
pztg
)
e3
:
SetTarget
(
s
.
pztg
)
e3
:
SetOperation
(
s
.
pzop
)
e3
:
SetOperation
(
s
.
pzop
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
--
Apply the LP gain effect of 1 "Valmonica" Normal Spell/Trap
--
copy
local
e4
=
Effect
.
CreateEffect
(
c
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCountLimit
(
1
,
121900031
)
e4
:
SetCountLimit
(
1
,
id
+
o
)
e4
:
SetCondition
(
function
(
e
)
return
e
:
GetHandler
():
GetFlagEffect
(
id
)
>
0
end
)
e4
:
SetCondition
(
s
.
cpcon
)
e4
:
SetCost
(
s
.
cpcost
)
e4
:
SetTarget
(
s
.
cptg
)
e4
:
SetTarget
(
s
.
cptg
)
e4
:
SetOperation
(
s
.
cpop
)
e4
:
SetOperation
(
s
.
cpop
)
c
:
RegisterEffect
(
e4
)
c
:
RegisterEffect
(
e4
)
-- Register flag on summon
if
not
s
.
global_check
then
if
not
c121999031
.
global_check
then
s
.
global_check
=
true
c121999031
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
ge1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
ge1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
ge1
:
SetLabel
(
id
)
ge1
:
SetLabel
(
id
)
ge1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
ge1
:
SetOperation
(
aux
.
sumreg
)
ge1
:
SetOperation
(
aux
.
sumreg
)
Duel
.
RegisterEffect
(
ge1
,
0
)
Duel
.
RegisterEffect
(
ge1
,
0
)
local
ge2
=
ge1
:
Clone
()
local
ge2
=
ge1
:
Clone
()
ge2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
ge2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
ge2
:
SetLabel
(
id
)
Duel
.
RegisterEffect
(
ge2
,
0
)
Duel
.
RegisterEffect
(
ge2
,
0
)
end
end
end
end
function
s
.
c
top
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
c
filter
(
c
)
s
.
addcounter
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
c
:
GetOriginalRace
()
&
RACE_FIEND
>
0
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
>
0
end
end
function
s
.
addcounter
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
ctcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_PZONE
,
0
,
1
,
e
:
GetHandler
())
and
ep
==
tp
end
function
s
.
ctop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
c
:
AddCounter
(
0x69
,
1
)
c
:
AddCounter
(
0x170
,
1
)
Duel
.
RaiseEvent
(
c
,
EVENT_CUSTOM
+
121999035
,
e
,
0
,
tp
,
tp
,
1
)
if
c
:
GetCounter
(
0x170
)
==
3
then
Duel
.
RaiseEvent
(
c
,
EVENT_CUSTOM
+
100421035
,
e
,
0
,
tp
,
tp
,
0
)
end
end
end
function
s
.
l
inkfilter
(
c
)
function
s
.
l
scon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
c
:
IsSetCard
(
0x19e
)
and
c
:
IsSpecialSummonable
(
SUMMON_TYPE_LINK
)
return
Duel
.
GetTurnPlayer
()
==
1
-
tp
end
end
function
s
.
linksptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
lfilter
(
c
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
linkfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
)
end
return
c
:
IsLinkSummonable
(
nil
)
and
c
:
IsSetCard
(
0x2a3
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
end
function
s
.
linkspop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
lstg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
lfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
end
function
s
.
lsop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
linkfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
):
GetFirst
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
lfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
sc
then
if
tc
then
Duel
.
LinkSummon
(
tp
,
tc
,
nil
)
end
Duel
.
LinkSummon
(
tp
,
sc
,
nil
)
end
end
end
function
s
.
pzcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
pzcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
c
)
end
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
)
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
,
c
)
end
end
function
s
.
pz
filter
(
c
)
function
s
.
filter
(
c
)
return
c
:
IsCode
(
1
21999
032
)
and
not
c
:
IsForbidden
()
return
c
:
IsCode
(
1
00421
032
)
and
not
c
:
IsForbidden
()
end
end
function
s
.
pztg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
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
)
if
chk
==
0
then
return
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
and
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
)
and
Duel
.
IsExistingMatchingCard
(
s
.
pz
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
and
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
end
end
function
s
.
pzop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
pzop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
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
if
not
(
c
:
IsRelateToEffect
(
e
)
and
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
and
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
))
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
pzfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
not
tc
then
return
end
if
tc
then
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
end
end
end
function
s
.
cpcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
cpcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
e
:
SetLabel
(
1
)
return
e
:
GetHandler
():
GetFlagEffect
(
id
)
>
0
return
true
end
end
function
s
.
cpfilter
(
c
)
function
s
.
pfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
(
c
:
GetType
()
==
TYPE_TRAP
or
c
:
GetType
()
==
TYPE_SPELL
)
and
c
:
IsAbleToRemoveAsCost
()
local
typ
=
c
:
GetType
()
return
c
:
IsSetCard
(
0x2a3
)
and
(
typ
==
TYPE_SPELL
or
typ
==
TYPE_TRAP
)
and
c
:
IsAbleToRemoveAsCost
()
and
c
:
CheckActivateEffect
(
false
,
true
,
false
)
and
c
:
CheckActivateEffect
(
false
,
true
,
false
)
end
end
function
s
.
cptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
cptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
chk
==
0
then
return
e
:
IsCostChecked
()
if
e
:
GetLabel
()
==
0
then
return
false
end
and
Duel
.
IsExistingMatchingCard
(
s
.
pfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
e
:
SetLabel
(
0
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
):
GetFirst
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
pfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
):
GetFirst
()
local
te
,
ceg
,
cep
,
cev
,
cre
,
cr
,
crp
=
tc
:
CheckActivateEffect
(
false
,
true
,
true
)
e
:
SetLabelObject
(
te
)
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_COST
)
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_COST
)
e
:
SetLabelObject
(
tc
)
e
:
SetProperty
(
te
:
GetProperty
())
local
tg
=
te
:
GetTarget
()
if
tg
then
tg
(
e
,
tp
,
ceg
,
cep
,
cev
,
cre
,
cr
,
crp
,
1
)
end
te
:
SetLabelObject
(
e
:
GetLabelObject
())
e
:
SetLabelObject
(
te
)
Duel
.
ClearOperationInfo
(
0
)
end
end
function
s
.
cpop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
cpop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
local
te
=
e
:
GetLabelObject
()
if
not
tc
then
return
end
if
not
te
then
return
end
local
eff
=
tc
:
GetActivateEffect
()
e
:
SetLabelObject
(
te
:
GetLabelObject
())
local
op
=
eff
:
GetOperation
()
local
op
=
te
:
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
,
1
)
end
if
op
then
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
0
)
end
end
end
\ No newline at end of file
expansions/script/c100421032.lua
View file @
6c72c127
--悪魔の聲
--悪魔の聲
local
s
,
id
=
GetID
()
--Demone Valmonica
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
function
s
.
initial_effect
(
c
)
--Pendulum procedure
aux
.
EnablePendulumAttribute
(
c
)
aux
.
EnablePendulumAttribute
(
c
)
--Can place Resonance Counters on it
c
:
EnableCounterPermit
(
0x170
,
LOCATION_PZONE
)
c
:
EnableCounterPermit
(
0x69
,
LOCATION_PZONE
)
--counter
--Place 1 Resonance Counter on this card each time you take effect damage
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_DAMAGE
)
e1
:
SetCode
(
EVENT_DAMAGE
)
e1
:
SetRange
(
LOCATION_PZONE
)
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
:
SetCondition
(
s
.
ctcon
)
e1
:
SetOperation
(
s
.
ctop
)
e1
:
SetOperation
(
s
.
ctop
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--
Opponent's monsters lose 100 ATK for each Resonance Counter on your field
--
atk down
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e2
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e2
:
SetRange
(
LOCATION_PZONE
)
e2
:
SetRange
(
LOCATION_PZONE
)
e2
:
SetTargetRange
(
0
,
LOCATION_MZONE
)
e2
:
SetTargetRange
(
0
,
LOCATION_MZONE
)
e2
:
SetValue
(
function
(
e
)
return
Duel
.
GetCounter
(
e
:
GetHandlerPlayer
(),
LOCATION_ONFIELD
,
0
,
0x69
)
*-
100
end
)
e2
:
SetValue
(
s
.
adval
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--
Place both this card and 1 "Angelo Valmonica" from your Deck in your Pendulum Z
one
--
to pz
one
local
e3
=
Effect
.
CreateEffect
(
c
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_HAND
)
e3
:
SetRange
(
LOCATION_HAND
)
e3
:
SetCountLimit
(
1
,
121999032
)
e3
:
SetCountLimit
(
1
,
id
)
e3
:
SetCost
(
s
.
pzcost
)
e3
:
SetCost
(
s
.
pzcost
)
e3
:
SetTarget
(
s
.
pztg
)
e3
:
SetTarget
(
s
.
pztg
)
e3
:
SetOperation
(
s
.
pzop
)
e3
:
SetOperation
(
s
.
pzop
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
--
Apply the damage-inflicting effect of 1 "Valmonica" Normal Spell/Trap
--
copy
local
e4
=
Effect
.
CreateEffect
(
c
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCountLimit
(
1
,
121900032
)
e4
:
SetCountLimit
(
1
,
id
+
o
)
e4
:
SetCondition
(
function
(
e
)
return
e
:
GetHandler
():
GetFlagEffect
(
id
)
>
0
end
)
e4
:
SetCondition
(
s
.
cpcon
)
e4
:
SetCost
(
s
.
cpcost
)
e4
:
SetTarget
(
s
.
cptg
)
e4
:
SetTarget
(
s
.
cptg
)
e4
:
SetOperation
(
s
.
cpop
)
e4
:
SetOperation
(
s
.
cpop
)
c
:
RegisterEffect
(
e4
)
c
:
RegisterEffect
(
e4
)
-- Register flag on summon
if
not
s
.
global_check
then
if
not
c121999032
.
global_check
then
s
.
global_check
=
true
c121999032
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
ge1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
ge1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
ge1
:
SetLabel
(
id
)
ge1
:
SetLabel
(
id
)
ge1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
ge1
:
SetOperation
(
aux
.
sumreg
)
ge1
:
SetOperation
(
aux
.
sumreg
)
Duel
.
RegisterEffect
(
ge1
,
0
)
Duel
.
RegisterEffect
(
ge1
,
0
)
local
ge2
=
ge1
:
Clone
()
local
ge2
=
ge1
:
Clone
()
ge2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
ge2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
ge2
:
SetLabel
(
id
)
Duel
.
RegisterEffect
(
ge2
,
0
)
Duel
.
RegisterEffect
(
ge2
,
0
)
end
end
end
end
function
s
.
c
top
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
c
filter
(
c
)
s
.
addcounter
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
c
:
GetOriginalRace
()
&
RACE_FAIRY
>
0
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
>
0
end
end
function
s
.
addcounter
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
ctcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_PZONE
,
0
,
1
,
e
:
GetHandler
())
and
r
==
REASON_EFFECT
and
ep
==
tp
end
function
s
.
ctop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
c
:
AddCounter
(
0x69
,
1
)
c
:
AddCounter
(
0x170
,
1
)
Duel
.
RaiseEvent
(
c
,
EVENT_CUSTOM
+
121999035
,
e
,
0
,
tp
,
tp
,
1
)
if
c
:
GetCounter
(
0x170
)
==
3
then
Duel
.
RaiseEvent
(
c
,
EVENT_CUSTOM
+
100421035
,
e
,
0
,
tp
,
tp
,
0
)
end
end
function
s
.
adval
(
e
,
c
)
return
Duel
.
GetCounter
(
e
:
GetHandlerPlayer
(),
1
,
0
,
0x170
)
*-
100
end
end
function
s
.
pzcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
pzcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
c
)
end
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
)
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
,
c
)
end
end
function
s
.
pz
filter
(
c
)
function
s
.
filter
(
c
)
return
c
:
IsCode
(
1
21999
031
)
and
not
c
:
IsForbidden
()
return
c
:
IsCode
(
1
00421
031
)
and
not
c
:
IsForbidden
()
end
end
function
s
.
pztg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
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
)
if
chk
==
0
then
return
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
and
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
)
and
Duel
.
IsExistingMatchingCard
(
s
.
pz
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
and
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
end
end
function
s
.
pzop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
pzop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
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
if
not
(
c
:
IsRelateToEffect
(
e
)
and
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
and
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
))
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
pzfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
not
tc
then
return
end
if
tc
then
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
end
end
end
function
s
.
cpcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
cpcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
e
:
SetLabel
(
1
)
return
e
:
GetHandler
():
GetFlagEffect
(
id
)
>
0
return
true
end
end
function
s
.
cpfilter
(
c
)
function
s
.
pfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
(
c
:
GetType
()
==
TYPE_TRAP
or
c
:
GetType
()
==
TYPE_SPELL
)
and
c
:
IsAbleToRemoveAsCost
()
local
typ
=
c
:
GetType
()
return
c
:
IsSetCard
(
0x2a3
)
and
(
typ
==
TYPE_SPELL
or
typ
==
TYPE_TRAP
)
and
c
:
IsAbleToRemoveAsCost
()
and
c
:
CheckActivateEffect
(
false
,
true
,
false
)
and
c
:
CheckActivateEffect
(
false
,
true
,
false
)
end
end
function
s
.
cptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
cptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
chk
==
0
then
return
e
:
IsCostChecked
()
if
e
:
GetLabel
()
==
0
then
return
false
end
and
Duel
.
IsExistingMatchingCard
(
s
.
pfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
e
:
SetLabel
(
0
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
):
GetFirst
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
pfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
):
GetFirst
()
local
te
,
ceg
,
cep
,
cev
,
cre
,
cr
,
crp
=
tc
:
CheckActivateEffect
(
false
,
true
,
true
)
e
:
SetLabelObject
(
te
)
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_COST
)
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_COST
)
e
:
SetLabelObject
(
tc
)
e
:
SetProperty
(
te
:
GetProperty
())
local
tg
=
te
:
GetTarget
()
if
tg
then
tg
(
e
,
tp
,
ceg
,
cep
,
cev
,
cre
,
cr
,
crp
,
1
)
end
te
:
SetLabelObject
(
e
:
GetLabelObject
())
e
:
SetLabelObject
(
te
)
Duel
.
ClearOperationInfo
(
0
)
end
end
function
s
.
cpop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
cpop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
local
te
=
e
:
GetLabelObject
()
if
not
tc
then
return
end
if
not
te
then
return
end
local
eff
=
tc
:
GetActivateEffect
()
e
:
SetLabelObject
(
te
:
GetLabelObject
())
local
op
=
eff
:
GetOperation
()
local
op
=
te
:
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
,
2
)
end
if
op
then
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
1
)
end
end
end
expansions/script/c100421033.lua
View file @
6c72c127
--ヴァルモニカの異神-ジュラルメ
--ヴァルモニカの異神-ジュラルメ
local
s
,
id
=
GetID
()
--Odd Deity of Valmonica - Giurarme
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
c
:
EnableReviveLimit
()
c
:
SetSPSummonOnce
(
id
)
--material
--Link Summon procedure
aux
.
AddLinkProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsType
,
TYPE_EFFECT
),
1
,
1
)
aux
.
AddLinkProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsLinkType
,
TYPE_EFFECT
),
1
)
--spsummon condition
--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
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCategory
(
CATEGORY_DESTROY
)
e1
:
SetCode
(
EFFECT_SPSUMMON_COST
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCost
(
s
.
spcost
)
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
)
c
:
RegisterEffect
(
e1
)
--This card can make a 2nd and 3rd attack this turn
--spsum once
c
:
SetSPSummonOnce
(
id
)
--destroy
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetCategory
(
CATEGORY_DESTROY
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCondition
(
function
()
return
Duel
.
IsAbleToEnterBP
()
end
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetCost
(
s
.
tripleatkcost
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e2
:
SetTarget
(
s
.
tripleatktg
)
e2
:
SetCondition
(
s
.
descon
)
e2
:
SetOperation
(
s
.
tripleatkop
)
e2
:
SetTarget
(
s
.
destg
)
e2
:
SetOperation
(
s
.
desop
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--three attacks
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCondition
(
s
.
tacon
)
e3
:
SetCost
(
s
.
tacost
)
e3
:
SetTarget
(
s
.
tatg
)
e3
:
SetOperation
(
s
.
taop
)
c
:
RegisterEffect
(
e3
)
end
end
function
s
.
sp
cfilter
(
c
)
function
s
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_FAIRY
)
and
c
:
GetCounter
(
0x69
)
>=
3
return
c
:
GetOriginalRace
()
&
RACE_FAIRY
>
0
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
>
0
and
c
:
GetCounter
(
0x170
)
>
2
end
end
function
s
.
spcost
(
e
,
c
,
tp
,
st
)
function
s
.
spcost
(
e
,
c
,
tp
,
st
)
if
(
st
&
SUMMON_TYPE_LINK
)
~=
SUMMON_TYPE_LINK
then
return
true
end
if
st
&
SUMMON_TYPE_LINK
~=
SUMMON_TYPE_LINK
then
return
true
end
return
Duel
.
IsExistingMatchingCard
(
s
.
spcfilter
,
tp
,
LOCATION_PZONE
,
0
,
1
,
nil
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_PZONE
,
0
,
1
,
nil
)
end
function
s
.
descon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_LINK
)
end
end
function
s
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
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
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
1
-
tp
)
end
local
ct
=
Duel
.
GetCounter
(
tp
,
1
,
0
,
0x69
)
local
ct
=
0
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_PZONE
,
0
)
for
tc
in
aux
.
Next
(
g
)
do
ct
=
ct
+
tc
:
GetCounter
(
0x170
)
end
if
chk
==
0
then
return
ct
>
0
and
Duel
.
IsExistingTarget
(
nil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
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
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
t
g
=
Duel
.
SelectTarget
(
tp
,
nil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
ct
,
nil
)
local
g
=
Duel
.
SelectTarget
(
tp
,
nil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
ct
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
tg
,
#
tg
,
tp
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
#
g
,
0
,
0
)
end
end
function
s
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tg
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
):
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
Duel
.
Destroy
(
Duel
.
GetTargetsRelateToChain
(),
REASON_EFFECT
)
if
#
tg
>
0
then
Duel
.
Destroy
(
tg
,
REASON_EFFECT
)
end
end
end
function
s
.
tripleatkcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
tacon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
chk
==
0
then
return
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
0
,
0x69
,
3
,
REASON_COST
)
end
return
Duel
.
IsAbleToEnterBP
()
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x69
,
3
,
REASON_COST
)
end
end
function
s
.
tripleatktg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
chk
(
g
,
tp
)
if
chk
==
0
then
local
tl
=
0
local
effs
=
{
e
:
GetHandler
():
IsHasEffect
(
EFFECT_EXTRA_ATTACK
)}
for
tc
in
aux
.
Next
(
g
)
do
for
_
,
eff
in
ipairs
(
effs
)
do
local
ct
=
0
if
eff
:
GetValue
()
>=
2
then
for
i
=
1
,
3
do
return
false
if
tc
:
IsCanRemoveCounter
(
tp
,
0x170
,
i
,
REASON_COST
)
then
ct
=
i
end
end
end
end
return
true
tl
=
tl
+
ct
end
end
return
tl
>
2
end
end
function
s
.
tripleatkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
tacost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_PZONE
,
0
)
if
c
:
IsRelateToEffect
(
e
)
then
if
chk
==
0
then
return
g
:
CheckSubGroup
(
s
.
chk
,
1
,
99
,
tp
)
end
--Can make a 2nd and 3rd attack this turn
local
ct
=
0
local
e1
=
Effect
.
CreateEffect
(
c
)
while
ct
<
3
do
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
local
tc
=
g
:
FilterSelect
(
tp
,
Card
.
IsCanRemoveCounter
,
1
,
1
,
nil
,
tp
,
0x170
,
1
,
REASON_COST
):
GetFirst
()
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_CLIENT_HINT
)
tc
:
RemoveCounter
(
tp
,
0x170
,
1
,
REASON_COST
)
e1
:
SetCode
(
EFFECT_EXTRA_ATTACK
)
ct
=
ct
+
1
e1
:
SetValue
(
2
)
e1
:
SetReset
(
RESET_EVENT
|
RESETS_STANDARD
|
RESET_PHASE
|
PHASE_END
)
c
:
RegisterEffect
(
e1
)
end
end
end
end
\ No newline at end of file
function
s
.
tatg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
GetEffectCount
(
EFFECT_EXTRA_ATTACK
)
==
0
end
end
function
s
.
taop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EXTRA_ATTACK
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e1
:
SetValue
(
2
)
c
:
RegisterEffect
(
e1
)
end
expansions/script/c100421034.lua
View file @
6c72c127
--ヴァルモニカの神異-ゼブフェーラ
--ヴァルモニカの神異-ゼブフェーラ
local
s
,
id
=
GetID
()
--Divine Oddity of Valmonica - Zebufera
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
c
:
EnableReviveLimit
()
c
:
SetSPSummonOnce
(
id
)
--material
--Link Summon procedure
aux
.
AddLinkProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsType
,
TYPE_EFFECT
),
1
,
1
)
aux
.
AddLinkProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsLinkType
,
TYPE_EFFECT
),
1
)
--spsummon condition
--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
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DESTROY_REPLACE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_COST
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetTarget
(
s
.
reptg
)
e1
:
SetCost
(
s
.
spcost
)
e1
:
SetValue
(
s
.
repval
)
e1
:
SetOperation
(
s
.
repop
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--Apply the effect of 1 "Valmonica" Normal Spell/Trap that is banished or in your GY
--spsum once
c
:
SetSPSummonOnce
(
id
)
--destroy replace
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EFFECT_DESTROY_REPLACE
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetHintTiming
(
0
,
TIMING_STANDBY_PHASE
+
TIMING_MAIN_END
+
TIMINGS_CHECK_MONSTER
)
e2
:
SetTarget
(
s
.
desreptg
)
e2
:
SetCountLimit
(
1
)
e2
:
SetValue
(
s
.
desrepval
)
e2
:
SetCondition
(
function
(
e
,
tp
)
return
Duel
.
GetTurnPlayer
()
==
1
-
tp
end
)
e2
:
SetOperation
(
s
.
desrepop
)
e2
:
SetTarget
(
s
.
cptg
)
e2
:
SetOperation
(
s
.
cpop
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--copy
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e3
:
SetCondition
(
s
.
cpcon
)
e3
:
SetTarget
(
s
.
cptg
)
e3
:
SetOperation
(
s
.
cpop
)
c
:
RegisterEffect
(
e3
)
end
end
function
s
.
sp
cfilter
(
c
)
function
s
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_FIEND
)
and
c
:
GetCounter
(
0x69
)
>=
3
return
c
:
GetOriginalRace
()
&
RACE_FIEND
>
0
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
>
0
and
c
:
GetCounter
(
0x170
)
>
2
end
end
function
s
.
spcost
(
e
,
c
,
tp
,
st
)
function
s
.
spcost
(
e
,
c
,
tp
,
st
)
if
(
st
&
SUMMON_TYPE_LINK
)
~=
SUMMON_TYPE_LINK
then
return
true
end
if
st
&
SUMMON_TYPE_LINK
~=
SUMMON_TYPE_LINK
then
return
true
end
return
Duel
.
IsExistingMatchingCard
(
s
.
sp
cfilter
,
tp
,
LOCATION_PZONE
,
0
,
1
,
nil
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_PZONE
,
0
,
1
,
nil
)
end
end
function
s
.
filter1
(
c
,
tp
)
function
s
.
desrepchk
(
g
,
tp
)
return
not
c
:
IsReason
(
REASON_REPLACE
)
and
c
:
IsLocation
(
LOCATION_ONFIELD
)
and
c
:
IsControler
(
tp
)
local
tl
=
0
and
c
:
IsReason
(
REASON_EFFECT
+
REASON_BATTLE
)
for
tc
in
aux
.
Next
(
g
)
do
local
ct
=
0
for
i
=
1
,
3
do
if
tc
:
IsCanRemoveCounter
(
tp
,
0x170
,
i
,
REASON_COST
)
then
ct
=
i
end
end
tl
=
tl
+
ct
end
return
tl
>
2
end
end
function
s
.
reptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
desrepfilter
(
c
,
tp
)
return
c
:
IsReason
(
REASON_BATTLE
+
REASON_EFFECT
)
and
not
c
:
IsReason
(
REASON_REPLACE
)
and
c
:
IsControler
(
tp
)
and
c
:
IsOnField
()
end
function
s
.
desreptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
g
=
eg
:
Filter
(
s
.
filter1
,
nil
,
tp
)
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_PZONE
,
0
)
if
chk
==
0
then
return
#
g
>
0
and
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
0
,
0x69
,
3
,
REASON_EFFECT
)
end
if
chk
==
0
then
return
eg
:
IsExists
(
s
.
desrepfilter
,
1
,
nil
,
tp
)
and
g
:
CheckSubGroup
(
s
.
desrepchk
,
1
,
2
)
end
return
Duel
.
SelectEffectYesNo
(
tp
,
c
,
96
)
return
Duel
.
SelectEffectYesNo
(
tp
,
c
,
96
)
end
end
function
s
.
repval
(
e
,
c
)
function
s
.
des
repval
(
e
,
c
)
return
s
.
filter1
(
c
,
e
:
GetHandlerPlayer
())
return
s
.
desrepfilter
(
c
,
e
:
GetHandlerPlayer
())
end
end
function
s
.
repop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
desrepop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x69
,
3
,
REASON_EFFECT
)
Duel
.
Hint
(
HINT_CARD
,
0
,
id
)
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_PZONE
,
0
)
local
ct
=
0
while
ct
<
3
do
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
local
tc
=
g
:
FilterSelect
(
tp
,
Card
.
IsCanRemoveCounter
,
1
,
1
,
nil
,
tp
,
0x170
,
1
,
REASON_COST
):
GetFirst
()
tc
:
RemoveCounter
(
tp
,
0x170
,
1
,
REASON_COST
)
ct
=
ct
+
1
end
end
end
function
s
.
cpfilter
(
c
)
function
s
.
cpcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
c
:
IsSetCard
(
0x19e
)
and
(
c
:
GetType
()
==
TYPE_TRAP
or
c
:
GetType
()
==
TYPE_SPELL
)
return
Duel
.
GetTurnPlayer
()
==
1
-
tp
and
c
:
IsFaceup
()
and
c
:
CheckActivateEffect
(
false
,
true
,
false
)
end
function
s
.
filter
(
c
)
local
typ
=
c
:
GetType
()
return
c
:
IsFaceupEx
()
and
c
:
IsSetCard
(
0x2a3
)
and
(
typ
==
TYPE_SPELL
or
typ
==
TYPE_TRAP
)
and
c
:
CheckActivateEffect
(
false
,
true
,
false
)
end
end
function
s
.
cptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
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
chkc
then
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
|
LOCATION_REMOVED
,
0
,
1
,
nil
)
end
local
te
=
e
:
GetLabelObject
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
local
tg
=
te
:
GetTarget
()
local
tc
=
Duel
.
SelectTarget
(
tp
,
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
|
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
):
GetFirst
()
return
tg
and
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
0
,
chkc
)
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
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
local
tc
=
Duel
.
SelectTarget
(
tp
,
s
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
):
GetFirst
()
local
te
,
ceg
,
cev
,
cre
,
cr
,
crp
=
tc
:
CheckActivateEffect
(
false
,
true
,
true
)
Duel
.
ClearTargetCard
()
tc
:
CreateEffectRelation
(
e
)
local
tg
=
te
:
GetTarget
()
if
tg
then
tg
(
e
,
tp
,
ceg
,
cev
,
cre
,
cr
,
crp
,
1
)
end
te
:
SetLabelObject
(
e
:
GetLabelObject
())
e
:
SetLabelObject
(
te
)
Duel
.
ClearOperationInfo
(
0
)
Duel
.
ClearOperationInfo
(
0
)
end
end
function
s
.
cpop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
cpop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
local
te
=
e
:
GetLabelObject
()
if
not
tc
:
IsRelateToEffect
(
e
)
then
return
end
if
not
(
te
and
te
:
GetHandler
():
IsRelateToEffect
(
e
))
then
return
end
local
eff
=
tc
:
CheckActivateEffect
(
false
,
true
,
false
)
e
:
SetLabelObject
(
te
:
GetLabelObject
())
if
not
eff
then
return
end
local
op
=
te
:
GetOperation
()
local
op
=
eff
:
GetOperation
()
if
op
then
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
if
op
then
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
end
end
\ No newline at end of file
expansions/script/c100421035.lua
View file @
6c72c127
--天魔の聲選器-『ヴァルモニカ』
--天魔の聲選器-『ヴァルモニカ』
local
s
,
id
=
GetID
()
--Angelic-Demonic Selector - "Valmonica"
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
function
s
.
initial_effect
(
c
)
--Activate
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
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
,
id
,
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetOperation
(
s
.
activate
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--
Take control of 1 opponent's monster
--
control
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_
SPECIAL_SUMMON
)
e2
:
SetCategory
(
CATEGORY_
CONTROL
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
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
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetCountLimit
(
1
,{
id
,
1
})
e2
:
SetCode
(
EVENT_CUSTOM
+
id
)
e2
:
SetCondition
(
s
.
ctrlcon
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetTarget
(
s
.
ctrltg
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e2
:
SetOperation
(
s
.
ctrlop
)
e2
:
SetCondition
(
s
.
concon
)
e2
:
SetTarget
(
s
.
contg
)
e2
:
SetOperation
(
s
.
conop
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
end
end
function
s
.
th
filter
(
c
)
function
s
.
filter
(
c
)
return
c
:
Is
Type
(
TYPE_MONSTER
)
and
c
:
IsSetCard
(
0x19e
)
and
c
:
IsAbleToHand
()
return
c
:
Is
SetCard
(
0x2a3
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
th
filter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
0
))
then
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
1
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
sg
,
nil
,
REASON_EFFECT
)
Duel
.
SendtoHand
(
sg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
sg
)
Duel
.
ConfirmCards
(
1
-
tp
,
sg
)
end
end
end
end
function
s
.
c
trl
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
c
on
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
ep
==
tp
and
eg
:
GetFirst
():
GetCounter
(
0x69
)
==
3
return
ep
==
tp
end
end
function
s
.
ctrltg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
function
s
.
contg
(
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
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
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CONTROL
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CONTROL
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_CONTROL
,
g
,
1
,
tp
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_CONTROL
,
g
,
1
,
0
,
0
)
end
end
function
s
.
ctrlop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
conop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
GetControl
(
tc
,
tp
,
PHASE_END
,
1
)
>
0
then
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
GetControl
(
tc
,
tp
,
PHASE_END
,
1
)
>
0
then
--It cannot declare an attack
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetDescription
(
3206
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_ATTACK_ANNOUNCE
)
e1
:
SetCode
(
EFFECT_CANNOT_ATTACK
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
+
RESET_PHASE
+
PHASE_END
)
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
)
tc
:
RegisterEffect
(
e1
)
end
end
end
end
expansions/script/c100421036.lua
0 → 100644
View file @
6c72c127
--ヴァルモニカ・シェルタ
--Valmonica Scelta
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_TODECK
+
CATEGORY_DRAW
+
CATEGORY_DAMAGE
+
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
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
)
end
function
s
.
filter
(
c
)
return
c
:
IsSetCard
(
0x2a3
)
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsAbleToHand
()
and
not
c
:
IsCode
(
id
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
op
)
if
op
==
nil
then
local
p
=
Duel
.
IsExistingMatchingCard
(
Card
.
IsSetCard
,
tp
,
LOCATION_PZONE
,
0
,
1
,
nil
,
0x2a3
)
and
tp
or
1
-
tp
op
=
aux
.
SelectFromOptions
(
p
,{
true
,
aux
.
Stringid
(
id
,
1
)},{
true
,
aux
.
Stringid
(
id
,
2
)})
end
if
op
==
1
then
if
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
<
1
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToDeck
,
tp
,
LOCATION_HAND
,
0
,
nil
)
if
#
g
>
0
and
Duel
.
IsPlayerCanDraw
(
tp
,
2
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
3
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
sg
)
Duel
.
BreakEffect
()
Duel
.
SendtoDeck
(
sg
,
nil
,
SEQ_DECKBOTTOM
,
REASON_EFFECT
)
if
sg
:
GetFirst
():
IsLocation
(
LOCATION_DECK
)
then
Duel
.
Draw
(
tp
,
2
,
REASON_EFFECT
)
end
end
elseif
Duel
.
Damage
(
tp
,
500
,
REASON_EFFECT
)
>
0
then
local
g
=
Duel
.
GetMatchingGroup
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
4
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
BreakEffect
()
Duel
.
SendtoHand
(
sg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
sg
)
end
end
end
expansions/script/c100421037.lua
View file @
6c72c127
--ヴァルモニカ・ヴェルサーレ
--ヴァルモニカ・ヴェルサーレ
local
s
,
id
=
GetID
()
--Valmonica Versare
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_
TOHAND
+
CATEGORY_SEARCH
+
CATEGORY_DAMAGE
+
CATEGORY_TOGRAVE
)
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_
SEARCH
+
CATEGORY_TOHAND
+
CATEGORY_DAMAGE
+
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
,
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
filter
(
c
)
if
chk
==
0
then
return
true
end
return
c
:
IsSetCard
(
0x2a3
)
and
c
:
IsAbleToGrave
()
and
not
c
:
IsCode
(
id
)
end
end
function
s
.
tgfilter
(
c
)
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
op
)
return
c
:
IsSetCard
(
0x19e
)
and
not
c
:
IsCode
(
id
)
and
c
:
IsAbleToGrave
()
if
op
==
nil
then
end
local
p
=
Duel
.
IsExistingMatchingCard
(
Card
.
IsSetCard
,
tp
,
LOCATION_PZONE
,
0
,
1
,
nil
,
0x2a3
)
and
tp
or
1
-
tp
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
angle_or_delvin
)
--Additional parameter used by "Angelo Valmonica" and "Demone Valmonica"
op
=
aux
.
SelectFromOptions
(
p
,{
true
,
aux
.
Stringid
(
id
,
1
)},{
true
,
aux
.
Stringid
(
id
,
2
)})
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
end
if
op
==
0
then
if
op
==
1
then
--Gain 500 LP and excavate cards from the top of your Deck
if
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
<
1
or
not
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
3
))
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsSetCard
,
tp
,
LOCATION_DECK
,
0
,
nil
,
0x19e
)
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsSetCard
,
tp
,
LOCATION_DECK
,
0
,
nil
,
0x2a3
)
if
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
5
))
then
local
dct
=
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
local
spcard
,
seq
=
g
:
GetMaxGroup
(
Card
.
GetSequence
)
local
seq
,
hc
=-
1
spcard
=
spcard
:
GetFirst
()
for
tc
in
aux
.
Next
(
g
)
do
if
not
spcard
then
return
end
local
sq
=
tc
:
GetSequence
()
Duel
.
BreakEffect
()
if
sq
>
seq
then
Duel
.
ConfirmDecktop
(
tp
,
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
-
seq
)
seq
=
sq
if
spcard
:
IsAbleToHand
()
then
hc
=
tc
Duel
.
SendtoHand
(
spcard
,
nil
,
REASON_EFFECT
)
end
Duel
.
ConfirmCards
(
1
-
tp
,
spcard
)
end
Duel
.
BreakEffect
()
if
seq
>-
1
then
Duel
.
ConfirmDecktop
(
tp
,
dct
-
seq
)
Duel
.
DisableShuffleCheck
()
if
hc
:
IsAbleToHand
()
then
Duel
.
SendtoHand
(
hc
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
hc
)
Duel
.
ShuffleHand
(
tp
)
else
else
Duel
.
SendtoGrave
(
spcard
,
REASON_RULE
)
Duel
.
SendtoGrave
(
hc
,
REASON_RULE
)
end
end
else
Duel
.
ConfirmDecktop
(
tp
,
dct
)
end
end
elseif
op
==
1
then
if
dct
-
seq
>
1
then
Duel
.
ShuffleDeck
(
tp
)
end
--Take 500 damage and send 1 "Valmonica" card from your Deck to the GY
elseif
Duel
.
Damage
(
tp
,
500
,
REASON_EFFECT
)
>
0
then
local
g
=
Duel
.
GetMatchingGroup
(
s
.
tg
filter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
filter
,
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
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
4
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
BreakEffect
()
Duel
.
BreakEffect
()
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
end
end
end
end
\ No newline at end of file
expansions/script/c100421038.lua
View file @
6c72c127
--ヴァルモニカ・イントナーレ
--ヴァルモニカ・イントナーレ
local
s
,
id
=
GetID
()
--Valmonica Intonare
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
function
s
.
initial_effect
(
c
)
--Activate
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
...
@@ -7,49 +9,36 @@ function s.initial_effect(c)
...
@@ -7,49 +9,36 @@ function s.initial_effect(c)
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_DAMAGE
+
CATEGORY_TOHAND
)
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_DAMAGE
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
,
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
filter
(
c
,
e
,
tp
)
if
chk
==
0
then
return
true
end
end
function
s
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
end
function
s
.
t
hfilter
(
c
)
function
s
.
hfilter
(
c
)
return
c
:
IsLevel
(
4
)
and
c
:
IsAbleToHand
()
return
c
:
IsLevel
(
4
)
and
c
:
IsAbleToHand
()
end
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
angle_or_delvin
)
--Additional parameter used by "Angelo Valmonica" and "Demone Valmonica"
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
op
)
local
op
=
nil
if
op
==
nil
then
if
angle_or_delvin
then
local
p
=
Duel
.
IsExistingMatchingCard
(
Card
.
IsSetCard
,
tp
,
LOCATION_PZONE
,
0
,
1
,
nil
,
0x2a3
)
and
tp
or
1
-
tp
op
=
angle_or_delvin
op
=
aux
.
SelectFromOptions
(
p
,{
true
,
aux
.
Stringid
(
id
,
1
)},{
true
,
aux
.
Stringid
(
id
,
2
)})
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
end
if
op
==
0
then
if
op
==
1
then
--Gain 500 LP and Special Summon 1 monster from your GY
if
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
<
1
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
NecroValleyFilter
(
s
.
spfilter
),
tp
,
LOCATION_GRAVE
,
0
,
nil
,
e
,
tp
)
local
g
=
Duel
.
SelectMatchingCard
(
1
-
tp
,
s
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
then
if
#
g
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
1
-
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
Select
(
1
-
tp
,
1
,
1
,
nil
)
Duel
.
BreakEffect
()
Duel
.
BreakEffect
()
Duel
.
SpecialSummon
(
s
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
elseif
op
==
1
then
elseif
Duel
.
Damage
(
tp
,
500
,
REASON_EFFECT
)
>
0
then
--Take 500 damage and add 1 Level 4 monster from your GY to your hand
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
NecroValleyFilter
(
s
.
hfilter
),
tp
,
LOCATION_GRAVE
,
0
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
NecroValleyFilter
(
s
.
thfilter
),
tp
,
LOCATION_GRAVE
,
0
,
nil
)
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
3
))
then
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
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
h
g
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
local
s
g
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
BreakEffect
()
Duel
.
BreakEffect
()
Duel
.
SendtoHand
(
h
g
,
nil
,
REASON_EFFECT
)
Duel
.
SendtoHand
(
s
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
h
g
)
Duel
.
ConfirmCards
(
1
-
tp
,
s
g
)
end
end
end
end
end
end
\ No newline at end of file
expansions/script/c100421039.lua
View file @
6c72c127
--律導のヴァルモニカ
--律導のヴァルモニカ
local
s
,
id
=
GetID
()
--Valmonica of the Guiding Rhythm
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
function
s
.
initial_effect
(
c
)
--Activate
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
...
@@ -7,65 +9,47 @@ function s.initial_effect(c)
...
@@ -7,65 +9,47 @@ function s.initial_effect(c)
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_DESTROY
+
CATEGORY_DAMAGE
+
CATEGORY_TOHAND
)
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_DESTROY
+
CATEGORY_DAMAGE
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMING_MAIN_END
+
TIMINGS_CHECK_MONSTER
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCountLimit
(
1
,
id
,
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
s
.
condition
)
e1
:
SetCondition
(
s
.
condition
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
function
s
.
cfilter
(
c
)
function
s
.
cfilter
(
c
)
return
c
:
Is
SetCard
(
0x19e
)
and
c
:
IsFaceup
()
and
(
c
:
IsType
(
TYPE_MONSTER
)
or
c
:
IsType
(
TYPE_PENDULUM
))
return
c
:
Is
Faceup
()
and
c
:
IsSetCard
(
0x2a3
)
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
>
0
end
end
function
s
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
afilter
(
c
)
if
chk
==
0
then
return
true
end
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x2a3
)
and
c
:
IsType
(
TYPE_LINK
)
end
end
function
s
.
linkfilter
(
c
)
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
op
)
return
c
:
IsSetCard
(
0x19e
)
and
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_LINK
)
if
op
==
nil
then
end
local
chk
=
Duel
.
IsExistingMatchingCard
(
s
.
afilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
angle_or_delvin
)
--Additional parameter used by "Angelo Valmonica" and "Demone Valmonica"
op
=
aux
.
SelectFromOptions
(
tp
,
local
op
=
nil
{
true
,
aux
.
Stringid
(
id
,
1
)},
if
angle_or_delvin
then
{
true
,
aux
.
Stringid
(
id
,
2
)},
op
=
angle_or_delvin
{
chk
,
aux
.
Stringid
(
id
,
3
)})
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
end
local
break_chk
=
nil
if
op
&
1
>
0
and
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
>
0
then
if
op
==
0
or
op
==
2
then
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsType
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
aux
.
ExceptThisCard
(
e
),
TYPE_SPELL
+
TYPE_TRAP
)
--Gain 500 LP and Destroy 1 Spell/Trap on the field
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
4
))
then
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
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
d
g
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
local
s
g
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
dg
,
true
)
Duel
.
HintSelection
(
sg
)
Duel
.
BreakEffect
()
Duel
.
BreakEffect
()
Duel
.
Destroy
(
d
g
,
REASON_EFFECT
)
Duel
.
Destroy
(
s
g
,
REASON_EFFECT
)
end
end
if
op
==
3
then
Duel
.
BreakEffect
()
end
end
end
if
op
==
1
or
op
==
2
then
if
op
&
2
>
0
and
Duel
.
Damage
(
tp
,
500
,
REASON_EFFECT
)
>
0
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
)
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToHand
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
)
if
break_chk
then
Duel
.
BreakEffect
()
end
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
5
))
then
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
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
h
g
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
local
s
g
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
hg
,
true
)
Duel
.
HintSelection
(
sg
)
Duel
.
BreakEffect
()
Duel
.
BreakEffect
()
Duel
.
SendtoHand
(
h
g
,
nil
,
REASON_EFFECT
)
Duel
.
SendtoHand
(
s
g
,
nil
,
REASON_EFFECT
)
end
end
end
end
end
end
expansions/script/c100421040.lua
View file @
6c72c127
--選律のヴァルモニカ
--選律のヴァルモニカ
local
s
,
id
=
GetID
()
--Valmonica of the Selecting Melody
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
function
s
.
initial_effect
(
c
)
--Activate
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_D
AMAGE
+
CATEGORY_DISABLE
)
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_D
ESTROY
+
CATEGORY_DAMAGE
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
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
:
SetCountLimit
(
1
,
id
,
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
s
.
condition
)
e1
:
SetCondition
(
s
.
condition
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
function
s
.
cfilter
(
c
)
function
s
.
cfilter
(
c
)
return
c
:
Is
SetCard
(
0x19e
)
and
c
:
IsFaceup
()
and
(
c
:
IsType
(
TYPE_MONSTER
)
or
c
:
IsType
(
TYPE_PENDULUM
))
return
c
:
Is
Faceup
()
and
c
:
IsSetCard
(
0x2a3
)
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
>
0
end
end
function
s
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
afilter
(
c
)
if
chk
==
0
then
return
true
end
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x2a3
)
and
c
:
IsType
(
TYPE_LINK
)
end
end
function
s
.
target1
(
e
,
c
)
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
op
)
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
()
local
c
=
e
:
GetHandler
()
if
op
==
0
or
op
==
2
then
if
op
==
nil
then
--Gain 500 LP and apply the targeting procetion effect
local
chk
=
Duel
.
IsExistingMatchingCard
(
s
.
afilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
if
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
>
0
then
op
=
aux
.
SelectFromOptions
(
tp
,
break_chk
=
true
{
true
,
aux
.
Stringid
(
id
,
1
)},
Duel
.
RegisterFlagEffect
(
tp
,
id
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
,
0
,
1
)
{
true
,
aux
.
Stringid
(
id
,
2
)},
--Your opponent cannot target "Valmonica" Monster Cards you control with card effects
{
chk
,
aux
.
Stringid
(
id
,
3
)})
local
e1
=
Effect
.
CreateEffect
(
c
)
end
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
if
op
&
1
>
0
and
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
>
0
then
e1
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CANNOT_BE_EFFECT_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetTargetRange
(
LOCATION_ONFIELD
,
0
)
e1
:
SetCode
(
EFFECT_CANNOT_BE_EFFECT_TARGET
)
e1
:
SetTarget
(
s
.
target1
)
e1
:
SetTargetRange
(
LOCATION_ONFIELD
,
0
)
e1
:
SetValue
(
aux
.
tgoval
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
e1
:
SetValue
(
aux
.
tgoval
)
end
Duel
.
RegisterEffect
(
e1
,
tp
)
if
op
==
3
then
Duel
.
BreakEffect
()
end
end
end
if
op
==
1
or
op
==
2
then
if
op
&
2
>
0
and
Duel
.
Damage
(
tp
,
500
,
REASON_EFFECT
)
>
0
then
--Take 500 damage and negate the effects of 1 opponent's Effect Monster
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
NegateEffectMonsterFilter
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
disfilter
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
4
))
then
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
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DISABLE
)
local
nc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
if
nc
:
IsCanBeDisabledByEffect
(
e
)
then
Duel
.
HintSelection
(
sg
)
Duel
.
NegateRelatedChain
(
nc
,
RESET_TURN_SET
)
local
tc
=
sg
:
GetFirst
()
local
e1
=
Effect
.
CreateEffect
(
c
)
Duel
.
BreakEffect
()
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
Duel
.
NegateRelatedChain
(
tc
,
RESET_TURN_SET
)
e1
:
SetCode
(
EFFECT_DISABLE
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
nc
:
RegisterEffect
(
e1
)
e1
:
SetCode
(
EFFECT_DISABLE
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
tc
:
RegisterEffect
(
e1
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
local
e2
=
e1
:
Clone
()
e2
:
SetValue
(
RESET_TURN_SET
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e2
:
SetValue
(
RESET_TURN_SET
)
nc
:
RegisterEffect
(
e2
)
tc
:
RegisterEffect
(
e2
)
end
end
end
end
end
end
end
\ No newline at end of file
function
s
.
target
(
e
,
c
)
return
c
:
IsSetCard
(
0x2a3
)
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
>
0
end
expansions/script/c101201084.lua
View file @
6c72c127
...
@@ -4,6 +4,7 @@ local s,id,o=GetID()
...
@@ -4,6 +4,7 @@ local s,id,o=GetID()
function
s
.
initial_effect
(
c
)
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
c
:
EnableReviveLimit
()
--material
--material
aux
.
AddMaterialCodeList
(
c
,
12275533
,
99733359
)
aux
.
AddFusionProcFun2
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsFusionCode
,
12275533
,
99733359
),
aux
.
FilterBoolFunction
(
Card
.
IsRace
,
RACE_MACHINE
+
RACE_DINOSAUR
),
true
)
aux
.
AddFusionProcFun2
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsFusionCode
,
12275533
,
99733359
),
aux
.
FilterBoolFunction
(
Card
.
IsRace
,
RACE_MACHINE
+
RACE_DINOSAUR
),
true
)
--indes
--indes
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
...
...
expansions/script/c101201086.lua
View file @
6c72c127
...
@@ -41,7 +41,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
...
@@ -41,7 +41,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
end
function
s
.
dfilter
(
c
)
function
s
.
dfilter
(
c
)
return
c
:
IsFacedown
()
or
c
:
IsSetCard
(
0x2a2
)
return
c
:
IsFacedown
()
or
c
:
IsSetCard
(
0x2a2
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
end
function
s
.
filter
(
c
)
function
s
.
filter
(
c
)
return
c
:
IsSetCard
(
0x2a2
)
and
c
:
IsAbleToHand
()
return
c
:
IsSetCard
(
0x2a2
)
and
c
:
IsAbleToHand
()
...
...
expansions/script/c101203001.lua
View file @
6c72c127
--スピリット・オブ・ユベル
--スピリット・オブ・ユベル
--Script by passingDio0
local
s
,
id
,
o
=
GetID
()
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
function
s
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
78371393
)
aux
.
AddCodeList
(
c
,
78371393
)
aux
.
AddSetNameMonsterList
(
c
,
0x2a4
)
--Special Summon (from hand : itself)
--Special Summon (from hand : itself)
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
...
@@ -14,7 +16,7 @@ function s.initial_effect(c)
...
@@ -14,7 +16,7 @@ function s.initial_effect(c)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--
Search
--
to hand/set
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
...
@@ -25,26 +27,26 @@ function s.initial_effect(c)
...
@@ -25,26 +27,26 @@ function s.initial_effect(c)
e2
:
SetTarget
(
s
.
thtg
)
e2
:
SetTarget
(
s
.
thtg
)
e2
:
SetOperation
(
s
.
thop
)
e2
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--
SpecialSummon
--
battle
local
e3
=
Effect
.
CreateEffect
(
c
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
3
))
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetCode
(
EFFECT_AVOID_BATTLE_DAMAGE
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetValue
(
1
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
)
e3
:
SetCode
(
EVENT_DESTROYED
)
e3
:
SetTarget
(
s
.
tg
)
e3
:
SetOperation
(
s
.
op
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
--battle
local
e4
=
Effect
.
CreateEffect
(
c
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
)
e4
:
SetCode
(
EFFECT_
AVOID_BATTLE_DAMAG
E
)
e4
:
SetCode
(
EFFECT_
INDESTRUCTABLE_BATTL
E
)
e4
:
SetValue
(
1
)
e4
:
SetValue
(
1
)
c
:
RegisterEffect
(
e4
)
c
:
RegisterEffect
(
e4
)
--special summon
local
e5
=
Effect
.
CreateEffect
(
c
)
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetType
(
EFFECT_TYPE_SINGLE
)
e5
:
SetDescription
(
aux
.
Stringid
(
id
,
3
))
e5
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e5
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e5
:
SetValue
(
1
)
e5
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e5
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e5
:
SetCode
(
EVENT_DESTROYED
)
e5
:
SetTarget
(
s
.
sptg2
)
e5
:
SetOperation
(
s
.
spop2
)
c
:
RegisterEffect
(
e5
)
c
:
RegisterEffect
(
e5
)
end
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
...
@@ -52,51 +54,47 @@ function s.spcon(e,tp,eg,ep,ev,re,r,rp)
...
@@ -52,51 +54,47 @@ function s.spcon(e,tp,eg,ep,ev,re,r,rp)
end
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
end
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
_DEFENSE
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
s
.
thfilter
(
c
)
function
s
.
thfilter
(
c
)
return
c
:
IsAbleToHand
()
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
aux
.
IsCodeListed
(
c
,
78371393
)
if
not
(
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
aux
.
IsCodeListed
(
c
,
78371393
))
then
return
false
end
return
c
:
IsAbleToHand
()
or
c
:
IsSSetable
()
end
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
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
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
end
end
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
id
,
2
)
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_OPERATECARD
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
local
c
=
g
:
GetFirst
()
local
tc
=
g
:
GetFirst
()
local
b1
=
c
:
IsAbleToHand
()
if
tc
then
local
b2
=
c
:
IsSSetable
()
if
tc
:
IsAbleToHand
()
and
(
not
tc
:
IsSSetable
()
or
Duel
.
SelectOption
(
tp
,
1190
,
1153
)
==
0
)
then
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
local
op
=
0
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
if
b1
and
b2
then
op
=
Duel
.
SelectOption
(
tp
,
1190
,
1153
)
elseif
b1
then
op
=
0
else
op
=
1
end
if
op
==
0
then
Duel
.
SendtoHand
(
c
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
else
else
Duel
.
SSet
(
tp
,
g
,
tp
,
true
)
Duel
.
SSet
(
tp
,
tc
)
end
end
end
end
end
end
function
s
.
spfilter
(
c
,
e
,
tp
)
function
s
.
filter2
(
c
,
e
,
tp
)
return
c
:
IsCode
(
78371393
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
and
(
c
:
IsLocation
(
LOCATION_HAND
+
LOCATION_DECK
+
LOCATION_GRAVE
+
LOCATION_REMOVED
)
or
c
:
IsFaceup
()
)
return
c
:
IsCode
(
78371393
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
true
)
end
end
function
s
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
sptg2
(
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
(
s
.
spfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_DECK
+
LOCATION_HAND
+
LOCATION_REMOVED
,
0
,
1
,
nil
,
e
,
tp
)
end
and
Duel
.
IsExistingMatchingCard
(
s
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
+
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_
GRAVE
+
LOCATION_DECK
+
LOCATION_HAND
+
LOCATION_REMOVED
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_
HAND
+
LOCATION_DECK
+
LOCATION_GRAVE
+
LOCATION_REMOVED
)
end
end
function
s
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
spop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
spfilter
),
tp
,
LOCATION_GRAVE
+
LOCATION_DECK
+
LOCATION_HAND
+
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
filter2
),
tp
,
LOCATION_HAND
+
LOCATION_DECK
+
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
true
,
true
,
POS_FACEUP
)
Duel
.
ShuffleDeck
(
tp
)
end
end
end
end
\ No newline at end of file
expansions/script/c101203002.lua
View file @
6c72c127
--ガイストーチ・ゴーレム
--ガイストーチ・ゴーレム
--Script by passingDio0
local
s
,
id
,
o
=
GetID
()
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
function
s
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
78371393
)
aux
.
AddCodeList
(
c
,
78371393
)
aux
.
AddSetNameMonsterList
(
c
,
0x2a4
)
c
:
SetSPSummonOnce
(
id
)
c
:
SetSPSummonOnce
(
id
)
--SpecialSummon
local
e0
=
aux
.
AddThisCardInGraveAlreadyCheck
(
c
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCost
(
s
.
spcost
)
e1
:
SetCost
(
s
.
spcost
)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--
gain lp
--
recover
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_RECOVER
)
e2
:
SetCategory
(
CATEGORY_RECOVER
)
e2
:
SetType
(
EFFECT_TYPE_
SINGLE
+
EFFECT_TYPE_TRIGGER
_F
)
e2
:
SetType
(
EFFECT_TYPE_
QUICK
_F
)
e2
:
SetCode
(
EVENT_PRE_DAMAGE_CALCULATE
)
e2
:
SetCode
(
EVENT_PRE_DAMAGE_CALCULATE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCondition
(
s
.
recon
)
e2
:
SetCondition
(
s
.
reccon
)
e2
:
SetTarget
(
s
.
retg
)
e2
:
SetOperation
(
s
.
recop
)
e2
:
SetOperation
(
s
.
reop
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--
rerival
--
special summon from grave
local
e3
=
Effect
.
CreateEffect
(
c
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
3
))
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_CARD_TARGET
)
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e3
:
SetRange
(
LOCATION_GRAVE
)
e3
:
SetRange
(
LOCATION_GRAVE
)
e3
:
Set
Property
(
EFFECT_FLAG_DELAY
)
e3
:
Set
LabelObject
(
e0
)
e3
:
SetCondition
(
s
.
con
)
e3
:
SetCondition
(
s
.
spfg
con
)
e3
:
SetTarget
(
s
.
tg
)
e3
:
SetTarget
(
s
.
spfg
tg
)
e3
:
SetOperation
(
s
.
op
)
e3
:
SetOperation
(
s
.
spfg
op
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
end
end
function
s
.
c
ost
filter
(
c
)
function
s
.
cfilter
(
c
)
return
(
c
:
IsSetCard
(
0x2a4
)
or
c
:
IsCode
(
78371393
)
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsPublic
()
return
c
:
IsSetCard
(
0x2a4
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsPublic
()
end
end
function
s
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
c
ostfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
c
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CONFIRM
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CONFIRM
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
costfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
local
sc
=
g
:
GetFirst
()
Duel
.
ConfirmCards
(
1
-
tp
,
sc
)
Duel
.
ShuffleHand
(
tp
)
Duel
.
ShuffleHand
(
tp
)
local
tc
=
g
:
GetFirst
()
sc
:
CreateEffectRelation
(
e
)
tc
:
CreateEffectRelation
(
e
)
e
:
SetLabelObject
(
sc
)
e
:
SetLabelObject
(
tc
)
end
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
,
tp
)
>
0
local
c
=
e
:
GetHandler
()
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
,
1
-
tp
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
)
>
0
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
LOCATION_HAND
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
c
,
1
,
0
,
0
)
end
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
,
tp
)
>
0
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
1
-
tp
,
false
,
false
,
POS_FACEUP
)
end
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
,
1
-
tp
)
then
local
sc
=
e
:
GetLabelObject
()
Duel
.
SpecialSummon
(
e
:
GetHandler
(),
0
,
tp
,
1
-
tp
,
false
,
false
,
POS_FACEUP
)
if
sc
:
IsRelateToEffect
(
e
)
and
sc
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
tc
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
then
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
3
))
then
local
a
=
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
1
))
Duel
.
BreakEffect
()
if
a
then
Duel
.
SpecialSummon
(
sc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
end
end
end
end
function
s
.
rec
on
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
rec
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
ct
=
c
:
GetBattleTarget
()
local
bc
=
c
:
GetBattleTarget
()
return
ct
:
IsSetCard
(
0x2a4
)
or
ct
:
IsCode
(
78371393
)
return
bc
and
bc
:
IsFaceup
()
and
bc
:
IsSetCard
(
0x2a4
)
end
end
function
s
.
retg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
recop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
chk
==
0
then
return
true
end
Duel
.
Recover
(
1
-
tp
,
3000
,
REASON_EFFECT
)
Duel
.
SetTargetPlayer
(
1
-
tp
)
Duel
.
SetTargetParam
(
3000
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_RECOVER
,
nil
,
0
,
1
-
tp
,
1000
)
end
end
function
s
.
reop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
spfgfilter
(
c
,
tp
,
se
)
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
return
c
:
IsFaceup
()
and
c
:
IsSummonPlayer
(
tp
)
and
c
:
IsCode
(
78371393
)
and
c
:
IsType
(
TYPE_MONSTER
)
Duel
.
Recover
(
p
,
d
,
REASON_EFFECT
)
and
(
se
==
nil
or
c
:
GetReasonEffect
()
~=
se
)
end
end
function
s
.
spfilter
(
c
,
tp
)
function
s
.
spfgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
c
:
IsCode
(
78371393
)
or
c
:
IsSetCard
(
0x2a4
)
local
se
=
e
:
GetLabelObject
():
GetLabelObject
()
return
eg
:
IsExists
(
s
.
spfgfilter
,
1
,
nil
,
tp
,
se
)
end
end
function
s
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
spfgtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
return
eg
:
IsExists
(
s
.
spfilter
,
1
,
nil
,
tp
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
1
-
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
end
function
s
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
spfgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
,
tp
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
,
1
-
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
LOCATION_GRAVE
)
end
function
s
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
1
-
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
1
-
tp
,
false
,
false
,
POS_FACEUP
)
end
end
end
\ No newline at end of file
expansions/script/c101203003.lua
View file @
6c72c127
--サクリファイス・D・ロータス
--サクリファイス・D・ロータス
--Script by passingDio0
local
s
,
id
,
o
=
GetID
()
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
function
s
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
78371393
)
aux
.
AddCodeList
(
c
,
78371393
)
--SpecialSummon from deck
aux
.
AddSetNameMonsterList
(
c
,
0x2a4
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
...
@@ -13,29 +15,32 @@ function s.initial_effect(c)
...
@@ -13,29 +15,32 @@ function s.initial_effect(c)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--
Destroy
--
Change effect
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
71166481
,
1
))
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_POSITION
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetHintTiming
(
TIMINGS_CHECK_MONSTER
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetCondition
(
s
.
chcon
)
e2
:
SetCondition
(
s
.
chcon
)
e2
:
SetCost
(
s
.
sp
cost
)
e2
:
SetCost
(
s
.
ch
cost
)
e2
:
SetTarget
(
s
.
chtg
)
e2
:
SetTarget
(
s
.
chtg
)
e2
:
SetOperation
(
s
.
chop
)
e2
:
SetOperation
(
s
.
chop
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--
SpecialSummon or to hand
--
to hand or spsummon
local
e3
=
Effect
.
CreateEffect
(
c
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e3
:
SetCategory
(
CATEGORY_
SPECIAL_SUMMON
+
CATEGORY_TOHAND
)
e3
:
SetCategory
(
CATEGORY_
TOHAND
+
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetRange
(
LOCATION_GRAVE
)
e3
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e3
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e3
:
SetCountLimit
(
1
,
120300003
)
e3
:
SetRange
(
LOCATION_GRAVE
)
e3
:
SetCondition
(
s
.
con
)
e3
:
SetCountLimit
(
1
,
id
+
o
*
2
)
e3
:
SetTarget
(
s
.
tg
)
e3
:
SetCondition
(
s
.
thoscon
)
e3
:
SetOperation
(
s
.
op
)
e3
:
SetTarget
(
s
.
thostg
)
e3
:
SetOperation
(
s
.
thosop
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
end
end
function
s
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
...
@@ -43,61 +48,76 @@ function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
...
@@ -43,61 +48,76 @@ function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel
.
Release
(
e
:
GetHandler
(),
REASON_COST
)
Duel
.
Release
(
e
:
GetHandler
(),
REASON_COST
)
end
end
function
s
.
spfilter
(
c
,
e
,
tp
)
function
s
.
spfilter
(
c
,
e
,
tp
)
return
(
c
:
IsSetCard
(
0x2a4
)
or
c
:
IsCode
(
78371393
))
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
return
c
:
IsSetCard
(
0x2a4
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
Get
LocationCount
(
tp
,
LOCATION_MZONE
)
>
0
if
chk
==
0
then
return
Duel
.
Get
MZoneCount
(
tp
,
e
:
GetHandler
()
)
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
end
and
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
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
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
end
end
function
s
.
c
h
filter
(
c
)
function
s
.
c
on
filter
(
c
)
return
(
c
:
IsSetCard
(
0x2a4
)
or
c
:
IsCode
(
78371393
))
and
c
:
IsType
(
TYPE_MONSTER
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x2a4
)
end
end
function
s
.
chcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
chcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
rp
==
1
-
tp
and
Duel
.
GetTurnPlayer
()
==
1
-
tp
and
Duel
.
IsExistingMatchingCard
(
s
.
chfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
return
Duel
.
GetTurnPlayer
()
==
1
-
tp
and
re
:
IsActiveType
(
TYPE_MONSTER
)
and
Duel
.
IsExistingMatchingCard
(
s
.
confilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
s
.
chcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsReleasable
()
end
Duel
.
Release
(
e
:
GetHandler
(),
REASON_COST
)
end
end
function
s
.
chtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
chtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
chfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
IsPlayerCanDraw
(
1
-
tp
,
1
)
end
end
end
function
s
.
chop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
chop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Group
.
CreateGroup
()
local
g
=
Group
.
CreateGroup
()
Duel
.
ChangeTargetCard
(
ev
,
g
)
Duel
.
ChangeTargetCard
(
ev
,
g
)
Duel
.
ChangeChainOperation
(
ev
,
s
.
repop
)
Duel
.
ChangeChainOperation
(
ev
,
s
.
repop
)
end
end
function
s
.
repfilter
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsSetCard
(
0x2a4
)
end
function
s
.
repop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
repop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ct
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
chfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
repfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
Destroy
(
ct
,
REASON_EFFECT
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
end
end
function
s
.
filter
(
c
)
function
s
.
rcc
filter
(
c
)
return
(
c
:
IsSetCard
(
0x2a4
)
or
c
:
IsCode
(
78371393
)
)
return
c
:
IsFaceup
()
and
c
:
IsCode
(
78371393
)
end
end
function
s
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
thos
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetTurnPlayer
()
~=
tp
then
return
false
end
return
Duel
.
GetTurnPlayer
()
==
tp
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
s
.
rccfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
end
function
s
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
thostg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
b1
=
e
:
GetHandler
():
IsAbleToHand
()
local
c
=
e
:
GetHandler
()
local
b2
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
if
chk
==
0
then
return
c
:
IsAbleToHand
()
or
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
if
chk
==
0
then
return
b1
or
b2
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
c
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
c
,
1
,
0
,
0
)
end
end
function
s
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
thos
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
b1
=
c
:
IsAbleToHand
()
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
local
b2
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_OPERATECARD
)
local
op
=
0
if
c
:
IsRelateToEffect
(
e
)
then
if
b1
and
b2
then
op
=
Duel
.
SelectOption
(
tp
,
1190
,
1152
)
if
ft
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
elseif
b1
then
op
=
0
and
(
not
c
:
IsAbleToHand
()
or
Duel
.
SelectOption
(
tp
,
1190
,
1152
)
==
1
)
then
else
op
=
1
end
if
op
==
0
then
Duel
.
SendtoHand
(
c
,
nil
,
REASON_EFFECT
)
else
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
else
Duel
.
SendtoHand
(
c
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
end
end
end
end
\ No newline at end of file
end
expansions/script/c101203038.lua
View file @
6c72c127
--ユベル-Das Ewig Liebe Wächter
--ユベル-Das Ewig Liebe Wächter
--Script by passingDio0
local
s
,
id
,
o
=
GetID
()
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
function
s
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
78371393
)
aux
.
AddCodeList
(
c
,
78371393
)
--fusion summon
c
:
EnableReviveLimit
()
c
:
EnableReviveLimit
()
aux
.
AddFusionProcFunFunRep
(
c
,
s
.
mfilter1
,
s
.
mfilter2
,
1
,
63
,
true
)
--material
--damage
aux
.
AddFusionProcFunFunRep
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsFusionSetCard
,
0x2a4
),
s
.
matfilter
,
1
,
63
,
true
)
--damage
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_DAMAGE
)
e1
:
SetCategory
(
CATEGORY_DAMAGE
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_DELAY
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCondition
(
s
.
dmgcon
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetTarget
(
s
.
damtg
)
e1
:
SetCondition
(
s
.
dacon
)
e1
:
SetOperation
(
s
.
dmgop
)
e1
:
SetOperation
(
s
.
daop
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--
can not be destroyed
--
damage&remove
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCode
(
EFFECT_AVOID_BATTLE_DAMAGE
)
e2
:
SetCategory
(
CATEGORY_DAMAGE
+
CATEGORY_REMOVE
)
e2
:
SetValue
(
1
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e2
:
SetCode
(
EVENT_DAMAGE_STEP_END
)
e2
:
SetCondition
(
aux
.
dsercon
)
e2
:
SetTarget
(
s
.
damrtg
)
e2
:
SetOperation
(
s
.
damrop
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--indes
local
e3
=
Effect
.
CreateEffect
(
c
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e3
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e3
:
SetValue
(
1
)
e3
:
SetValue
(
1
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
local
e4
=
e3
:
Clone
()
local
e4
=
e3
:
Clone
()
e4
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e4
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
c
:
RegisterEffect
(
e4
)
c
:
RegisterEffect
(
e4
)
--battle
--damage val
local
e5
=
Effect
.
CreateEffect
(
c
)
local
e5
=
e3
:
Clone
()
e5
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e5
:
SetCode
(
EFFECT_AVOID_BATTLE_DAMAGE
)
e5
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e5
:
SetCode
(
EVENT_BATTLED
)
e5
:
SetOperation
(
s
.
batop
)
c
:
RegisterEffect
(
e5
)
c
:
RegisterEffect
(
e5
)
local
e6
=
Effect
.
CreateEffect
(
c
)
e6
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e6
:
SetCategory
(
CATEGORY_DAMAGE
+
CATEGORY_REMOVE
)
e6
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e6
:
SetCode
(
EVENT_DAMAGE_STEP_END
)
e6
:
SetCondition
(
aux
.
dsercon
)
e6
:
SetTarget
(
s
.
damtg
)
e6
:
SetOperation
(
s
.
damop
)
e6
:
SetLabelObject
(
e5
)
c
:
RegisterEffect
(
e6
)
end
end
function
s
.
m
filter1
(
c
)
function
s
.
m
atfilter
(
c
)
return
c
:
Is
FusionSetCard
(
0x2a4
)
or
c
:
IsCode
(
78371393
)
return
c
:
Is
Location
(
LOCATION_MZONE
)
and
c
:
IsType
(
TYPE_EFFECT
)
end
end
function
s
.
mfilter2
(
c
)
function
s
.
dmgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
c
:
IsType
(
TYPE_EFFECT
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
s
.
dacon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_FUSION
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_FUSION
)
end
end
function
s
.
daop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
damtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
val
=
c
:
GetMaterialCount
()
local
damage
=
c
:
GetMaterialCount
()
*
500
Duel
.
Damage
(
1
-
tp
,
val
*
500
,
REASON_EFFECT
)
Duel
.
SetTargetPlayer
(
1
-
tp
)
Duel
.
SetTargetParam
(
damage
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DAMAGE
,
nil
,
0
,
1
-
tp
,
damage
)
e
:
SetLabel
(
damage
)
end
function
s
.
dmgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Damage
(
p
,
d
,
REASON_EFFECT
)
end
end
function
s
.
batop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
damrtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
bc
=
c
:
GetBattleTarget
()
local
bc
=
c
:
GetBattleTarget
()
if
bc
then
if
chk
==
0
then
return
c
:
IsStatus
(
STATUS_OPPO_BATTLE
)
and
bc
~=
nil
end
e
:
SetLabel
(
bc
:
GetAttack
())
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DAMAGE
,
nil
,
0
,
1
-
tp
,
bc
:
GetAttack
())
e
:
SetLabelObject
(
bc
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_RECOVER
,
nil
,
0
,
tp
,
bc
:
GetDefense
())
else
e
:
SetLabelObject
(
nil
)
end
end
function
s
.
damtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
bc
=
e
:
GetLabelObject
():
GetLabelObject
()
if
chk
==
0
then
return
bc
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DAMAGE
,
nil
,
0
,
1
-
tp
,
e
:
GetLabelObject
():
GetLabel
())
if
bc
:
IsRelateToBattle
()
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
bc
,
1
,
0
,
0
)
end
end
end
function
s
.
damop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
damrop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Damage
(
1
-
tp
,
e
:
GetLabelObject
():
GetLabel
(),
REASON_EFFECT
)
local
bc
=
e
:
GetHandler
():
GetBattleTarget
()
local
bc
=
e
:
GetLabelObject
():
GetLabelObject
()
local
atk
=
bc
:
GetAttack
()
if
bc
:
IsRelateToBattle
()
then
local
def
=
bc
:
GetDefense
()
Duel
.
Remove
(
bc
,
POS_FACEUP
,
REASON_EFFECT
)
if
atk
<
0
then
atk
=
0
end
end
Duel
.
Damage
(
1
-
tp
,
atk
,
REASON_EFFECT
,
true
)
Duel
.
Remove
(
bc
,
0
,
REASON_EFFECT
)
Duel
.
RDComplete
()
end
end
\ No newline at end of file
expansions/script/c101203054.lua
View file @
6c72c127
--ナイトメア・ペイン
--ナイトメア・ペイン
--Script by passingDio0
local
s
,
id
,
o
=
GetID
()
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
function
s
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
78371393
)
aux
.
AddCodeList
(
c
,
78371393
)
--active
aux
.
AddSetNameMonsterList
(
c
,
0x2a4
)
local
e0
=
Effect
.
CreateEffect
(
c
)
--Activate
e0
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e0
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e0
)
--SearchCard
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetTarget
(
s
.
thtg
)
e1
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--a
ttack limit
--a
dd to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCode
(
EFFECT_MUST_ATTACK
)
e2
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetTargetRange
(
0
,
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetCondition
(
s
.
atkcon
)
e2
:
SetTarget
(
s
.
thtg
)
e2
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
local
e4
=
e2
:
Clone
()
--must attack
e4
:
SetCode
(
EFFECT_MUST_ATTACK_MONSTER
)
e4
:
SetValue
(
s
.
atklimit
)
c
:
RegisterEffect
(
e4
)
--reflect damage
local
e3
=
Effect
.
CreateEffect
(
c
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EFFECT_
REFLECT_BATTLE_DAMAGE
)
e3
:
SetCode
(
EFFECT_
MUST_ATTACK
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e3
:
SetTargetRange
(
0
,
LOCATION_MZONE
)
e3
:
Set
Target
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x2a4
)
)
e3
:
Set
Condition
(
s
.
atkcon
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
local
e4
=
e3
:
Clone
()
e4
:
SetCode
(
EFFECT_MUST_ATTACK_MONSTER
)
e4
:
SetValue
(
s
.
atklimit
)
c
:
RegisterEffect
(
e4
)
--reflect
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetType
(
EFFECT_TYPE_FIELD
)
e5
:
SetCode
(
EFFECT_REFLECT_BATTLE_DAMAGE
)
e5
:
SetRange
(
LOCATION_SZONE
)
e5
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e5
:
SetTarget
(
s
.
reftg
)
e5
:
SetValue
(
1
)
c
:
RegisterEffect
(
e5
)
end
end
function
s
.
cfilter
(
c
,
tp
)
function
s
.
dfilter
(
c
,
e
,
tp
)
return
c
:
IsFaceupEx
()
and
c
:
Is
Attribute
(
ATTRIBUTE_DARK
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
return
c
:
IsFaceupEx
()
and
c
:
Is
Type
(
TYPE_MONSTER
)
and
c
:
IsAttribute
(
ATTRIBUTE_DARK
)
end
end
function
s
.
filter
(
c
)
function
s
.
thfilter
(
c
,
code
)
return
(
(
c
:
IsSetCard
(
0x2a4
)
and
c
:
IsType
(
TYPE_MONSTER
)
)
or
aux
.
IsCodeListed
(
c
,
78371393
))
and
c
:
IsAbleToHand
()
and
not
c
:
IsCode
(
id
)
return
(
c
:
IsCode
(
78371393
)
or
aux
.
IsCodeListed
(
c
,
78371393
))
and
c
:
IsAbleToHand
()
and
not
c
:
IsCode
(
id
)
end
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
thtg
(
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
Duel
.
IsExistingMatchingCard
(
s
.
dfilter
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
,
0
,
1
,
nil
,
e
,
tp
)
if
chk
==
0
then
return
#
g
>
0
end
and
Duel
.
IsExistingMatchingCard
(
s
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
end
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cfilter
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
tp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
dfilter
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
==
0
then
return
end
if
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
<
1
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
thfilter
),
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
:
GetHandler
():
GetCode
())
Duel
.
SendtoHand
(
sg
,
nil
,
REASON_EFFECT
)
if
#
g
>
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
sg
)
Duel
.
SendtoHand
(
tg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tg
)
end
end
end
function
s
.
atkfilter
(
c
)
function
s
.
atkfilter
(
c
)
return
c
:
Is
SetCard
(
0x2a4
)
or
c
:
IsCode
(
78371393
)
return
c
:
Is
Faceup
()
and
c
:
IsSetCard
(
0x2a4
)
end
end
function
s
.
atkcon
(
e
)
function
s
.
atkcon
(
e
)
return
Duel
.
IsExistingMatchingCard
(
s
.
atkfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
return
Duel
.
IsExistingMatchingCard
(
s
.
atkfilter
,
e
:
GetHandlerPlayer
()
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
end
function
s
.
atklimit
(
e
,
c
)
function
s
.
atklimit
(
e
,
c
)
return
c
:
IsSetCard
(
0x2a4
)
or
c
:
IsCode
(
78371393
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x2a4
)
end
function
s
.
reftg
(
e
,
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x2a4
)
end
end
\ No newline at end of file
expansions/script/c101203055.lua
View file @
6c72c127
--マチュア・クロニクル
--マチュア・クロニクル
--Script by passingDio0
local
s
,
id
,
o
=
GetID
()
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
function
s
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
78371393
)
c
:
EnableCounterPermit
(
0x25
)
c
:
EnableCounterPermit
(
0x25
)
--active
aux
.
AddCodeList
(
c
,
78371393
)
local
e0
=
Effect
.
CreateEffect
(
c
)
aux
.
AddSetNameMonsterList
(
c
,
0x2a4
)
e0
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
--Activate
e0
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e0
)
--add counter
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetOperation
(
s
.
ctop
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--
revial
--
counter
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetOperation
(
s
.
counter
)
e2
:
SetCost
(
s
.
cost1
)
e2
:
SetTarget
(
s
.
sptg
)
e2
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--
recycle
--
special summon
local
e3
=
Effect
.
CreateEffect
(
c
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetCategory
(
CATEGORY_TOHAND
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e3
:
SetCountLimit
(
1
,
id
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCountLimit
(
1
,
id
)
e3
:
SetCost
(
s
.
cost1
)
e3
:
SetCost
(
s
.
cost2
)
e3
:
SetTarget
(
s
.
tg1
)
e3
:
SetTarget
(
s
.
thtg
)
e3
:
SetOperation
(
s
.
op1
)
e3
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
--
Remove
--
to hand from removed
local
e4
=
Effect
.
CreateEffect
(
c
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e4
:
SetCategory
(
CATEGORY_TOHAND
)
e4
:
SetCategory
(
CATEGORY_REMOVE
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e4
:
SetCountLimit
(
1
,
id
)
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_SZONE
)
e4
:
SetRange
(
LOCATION_SZONE
)
e4
:
SetCountLimit
(
1
,
id
)
e4
:
SetCost
(
s
.
cost2
)
e4
:
SetCost
(
s
.
cost3
)
e4
:
SetTarget
(
s
.
tg2
)
e4
:
SetTarget
(
s
.
retg
)
e4
:
SetOperation
(
s
.
op2
)
e4
:
SetOperation
(
s
.
reop
)
c
:
RegisterEffect
(
e4
)
c
:
RegisterEffect
(
e4
)
--
Destroy
--
remove from deck
local
e5
=
Effect
.
CreateEffect
(
c
)
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
id
,
3
))
e5
:
SetCategory
(
CATEGORY_REMOVE
)
e5
:
SetCategory
(
CATEGORY_DESTROY
)
e5
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e5
:
SetCountLimit
(
1
,
id
)
e5
:
SetType
(
EFFECT_TYPE_IGNITION
)
e5
:
SetType
(
EFFECT_TYPE_IGNITION
)
e5
:
SetRange
(
LOCATION_SZONE
)
e5
:
SetRange
(
LOCATION_SZONE
)
e5
:
SetCountLimit
(
1
,
id
)
e5
:
SetCost
(
s
.
cost3
)
e5
:
SetCost
(
s
.
cost4
)
e5
:
SetTarget
(
s
.
tg3
)
e5
:
SetTarget
(
s
.
detg
)
e5
:
SetOperation
(
s
.
op3
)
e5
:
SetOperation
(
s
.
deop
)
c
:
RegisterEffect
(
e5
)
c
:
RegisterEffect
(
e5
)
--
SearchCard
--
destory
local
e6
=
Effect
.
CreateEffect
(
c
)
local
e6
=
Effect
.
CreateEffect
(
c
)
e6
:
SetDescription
(
aux
.
Stringid
(
id
,
4
))
e6
:
SetCategory
(
CATEGORY_DESTROY
)
e6
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e6
:
SetDescription
(
aux
.
Stringid
(
id
,
3
))
e6
:
SetCountLimit
(
1
,
id
)
e6
:
SetType
(
EFFECT_TYPE_IGNITION
)
e6
:
SetType
(
EFFECT_TYPE_IGNITION
)
e6
:
SetRange
(
LOCATION_SZONE
)
e6
:
SetRange
(
LOCATION_SZONE
)
e6
:
SetCountLimit
(
1
,
id
)
e6
:
SetCost
(
s
.
cost4
)
e6
:
SetCost
(
s
.
cost5
)
e6
:
SetTarget
(
s
.
tg4
)
e6
:
SetTarget
(
s
.
setg
)
e6
:
SetOperation
(
s
.
op4
)
e6
:
SetOperation
(
s
.
seop
)
c
:
RegisterEffect
(
e6
)
c
:
RegisterEffect
(
e6
)
end
--to hand from deck
function
s
.
ctfilter
(
c
)
local
e7
=
Effect
.
CreateEffect
(
c
)
return
c
:
IsFaceup
()
and
(
c
:
IsSetCard
(
0x2a4
)
or
aux
.
IsCodeListed
(
c
,
78371393
))
e7
:
SetCategory
(
CATEGORY_TOHAND
)
end
e7
:
SetDescription
(
aux
.
Stringid
(
id
,
4
))
function
s
.
ctop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
e7
:
SetCountLimit
(
1
,
id
)
if
eg
:
IsExists
(
s
.
ctfilter
,
1
,
nil
)
then
e7
:
SetType
(
EFFECT_TYPE_IGNITION
)
e7
:
SetRange
(
LOCATION_SZONE
)
e7
:
SetCost
(
s
.
cost5
)
e7
:
SetTarget
(
s
.
tg5
)
e7
:
SetOperation
(
s
.
op5
)
c
:
RegisterEffect
(
e7
)
end
function
s
.
cfilter
(
c
)
return
c
:
IsSetCard
(
0x2a4
)
or
aux
.
IsCodeListed
(
c
,
78371393
)
end
function
s
.
counter
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
eg
:
IsExists
(
s
.
cfilter
,
1
,
nil
)
then
e
:
GetHandler
():
AddCounter
(
0x25
,
1
)
e
:
GetHandler
():
AddCounter
(
0x25
,
1
)
end
end
end
end
...
@@ -84,20 +86,19 @@ function s.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
...
@@ -84,20 +86,19 @@ function s.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x25
,
1
,
REASON_COST
)
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x25
,
1
,
REASON_COST
)
end
end
function
s
.
spfilter
(
c
,
e
,
tp
)
function
s
.
filter1
(
c
,
e
,
tp
)
return
c
:
IsCode
(
78371393
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
return
c
:
IsCode
(
78371393
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
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
(
s
.
spfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
and
Duel
.
IsExistingMatchingCard
(
s
.
filter1
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
end
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
spfilter
),
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
filter1
),
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
tc
=
g
:
GetFirst
()
if
g
:
GetCount
()
>
0
then
if
tc
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
true
,
true
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
tc
,
nil
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
end
end
function
s
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
...
@@ -105,16 +106,20 @@ function s.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
...
@@ -105,16 +106,20 @@ function s.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x25
,
2
,
REASON_COST
)
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x25
,
2
,
REASON_COST
)
end
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
function
s
.
filter2
(
c
,
e
,
tp
)
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsAbleToHand
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
nil
)
end
return
c
:
IsAbleToHand
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
end
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsAbleToHand
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
)
function
s
.
tg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
LOCATION_REMOVED
)
if
chk
==
0
then
return
true
and
Duel
.
IsExistingMatchingCard
(
s
.
filter2
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_REMOVED
)
end
end
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
if
tc
:
IsRelateToEffect
(
e
)
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter2
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SendtoHand
(
tc
,
tp
,
REASON_EFFECT
)
local
tc
=
g
:
GetFirst
()
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
end
end
end
end
function
s
.
cost3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
cost3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
...
@@ -122,32 +127,33 @@ function s.cost3(e,tp,eg,ep,ev,re,r,rp,chk)
...
@@ -122,32 +127,33 @@ function s.cost3(e,tp,eg,ep,ev,re,r,rp,chk)
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x25
,
3
,
REASON_COST
)
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x25
,
3
,
REASON_COST
)
end
end
function
s
.
retg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
function
s
.
tg3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
0
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
end
function
s
.
reop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
op3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
local
tg
=
g
:
GetFirst
()
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
if
tg
==
nil
then
return
end
end
Duel
.
Remove
(
tg
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
s
.
cost4
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
cost4
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
0
,
0x25
,
4
,
REASON_COST
)
end
if
chk
==
0
then
return
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
0
,
0x25
,
4
,
REASON_COST
)
end
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x25
,
4
,
REASON_COST
)
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x25
,
4
,
REASON_COST
)
end
end
function
s
.
detg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
function
s
.
tg4
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
nil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
aux
.
TRUE
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
TRUE
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
nil
)
local
g
=
Duel
.
SelectTarget
(
tp
,
nil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
LOCATION_ONFIELD
)
end
end
function
s
.
deop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
op4
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
if
tc
:
IsRelateToEffect
(
e
)
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
TRUE
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
if
#
g
>
0
then
Duel
.
HintSelection
(
g
)
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
end
end
end
function
s
.
cost5
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
cost5
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
...
@@ -155,18 +161,19 @@ function s.cost5(e,tp,eg,ep,ev,re,r,rp,chk)
...
@@ -155,18 +161,19 @@ function s.cost5(e,tp,eg,ep,ev,re,r,rp,chk)
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x25
,
5
,
REASON_COST
)
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x25
,
5
,
REASON_COST
)
end
end
function
s
.
filter
(
c
)
function
s
.
filter
5
(
c
,
e
,
tp
)
return
c
:
Is
Code
(
48130397
)
and
c
:
IsAbleToHand
(
)
return
c
:
Is
AbleToHand
()
and
c
:
IsCode
(
48130397
)
end
end
function
s
.
setg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
function
s
.
tg5
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
if
chk
==
0
then
return
true
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
0
,
LOCATION_DECK
)
and
Duel
.
IsExistingMatchingCard
(
s
.
filter5
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
end
function
s
.
seop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
op5
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_
ATOHAND
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_
SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
5
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
SendtoHand
(
g
:
GetFirst
()
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
ShuffleDeck
(
tp
)
end
end
end
end
\ No newline at end of file
expansions/script/c101203073.lua
View file @
6c72c127
--エターナル・フェイバリット
--エターナル・フェイバリット
--Script by passingDio0
local
s
,
id
,
o
=
GetID
()
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
function
s
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
78371393
)
aux
.
AddCodeList
(
c
,
78371393
)
--active
aux
.
AddSetNameMonsterList
(
c
,
0x2a4
)
local
e0
=
Effect
.
CreateEffect
(
c
)
--Activate
e0
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e0
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e0
)
--SpecialSummon
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCountLimit
(
1
,
EFFECT_COUNT_CODE_SINGLE
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--
fusi
on
--
special summ
on
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_
FUSION
_SUMMON
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_
SPECIAL
_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCountLimit
(
1
,
EFFECT_COUNT_CODE_SINGLE
)
e2
:
SetCountLimit
(
1
,
EFFECT_COUNT_CODE_SINGLE
)
e2
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
s
.
fscon
)
e2
:
SetTarget
(
s
.
sptg
)
e2
:
SetCost
(
s
.
fscost
)
e2
:
SetOperation
(
s
.
spop
)
e2
:
SetTarget
(
s
.
fstg
)
e2
:
SetOperation
(
s
.
fsop
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--special summon
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCountLimit
(
1
,
EFFECT_COUNT_CODE_SINGLE
)
e3
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e3
:
SetCondition
(
s
.
fucon
)
e3
:
SetCost
(
s
.
fucost
)
e3
:
SetTarget
(
s
.
futg
)
e3
:
SetOperation
(
s
.
fuop
)
c
:
RegisterEffect
(
e3
)
end
end
function
s
.
spfilter
(
c
,
e
,
tp
)
function
s
.
spfilter
(
c
,
e
,
tp
)
return
(
c
:
IsSetCard
(
0x2a4
)
or
c
:
IsCode
(
78371393
))
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
and
c
:
IsFaceup
(
)
return
c
:
IsSetCard
(
0x2a4
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
if
chk
==
0
then
return
Duel
.
Get
FlagEffect
(
tp
,
id
)
==
0
and
Duel
.
Get
LocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
,
e
,
tp
)
end
and
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
Duel
.
RegisterFlagEffect
(
tp
,
id
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
)
end
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
spfilter
),
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
spfilter
),
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
tc
=
g
:
GetFirst
()
if
g
:
GetCount
()
>
0
then
if
tc
and
Duel
.
SpecialSummonStep
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
local
tc
=
g
:
GetFirst
()
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
if
tc
and
Duel
.
SpecialSummonStep
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetLabelObject
(
tc
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetOperation
(
s
.
sumop
)
e1
:
SetLabelObject
(
tc
)
Duel
.
RegisterEffect
(
e1
,
tp
)
e1
:
SetOperation
(
s
.
sumop
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
Duel
.
RegisterEffect
(
e1
,
tp
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetCode
(
EVENT_CHAIN_END
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetLabelObject
(
e1
)
e2
:
SetCode
(
EVENT_CHAIN_END
)
e2
:
SetOperation
(
s
.
cedop
)
e2
:
SetLabelObject
(
e1
)
Duel
.
RegisterEffect
(
e2
,
tp
)
e2
:
SetOperation
(
s
.
cedop
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
Duel
.
SpecialSummonComplete
()
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
true
,
true
,
POS_FACEUP
)
end
end
Duel
.
SpecialSummonComplete
()
end
end
function
s
.
sumop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
sumop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
eg
:
IsContains
(
e
:
GetLabelObject
())
then
if
eg
:
IsContains
(
e
:
GetLabelObject
())
then
...
@@ -74,64 +81,66 @@ function s.cedop(e,tp,eg,ep,ev,re,r,rp)
...
@@ -74,64 +81,66 @@ function s.cedop(e,tp,eg,ep,ev,re,r,rp)
end
end
e
:
Reset
()
e
:
Reset
()
end
end
function
s
.
filter1
(
c
)
function
s
.
fufilter
(
c
,
e
,
tp
)
return
(
c
:
IsSetCard
(
0x2a4
)
or
c
:
IsCode
(
78371393
))
return
c
:
IsFaceup
()
and
c
:
IsCode
(
78371393
)
end
function
s
.
filter2
(
c
)
return
(
c
:
IsSetCard
(
0x2a4
)
or
c
:
IsCode
(
78371393
))
and
c
:
IsCanBeFusionMaterial
()
end
end
function
s
.
f
s
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
f
u
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
s
.
f
ilter1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
s
.
filter2
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
return
Duel
.
IsExistingMatchingCard
(
s
.
f
ufilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
end
function
s
.
fscost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
fucost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToGraveAsCost
()
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
c
=
e
:
GetHandler
()
Duel
.
DiscardHand
(
tp
,
nil
,
1
,
1
,
REASON_COST
,
nil
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
Duel
.
SendtoGrave
(
e
:
GetHandler
(),
REASON_COST
)
and
c
:
IsAbleToGraveAsCost
()
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
Duel
.
SendtoGrave
(
c
,
REASON_COST
)
end
end
function
s
.
m
filter0
(
c
)
function
s
.
filter0
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCanBeFusionMaterial
()
return
c
:
IsFaceup
()
and
c
:
IsCanBeFusionMaterial
()
end
end
function
s
.
m
filter1
(
c
,
e
)
function
s
.
filter1
(
c
,
e
)
return
c
:
IsFaceup
()
and
c
:
IsCanBeFusionMaterial
()
and
not
c
:
IsImmuneToEffect
(
e
)
return
c
:
IsFaceup
()
and
c
:
IsCanBeFusionMaterial
()
and
not
c
:
IsImmuneToEffect
(
e
)
end
end
function
s
.
m
filter2
(
c
,
e
,
tp
,
m
,
f
,
chkf
)
function
s
.
filter2
(
c
,
e
,
tp
,
m
,
f
,
chkf
)
return
c
:
IsType
(
TYPE_FUSION
)
and
(
not
f
or
f
(
c
))
return
c
:
IsType
(
TYPE_FUSION
)
and
(
not
f
or
f
(
c
))
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_FUSION
,
tp
,
false
,
false
)
and
c
:
CheckFusionMaterial
(
m
,
nil
,
chkf
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_FUSION
,
tp
,
false
,
false
)
and
c
:
CheckFusionMaterial
(
m
,
nil
,
chkf
)
end
end
function
s
.
m
filter3
(
c
,
e
)
function
s
.
filter3
(
c
,
e
)
return
c
:
IsOnField
()
and
not
c
:
IsImmuneToEffect
(
e
)
return
c
:
IsOnField
()
and
not
c
:
IsImmuneToEffect
(
e
)
end
end
function
s
.
fcheck
(
tp
,
sg
,
fc
)
function
s
.
fcheck
(
tp
,
sg
,
fc
)
return
sg
:
IsExists
(
Card
.
IsSetCard
,
1
,
nil
,
0x2a4
)
return
sg
:
IsExists
(
Card
.
IsSetCard
,
1
,
nil
,
0x2a4
)
end
end
function
s
.
f
s
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
f
u
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
chk
==
0
then
local
chkf
=
tp
local
chkf
=
tp
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
):
Filter
(
Card
.
IsOnField
,
nil
)
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
):
Filter
(
Card
.
IsOnField
,
nil
)
local
mg2
=
Duel
.
GetMatchingGroup
(
s
.
m
filter0
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
local
mg2
=
Duel
.
GetMatchingGroup
(
s
.
filter0
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
mg1
:
Merge
(
mg2
)
mg1
:
Merge
(
mg2
)
aux
.
FCheckAdditional
=
s
.
fcheck
aux
.
FCheckAdditional
=
s
.
fcheck
local
res
=
Duel
.
IsExistingMatchingCard
(
s
.
m
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg1
,
nil
,
chkf
)
local
res
=
Duel
.
IsExistingMatchingCard
(
s
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg1
,
nil
,
chkf
)
if
not
res
then
if
not
res
then
local
ce
=
Duel
.
GetChainMaterial
(
tp
)
local
ce
=
Duel
.
GetChainMaterial
(
tp
)
if
ce
~=
nil
then
if
ce
~=
nil
then
local
fgroup
=
ce
:
GetTarget
()
local
fgroup
=
ce
:
GetTarget
()
local
mg3
=
fgroup
(
ce
,
e
,
tp
)
local
mg3
=
fgroup
(
ce
,
e
,
tp
)
local
mf
=
ce
:
GetValue
()
local
mf
=
ce
:
GetValue
()
res
=
Duel
.
IsExistingMatchingCard
(
s
.
m
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg3
,
mf
,
chkf
)
res
=
Duel
.
IsExistingMatchingCard
(
s
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg3
,
mf
,
chkf
)
end
end
end
end
return
res
aux
.
FCheckAdditional
=
nil
return
Duel
.
GetFlagEffect
(
tp
,
id
+
o
)
==
0
and
res
end
end
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
Duel
.
RegisterFlagEffect
(
tp
,
id
+
o
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
end
function
s
.
f
s
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
f
u
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
chkf
=
tp
local
chkf
=
tp
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
):
Filter
(
s
.
m
filter3
,
nil
,
e
)
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
):
Filter
(
s
.
filter3
,
nil
,
e
)
local
mg2
=
Duel
.
GetMatchingGroup
(
s
.
m
filter1
,
tp
,
0
,
LOCATION_MZONE
,
nil
,
e
)
local
mg2
=
Duel
.
GetMatchingGroup
(
s
.
filter1
,
tp
,
0
,
LOCATION_MZONE
,
nil
,
e
)
mg1
:
Merge
(
mg2
)
mg1
:
Merge
(
mg2
)
aux
.
FCheckAdditional
=
s
.
fcheck
aux
.
FCheckAdditional
=
s
.
fcheck
local
sg1
=
Duel
.
GetMatchingGroup
(
s
.
m
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
,
mg1
,
nil
,
chkf
)
local
sg1
=
Duel
.
GetMatchingGroup
(
s
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
,
mg1
,
nil
,
chkf
)
local
mg3
=
nil
local
mg3
=
nil
local
sg2
=
nil
local
sg2
=
nil
local
ce
=
Duel
.
GetChainMaterial
(
tp
)
local
ce
=
Duel
.
GetChainMaterial
(
tp
)
...
@@ -139,7 +148,7 @@ function s.fsop(e,tp,eg,ep,ev,re,r,rp)
...
@@ -139,7 +148,7 @@ function s.fsop(e,tp,eg,ep,ev,re,r,rp)
local
fgroup
=
ce
:
GetTarget
()
local
fgroup
=
ce
:
GetTarget
()
mg3
=
fgroup
(
ce
,
e
,
tp
)
mg3
=
fgroup
(
ce
,
e
,
tp
)
local
mf
=
ce
:
GetValue
()
local
mf
=
ce
:
GetValue
()
local
sg2
=
Duel
.
GetMatchingGroup
(
s
.
m
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
,
mg3
,
mf
,
chkf
)
sg2
=
Duel
.
GetMatchingGroup
(
s
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
,
mg3
,
mf
,
chkf
)
end
end
if
sg1
:
GetCount
()
>
0
or
(
sg2
~=
nil
and
sg2
:
GetCount
()
>
0
)
then
if
sg1
:
GetCount
()
>
0
or
(
sg2
~=
nil
and
sg2
:
GetCount
()
>
0
)
then
local
sg
=
sg1
:
Clone
()
local
sg
=
sg1
:
Clone
()
...
@@ -160,4 +169,5 @@ function s.fsop(e,tp,eg,ep,ev,re,r,rp)
...
@@ -160,4 +169,5 @@ function s.fsop(e,tp,eg,ep,ev,re,r,rp)
end
end
tc
:
CompleteProcedure
()
tc
:
CompleteProcedure
()
end
end
end
aux
.
FCheckAdditional
=
nil
end
\ No newline at end of file
expansions/strings.conf
View file @
6c72c127
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
#先行
#先行
!
counter
0
x169
指示物(吠陀-优婆尼沙昙)
!
counter
0
x169
指示物(吠陀-优婆尼沙昙)
!
counter
0
x170
响鸣指示物
!
setname
0
x4073
铠装超量 アーマード・エクシーズ
!
setname
0
x4073
铠装超量 アーマード・エクシーズ
!
setname
0
x29a
吠陀 ヴェーダ
!
setname
0
x29a
吠陀 ヴェーダ
!
setname
0
x29b
哈特 ハート
!
setname
0
x29b
哈特 ハート
...
@@ -17,8 +18,10 @@
...
@@ -17,8 +18,10 @@
!
setname
0
x29f
迪亚贝尔斯塔尔 ディアベルスター
!
setname
0
x29f
迪亚贝尔斯塔尔 ディアベルスター
!
setname
0
x2a0
蛇眼 スネークアイ
!
setname
0
x2a0
蛇眼 スネークアイ
!
setname
0
x2a1
莫忘 メメント
!
setname
0
x2a1
莫忘 メメント
!
setname
0
x2a2
Tistina
Tistina
!
setname
0
x2a2
蒂斯蒂娜
Tistina
!
setname
0
x2a3
异响鸣 ヴァルモニカ
!
setname
0
x2a3
异响鸣 ヴァルモニカ
!
setname
0
x2a4
于贝尔 ユベル
!
setname
0
x2a5
百夫长骑士 センチュリオン
#1263790966
#1263790966
#【2022年12月31日前禁止投稿】
#【2022年12月31日前禁止投稿】
...
...
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