Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-222DIY-cards
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alstroemeria-silentlove
ygopro-222DIY-cards
Commits
6c72c127
Commit
6c72c127
authored
Sep 06, 2023
by
Huangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update pre 0906
parent
1cdf9bc3
Pipeline
#23376
passed with stages
in 27 minutes and 19 seconds
Changes
48
Pipelines
1
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)
local
tg
=
g
:
Filter
(
s
.
desfilter
,
nil
,
e
:
GetLabel
())
Duel
.
Destroy
(
tg
,
REASON_EFFECT
)
--end snip 1
end
\ No newline at end of file
end
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
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
sfilter
,
tp
,
LOCATION_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
or
not
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
2
))
then
return
end
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
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
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
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
end
...
...
@@ -96,7 +96,7 @@ end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
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
)
end
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)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
s
.
chk
(
g
,
lv
)
return
aux
.
dncheck
(
g
)
and
g
:
GetSum
(
Card
.
GetLevel
)
<=
lv
function
s
.
gcheck
(
lv
)
return
function
(
g
)
return
aux
.
dncheck
(
g
)
and
g
:
GetSum
(
Card
.
GetLevel
)
<=
lv
end
end
function
s
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
...
...
@@ -62,6 +64,8 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local
lv
=
tc
:
GetOriginalLevel
()
local
g
=
Duel
.
GetMatchingGroup
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
nil
,
lv
)
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
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
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
100421004
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
100421004
)
e1
:
SetCost
(
c100421004
.
descost
)
e1
:
SetTarget
(
c100421004
.
destg
)
e1
:
SetOperation
(
c100421004
.
desop
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCost
(
s
.
cost
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
--spsummon
--sp
ecial
summon
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
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
,
110421004
)
e3
:
SetTarget
(
c100421004
.
sptg
)
e3
:
SetOperation
(
c100421004
.
spop
)
e3
:
SetCountLimit
(
1
,
id
+
o
)
e3
:
SetTarget
(
s
.
sptg
)
e3
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
c100421004
.
descost
filter
(
c
)
function
s
.
c
filter
(
c
)
return
c
:
IsSetCard
(
0x2a1
)
and
c
:
IsDiscardable
()
end
function
c100421004
.
descost
(
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
Duel
.
DiscardHand
(
tp
,
c100421004
.
descostfilter
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
function
s
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
Duel
.
DiscardHand
(
tp
,
s
.
cfilter
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
end
function
s
.
filter
(
c
)
return
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
end
function
c100421004
.
destg
(
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
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsType
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
,
TYPE_SPELL
+
TYPE_TRAP
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
Is
OnField
()
and
chkc
:
IsControler
(
1
-
tp
)
and
s
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
end
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
)
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
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
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
~=
0
and
e
:
GetLabel
()
==
1
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
100421004
,
1
))
then
Duel
.
BreakEffect
()
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
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
end
function
c100421004
.
s
filter
(
c
,
e
,
tp
)
return
c
:
Is
LevelBelow
(
3
)
and
c
:
IsSetCard
(
0x2a1
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
function
s
.
sp
filter
(
c
,
e
,
tp
)
return
c
:
Is
SetCard
(
0x2a1
)
and
c
:
IsLevelBelow
(
3
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c100421004
.
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
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c100421004
.
sfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
dfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
,
tp
)
if
chk
==
0
then
return
#
g
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
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
)
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
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
c100421004
.
sfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
>
0
and
tc
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SpecialSummon
(
sg
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
expansions/script/c100421005.lua
View file @
6c72c127
...
...
@@ -42,7 +42,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
function
s
.
cfilter
(
c
)
function
s
.
cfilter
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x2a1
)
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
s
.
sfilter
(
c
,
e
,
tp
)
...
...
@@ -50,7 +50,7 @@ function s.sfilter(c,e,tp)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
s
.
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
.
IsExistingTarget
(
s
.
sfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
...
...
@@ -60,7 +60,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
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
()
if
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
>
0
and
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
...
...
expansions/script/c100421008.lua
View file @
6c72c127
...
...
@@ -52,10 +52,11 @@ end
function
s
.
lecon
(
e
)
local
a
=
Duel
.
GetAttacker
()
local
d
=
Duel
.
GetAttackTarget
()
local
tp
=
e
:
GetHandlerPlayer
()
return
a
and
s
.
lfilter
(
a
,
tp
)
or
d
and
s
.
lfilter
(
d
,
tp
)
end
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
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
,
c
:
GetLevel
())
end
...
...
@@ -86,7 +87,7 @@ function s.sfilter(c)
return
c
:
IsSetCard
(
0x2a1
)
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsSSetable
()
end
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
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
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
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
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
()
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
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
dc
):
GetFirst
()
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
})
if
op
==
1
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
...
...
@@ -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
)
tc
:
RegisterEffect
(
e1
)
end
end
\ No newline at end of file
end
expansions/script/c100421010.lua
View file @
6c72c127
...
...
@@ -10,7 +10,7 @@ function s.initial_effect(c)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_LEAVE_FIELD
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCondition
(
s
.
condition
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
...
...
@@ -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
)
end
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
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
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)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsOnField
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
nil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
local
c
=
e
:
GetHandler
()
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
)
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
)
end
function
s
.
filter
(
c
)
...
...
@@ -48,7 +49,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
local
tc
=
Duel
.
GetFirstTarget
()
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
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
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
...
...
expansions/script/c100421012.lua
View file @
6c72c127
...
...
@@ -18,7 +18,7 @@ function s.initial_effect(c)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EFFECT_MUST_ATTACK_MONSTER
)
e3
:
Set
Target
(
s
.
matg
)
e3
:
Set
Value
(
s
.
atklimit
)
c
:
RegisterEffect
(
e3
)
--disable
local
e4
=
Effect
.
CreateEffect
(
c
)
...
...
@@ -40,7 +40,7 @@ end
function
s
.
macon
(
e
)
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
e
:
GetHandlerPlayer
(),
LOCATION_MZONE
,
0
,
1
,
nil
)
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
)
return
g
and
g
:
IsContains
(
c
)
end
...
...
expansions/script/c100421016.lua
View file @
6c72c127
local
cm
,
m
=
GetID
()
cm
.
name
=
"百夫长战旗重骑士 芙莉美娜"
function
cm
.
initial_effect
(
c
)
--重騎士プリメラ
--Script by passingDio0
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--to hand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_
TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_
TRIGGER_O
+
EFFECT_TYPE_SINGLE
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_
SEARCH
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_
SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
tg
)
e1
:
SetOperation
(
cm
.
op
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetTarget
(
s
.
th
tg
)
e1
:
SetOperation
(
s
.
th
op
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
--effect destory
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e3
:
SetCo
de
(
cm
.
con
)
e3
:
SetTarget
(
cm
.
tg1
)
e3
:
SetCo
ndition
(
s
.
ed
con
)
e3
:
SetTarget
(
s
.
edtg
)
e3
:
SetValue
(
1
)
c
:
RegisterEffect
(
e3
)
--spsummon from szone
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e4
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e4
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e4
:
SetRange
(
LOCATION_SZONE
)
e4
:
SetCode
(
EVENT_FREE_CHAIN
)
e4
:
SetCountLimit
(
1
,
m
+
100
)
e4
:
SetCondition
(
cm
.
con1
)
e4
:
SetTarget
(
cm
.
tg2
)
e4
:
SetOperation
(
cm
.
op1
)
e4
:
SetCountLimit
(
1
,
id
+
o
)
e4
:
SetHintTiming
(
0
,
TIMING_MAIN_END
)
e4
:
SetCondition
(
s
.
spcon
)
e4
:
SetTarget
(
s
.
sptg
)
e4
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e4
)
end
function
cm
.
f
(
c
)
return
c
:
IsSetCard
(
0x2c4
)
and
not
c
:
IsCode
(
m
)
and
c
:
IsAbleToHand
()
end
function
cm
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
f
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
function
s
.
thfilter
(
c
)
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
)
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
)
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
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
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
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
function
cm
.
splimit
(
e
,
c
,
sump
,
sumtype
,
sumpos
,
targetp
,
se
)
return
c
:
IsCode
(
m
)
function
s
.
splimit
(
e
,
c
)
return
c
:
IsCode
(
id
)
end
function
cm
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
GetType
()
&
TYPE_TRAP
+
TYPE_CONTINUOUS
==
TYPE_TRAP
+
TYPE_CONTINUOUS
function
s
.
edcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetType
()
==
TYPE_TRAP
+
TYPE_CONTINUOUS
end
function
cm
.
tg1
(
e
,
c
)
return
c
:
IsSetCard
(
0x2
c4
)
function
s
.
edtg
(
e
,
c
)
return
c
:
IsSetCard
(
0x2
a5
)
and
c
:
IsLevelAbove
(
5
)
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
c
=
e
:
GetHandler
()
return
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
and
c
:
GetType
()
&
TYPE_TRAP
+
TYPE_CONTINUOUS
==
TYPE_TRAP
+
TYPE_CONTINUOUS
return
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
and
e
:
GetHandler
():
GetType
()
==
TYPE_TRAP
+
TYPE_CONTINUOUS
end
function
cm
.
tg2
(
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
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
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
)
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
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
...
...
expansions/script/c100421017.lua
View file @
6c72c127
local
cm
,
m
=
GetID
()
cm
.
name
=
"百夫长战旗从骑士 图卢蒂娅"
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
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
)
--従騎士トゥルーデア
--Script by passingDio0
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--set
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCountLimit
(
1
,
m
+
100
)
e2
:
SetCondition
(
cm
.
con
)
e2
:
SetTarget
(
cm
.
tg1
)
e2
:
SetOperation
(
cm
.
op1
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetTarget
(
s
.
settg
)
e2
:
SetOperation
(
s
.
setop
)
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
function
cm
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_MZONE
+
LOCATION_DECK
+
LOCATION_HAND
,
0
)
if
chk
==
0
then
return
g
:
CheckSubGroup
(
cm
.
f
,
2
,
2
,
e
:
GetHandler
())
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
1
end
function
s
.
filter
(
c
)
return
c
:
IsSetCard
(
0x2a5
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsForbidden
()
and
not
c
:
IsCode
(
id
)
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<
2
then
return
false
end
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_MZONE
+
LOCATION_DECK
+
LOCATION_HAND
,
0
)
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
)
function
s
.
settg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
1
end
end
function
cm
.
f
(
g
,
c
)
return
g
:
IsContains
(
c
)
and
g
:
IsExists
(
cm
.
f1
,
1
,
nil
)
function
s
.
setop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
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
function
cm
.
f1
(
c
)
return
c
:
Is
Type
(
TYPE_MONSTER
)
and
c
:
IsSetCard
(
0x2c4
)
and
c
:
IsLocation
(
LOCATION_HAND
+
LOCATION_DECK
)
and
not
c
:
IsCode
(
m
)
function
s
.
splimit
(
e
,
c
)
return
c
:
Is
Code
(
id
)
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
c
=
e
:
GetHandler
()
return
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
and
c
:
GetType
()
&
TYPE_TRAP
+
TYPE_CONTINUOUS
==
TYPE_TRAP
+
TYPE_CONTINUOUS
return
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
and
e
:
GetHandler
():
GetType
()
==
TYPE_TRAP
+
TYPE_CONTINUOUS
end
function
cm
.
tg1
(
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
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
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
)
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
()
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
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_LEVEL
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetValue
(
4
)
c
:
RegisterEffect
(
e1
)
end
end
\ No newline at end of file
end
expansions/script/c100421018.lua
View file @
6c72c127
local
cm
,
m
=
GetID
()
cm
.
name
=
"百夫长战旗重骑兵 艾梅特VI"
function
cm
.
initial_effect
(
c
)
--重騎兵エメトVI
--Script by passingDio0
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--spcial from hand or grave
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetRange
(
LOCATION_HAND
+
LOCATION_GRAVE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetCondition
(
cm
.
con
)
e1
:
SetTarget
(
cm
.
tg
)
e1
:
SetOperation
(
cm
.
op
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetRange
(
LOCATION_HAND
+
LOCATION_GRAVE
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e1
:
SetCondition
(
s
.
spcon1
)
e1
:
SetTarget
(
s
.
sptg1
)
e1
:
SetOperation
(
s
.
spop1
)
c
:
RegisterEffect
(
e1
)
--spsummon from szone
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCountLimit
(
1
,
m
+
100
)
e2
:
SetCondition
(
cm
.
con1
)
e2
:
SetTarget
(
cm
.
tg1
)
e2
:
SetOperation
(
cm
.
op1
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetHintTiming
(
0
,
TIMING_MAIN_END
)
e2
:
SetCondition
(
s
.
spcon2
)
e2
:
SetTarget
(
s
.
sptg2
)
e2
:
SetOperation
(
s
.
spop2
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetTurnPlayer
()
==
1
-
tp
function
s
.
spcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetTurnPlayer
()
==
1
-
tp
end
function
cm
.
f
(
c
)
return
c
:
Is
SetCard
(
0x2c4
)
and
not
c
:
IsCode
(
m
)
function
s
.
filter
(
c
,
tp
)
return
c
:
Is
Faceup
()
and
c
:
IsSetCard
(
0x2a5
)
and
not
c
:
IsCode
(
id
)
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
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
()
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsSetCard
(
0x2c4
)
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
Duel
.
Hint
(
3
,
tp
,
HINTMSG_SELECT
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsSetCard
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
0x2c4
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
c
,
1
,
0
,
0
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
s
.
filter
(
chkc
,
tp
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
tp
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
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
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
function
s
.
spop1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
tc
:
IsRelateToEffect
(
e
)
then
return
false
end
if
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
local
tc
=
Duel
.
GetFirstTarget
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
...
...
@@ -52,32 +58,32 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e1
)
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
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_OATH
)
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
:
SetTarget
(
cm
.
splimit
)
e1
:
SetTarget
(
s
.
splimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
cm
.
splimit
(
e
,
c
,
sump
,
sumtype
,
sumpos
,
targetp
,
se
)
return
c
:
IsCode
(
m
)
function
s
.
splimit
(
e
,
c
)
return
c
:
IsCode
(
id
)
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
c
=
e
:
GetHandler
()
return
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
and
c
:
GetType
()
&
TYPE_TRAP
+
TYPE_CONTINUOUS
==
TYPE_TRAP
+
TYPE_CONTINUOUS
return
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
and
e
:
GetHandler
():
GetType
()
==
TYPE_TRAP
+
TYPE_CONTINUOUS
end
function
cm
.
tg1
(
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
function
s
.
sptg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
id
,
0x2a5
,
TYPE_MONSTER
+
TYPE_EFFECT
,
1000
,
2000
,
4
,
RACE_PYRO
,
ATTRIBUTE_DARK
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
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
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
\ No newline at end of file
end
expansions/script/c100421019.lua
View file @
6c72c127
local
cm
,
m
=
GetID
()
cm
.
name
=
"百夫长战旗骑士皇 蕾伽蒂娅"
function
cm
.
initial_effect
(
c
)
--騎士皇レガーティア
--Script by passingDio0
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--synchro summon
aux
.
AddSynchroProcedure
(
c
,
nil
,
aux
.
NonTuner
(
nil
),
1
)
c
:
EnableReviveLimit
()
--draw and destory
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_
DRAW
+
CATEGORY_DESTROY
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_
SEARCH
+
CATEGORY_TOHAND
)
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
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
tg
)
e1
:
SetOperation
(
cm
.
op
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetTarget
(
s
.
dd
tg
)
e1
:
SetOperation
(
s
.
dd
op
)
c
:
RegisterEffect
(
e1
)
--avoid battle destory
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsAttackBelow
,
2000
)
)
e2
:
SetTarget
(
s
.
bdtg
)
e2
:
SetValue
(
1
)
c
:
RegisterEffect
(
e2
)
--set
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
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e3
:
SetCountLimit
(
1
,
m
+
100
)
e3
:
SetTarget
(
cm
.
tg1
)
e3
:
SetOperation
(
cm
.
op1
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
,
id
+
o
)
e3
:
SetTarget
(
s
.
settg
)
e3
:
SetOperation
(
s
.
setop
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
function
s
.
dd
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
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
)
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
)
if
#
g
==
0
then
return
false
end
g
=
g
:
GetMaxGroup
(
Card
.
GetAttack
)
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
1
))
then
Duel
.
Hint
(
3
,
tp
,
HINTMSG_DESTROY
)
local
g
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
if
#
g
==
0
then
return
false
end
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
if
#
g
>
0
then
local
tg
=
g
:
GetMaxGroup
(
Card
.
GetAttack
)
if
#
tg
>
1
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
sg
=
tg
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
sg
)
Duel
.
Destroy
(
sg
,
REASON_EFFECT
)
else
Duel
.
Destroy
(
tg
,
REASON_EFFECT
)
end
end
end
end
function
cm
.
f
(
c
)
return
c
:
Is
SetCard
(
0x2c4
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsType
(
TYPE_SYNCHRO
)
function
s
.
bdtg
(
e
,
c
)
return
c
:
Is
Faceup
()
and
c
:
IsAttackBelow
(
2000
)
end
function
cm
.
tg1
(
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
function
s
.
filter
(
c
)
return
c
:
IsSetCard
(
0x2a5
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsForbidden
()
and
not
c
:
IsType
(
TYPE_SYNCHRO
)
end
function
cm
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
3
,
tp
,
HINTMSG_SELECT
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
f
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
for
tc
in
aux
.
Next
(
g
)
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
function
s
.
settg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_HAND
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
s
.
setop
(
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
,
aux
.
NecroValleyFilter
(
s
.
filter
),
tp
,
LOCATION_GRAVE
+
LOCATION_HAND
,
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
)
end
end
\ No newline at end of file
expansions/script/c100421020.lua
View file @
6c72c127
local
cm
,
m
=
GetID
()
cm
.
name
=
"站起来吧百夫长战旗!"
function
cm
.
initial_effect
(
c
)
--スタンドアップ・センチュリオン!
--Script by passingDio0
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
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetOperation
(
cm
.
op
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e1
:
SetRange
(
LOCATION_FZONE
)
e1
:
SetValue
(
aux
.
indoval
)
e1
:
SetCondition
(
s
.
con
)
c
:
RegisterEffect
(
e1
)
--set
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e2
:
SetCategory
(
CATEGORY_TOGRAVE
+
CATEGORY_TOEXTRA
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetCountLimit
(
1
,
m
)
e2
:
SetCondition
(
cm
.
con
)
e2
:
SetCost
(
cm
.
cost
)
e2
:
SetTarget
(
cm
.
tg
)
e2
:
SetOperation
(
cm
.
op1
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetCondition
(
s
.
set
con
)
e2
:
SetCost
(
s
.
set
cost
)
e2
:
SetTarget
(
s
.
set
tg
)
e2
:
SetOperation
(
s
.
setop
)
c
:
RegisterEffect
(
e2
)
--synchro summon
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
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetRange
(
LOCATION_FZONE
)
e3
:
SetCountLimit
(
1
,
m
+
100
)
e3
:
SetTarget
(
cm
.
tg1
)
e3
:
SetOperation
(
cm
.
op2
)
e3
:
SetCountLimit
(
1
,
id
+
o
)
e3
:
SetCondition
(
s
.
sccon
)
e3
:
SetTarget
(
s
.
sctg
)
e3
:
SetOperation
(
s
.
scop
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
c
:
RegisterFlagEffect
(
m
,
RESET_PHASE
+
PHASE_END
,
EFFECT_FLAG_CLIENT_HINT
,
1
,
0
,
aux
.
Stringid
(
m
,
2
))
function
s
.
reg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
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
function
cm
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetFlagEffect
(
m
)
>
0
function
s
.
set
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetFlagEffect
(
id
)
~=
0
end
function
cm
.
cost
(
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
Duel
.
Hint
(
3
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToGraveAsCost
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
function
s
.
setcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToGraveAsCost
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsAbleToGraveAsCost
,
1
,
1
,
REASON_COST
)
end
function
s
.
filter
(
c
)
return
c
:
IsSetCard
(
0x2a5
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsForbidden
()
end
function
cm
.
tg
(
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
function
s
.
settg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
cm
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
3
,
tp
,
HINTMSG_SELECT
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
f
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
for
tc
in
aux
.
Next
(
g
)
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
function
s
.
setop
(
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
.
filter
,
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
)
end
end
function
cm
.
f
(
c
)
return
c
:
Is
SetCard
(
0x2c4
)
and
c
:
IsType
(
TYPE_MONSTER
)
function
s
.
scconfilter
(
c
,
tp
)
return
c
:
Is
Faceup
(
)
end
function
cm
.
f1
(
c
)
return
c
:
IsSetCard
(
0x2c4
)
and
c
:
IsType
(
TYPE_MONSTER
)
function
s
.
sccon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
s
.
scconfilter
,
1
,
nil
,
tp
)
end
function
cm
.
f2
(
c
)
return
c
:
Is
HasEffect
(
EFFECT_HAND_SYNCHRO
)
and
c
:
IsType
(
TYPE_MONSTER
)
function
s
.
mfilter
(
c
)
return
c
:
Is
SetCard
(
0x2a5
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsFaceup
(
)
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
local
mg
=
Duel
.
GetMatchingGroup
(
cm
.
f1
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
exg
=
Duel
.
GetMatchingGroup
(
cm
.
f2
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
mg
:
Merge
(
exg
)
return
Duel
.
IsExistingMatchingCard
(
cm
.
f4
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
mg
)
local
mg
=
Duel
.
GetMatchingGroup
(
s
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
return
Duel
.
IsExistingMatchingCard
(
s
.
scfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
mg
)
end
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
cm
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
mg
=
Duel
.
GetMatchingGroup
(
cm
.
f1
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
exg
=
Duel
.
GetMatchingGroup
(
cm
.
f2
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
mg
:
Merge
(
exg
)
local
g
=
Duel
.
GetMatchingGroup
(
cm
.
f4
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
mg
)
function
s
.
scop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
mg
=
Duel
.
GetMatchingGroup
(
s
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
scfilter
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
mg
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
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
())
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
\ 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
=
"百夫长战旗骑士的牵绊"
function
cm
.
initial_effect
(
c
)
--騎士の絆
--Faith of Centurion
--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
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
tg
)
e1
:
SetOperation
(
cm
.
op
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
--place trap
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
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
m
+
100
)
e2
:
SetCondition
(
cm
.
con
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e2
:
SetLabelObject
(
e0
)
e2
:
SetCondition
(
s
.
ptcon
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
cm
.
tg1
)
e2
:
SetOperation
(
cm
.
op1
)
e2
:
SetTarget
(
s
.
pttg
)
e2
:
SetOperation
(
s
.
ptop
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
f
(
c
)
return
c
:
IsSetCard
(
0x2
c4
)
and
c
:
IsType
(
TYPE_MONSTER
)
function
s
.
filter
(
c
)
return
c
:
IsSetCard
(
0x2
a5
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsForbidden
(
)
end
function
cm
.
tg
(
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
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
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
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
3
,
tp
,
HINTMSG_SELECT
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
f
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
for
tc
in
aux
.
Next
(
g
)
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
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
filter
),
tp
,
LOCATION_GRAVE
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
tc
and
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
function
cm
.
f1
(
c
,
tp
)
return
c
:
IsType
(
TYPE_SYNCHRO
)
and
c
:
IsSummonPlayer
(
tp
)
function
s
.
cfilter
(
c
,
tp
,
se
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x2a5
)
and
c
:
IsType
(
TYPE_SYNCHRO
)
and
c
:
IsControler
(
tp
)
and
(
se
==
nil
or
c
:
GetReasonEffect
()
~=
se
)
end
function
cm
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
cm
.
f1
,
1
,
nil
,
tp
)
function
s
.
pt
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
s
.
cfilter
,
1
,
nil
,
tp
,
e
:
GetLabelObject
():
GetLabelObject
()
)
end
function
cm
.
f2
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsSetCard
(
0x2c4
)
function
s
.
pttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
s
.
filter
(
chkc
)
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
function
cm
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
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
)
function
s
.
ptop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
not
tc
:
IsRelateToEffect
(
e
)
then
return
false
end
if
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
if
tc
:
IsRelateToEffect
(
e
)
and
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
)
...
...
@@ -70,4 +76,4 @@ function cm.op1(e,tp,eg,ep,ev,re,r,rp)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e1
)
end
end
\ No newline at end of file
end
expansions/script/c100421023.lua
View file @
6c72c127
local
cm
,
m
=
GetID
()
cm
.
name
=
"百夫长战旗骑士魔防阵"
function
cm
.
initial_effect
(
c
)
--騎士魔防陣
--Centurion Phalanx
--coded by Lyris & DIO0passing
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_REMOVE
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
tg
)
e1
:
SetOperation
(
cm
.
op
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
--spsummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
m
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
cm
.
tg1
)
e2
:
SetOperation
(
cm
.
op2
)
e2
:
SetTarget
(
s
.
sptg
)
e2
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
f
(
c
)
return
c
:
Is
AbleToRemove
()
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
==
TYPE_MONSTER
and
c
:
IsFaceup
()
function
s
.
filter
(
c
)
return
c
:
Is
Faceup
()
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
>
0
and
c
:
IsAbleToRemove
()
end
function
cm
.
tg
(
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
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
f
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
Is
OnField
()
and
s
.
filter
(
chkc
)
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
)
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
)
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
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
Remove
(
tc
,
0
,
REASON_EFFECT
+
REASON_TEMPORARY
)
~=
0
then
local
ct
=
Duel
.
GetCurrentPhase
()
<=
PHASE_STANDBY
and
2
or
1
tc
:
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_STANDBY
,
0
,
ct
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_PHASE
+
PHASE_STANDBY
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_STANDBY
,
ct
)
e2
:
SetLabelObject
(
tc
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCondition
(
cm
.
con
)
e2
:
SetOperation
(
cm
.
op1
)
e2
:
SetLabel
(
Duel
.
GetTurnCount
()
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
if
not
tc
:
IsRelateToEffect
(
e
)
or
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
<
1
or
not
tc
:
IsLocation
(
LOCATION_REMOVED
)
then
return
end
tc
:
RegisterFlagEffect
(
id
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_STANDBY
,
0
,
2
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_STANDBY
)
e1
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetLabel
(
Duel
.
GetTurnCount
()
)
e1
:
SetLabelObject
(
tc
)
e1
:
SetCondition
(
s
.
retcon
)
e1
:
SetOperation
(
s
.
retop
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_STANDBY
,
2
)
Duel
.
RegisterEffect
(
e1
,
tp
)
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
()
return
Duel
.
GetTurnCount
()
~=
e
:
GetLabel
()
and
tc
:
GetFlagEffect
(
m
)
~=
0
return
Duel
.
GetTurnCount
()
==
e
:
GetLabel
()
+
1
and
tc
:
GetFlagEffect
(
id
)
>
0
end
function
cm
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
ReturnToField
(
e
:
GetLabelObject
())
function
s
.
retop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tc
:
GetOwner
(),
false
,
false
,
POS_FACEUP
)
end
function
cm
.
f1
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x2
c4
)
and
c
:
IsType
(
TYPE_SYNCHRO
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
function
s
.
sfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x2
a5
)
and
c
:
IsType
(
TYPE_SYNCHRO
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
tg1
(
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
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
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
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
)
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
)
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
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
SpecialSummonStep
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
...
...
@@ -80,4 +87,4 @@ function cm.op2(e,tp,eg,ep,ev,re,r,rp)
tc
:
RegisterEffect
(
e1
)
end
Duel
.
SpecialSummonComplete
()
end
\ No newline at end of file
end
expansions/script/c100421024.lua
View file @
6c72c127
local
cm
,
m
=
GetID
()
cm
.
name
=
"百夫长战旗骑士皇爆诞"
function
cm
.
initial_effect
(
c
)
--騎士皇爆誕
--Truth Centurion
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_NEGATE
+
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCountLimit
(
1
,
m
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
cm
.
c
on
)
e1
:
SetCost
(
cm
.
cost
)
e1
:
SetTarget
(
cm
.
tg
)
e1
:
SetOperation
(
cm
.
op
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
s
.
conditi
on
)
e1
:
SetCost
(
s
.
cost
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
c
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
)
function
s
.
conditi
on
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
(
re
:
Is
HasType
(
EFFECT_TYPE_ACTIVATE
)
or
re
:
IsActiveType
(
TYPE_MONSTER
))
and
Duel
.
IsChainNegatable
(
ev
)
end
function
cm
.
f
(
c
)
return
c
:
IsFaceup
()
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
==
TYPE_MONSTER
and
c
:
IsAbleToGraveAsCost
()
function
s
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
>
0
and
c
:
GetSequence
()
<
5
and
c
:
IsAbleToGraveAsCost
()
end
function
cm
.
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
function
s
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_SZONE
,
0
,
1
,
nil
)
end
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
)
end
function
cm
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_NEGATE
,
eg
,
1
,
0
,
0
)
if
re
:
GetHandler
():
IsDestructable
()
and
re
:
GetHandler
():
IsRelateToEffect
(
re
)
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
eg
,
1
,
0
,
0
)
end
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
Duel
.
NegateActivation
(
ev
)
then
return
end
if
re
:
GetHandler
():
IsRelateToEffect
(
re
)
then
Duel
.
Destroy
(
eg
,
REASON_EFFECT
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
NegateActivation
(
ev
)
and
re
:
GetHandler
():
IsRelateToEffect
(
re
)
then
Duel
.
Destroy
(
eg
,
REASON_EFFECT
)
end
end
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
)
--Pendulum procedure
aux
.
EnablePendulumAttribute
(
c
)
--Can place Resonance Counters on it
c
:
EnableCounterPermit
(
0x69
,
LOCATION_PZONE
)
--Place 1 Resonance Counter on this card each time you gain LP
c
:
EnableCounterPermit
(
0x170
,
LOCATION_PZONE
)
--counter
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_RECOVER
)
e1
:
SetRange
(
LOCATION_PZONE
)
e1
:
SetCondition
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
ep
==
tp
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsRace
,
tp
,
LOCATION_PZONE
,
0
,
1
,
e
:
GetHandler
(),
RACE_FIEND
)
end
)
e1
:
SetCondition
(
s
.
ctcon
)
e1
:
SetOperation
(
s
.
ctop
)
c
:
RegisterEffect
(
e1
)
--
Link Summon 1 "Valmonica" monster
--
link summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
...
...
@@ -21,113 +21,124 @@ function s.initial_effect(c)
e2
:
SetCode
(
EVENT_ATTACK_ANNOUNCE
)
e2
:
SetRange
(
LOCATION_PZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCondition
(
function
(
e
,
tp
)
return
Duel
.
GetAttacker
():
IsControler
(
1
-
tp
)
end
)
e2
:
SetTarget
(
s
.
l
inksp
tg
)
e2
:
SetOperation
(
s
.
l
inksp
op
)
e2
:
SetCondition
(
s
.
lscon
)
e2
:
SetTarget
(
s
.
l
s
tg
)
e2
:
SetOperation
(
s
.
l
s
op
)
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
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_HAND
)
e3
:
SetCountLimit
(
1
,
121999031
)
e3
:
SetCountLimit
(
1
,
id
)
e3
:
SetCost
(
s
.
pzcost
)
e3
:
SetTarget
(
s
.
pztg
)
e3
:
SetOperation
(
s
.
pzop
)
c
:
RegisterEffect
(
e3
)
--
Apply the LP gain effect of 1 "Valmonica" Normal Spell/Trap
--
copy
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCountLimit
(
1
,
121900031
)
e4
:
SetCondition
(
function
(
e
)
return
e
:
GetHandler
():
GetFlagEffect
(
id
)
>
0
end
)
e4
:
SetCost
(
s
.
cpcost
)
e4
:
SetCountLimit
(
1
,
id
+
o
)
e4
:
SetCondition
(
s
.
cpcon
)
e4
:
SetTarget
(
s
.
cptg
)
e4
:
SetOperation
(
s
.
cpop
)
c
:
RegisterEffect
(
e4
)
-- Register flag on summon
if
not
c121999031
.
global_check
then
c121999031
.
global_check
=
true
if
not
s
.
global_check
then
s
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
ge1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
ge1
:
SetLabel
(
id
)
ge1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
ge1
:
SetOperation
(
aux
.
sumreg
)
Duel
.
RegisterEffect
(
ge1
,
0
)
local
ge2
=
ge1
:
Clone
()
ge2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
ge2
:
SetLabel
(
id
)
Duel
.
RegisterEffect
(
ge2
,
0
)
end
end
function
s
.
c
top
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
s
.
addcounter
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
c
filter
(
c
)
return
c
:
GetOriginalRace
()
&
RACE_FIEND
>
0
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
>
0
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
()
c
:
AddCounter
(
0x69
,
1
)
Duel
.
RaiseEvent
(
c
,
EVENT_CUSTOM
+
121999035
,
e
,
0
,
tp
,
tp
,
1
)
c
:
AddCounter
(
0x170
,
1
)
if
c
:
GetCounter
(
0x170
)
==
3
then
Duel
.
RaiseEvent
(
c
,
EVENT_CUSTOM
+
100421035
,
e
,
0
,
tp
,
tp
,
0
)
end
end
function
s
.
l
inkfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
c
:
IsSpecialSummonable
(
SUMMON_TYPE_LINK
)
function
s
.
l
scon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetTurnPlayer
()
==
1
-
tp
end
function
s
.
linksptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
linkfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
function
s
.
lfilter
(
c
)
return
c
:
IsLinkSummonable
(
nil
)
and
c
:
IsSetCard
(
0x2a3
)
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
)
local
sc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
linkfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
sc
then
Duel
.
LinkSummon
(
tp
,
sc
,
nil
)
end
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
lfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
tc
then
Duel
.
LinkSummon
(
tp
,
tc
,
nil
)
end
end
function
s
.
pzcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
c
)
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
|
REASON_DISCARD
,
c
)
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
,
c
)
end
function
s
.
pz
filter
(
c
)
return
c
:
IsCode
(
1
21999
032
)
and
not
c
:
IsForbidden
()
function
s
.
filter
(
c
)
return
c
:
IsCode
(
1
00421
032
)
and
not
c
:
IsForbidden
()
end
function
s
.
pztg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
and
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
)
and
Duel
.
IsExistingMatchingCard
(
s
.
pz
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
and
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
end
function
s
.
pzop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
(
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
and
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
)
and
c
:
IsRelateToEffect
(
e
))
then
return
end
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
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
pzfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
not
tc
then
return
end
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
tc
then
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
end
end
function
s
.
cpcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
e
:
SetLabel
(
1
)
return
true
function
s
.
cpcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetFlagEffect
(
id
)
>
0
end
function
s
.
cpfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
(
c
:
GetType
()
==
TYPE_TRAP
or
c
:
GetType
()
==
TYPE_SPELL
)
and
c
:
IsAbleToRemoveAsCost
()
function
s
.
pfilter
(
c
)
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
)
end
function
s
.
cptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
e
:
GetLabel
()
==
0
then
return
false
end
e
:
SetLabel
(
0
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
if
chk
==
0
then
return
e
:
IsCostChecked
()
and
Duel
.
IsExistingMatchingCard
(
s
.
pfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
):
GetFirst
()
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
)
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
function
s
.
cpop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
if
not
tc
then
return
end
local
eff
=
tc
:
GetActivateEffect
()
local
op
=
eff
:
GetOperation
()
--Additional parameter checked in the script of "Valmonica" Normal Spells/Traps to correctly apply the LP gain effect
if
op
then
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
0
)
end
end
\ No newline at end of file
local
te
=
e
:
GetLabelObject
()
if
not
te
then
return
end
e
:
SetLabelObject
(
te
:
GetLabelObject
())
local
op
=
te
:
GetOperation
()
if
op
then
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
1
)
end
end
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
)
--Pendulum procedure
aux
.
EnablePendulumAttribute
(
c
)
--Can place Resonance Counters on it
c
:
EnableCounterPermit
(
0x69
,
LOCATION_PZONE
)
--Place 1 Resonance Counter on this card each time you take effect damage
c
:
EnableCounterPermit
(
0x170
,
LOCATION_PZONE
)
--counter
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_DAMAGE
)
e1
:
SetRange
(
LOCATION_PZONE
)
e1
:
SetCondition
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
ep
==
tp
and
r
&
REASON_EFFECT
>
0
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsRace
,
tp
,
LOCATION_PZONE
,
0
,
1
,
e
:
GetHandler
(),
RACE_FAIRY
)
end
)
e1
:
SetCondition
(
s
.
ctcon
)
e1
:
SetOperation
(
s
.
ctop
)
c
:
RegisterEffect
(
e1
)
--
Opponent's monsters lose 100 ATK for each Resonance Counter on your field
--
atk down
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e2
:
SetRange
(
LOCATION_PZONE
)
e2
:
SetTargetRange
(
0
,
LOCATION_MZONE
)
e2
:
SetValue
(
function
(
e
)
return
Duel
.
GetCounter
(
e
:
GetHandlerPlayer
(),
LOCATION_ONFIELD
,
0
,
0x69
)
*-
100
end
)
e2
:
SetValue
(
s
.
adval
)
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
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_HAND
)
e3
:
SetCountLimit
(
1
,
121999032
)
e3
:
SetCountLimit
(
1
,
id
)
e3
:
SetCost
(
s
.
pzcost
)
e3
:
SetTarget
(
s
.
pztg
)
e3
:
SetOperation
(
s
.
pzop
)
c
:
RegisterEffect
(
e3
)
--
Apply the damage-inflicting effect of 1 "Valmonica" Normal Spell/Trap
--
copy
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCountLimit
(
1
,
121900032
)
e4
:
SetCondition
(
function
(
e
)
return
e
:
GetHandler
():
GetFlagEffect
(
id
)
>
0
end
)
e4
:
SetCost
(
s
.
cpcost
)
e4
:
SetCountLimit
(
1
,
id
+
o
)
e4
:
SetCondition
(
s
.
cpcon
)
e4
:
SetTarget
(
s
.
cptg
)
e4
:
SetOperation
(
s
.
cpop
)
c
:
RegisterEffect
(
e4
)
-- Register flag on summon
if
not
c121999032
.
global_check
then
c121999032
.
global_check
=
true
if
not
s
.
global_check
then
s
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
ge1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
ge1
:
SetLabel
(
id
)
ge1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
ge1
:
SetOperation
(
aux
.
sumreg
)
Duel
.
RegisterEffect
(
ge1
,
0
)
local
ge2
=
ge1
:
Clone
()
ge2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
ge2
:
SetLabel
(
id
)
Duel
.
RegisterEffect
(
ge2
,
0
)
end
end
function
s
.
c
top
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
s
.
addcounter
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
c
filter
(
c
)
return
c
:
GetOriginalRace
()
&
RACE_FAIRY
>
0
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
>
0
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
()
c
:
AddCounter
(
0x69
,
1
)
Duel
.
RaiseEvent
(
c
,
EVENT_CUSTOM
+
121999035
,
e
,
0
,
tp
,
tp
,
1
)
c
:
AddCounter
(
0x170
,
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
function
s
.
pzcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
c
)
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
|
REASON_DISCARD
,
c
)
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
,
c
)
end
function
s
.
pz
filter
(
c
)
return
c
:
IsCode
(
1
21999
031
)
and
not
c
:
IsForbidden
()
function
s
.
filter
(
c
)
return
c
:
IsCode
(
1
00421
031
)
and
not
c
:
IsForbidden
()
end
function
s
.
pztg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
and
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
)
and
Duel
.
IsExistingMatchingCard
(
s
.
pz
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
and
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
end
function
s
.
pzop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
(
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
and
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
)
and
c
:
IsRelateToEffect
(
e
))
then
return
end
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
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
pzfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
not
tc
then
return
end
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
tc
then
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
end
end
function
s
.
cpcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
e
:
SetLabel
(
1
)
return
true
function
s
.
cpcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetFlagEffect
(
id
)
>
0
end
function
s
.
cpfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
(
c
:
GetType
()
==
TYPE_TRAP
or
c
:
GetType
()
==
TYPE_SPELL
)
and
c
:
IsAbleToRemoveAsCost
()
function
s
.
pfilter
(
c
)
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
)
end
function
s
.
cptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
e
:
GetLabel
()
==
0
then
return
false
end
e
:
SetLabel
(
0
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
if
chk
==
0
then
return
e
:
IsCostChecked
()
and
Duel
.
IsExistingMatchingCard
(
s
.
pfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
):
GetFirst
()
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
)
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
function
s
.
cpop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
if
not
tc
then
return
end
local
eff
=
tc
:
GetActivateEffect
()
local
op
=
eff
:
GetOperation
()
--Additional parameter checked in the script of "Valmonica" Normal Spells/Traps to correctly apply the damage-inflicting effect
if
op
then
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
1
)
end
local
te
=
e
:
GetLabelObject
()
if
not
te
then
return
end
e
:
SetLabelObject
(
te
:
GetLabelObject
())
local
op
=
te
:
GetOperation
()
if
op
then
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
2
)
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
)
c
:
EnableReviveLimit
()
c
:
SetSPSummonOnce
(
id
)
--Link Summon procedure
aux
.
AddLinkProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsLinkType
,
TYPE_EFFECT
),
1
)
--Cannot be Link Summoned unless you have a Fairy Monster Card with 3 or more Resonance Counters in your Pendulum Zone
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_SINGLE
)
e0
:
SetCode
(
EFFECT_SPSUMMON_COST
)
e0
:
SetCost
(
s
.
spcost
)
c
:
RegisterEffect
(
e0
)
--Destroy opponent's monsters up to the number of Resonance Counters in your Pendulum Zone
--material
aux
.
AddLinkProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsType
,
TYPE_EFFECT
),
1
,
1
)
--spsummon condition
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCondition
(
function
(
e
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_LINK
)
end
)
e1
:
SetTarget
(
s
.
destg
)
e1
:
SetOperation
(
s
.
desop
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_COST
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetCost
(
s
.
spcost
)
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
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCondition
(
function
()
return
Duel
.
IsAbleToEnterBP
()
end
)
e2
:
SetCost
(
s
.
tripleatkcost
)
e2
:
SetTarget
(
s
.
tripleatktg
)
e2
:
SetOperation
(
s
.
tripleatkop
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_DESTROY
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e2
:
SetCondition
(
s
.
descon
)
e2
:
SetTarget
(
s
.
destg
)
e2
:
SetOperation
(
s
.
desop
)
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
function
s
.
sp
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_FAIRY
)
and
c
:
GetCounter
(
0x69
)
>=
3
function
s
.
cfilter
(
c
)
return
c
:
GetOriginalRace
()
&
RACE_FAIRY
>
0
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
>
0
and
c
:
GetCounter
(
0x170
)
>
2
end
function
s
.
spcost
(
e
,
c
,
tp
,
st
)
if
(
st
&
SUMMON_TYPE_LINK
)
~=
SUMMON_TYPE_LINK
then
return
true
end
return
Duel
.
IsExistingMatchingCard
(
s
.
spcfilter
,
tp
,
LOCATION_PZONE
,
0
,
1
,
nil
)
if
st
&
SUMMON_TYPE_LINK
~=
SUMMON_TYPE_LINK
then
return
true
end
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
function
s
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsControler
(
1
-
tp
)
and
chkc
:
IsLocation
(
LOCATION_MZONE
)
end
local
ct
=
Duel
.
GetCounter
(
tp
,
1
,
0
,
0x69
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
1
-
tp
)
end
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
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
t
g
=
Duel
.
SelectTarget
(
tp
,
nil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
ct
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
tg
,
#
tg
,
tp
,
0
)
local
g
=
Duel
.
SelectTarget
(
tp
,
nil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
ct
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
#
g
,
0
,
0
)
end
function
s
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tg
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
):
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
if
#
tg
>
0
then
Duel
.
Destroy
(
tg
,
REASON_EFFECT
)
end
Duel
.
Destroy
(
Duel
.
GetTargetsRelateToChain
(),
REASON_EFFECT
)
end
function
s
.
tripleatkcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
0
,
0x69
,
3
,
REASON_COST
)
end
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x69
,
3
,
REASON_COST
)
function
s
.
tacon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsAbleToEnterBP
()
end
function
s
.
tripleatktg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
effs
=
{
e
:
GetHandler
():
IsHasEffect
(
EFFECT_EXTRA_ATTACK
)}
for
_
,
eff
in
ipairs
(
effs
)
do
if
eff
:
GetValue
()
>=
2
then
return
false
end
function
s
.
chk
(
g
,
tp
)
local
tl
=
0
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
return
true
tl
=
tl
+
ct
end
return
tl
>
2
end
function
s
.
tripleatkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
--Can make a 2nd and 3rd attack this turn
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_EXTRA_ATTACK
)
e1
:
SetValue
(
2
)
e1
:
SetReset
(
RESET_EVENT
|
RESETS_STANDARD
|
RESET_PHASE
|
PHASE_END
)
c
:
RegisterEffect
(
e1
)
function
s
.
tacost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_PZONE
,
0
)
if
chk
==
0
then
return
g
:
CheckSubGroup
(
s
.
chk
,
1
,
99
,
tp
)
end
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
\ No newline at end of file
end
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
)
c
:
EnableReviveLimit
()
c
:
SetSPSummonOnce
(
id
)
--Link Summon procedure
aux
.
AddLinkProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsLinkType
,
TYPE_EFFECT
),
1
)
--Cannot be Link Summoned unless you have a Fiend Monster Card with 3 or more Resonance Counters in your Pendulum Zone
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_SINGLE
)
e0
:
SetCode
(
EFFECT_SPSUMMON_COST
)
e0
:
SetCost
(
s
.
spcost
)
c
:
RegisterEffect
(
e0
)
--Remove 3 Resonance Counters from your Pendulum Zone instead of destroying this card
--material
aux
.
AddLinkProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsType
,
TYPE_EFFECT
),
1
,
1
)
--spsummon condition
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EFFECT_DESTROY_REPLACE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTarget
(
s
.
reptg
)
e1
:
SetValue
(
s
.
repval
)
e1
:
SetOperation
(
s
.
repop
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_COST
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetCost
(
s
.
spcost
)
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
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EFFECT_DESTROY_REPLACE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetHintTiming
(
0
,
TIMING_STANDBY_PHASE
+
TIMING_MAIN_END
+
TIMINGS_CHECK_MONSTER
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCondition
(
function
(
e
,
tp
)
return
Duel
.
GetTurnPlayer
()
==
1
-
tp
end
)
e2
:
SetTarget
(
s
.
cptg
)
e2
:
SetOperation
(
s
.
cpop
)
e2
:
SetTarget
(
s
.
desreptg
)
e2
:
SetValue
(
s
.
desrepval
)
e2
:
SetOperation
(
s
.
desrepop
)
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
function
s
.
sp
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_FIEND
)
and
c
:
GetCounter
(
0x69
)
>=
3
function
s
.
cfilter
(
c
)
return
c
:
GetOriginalRace
()
&
RACE_FIEND
>
0
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
>
0
and
c
:
GetCounter
(
0x170
)
>
2
end
function
s
.
spcost
(
e
,
c
,
tp
,
st
)
if
(
st
&
SUMMON_TYPE_LINK
)
~=
SUMMON_TYPE_LINK
then
return
true
end
return
Duel
.
IsExistingMatchingCard
(
s
.
sp
cfilter
,
tp
,
LOCATION_PZONE
,
0
,
1
,
nil
)
if
st
&
SUMMON_TYPE_LINK
~=
SUMMON_TYPE_LINK
then
return
true
end
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_PZONE
,
0
,
1
,
nil
)
end
function
s
.
filter1
(
c
,
tp
)
return
not
c
:
IsReason
(
REASON_REPLACE
)
and
c
:
IsLocation
(
LOCATION_ONFIELD
)
and
c
:
IsControler
(
tp
)
and
c
:
IsReason
(
REASON_EFFECT
+
REASON_BATTLE
)
function
s
.
desrepchk
(
g
,
tp
)
local
tl
=
0
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
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
g
=
eg
:
Filter
(
s
.
filter1
,
nil
,
tp
)
if
chk
==
0
then
return
#
g
>
0
and
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
0
,
0x69
,
3
,
REASON_EFFECT
)
end
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_PZONE
,
0
)
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
)
end
function
s
.
repval
(
e
,
c
)
return
s
.
filter1
(
c
,
e
:
GetHandlerPlayer
())
function
s
.
des
repval
(
e
,
c
)
return
s
.
desrepfilter
(
c
,
e
:
GetHandlerPlayer
())
end
function
s
.
repop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x69
,
3
,
REASON_EFFECT
)
function
s
.
desrepop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
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
function
s
.
cpfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
(
c
:
GetType
()
==
TYPE_TRAP
or
c
:
GetType
()
==
TYPE_SPELL
)
and
c
:
IsFaceup
()
and
c
:
CheckActivateEffect
(
false
,
true
,
false
)
function
s
.
cpcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetTurnPlayer
()
==
1
-
tp
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
function
s
.
cptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
|
LOCATION_REMOVED
)
and
chkc
:
IsControler
(
tp
)
and
s
.
cpfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
|
LOCATION_REMOVED
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
local
tc
=
Duel
.
SelectTarget
(
tp
,
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
|
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
):
GetFirst
()
local
eff
=
tc
:
CheckActivateEffect
(
false
,
true
,
false
)
e
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
|
eff
:
GetProperty
())
local
tg
=
eff
:
GetTarget
()
if
tg
then
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
1
)
if
chkc
then
local
te
=
e
:
GetLabelObject
()
local
tg
=
te
:
GetTarget
()
return
tg
and
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
0
,
chkc
)
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
)
end
function
s
.
cpop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
not
tc
:
IsRelateToEffect
(
e
)
then
return
end
local
eff
=
tc
:
CheckActivateEffect
(
false
,
true
,
false
)
if
not
eff
then
return
end
local
op
=
eff
:
GetOperation
()
local
te
=
e
:
GetLabelObject
()
if
not
(
te
and
te
:
GetHandler
():
IsRelateToEffect
(
e
))
then
return
end
e
:
SetLabelObject
(
te
:
GetLabelObject
())
local
op
=
te
:
GetOperation
()
if
op
then
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
end
\ No newline at end of file
end
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
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
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
)
c
:
RegisterEffect
(
e1
)
--
Take control of 1 opponent's monster
--
control
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_
SPECIAL_SUMMON
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_
CONTROL
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCode
(
EVENT_CUSTOM
+
id
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetCountLimit
(
1
,{
id
,
1
})
e2
:
SetCondition
(
s
.
ctrlcon
)
e2
:
SetTarget
(
s
.
ctrltg
)
e2
:
SetOperation
(
s
.
ctrlop
)
e2
:
SetCode
(
EVENT_CUSTOM
+
id
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e2
:
SetCondition
(
s
.
concon
)
e2
:
SetTarget
(
s
.
contg
)
e2
:
SetOperation
(
s
.
conop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
th
filter
(
c
)
return
c
:
Is
Type
(
TYPE_MONSTER
)
and
c
:
IsSetCard
(
0x19e
)
and
c
:
IsAbleToHand
()
function
s
.
filter
(
c
)
return
c
:
Is
SetCard
(
0x2a3
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
th
filter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
0
))
then
local
g
=
Duel
.
GetMatchingGroup
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
1
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
sg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
sg
)
end
end
function
s
.
c
trl
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
ep
==
tp
and
eg
:
GetFirst
():
GetCounter
(
0x69
)
==
3
function
s
.
c
on
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
ep
==
tp
end
function
s
.
ctrltg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
1
-
tp
)
and
chkc
:
IsControlerCanBeChanged
()
end
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
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CONTROL
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_CONTROL
,
g
,
1
,
tp
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_CONTROL
,
g
,
1
,
0
,
0
)
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
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
GetControl
(
tc
,
tp
,
PHASE_END
,
1
)
>
0
then
--It cannot declare an attack
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetDescription
(
3206
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_ATTACK
)
e1
:
SetCondition
(
function
(
e
)
return
e
:
GetHandler
():
IsControler
(
tp
)
end
)
e1
:
SetReset
(
RESET_EVENT
|
(
RESETS_STANDARD
&~
RESET_TURN_SET
)
|
RESET_PHASE
|
PHASE_END
)
e1
:
SetCode
(
EFFECT_CANNOT_ATTACK_ANNOUNCE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
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
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_
TOHAND
+
CATEGORY_SEARCH
+
CATEGORY_DAMAGE
+
CATEGORY_TOGRAVE
)
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_
SEARCH
+
CATEGORY_TOHAND
+
CATEGORY_DAMAGE
+
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
,
EFFECT_COUNT_CODE_OATH
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
function
s
.
filter
(
c
)
return
c
:
IsSetCard
(
0x2a3
)
and
c
:
IsAbleToGrave
()
and
not
c
:
IsCode
(
id
)
end
function
s
.
tgfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
not
c
:
IsCode
(
id
)
and
c
:
IsAbleToGrave
()
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
angle_or_delvin
)
--Additional parameter used by "Angelo Valmonica" and "Demone Valmonica"
local
op
=
nil
if
angle_or_delvin
then
op
=
angle_or_delvin
else
local
sel_player
=
Duel
.
IsExistingMatchingCard
(
Card
.
IsSetCard
,
tp
,
LOCATION_PZONE
,
0
,
1
,
nil
,
0x19e
)
and
tp
or
1
-
tp
local
offset
=
sel_player
==
1
-
tp
and
2
or
0
op
=
Duel
.
SelectOption
(
sel_player
,
aux
.
Stringid
(
id
,
1
+
offset
),
aux
.
Stringid
(
id
,
2
+
offset
))
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
==
0
then
--Gain 500 LP and excavate cards from the top of your Deck
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsSetCard
,
tp
,
LOCATION_DECK
,
0
,
nil
,
0x19e
)
if
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
5
))
then
local
spcard
,
seq
=
g
:
GetMaxGroup
(
Card
.
GetSequence
)
spcard
=
spcard
:
GetFirst
()
if
not
spcard
then
return
end
Duel
.
BreakEffect
()
Duel
.
ConfirmDecktop
(
tp
,
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
-
seq
)
if
spcard
:
IsAbleToHand
()
then
Duel
.
SendtoHand
(
spcard
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
spcard
)
if
op
==
1
then
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
,
0x2a3
)
local
dct
=
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
local
seq
,
hc
=-
1
for
tc
in
aux
.
Next
(
g
)
do
local
sq
=
tc
:
GetSequence
()
if
sq
>
seq
then
seq
=
sq
hc
=
tc
end
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
Duel
.
SendtoGrave
(
spcard
,
REASON_RULE
)
Duel
.
SendtoGrave
(
hc
,
REASON_RULE
)
end
else
Duel
.
ConfirmDecktop
(
tp
,
dct
)
end
elseif
op
==
1
then
--Take 500 damage and send 1 "Valmonica" card from your Deck to the GY
local
g
=
Duel
.
GetMatchingGroup
(
s
.
tg
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
dct
-
seq
>
1
then
Duel
.
ShuffleDeck
(
tp
)
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_TOGRAVE
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
BreakEffect
()
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
end
\ No newline at end of file
end
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
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
...
...
@@ -7,49 +9,36 @@ function s.initial_effect(c)
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_DAMAGE
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
,
EFFECT_COUNT_CODE_OATH
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
s
.
spfilter
(
c
,
e
,
tp
)
function
s
.
filter
(
c
,
e
,
tp
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
s
.
t
hfilter
(
c
)
function
s
.
hfilter
(
c
)
return
c
:
IsLevel
(
4
)
and
c
:
IsAbleToHand
()
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
angle_or_delvin
)
--Additional parameter used by "Angelo Valmonica" and "Demone Valmonica"
local
op
=
nil
if
angle_or_delvin
then
op
=
angle_or_delvin
else
local
sel_player
=
Duel
.
IsExistingMatchingCard
(
Card
.
IsSetCard
,
tp
,
LOCATION_PZONE
,
0
,
1
,
nil
,
0x19e
)
and
tp
or
1
-
tp
local
offset
=
sel_player
==
1
-
tp
and
2
or
0
op
=
Duel
.
SelectOption
(
sel_player
,
aux
.
Stringid
(
id
,
1
+
offset
),
aux
.
Stringid
(
id
,
2
+
offset
))
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
==
0
then
--Gain 500 LP and Special Summon 1 monster from your GY
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
NecroValleyFilter
(
s
.
spfilter
),
tp
,
LOCATION_GRAVE
,
0
,
nil
,
e
,
tp
)
if
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
1
-
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
Select
(
1
-
tp
,
1
,
1
,
nil
)
if
op
==
1
then
if
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
<
1
then
return
end
local
g
=
Duel
.
SelectMatchingCard
(
1
-
tp
,
s
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
#
g
>
0
then
Duel
.
BreakEffect
()
Duel
.
SpecialSummon
(
s
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
elseif
op
==
1
then
--Take 500 damage and add 1 Level 4 monster from your GY to your hand
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
NecroValleyFilter
(
s
.
thfilter
),
tp
,
LOCATION_GRAVE
,
0
,
nil
)
if
Duel
.
Damage
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
5
))
then
elseif
Duel
.
Damage
(
tp
,
500
,
REASON_EFFECT
)
>
0
then
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
NecroValleyFilter
(
s
.
hfilter
),
tp
,
LOCATION_GRAVE
,
0
,
nil
)
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
3
))
then
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
.
SendtoHand
(
h
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
h
g
)
Duel
.
SendtoHand
(
s
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
s
g
)
end
end
end
\ No newline at end of file
end
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
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
...
...
@@ -7,65 +9,47 @@ function s.initial_effect(c)
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_DESTROY
+
CATEGORY_DAMAGE
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMING_MAIN_END
+
TIMINGS_CHECK_MONSTER
)
e1
:
SetCountLimit
(
1
,
id
,
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
s
.
condition
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
s
.
cfilter
(
c
)
return
c
:
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
function
s
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
function
s
.
afilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x2a3
)
and
c
:
IsType
(
TYPE_LINK
)
end
function
s
.
linkfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_LINK
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
angle_or_delvin
)
--Additional parameter used by "Angelo Valmonica" and "Demone Valmonica"
local
op
=
nil
if
angle_or_delvin
then
op
=
angle_or_delvin
else
local
both
=
Duel
.
IsExistingMatchingCard
(
s
.
linkfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
if
both
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
id
,
1
),
aux
.
Stringid
(
id
,
2
),
aux
.
Stringid
(
id
,
3
))
else
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
id
,
1
),
aux
.
Stringid
(
id
,
2
))
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
op
)
if
op
==
nil
then
local
chk
=
Duel
.
IsExistingMatchingCard
(
s
.
afilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
op
=
aux
.
SelectFromOptions
(
tp
,
{
true
,
aux
.
Stringid
(
id
,
1
)},
{
true
,
aux
.
Stringid
(
id
,
2
)},
{
chk
,
aux
.
Stringid
(
id
,
3
)})
end
local
break_chk
=
nil
if
op
==
0
or
op
==
2
then
--Gain 500 LP and Destroy 1 Spell/Trap on the field
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsType
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
(),
TYPE_SPELL
+
TYPE_TRAP
)
if
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
4
))
then
break_chk
=
true
if
op
&
1
>
0
and
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
>
0
then
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsType
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
aux
.
ExceptThisCard
(
e
),
TYPE_SPELL
+
TYPE_TRAP
)
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
4
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
d
g
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
dg
,
true
)
local
s
g
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
sg
)
Duel
.
BreakEffect
()
Duel
.
Destroy
(
d
g
,
REASON_EFFECT
)
Duel
.
Destroy
(
s
g
,
REASON_EFFECT
)
end
if
op
==
3
then
Duel
.
BreakEffect
()
end
end
if
op
==
1
or
op
==
2
then
--Take 500 damage and return 1 monster on the field to the hand
if
op
&
2
>
0
and
Duel
.
Damage
(
tp
,
500
,
REASON_EFFECT
)
>
0
then
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToHand
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
)
if
break_chk
then
Duel
.
BreakEffect
()
end
if
Duel
.
Damage
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
5
))
then
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
5
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
h
g
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
hg
,
true
)
local
s
g
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
sg
)
Duel
.
BreakEffect
()
Duel
.
SendtoHand
(
h
g
,
nil
,
REASON_EFFECT
)
Duel
.
SendtoHand
(
s
g
,
nil
,
REASON_EFFECT
)
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
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
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
:
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
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
end
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
function
s
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
function
s
.
afilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x2a3
)
and
c
:
IsType
(
TYPE_LINK
)
end
function
s
.
target1
(
e
,
c
)
return
c
:
IsSetCard
(
0x19e
)
and
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
s
.
linkfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_LINK
)
end
function
s
.
disfilter
(
c
)
return
c
:
IsType
(
TYPE_EFFECT
)
and
c
:
IsFaceup
()
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
angle_or_delvin
)
--Additional parameter used by "Angelo Valmonica" and "Demone Valmonica"
local
op
=
nil
if
angle_or_delvin
then
op
=
angle_or_delvin
else
local
both
=
Duel
.
IsExistingMatchingCard
(
s
.
linkfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
if
both
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
id
,
1
),
aux
.
Stringid
(
id
,
2
),
aux
.
Stringid
(
id
,
3
))
else
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
id
,
1
),
aux
.
Stringid
(
id
,
2
))
end
end
local
break_chk
=
nil
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
op
)
local
c
=
e
:
GetHandler
()
if
op
==
0
or
op
==
2
then
--Gain 500 LP and apply the targeting procetion effect
if
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
>
0
then
break_chk
=
true
Duel
.
RegisterFlagEffect
(
tp
,
id
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
,
0
,
1
)
--Your opponent cannot target "Valmonica" Monster Cards you control with card effects
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
)
e1
:
SetCode
(
EFFECT_CANNOT_BE_EFFECT_TARGET
)
e1
:
SetTargetRange
(
LOCATION_ONFIELD
,
0
)
e1
:
SetTarget
(
s
.
target1
)
e1
:
SetValue
(
aux
.
tgoval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
if
op
==
nil
then
local
chk
=
Duel
.
IsExistingMatchingCard
(
s
.
afilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
op
=
aux
.
SelectFromOptions
(
tp
,
{
true
,
aux
.
Stringid
(
id
,
1
)},
{
true
,
aux
.
Stringid
(
id
,
2
)},
{
chk
,
aux
.
Stringid
(
id
,
3
)})
end
if
op
&
1
>
0
and
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
>
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_BE_EFFECT_TARGET
)
e1
:
SetTargetRange
(
LOCATION_ONFIELD
,
0
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetValue
(
aux
.
tgoval
)
Duel
.
RegisterEffect
(
e1
,
tp
)
if
op
==
3
then
Duel
.
BreakEffect
()
end
end
if
op
==
1
or
op
==
2
then
--Take 500 damage and negate the effects of 1 opponent's Effect Monster
local
g
=
Duel
.
GetMatchingGroup
(
s
.
disfilter
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
if
break_chk
then
Duel
.
BreakEffect
()
end
if
Duel
.
Damage
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
4
))
then
if
op
&
2
>
0
and
Duel
.
Damage
(
tp
,
500
,
REASON_EFFECT
)
>
0
then
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
NegateEffectMonsterFilter
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
4
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DISABLE
)
local
nc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
if
nc
:
IsCanBeDisabledByEffect
(
e
)
then
Duel
.
NegateRelatedChain
(
nc
,
RESET_TURN_SET
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
nc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetValue
(
RESET_TURN_SET
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
nc
:
RegisterEffect
(
e2
)
end
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
sg
)
local
tc
=
sg
:
GetFirst
()
Duel
.
BreakEffect
()
Duel
.
NegateRelatedChain
(
tc
,
RESET_TURN_SET
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetValue
(
RESET_TURN_SET
)
tc
:
RegisterEffect
(
e2
)
end
end
end
\ No newline at end of file
end
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()
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--material
aux
.
AddMaterialCodeList
(
c
,
12275533
,
99733359
)
aux
.
AddFusionProcFun2
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsFusionCode
,
12275533
,
99733359
),
aux
.
FilterBoolFunction
(
Card
.
IsRace
,
RACE_MACHINE
+
RACE_DINOSAUR
),
true
)
--indes
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)
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
s
.
dfilter
(
c
)
return
c
:
IsFacedown
()
or
c
:
IsSetCard
(
0x2a2
)
return
c
:
IsFacedown
()
or
c
:
IsSetCard
(
0x2a2
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
s
.
filter
(
c
)
return
c
:
IsSetCard
(
0x2a2
)
and
c
:
IsAbleToHand
()
...
...
expansions/script/c101203001.lua
View file @
6c72c127
--スピリット・オブ・ユベル
--Script by passingDio0
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
78371393
)
aux
.
AddSetNameMonsterList
(
c
,
0x2a4
)
--Special Summon (from hand : itself)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
...
...
@@ -14,7 +16,7 @@ function s.initial_effect(c)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
--
Search
--
to hand/set
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
...
...
@@ -25,26 +27,26 @@ function s.initial_effect(c)
e2
:
SetTarget
(
s
.
thtg
)
e2
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e2
)
--
SpecialSummon
--
battle
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
3
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
)
e3
:
SetCode
(
EVENT_DESTROYED
)
e3
:
SetTarget
(
s
.
tg
)
e3
:
SetOperation
(
s
.
op
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_AVOID_BATTLE_DAMAGE
)
e3
:
SetValue
(
1
)
c
:
RegisterEffect
(
e3
)
--battle
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
)
e4
:
SetCode
(
EFFECT_
AVOID_BATTLE_DAMAG
E
)
e4
:
SetCode
(
EFFECT_
INDESTRUCTABLE_BATTL
E
)
e4
:
SetValue
(
1
)
c
:
RegisterEffect
(
e4
)
--special summon
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetType
(
EFFECT_TYPE_SINGLE
)
e5
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e5
:
SetValue
(
1
)
e5
:
SetDescription
(
aux
.
Stringid
(
id
,
3
))
e5
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
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
)
end
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
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
,
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
)
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
)
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
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
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
end
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
c
=
g
:
GetFirst
()
local
b1
=
c
:
IsAbleToHand
()
local
b2
=
c
:
IsSSetable
()
if
g
:
GetCount
()
>
0
then
local
op
=
0
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
)
local
tc
=
g
:
GetFirst
()
if
tc
then
if
tc
:
IsAbleToHand
()
and
(
not
tc
:
IsSSetable
()
or
Duel
.
SelectOption
(
tp
,
1190
,
1153
)
==
0
)
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
else
Duel
.
SSet
(
tp
,
g
,
tp
,
true
)
Duel
.
SSet
(
tp
,
tc
)
end
end
end
function
s
.
spfilter
(
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
()
)
function
s
.
filter2
(
c
,
e
,
tp
)
return
c
:
IsCode
(
78371393
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
true
)
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
and
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_DECK
+
LOCATION_HAND
+
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
)
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_
HAND
+
LOCATION_DECK
+
LOCATION_GRAVE
+
LOCATION_REMOVED
)
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
)
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
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
\ No newline at end of file
end
expansions/script/c101203002.lua
View file @
6c72c127
--ガイストーチ・ゴーレム
--Script by passingDio0
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
78371393
)
aux
.
AddSetNameMonsterList
(
c
,
0x2a4
)
c
:
SetSPSummonOnce
(
id
)
--SpecialSummon
local
e0
=
aux
.
AddThisCardInGraveAlreadyCheck
(
c
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCost
(
s
.
spcost
)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
--
gain lp
--
recover
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
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
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCondition
(
s
.
recon
)
e2
:
SetTarget
(
s
.
retg
)
e2
:
SetOperation
(
s
.
reop
)
e2
:
SetCondition
(
s
.
reccon
)
e2
:
SetOperation
(
s
.
recop
)
c
:
RegisterEffect
(
e2
)
--
rerival
--
special summon from grave
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
3
))
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_CARD_TARGET
)
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e3
:
SetRange
(
LOCATION_GRAVE
)
e3
:
Set
Property
(
EFFECT_FLAG_DELAY
)
e3
:
SetCondition
(
s
.
con
)
e3
:
SetTarget
(
s
.
tg
)
e3
:
SetOperation
(
s
.
op
)
e3
:
Set
LabelObject
(
e0
)
e3
:
SetCondition
(
s
.
spfg
con
)
e3
:
SetTarget
(
s
.
spfg
tg
)
e3
:
SetOperation
(
s
.
spfg
op
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
c
ost
filter
(
c
)
return
(
c
:
IsSetCard
(
0x2a4
)
or
c
:
IsCode
(
78371393
)
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsPublic
()
function
s
.
cfilter
(
c
)
return
c
:
IsSetCard
(
0x2a4
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsPublic
()
end
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
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
costfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
local
sc
=
g
:
GetFirst
()
Duel
.
ConfirmCards
(
1
-
tp
,
sc
)
Duel
.
ShuffleHand
(
tp
)
local
tc
=
g
:
GetFirst
()
tc
:
CreateEffectRelation
(
e
)
e
:
SetLabelObject
(
tc
)
sc
:
CreateEffectRelation
(
e
)
e
:
SetLabelObject
(
sc
)
end
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
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_HAND
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
1
-
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
tc
=
e
:
GetLabelObject
()
if
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
,
tp
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
,
1
-
tp
)
then
Duel
.
SpecialSummon
(
e
:
GetHandler
(),
0
,
tp
,
1
-
tp
,
false
,
false
,
POS_FACEUP
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
tc
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
then
local
a
=
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
1
))
if
a
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
1
-
tp
,
false
,
false
,
POS_FACEUP
)
end
local
sc
=
e
:
GetLabelObject
()
if
sc
:
IsRelateToEffect
(
e
)
and
sc
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
3
))
then
Duel
.
BreakEffect
()
Duel
.
SpecialSummon
(
sc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
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
ct
=
c
:
GetBattleTarget
()
return
ct
:
IsSetCard
(
0x2a4
)
or
ct
:
IsCode
(
78371393
)
local
bc
=
c
:
GetBattleTarget
()
return
bc
and
bc
:
IsFaceup
()
and
bc
:
IsSetCard
(
0x2a4
)
end
function
s
.
retg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetTargetPlayer
(
1
-
tp
)
Duel
.
SetTargetParam
(
3000
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_RECOVER
,
nil
,
0
,
1
-
tp
,
1000
)
function
s
.
recop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Recover
(
1
-
tp
,
3000
,
REASON_EFFECT
)
end
function
s
.
reop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Recover
(
p
,
d
,
REASON_EFFECT
)
function
s
.
spfgfilter
(
c
,
tp
,
se
)
return
c
:
IsFaceup
()
and
c
:
IsSummonPlayer
(
tp
)
and
c
:
IsCode
(
78371393
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
(
se
==
nil
or
c
:
GetReasonEffect
()
~=
se
)
end
function
s
.
spfilter
(
c
,
tp
)
return
c
:
IsCode
(
78371393
)
or
c
:
IsSetCard
(
0x2a4
)
function
s
.
spfgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
se
=
e
:
GetLabelObject
():
GetLabelObject
()
return
eg
:
IsExists
(
s
.
spfgfilter
,
1
,
nil
,
tp
,
se
)
end
function
s
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
s
.
spfilter
,
1
,
nil
,
tp
)
function
s
.
spfgtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
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
function
s
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
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
)
function
s
.
spfgop
(
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
,
1
-
tp
,
false
,
false
,
POS_FACEUP
)
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
1
-
tp
,
false
,
false
,
POS_FACEUP
)
end
end
\ No newline at end of file
expansions/script/c101203003.lua
View file @
6c72c127
--サクリファイス・D・ロータス
--Script by passingDio0
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
78371393
)
--SpecialSummon from deck
aux
.
AddSetNameMonsterList
(
c
,
0x2a4
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
...
...
@@ -13,29 +15,32 @@ function s.initial_effect(c)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
--
Destroy
--
Change effect
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
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetHintTiming
(
TIMINGS_CHECK_MONSTER
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetCondition
(
s
.
chcon
)
e2
:
SetCost
(
s
.
sp
cost
)
e2
:
SetCost
(
s
.
ch
cost
)
e2
:
SetTarget
(
s
.
chtg
)
e2
:
SetOperation
(
s
.
chop
)
c
:
RegisterEffect
(
e2
)
--
SpecialSummon or to hand
--
to hand or spsummon
local
e3
=
Effect
.
CreateEffect
(
c
)
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
:
SetRange
(
LOCATION_GRAVE
)
e3
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e3
:
SetCountLimit
(
1
,
120300003
)
e3
:
SetCondition
(
s
.
con
)
e3
:
SetTarget
(
s
.
tg
)
e3
:
SetOperation
(
s
.
op
)
e3
:
SetRange
(
LOCATION_GRAVE
)
e3
:
SetCountLimit
(
1
,
id
+
o
*
2
)
e3
:
SetCondition
(
s
.
thoscon
)
e3
:
SetTarget
(
s
.
thostg
)
e3
:
SetOperation
(
s
.
thosop
)
c
:
RegisterEffect
(
e3
)
end
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
)
end
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
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
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
s
.
c
h
filter
(
c
)
return
(
c
:
IsSetCard
(
0x2a4
)
or
c
:
IsCode
(
78371393
))
and
c
:
IsType
(
TYPE_MONSTER
)
function
s
.
c
on
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x2a4
)
end
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
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
function
s
.
chop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Group
.
CreateGroup
()
Duel
.
ChangeTargetCard
(
ev
,
g
)
Duel
.
ChangeChainOperation
(
ev
,
s
.
repop
)
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
)
local
ct
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
chfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
Destroy
(
ct
,
REASON_EFFECT
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
repfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
end
function
s
.
filter
(
c
)
return
(
c
:
IsSetCard
(
0x2a4
)
or
c
:
IsCode
(
78371393
)
)
function
s
.
rcc
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCode
(
78371393
)
end
function
s
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetTurnPlayer
()
~=
tp
then
return
false
end
return
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
function
s
.
thos
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetTurnPlayer
()
==
tp
and
Duel
.
IsExistingMatchingCard
(
s
.
rccfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
s
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
b1
=
e
:
GetHandler
():
IsAbleToHand
()
local
b2
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
if
chk
==
0
then
return
b1
or
b2
end
function
s
.
thostg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToHand
()
or
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
c
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
c
,
1
,
0
,
0
)
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
b1
=
c
:
IsAbleToHand
()
local
b2
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
local
op
=
0
if
b1
and
b2
then
op
=
Duel
.
SelectOption
(
tp
,
1190
,
1152
)
elseif
b1
then
op
=
0
else
op
=
1
end
if
op
==
0
then
Duel
.
SendtoHand
(
c
,
nil
,
REASON_EFFECT
)
else
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_OPERATECARD
)
if
c
:
IsRelateToEffect
(
e
)
then
if
ft
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
(
not
c
:
IsAbleToHand
()
or
Duel
.
SelectOption
(
tp
,
1190
,
1152
)
==
1
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
else
Duel
.
SendtoHand
(
c
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
end
end
\ No newline at end of file
end
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
()
function
s
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
78371393
)
--fusion summon
c
:
EnableReviveLimit
()
aux
.
AddFusionProcFunFunRep
(
c
,
s
.
mfilter1
,
s
.
mfilter2
,
1
,
63
,
true
)
--damage
--material
aux
.
AddFusionProcFunFunRep
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsFusionSetCard
,
0x2a4
),
s
.
matfilter
,
1
,
63
,
true
)
--damage
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_DAMAGE
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_DELAY
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCondition
(
s
.
dacon
)
e1
:
SetOperation
(
s
.
daop
)
e1
:
SetCondition
(
s
.
dmgcon
)
e1
:
SetTarget
(
s
.
damtg
)
e1
:
SetOperation
(
s
.
dmgop
)
c
:
RegisterEffect
(
e1
)
--
can not be destroyed
--
damage&remove
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_AVOID_BATTLE_DAMAGE
)
e2
:
SetValue
(
1
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_DAMAGE
+
CATEGORY_REMOVE
)
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
)
--indes
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e3
:
SetValue
(
1
)
c
:
RegisterEffect
(
e3
)
local
e4
=
e3
:
Clone
()
e4
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
c
:
RegisterEffect
(
e4
)
--battle
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e5
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e5
:
SetCode
(
EVENT_BATTLED
)
e5
:
SetOperation
(
s
.
batop
)
--damage val
local
e5
=
e3
:
Clone
()
e5
:
SetCode
(
EFFECT_AVOID_BATTLE_DAMAGE
)
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
function
s
.
m
filter1
(
c
)
return
c
:
Is
FusionSetCard
(
0x2a4
)
or
c
:
IsCode
(
78371393
)
function
s
.
m
atfilter
(
c
)
return
c
:
Is
Location
(
LOCATION_MZONE
)
and
c
:
IsType
(
TYPE_EFFECT
)
end
function
s
.
mfilter2
(
c
)
return
c
:
IsType
(
TYPE_EFFECT
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
s
.
dacon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
dmgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_FUSION
)
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
val
=
c
:
GetMaterialCount
()
Duel
.
Damage
(
1
-
tp
,
val
*
500
,
REASON_EFFECT
)
local
damage
=
c
:
GetMaterialCount
()
*
500
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
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
bc
=
c
:
GetBattleTarget
()
if
bc
then
e
:
SetLabel
(
bc
:
GetAttack
())
e
:
SetLabelObject
(
bc
)
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
if
chk
==
0
then
return
c
:
IsStatus
(
STATUS_OPPO_BATTLE
)
and
bc
~=
nil
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DAMAGE
,
nil
,
0
,
1
-
tp
,
bc
:
GetAttack
())
Duel
.
SetOperationInfo
(
0
,
CATEGORY_RECOVER
,
nil
,
0
,
tp
,
bc
:
GetDefense
())
end
function
s
.
damop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Damage
(
1
-
tp
,
e
:
GetLabelObject
():
GetLabel
(),
REASON_EFFECT
)
local
bc
=
e
:
GetLabelObject
():
GetLabelObject
()
if
bc
:
IsRelateToBattle
()
then
Duel
.
Remove
(
bc
,
POS_FACEUP
,
REASON_EFFECT
)
end
function
s
.
damrop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
bc
=
e
:
GetHandler
():
GetBattleTarget
()
local
atk
=
bc
:
GetAttack
()
local
def
=
bc
:
GetDefense
()
if
atk
<
0
then
atk
=
0
end
Duel
.
Damage
(
1
-
tp
,
atk
,
REASON_EFFECT
,
true
)
Duel
.
Remove
(
bc
,
0
,
REASON_EFFECT
)
Duel
.
RDComplete
()
end
\ No newline at end of file
expansions/script/c101203054.lua
View file @
6c72c127
--ナイトメア・ペイン
--Script by passingDio0
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
78371393
)
--active
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e0
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e0
)
--SearchCard
aux
.
AddSetNameMonsterList
(
c
,
0x2a4
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetTarget
(
s
.
thtg
)
e1
:
SetOperation
(
s
.
thop
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
--a
ttack limit
--a
dd to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_MUST_ATTACK
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetTargetRange
(
0
,
LOCATION_MZONE
)
e2
:
SetCondition
(
s
.
atkcon
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetTarget
(
s
.
thtg
)
e2
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e2
)
local
e4
=
e2
:
Clone
()
e4
:
SetCode
(
EFFECT_MUST_ATTACK_MONSTER
)
e4
:
SetValue
(
s
.
atklimit
)
c
:
RegisterEffect
(
e4
)
--reflect damage
--must attack
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EFFECT_
REFLECT_BATTLE_DAMAGE
)
e3
:
SetCode
(
EFFECT_
MUST_ATTACK
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e3
:
Set
Target
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x2a4
)
)
e3
:
SetTargetRange
(
0
,
LOCATION_MZONE
)
e3
:
Set
Condition
(
s
.
atkcon
)
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
function
s
.
cfilter
(
c
,
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
)
function
s
.
dfilter
(
c
,
e
,
tp
)
return
c
:
IsFaceupEx
()
and
c
:
Is
Type
(
TYPE_MONSTER
)
and
c
:
IsAttribute
(
ATTRIBUTE_DARK
)
end
function
s
.
filter
(
c
)
return
(
(
c
:
IsSetCard
(
0x2a4
)
and
c
:
IsType
(
TYPE_MONSTER
)
)
or
aux
.
IsCodeListed
(
c
,
78371393
))
and
c
:
IsAbleToHand
()
and
not
c
:
IsCode
(
id
)
function
s
.
thfilter
(
c
,
code
)
return
(
c
:
IsCode
(
78371393
)
or
aux
.
IsCodeListed
(
c
,
78371393
))
and
c
:
IsAbleToHand
()
and
not
c
:
IsCode
(
id
)
end
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
#
g
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
dfilter
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
,
0
,
1
,
nil
,
e
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
s
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cfilter
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
tp
)
if
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
==
0
then
return
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
dfilter
,
tp
,
LOCATION_HAND
+
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
<
1
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
sg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
sg
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
thfilter
),
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
:
GetHandler
():
GetCode
())
if
#
g
>
0
then
Duel
.
SendtoHand
(
tg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tg
)
end
end
function
s
.
atkfilter
(
c
)
return
c
:
Is
SetCard
(
0x2a4
)
or
c
:
IsCode
(
78371393
)
return
c
:
Is
Faceup
()
and
c
:
IsSetCard
(
0x2a4
)
end
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
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
\ No newline at end of file
expansions/script/c101203055.lua
View file @
6c72c127
--マチュア・クロニクル
--Script by passingDio0
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
78371393
)
c
:
EnableCounterPermit
(
0x25
)
--active
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e0
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e0
)
--add counter
aux
.
AddCodeList
(
c
,
78371393
)
aux
.
AddSetNameMonsterList
(
c
,
0x2a4
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetOperation
(
s
.
ctop
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
--
revial
--
counter
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetCost
(
s
.
cost1
)
e2
:
SetTarget
(
s
.
sptg
)
e2
:
SetOperation
(
s
.
spop
)
e2
:
SetOperation
(
s
.
counter
)
c
:
RegisterEffect
(
e2
)
--
recycle
--
special summon
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetCategory
(
CATEGORY_TOHAND
)
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e3
:
SetCountLimit
(
1
,
id
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCountLimit
(
1
,
id
)
e3
:
SetCost
(
s
.
cost2
)
e3
:
SetTarget
(
s
.
thtg
)
e3
:
SetOperation
(
s
.
thop
)
e3
:
SetCost
(
s
.
cost1
)
e3
:
SetTarget
(
s
.
tg1
)
e3
:
SetOperation
(
s
.
op1
)
c
:
RegisterEffect
(
e3
)
--
Remove
--
to hand from removed
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e4
:
SetCategory
(
CATEGORY_REMOVE
)
e4
:
SetCategory
(
CATEGORY_TOHAND
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e4
:
SetCountLimit
(
1
,
id
)
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_SZONE
)
e4
:
SetCountLimit
(
1
,
id
)
e4
:
SetCost
(
s
.
cost3
)
e4
:
SetTarget
(
s
.
retg
)
e4
:
SetOperation
(
s
.
reop
)
e4
:
SetCost
(
s
.
cost2
)
e4
:
SetTarget
(
s
.
tg2
)
e4
:
SetOperation
(
s
.
op2
)
c
:
RegisterEffect
(
e4
)
--
Destroy
--
remove from deck
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
id
,
3
))
e5
:
SetCategory
(
CATEGORY_DESTROY
)
e5
:
SetCategory
(
CATEGORY_REMOVE
)
e5
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e5
:
SetCountLimit
(
1
,
id
)
e5
:
SetType
(
EFFECT_TYPE_IGNITION
)
e5
:
SetRange
(
LOCATION_SZONE
)
e5
:
SetCountLimit
(
1
,
id
)
e5
:
SetCost
(
s
.
cost4
)
e5
:
SetTarget
(
s
.
detg
)
e5
:
SetOperation
(
s
.
deop
)
e5
:
SetCost
(
s
.
cost3
)
e5
:
SetTarget
(
s
.
tg3
)
e5
:
SetOperation
(
s
.
op3
)
c
:
RegisterEffect
(
e5
)
--
SearchCard
--
destory
local
e6
=
Effect
.
CreateEffect
(
c
)
e6
:
SetDescription
(
aux
.
Stringid
(
id
,
4
))
e6
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e6
:
SetCategory
(
CATEGORY_DESTROY
)
e6
:
SetDescription
(
aux
.
Stringid
(
id
,
3
))
e6
:
SetCountLimit
(
1
,
id
)
e6
:
SetType
(
EFFECT_TYPE_IGNITION
)
e6
:
SetRange
(
LOCATION_SZONE
)
e6
:
SetCountLimit
(
1
,
id
)
e6
:
SetCost
(
s
.
cost5
)
e6
:
SetTarget
(
s
.
setg
)
e6
:
SetOperation
(
s
.
seop
)
e6
:
SetCost
(
s
.
cost4
)
e6
:
SetTarget
(
s
.
tg4
)
e6
:
SetOperation
(
s
.
op4
)
c
:
RegisterEffect
(
e6
)
end
function
s
.
ctfilter
(
c
)
return
c
:
IsFaceup
()
and
(
c
:
IsSetCard
(
0x2a4
)
or
aux
.
IsCodeListed
(
c
,
78371393
))
end
function
s
.
ctop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
eg
:
IsExists
(
s
.
ctfilter
,
1
,
nil
)
then
--to hand from deck
local
e7
=
Effect
.
CreateEffect
(
c
)
e7
:
SetCategory
(
CATEGORY_TOHAND
)
e7
:
SetDescription
(
aux
.
Stringid
(
id
,
4
))
e7
:
SetCountLimit
(
1
,
id
)
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
)
end
end
...
...
@@ -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
.
RemoveCounter
(
tp
,
1
,
0
,
0x25
,
1
,
REASON_COST
)
end
function
s
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsCode
(
78371393
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
function
s
.
filter1
(
c
,
e
,
tp
)
return
c
:
IsCode
(
78371393
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
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
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
)
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
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
spfilter
),
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
tc
=
g
:
GetFirst
()
if
tc
then
Duel
.
SpecialSummon
(
tc
,
nil
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
filter1
),
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
true
,
true
,
POS_FACEUP
)
end
end
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
.
RemoveCounter
(
tp
,
1
,
0
,
0x25
,
2
,
REASON_COST
)
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsAbleToHand
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsAbleToHand
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
LOCATION_REMOVED
)
function
s
.
filter2
(
c
,
e
,
tp
)
return
c
:
IsAbleToHand
()
end
function
s
.
tg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
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
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoHand
(
tc
,
tp
,
REASON_EFFECT
)
function
s
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter2
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
tc
=
g
:
GetFirst
()
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
end
end
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
.
RemoveCounter
(
tp
,
1
,
0
,
0x25
,
3
,
REASON_COST
)
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
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
0
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
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
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
local
tg
=
g
:
GetFirst
()
if
tg
==
nil
then
return
end
Duel
.
Remove
(
tg
,
POS_FACEUP
,
REASON_EFFECT
)
end
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
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x25
,
4
,
REASON_COST
)
end
function
s
.
detg
(
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
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectTarget
(
tp
,
nil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
LOCATION_ONFIELD
)
function
s
.
tg4
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
aux
.
TRUE
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
TRUE
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
end
function
s
.
deop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
function
s
.
op4
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
TRUE
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
#
g
>
0
then
Duel
.
HintSelection
(
g
)
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
end
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
.
RemoveCounter
(
tp
,
1
,
0
,
0x25
,
5
,
REASON_COST
)
end
function
s
.
filter
(
c
)
return
c
:
Is
Code
(
48130397
)
and
c
:
IsAbleToHand
(
)
function
s
.
filter
5
(
c
,
e
,
tp
)
return
c
:
Is
AbleToHand
()
and
c
:
IsCode
(
48130397
)
end
function
s
.
setg
(
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
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
0
,
LOCATION_DECK
)
function
s
.
tg5
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
true
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
function
s
.
seop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_
ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
function
s
.
op5
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_
SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter
5
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
SendtoHand
(
g
:
GetFirst
()
,
nil
,
REASON_EFFECT
)
Duel
.
ShuffleDeck
(
tp
)
end
end
\ No newline at end of file
end
expansions/script/c101203073.lua
View file @
6c72c127
--エターナル・フェイバリット
--Script by passingDio0
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
78371393
)
--active
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e0
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e0
)
--SpecialSummon
aux
.
AddSetNameMonsterList
(
c
,
0x2a4
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
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
)
--
fusi
on
--
special summ
on
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_
FUSION
_SUMMON
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_
SPECIAL
_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCountLimit
(
1
,
EFFECT_COUNT_CODE_SINGLE
)
e2
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e2
:
SetCondition
(
s
.
fscon
)
e2
:
SetCost
(
s
.
fscost
)
e2
:
SetTarget
(
s
.
fstg
)
e2
:
SetOperation
(
s
.
fsop
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetTarget
(
s
.
sptg
)
e2
:
SetOperation
(
s
.
spop
)
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
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
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
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
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
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
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
tc
=
g
:
GetFirst
()
if
tc
and
Duel
.
SpecialSummonStep
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetLabelObject
(
tc
)
e1
:
SetOperation
(
s
.
sumop
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_END
)
e2
:
SetLabelObject
(
e1
)
e2
:
SetOperation
(
s
.
cedop
)
Duel
.
RegisterEffect
(
e2
,
tp
)
if
g
:
GetCount
()
>
0
then
local
tc
=
g
:
GetFirst
()
if
tc
and
Duel
.
SpecialSummonStep
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetLabelObject
(
tc
)
e1
:
SetOperation
(
s
.
sumop
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_END
)
e2
:
SetLabelObject
(
e1
)
e2
:
SetOperation
(
s
.
cedop
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
Duel
.
SpecialSummonComplete
()
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
true
,
true
,
POS_FACEUP
)
end
Duel
.
SpecialSummonComplete
()
end
function
s
.
sumop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
eg
:
IsContains
(
e
:
GetLabelObject
())
then
...
...
@@ -74,64 +81,66 @@ function s.cedop(e,tp,eg,ep,ev,re,r,rp)
end
e
:
Reset
()
end
function
s
.
filter1
(
c
)
return
(
c
:
IsSetCard
(
0x2a4
)
or
c
:
IsCode
(
78371393
))
end
function
s
.
filter2
(
c
)
return
(
c
:
IsSetCard
(
0x2a4
)
or
c
:
IsCode
(
78371393
))
and
c
:
IsCanBeFusionMaterial
()
function
s
.
fufilter
(
c
,
e
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsCode
(
78371393
)
end
function
s
.
f
s
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
)
function
s
.
f
u
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
s
.
f
ufilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
function
s
.
fscost
(
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
Duel
.
DiscardHand
(
tp
,
nil
,
1
,
1
,
REASON_COST
,
nil
)
Duel
.
SendtoGrave
(
e
:
GetHandler
(),
REASON_COST
)
function
s
.
fucost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
and
c
:
IsAbleToGraveAsCost
()
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
Duel
.
SendtoGrave
(
c
,
REASON_COST
)
end
function
s
.
m
filter0
(
c
)
function
s
.
filter0
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCanBeFusionMaterial
()
end
function
s
.
m
filter1
(
c
,
e
)
function
s
.
filter1
(
c
,
e
)
return
c
:
IsFaceup
()
and
c
:
IsCanBeFusionMaterial
()
and
not
c
:
IsImmuneToEffect
(
e
)
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
))
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_FUSION
,
tp
,
false
,
false
)
and
c
:
CheckFusionMaterial
(
m
,
nil
,
chkf
)
end
function
s
.
m
filter3
(
c
,
e
)
function
s
.
filter3
(
c
,
e
)
return
c
:
IsOnField
()
and
not
c
:
IsImmuneToEffect
(
e
)
end
function
s
.
fcheck
(
tp
,
sg
,
fc
)
return
sg
:
IsExists
(
Card
.
IsSetCard
,
1
,
nil
,
0x2a4
)
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
local
chkf
=
tp
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
)
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
local
ce
=
Duel
.
GetChainMaterial
(
tp
)
if
ce
~=
nil
then
local
fgroup
=
ce
:
GetTarget
()
local
mg3
=
fgroup
(
ce
,
e
,
tp
)
local
mf
=
ce
:
GetValue
()
res
=
Duel
.
IsExistingMatchingCard
(
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
return
res
aux
.
FCheckAdditional
=
nil
return
Duel
.
GetFlagEffect
(
tp
,
id
+
o
)
==
0
and
res
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
)
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
mg1
=
Duel
.
GetFusionMaterial
(
tp
):
Filter
(
s
.
m
filter3
,
nil
,
e
)
local
mg2
=
Duel
.
GetMatchingGroup
(
s
.
m
filter1
,
tp
,
0
,
LOCATION_MZONE
,
nil
,
e
)
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
):
Filter
(
s
.
filter3
,
nil
,
e
)
local
mg2
=
Duel
.
GetMatchingGroup
(
s
.
filter1
,
tp
,
0
,
LOCATION_MZONE
,
nil
,
e
)
mg1
:
Merge
(
mg2
)
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
sg2
=
nil
local
ce
=
Duel
.
GetChainMaterial
(
tp
)
...
...
@@ -139,7 +148,7 @@ function s.fsop(e,tp,eg,ep,ev,re,r,rp)
local
fgroup
=
ce
:
GetTarget
()
mg3
=
fgroup
(
ce
,
e
,
tp
)
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
if
sg1
:
GetCount
()
>
0
or
(
sg2
~=
nil
and
sg2
:
GetCount
()
>
0
)
then
local
sg
=
sg1
:
Clone
()
...
...
@@ -160,4 +169,5 @@ function s.fsop(e,tp,eg,ep,ev,re,r,rp)
end
tc
:
CompleteProcedure
()
end
end
aux
.
FCheckAdditional
=
nil
end
\ No newline at end of file
expansions/strings.conf
View file @
6c72c127
...
...
@@ -8,6 +8,7 @@
#先行
!
counter
0
x169
指示物(吠陀-优婆尼沙昙)
!
counter
0
x170
响鸣指示物
!
setname
0
x4073
铠装超量 アーマード・エクシーズ
!
setname
0
x29a
吠陀 ヴェーダ
!
setname
0
x29b
哈特 ハート
...
...
@@ -17,8 +18,10 @@
!
setname
0
x29f
迪亚贝尔斯塔尔 ディアベルスター
!
setname
0
x2a0
蛇眼 スネークアイ
!
setname
0
x2a1
莫忘 メメント
!
setname
0
x2a2
Tistina
Tistina
!
setname
0
x2a2
蒂斯蒂娜
Tistina
!
setname
0
x2a3
异响鸣 ヴァルモニカ
!
setname
0
x2a4
于贝尔 ユベル
!
setname
0
x2a5
百夫长骑士 センチュリオン
#1263790966
#【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