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
04683c1f
Commit
04683c1f
authored
Aug 13, 2023
by
Huangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new card
parent
33f840f8
Pipeline
#23090
passed with stages
in 19 minutes and 20 seconds
Changes
26
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
2346 additions
and
0 deletions
+2346
-0
expansions/script/c100200242.lua
expansions/script/c100200242.lua
+86
-0
expansions/script/c100421004.lua
expansions/script/c100421004.lua
+80
-0
expansions/script/c100421016.lua
expansions/script/c100421016.lua
+84
-0
expansions/script/c100421017.lua
expansions/script/c100421017.lua
+84
-0
expansions/script/c100421018.lua
expansions/script/c100421018.lua
+83
-0
expansions/script/c100421019.lua
expansions/script/c100421019.lua
+74
-0
expansions/script/c100421020.lua
expansions/script/c100421020.lua
+102
-0
expansions/script/c100421022.lua
expansions/script/c100421022.lua
+73
-0
expansions/script/c100421023.lua
expansions/script/c100421023.lua
+83
-0
expansions/script/c100421024.lua
expansions/script/c100421024.lua
+40
-0
expansions/script/c100421031.lua
expansions/script/c100421031.lua
+133
-0
expansions/script/c100421032.lua
expansions/script/c100421032.lua
+115
-0
expansions/script/c100421033.lua
expansions/script/c100421033.lua
+85
-0
expansions/script/c100421034.lua
expansions/script/c100421034.lua
+84
-0
expansions/script/c100421035.lua
expansions/script/c100421035.lua
+62
-0
expansions/script/c100421037.lua
expansions/script/c100421037.lua
+58
-0
expansions/script/c100421038.lua
expansions/script/c100421038.lua
+55
-0
expansions/script/c100421039.lua
expansions/script/c100421039.lua
+71
-0
expansions/script/c100421040.lua
expansions/script/c100421040.lua
+94
-0
expansions/script/c101203001.lua
expansions/script/c101203001.lua
+102
-0
expansions/script/c101203002.lua
expansions/script/c101203002.lua
+101
-0
expansions/script/c101203003.lua
expansions/script/c101203003.lua
+103
-0
expansions/script/c101203038.lua
expansions/script/c101203038.lua
+89
-0
expansions/script/c101203054.lua
expansions/script/c101203054.lua
+70
-0
expansions/script/c101203055.lua
expansions/script/c101203055.lua
+172
-0
expansions/script/c101203073.lua
expansions/script/c101203073.lua
+163
-0
No files found.
expansions/script/c100200242.lua
0 → 100644
View file @
04683c1f
--レスキューヘッジホッグ
--Rescue Hedgehog
--coded by Lyris
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCost
(
aux
.
bfgcost
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
operation
)
c
:
RegisterEffect
(
e1
)
end
function
s
.
filter
(
c
,
e
,
tp
)
return
c
:
IsLevelBelow
(
3
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
s
.
chk
(
g
)
if
g
:
GetClassCount
(
Card
.
GetRace
)
>
1
or
g
:
GetClassCount
(
Card
.
GetAttribute
)
>
1
or
g
:
GetClassCount
(
Card
.
GetLevel
)
>
1
then
return
false
end
local
fc
=
g
:
GetFirst
()
local
sc
=
g
:
GetNext
()
return
fc
:
IsType
(
TYPE_NORMAL
)
and
sc
:
IsType
(
TYPE_EFFECT
)
or
sc
:
IsType
(
TYPE_NORMAL
)
and
fc
:
IsType
(
TYPE_EFFECT
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
nil
,
e
,
tp
)
if
chk
==
0
then
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
59822133
)
and
Duel
.
GetMZoneCount
(
tp
,
e
:
GetHandler
())
>
1
and
g
:
CheckSubGroup
(
s
.
chk
,
2
,
2
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
2
,
tp
,
LOCATION_DECK
)
end
function
s
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
nil
,
e
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
59822133
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<
2
or
not
g
:
CheckSubGroup
(
s
.
chk
,
2
,
2
)
then
return
end
local
c
=
e
:
GetHandler
()
local
fid
=
c
:
GetFieldID
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
SelectSubGroup
(
tp
,
s
.
chk
,
false
,
2
,
2
)
if
not
sg
then
return
end
for
tc
in
aux
.
Next
(
sg
)
do
if
Duel
.
SpecialSummonStep
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_DISABLE_CHAIN
)
e2
:
SetValue
(
RESET_TURN_SET
)
tc
:
RegisterEffect
(
e2
)
tc
:
RegisterFlagEffect
(
id
,
RESET_EVENT
+
RESETS_STANDARD
,
0
,
1
,
fid
)
end
end
Duel
.
SpecialSummonComplete
()
sg
:
KeepAlive
()
--snip 1: from "Rescue Cat"
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
(
sg
)
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 snip 1
end
\ No newline at end of file
expansions/script/c100421004.lua
0 → 100644
View file @
04683c1f
--莫忘 暗黑之剑
function
c100421004
.
initial_effect
(
c
)
--destroy
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
100421004
,
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
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
--spsummon
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
100421004
,
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
)
c
:
RegisterEffect
(
e3
)
end
function
c100421004
.
descostfilter
(
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
)
end
function
c100421004
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsControler
(
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
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
)
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
)
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
)
end
end
function
c100421004
.
cfilter
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x2a1
)
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c100421004
.
sfilter
(
c
,
e
,
tp
)
return
c
:
IsLevelBelow
(
3
)
and
c
:
IsSetCard
(
0x2a1
)
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
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c100421004
.
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
)
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
end
expansions/script/c100421016.lua
0 → 100644
View file @
04683c1f
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_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_TRIGGER_O
+
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
tg
)
e1
:
SetOperation
(
cm
.
op
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
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
:
SetCode
(
cm
.
con
)
e3
:
SetTarget
(
cm
.
tg1
)
e3
:
SetValue
(
1
)
c
:
RegisterEffect
(
e3
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
m
,
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
)
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
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
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
)
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
end
function
cm
.
splimit
(
e
,
c
,
sump
,
sumtype
,
sumpos
,
targetp
,
se
)
return
c
:
IsCode
(
m
)
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
end
function
cm
.
tg1
(
e
,
c
)
return
c
:
IsSetCard
(
0x2c4
)
end
function
cm
.
con1
(
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
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
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
cm
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
\ No newline at end of file
expansions/script/c100421017.lua
0 → 100644
View file @
04683c1f
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
)
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
)
c
:
RegisterEffect
(
e2
)
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
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
)
end
function
cm
.
f
(
g
,
c
)
return
g
:
IsContains
(
c
)
and
g
:
IsExists
(
cm
.
f1
,
1
,
nil
)
end
function
cm
.
f1
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsSetCard
(
0x2c4
)
and
c
:
IsLocation
(
LOCATION_HAND
+
LOCATION_DECK
)
and
not
c
:
IsCode
(
m
)
end
function
cm
.
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
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
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
cm
.
op1
(
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
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_LEVEL
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetValue
(
4
)
c
:
RegisterEffect
(
e1
)
end
end
\ No newline at end of file
expansions/script/c100421018.lua
0 → 100644
View file @
04683c1f
local
cm
,
m
=
GetID
()
cm
.
name
=
"百夫长战旗重骑兵 艾梅特VI"
function
cm
.
initial_effect
(
c
)
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
)
c
:
RegisterEffect
(
e1
)
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
.
con1
)
e2
:
SetTarget
(
cm
.
tg1
)
e2
:
SetOperation
(
cm
.
op1
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetTurnPlayer
()
==
1
-
tp
end
function
cm
.
f
(
c
)
return
c
:
IsSetCard
(
0x2c4
)
and
not
c
:
IsCode
(
m
)
end
function
cm
.
tg
(
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
)
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
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
())
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
)
if
c
:
IsRelateToEffect
(
e
)
then
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
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
cm
.
splimit
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
cm
.
splimit
(
e
,
c
,
sump
,
sumtype
,
sumpos
,
targetp
,
se
)
return
c
:
IsCode
(
m
)
end
function
cm
.
con1
(
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
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
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
cm
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
\ No newline at end of file
expansions/script/c100421019.lua
0 → 100644
View file @
04683c1f
local
cm
,
m
=
GetID
()
cm
.
name
=
"百夫长战旗骑士皇 蕾伽蒂娅"
function
cm
.
initial_effect
(
c
)
aux
.
AddSynchroProcedure
(
c
,
nil
,
aux
.
NonTuner
(
nil
),
1
)
c
:
EnableReviveLimit
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_DRAW
+
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_DELAY
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
tg
)
e1
:
SetOperation
(
cm
.
op
)
c
:
RegisterEffect
(
e1
)
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
:
SetValue
(
1
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
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
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
cm
.
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
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
)
end
end
end
function
cm
.
f
(
c
)
return
c
:
IsSetCard
(
0x2c4
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsType
(
TYPE_SYNCHRO
)
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
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
end
end
\ No newline at end of file
expansions/script/c100421020.lua
0 → 100644
View file @
04683c1f
local
cm
,
m
=
GetID
()
cm
.
name
=
"站起来吧百夫长战旗!"
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetOperation
(
cm
.
op
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e2
:
SetCategory
(
CATEGORY_TOGRAVE
+
CATEGORY_TOEXTRA
)
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
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
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
)
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
))
end
function
cm
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetFlagEffect
(
m
)
>
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
)
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
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
end
end
function
cm
.
f
(
c
)
return
c
:
IsSetCard
(
0x2c4
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
cm
.
f1
(
c
)
return
c
:
IsSetCard
(
0x2c4
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
cm
.
f2
(
c
)
return
c
:
IsHasEffect
(
EFFECT_HAND_SYNCHRO
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
cm
.
tg1
(
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
)
end
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
)
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
())
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/c100421022.lua
0 → 100644
View file @
04683c1f
local
cm
,
m
=
GetID
()
cm
.
name
=
"百夫长战旗骑士的牵绊"
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
tg
)
e1
:
SetOperation
(
cm
.
op
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
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
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
cm
.
tg1
)
e2
:
SetOperation
(
cm
.
op1
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
f
(
c
)
return
c
:
IsSetCard
(
0x2c4
)
and
c
:
IsType
(
TYPE_MONSTER
)
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
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
end
end
function
cm
.
f1
(
c
,
tp
)
return
c
:
IsType
(
TYPE_SYNCHRO
)
and
c
:
IsSummonPlayer
(
tp
)
end
function
cm
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
cm
.
f1
,
1
,
nil
,
tp
)
end
function
cm
.
f2
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsSetCard
(
0x2c4
)
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
)
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
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/c100421023.lua
0 → 100644
View file @
04683c1f
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_REMOVE
)
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
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
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
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
cm
.
tg1
)
e2
:
SetOperation
(
cm
.
op2
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
f
(
c
)
return
c
:
IsAbleToRemove
()
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
==
TYPE_MONSTER
and
c
:
IsFaceup
()
end
function
cm
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
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
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectTarget
(
tp
,
cm
.
f
,
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
)
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
end
function
cm
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
return
Duel
.
GetTurnCount
()
~=
e
:
GetLabel
()
and
tc
:
GetFlagEffect
(
m
)
~=
0
end
function
cm
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
ReturnToField
(
e
:
GetLabelObject
())
end
function
cm
.
f1
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x2c4
)
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
:
IsControler
(
tp
)
and
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
cm
.
f1
(
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
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
cm
.
f1
,
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
)
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
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetValue
(
-
1500
)
tc
:
RegisterEffect
(
e1
)
end
Duel
.
SpecialSummonComplete
()
end
\ No newline at end of file
expansions/script/c100421024.lua
0 → 100644
View file @
04683c1f
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_NEGATE
+
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCountLimit
(
1
,
m
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
cm
.
con
)
e1
:
SetCost
(
cm
.
cost
)
e1
:
SetTarget
(
cm
.
tg
)
e1
:
SetOperation
(
cm
.
op
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
(
re
:
IsActiveType
(
TYPE_MONSTER
)
or
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
))
and
Duel
.
IsChainNegatable
(
ev
)
end
function
cm
.
f
(
c
)
return
c
:
IsFaceup
()
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
==
TYPE_MONSTER
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
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
f
,
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
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
end
expansions/script/c100421031.lua
0 → 100644
View file @
04683c1f
--天使の聲
local
s
,
id
=
GetID
()
function
s
.
initial_effect
(
c
)
--Pendulum procedure
aux
.
EnablePendulumAttribute
(
c
)
--Can place Resonance Counters on it
c
:
EnableCounterPermit
(
0x69
,
LOCATION_PZONE
)
--Place 1 Resonance Counter on this card each time you gain LP
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_RECOVER
)
e1
:
SetRange
(
LOCATION_PZONE
)
e1
:
SetCondition
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
ep
==
tp
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsRace
,
tp
,
LOCATION_PZONE
,
0
,
1
,
e
:
GetHandler
(),
RACE_FIEND
)
end
)
e1
:
SetOperation
(
s
.
ctop
)
c
:
RegisterEffect
(
e1
)
--Link Summon 1 "Valmonica" monster
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_ATTACK_ANNOUNCE
)
e2
:
SetRange
(
LOCATION_PZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCondition
(
function
(
e
,
tp
)
return
Duel
.
GetAttacker
():
IsControler
(
1
-
tp
)
end
)
e2
:
SetTarget
(
s
.
linksptg
)
e2
:
SetOperation
(
s
.
linkspop
)
c
:
RegisterEffect
(
e2
)
--Place both this card and 1 "Demone Valmonica" from your Deck in your Pendulum Zone
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_HAND
)
e3
:
SetCountLimit
(
1
,
121999031
)
e3
:
SetCost
(
s
.
pzcost
)
e3
:
SetTarget
(
s
.
pztg
)
e3
:
SetOperation
(
s
.
pzop
)
c
:
RegisterEffect
(
e3
)
--Apply the LP gain effect of 1 "Valmonica" Normal Spell/Trap
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCountLimit
(
1
,
121900031
)
e4
:
SetCondition
(
function
(
e
)
return
e
:
GetHandler
():
GetFlagEffect
(
id
)
>
0
end
)
e4
:
SetCost
(
s
.
cpcost
)
e4
:
SetTarget
(
s
.
cptg
)
e4
:
SetOperation
(
s
.
cpop
)
c
:
RegisterEffect
(
e4
)
-- Register flag on summon
if
not
c121999031
.
global_check
then
c121999031
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
ge1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
ge1
:
SetLabel
(
id
)
ge1
:
SetOperation
(
aux
.
sumreg
)
Duel
.
RegisterEffect
(
ge1
,
0
)
local
ge2
=
ge1
:
Clone
()
ge2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
Duel
.
RegisterEffect
(
ge2
,
0
)
end
end
function
s
.
ctop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
s
.
addcounter
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
function
s
.
addcounter
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
c
:
AddCounter
(
0x69
,
1
)
Duel
.
RaiseEvent
(
c
,
EVENT_CUSTOM
+
121999035
,
e
,
0
,
tp
,
tp
,
1
)
end
function
s
.
linkfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
c
:
IsSpecialSummonable
(
SUMMON_TYPE_LINK
)
end
function
s
.
linksptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
linkfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
s
.
linkspop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
linkfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
sc
then
Duel
.
LinkSummon
(
tp
,
sc
,
nil
)
end
end
function
s
.
pzcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
c
)
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
|
REASON_DISCARD
,
c
)
end
function
s
.
pzfilter
(
c
)
return
c
:
IsCode
(
121999032
)
and
not
c
:
IsForbidden
()
end
function
s
.
pztg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
and
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
)
and
Duel
.
IsExistingMatchingCard
(
s
.
pzfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
end
function
s
.
pzop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
(
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
and
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
)
and
c
:
IsRelateToEffect
(
e
))
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
pzfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
not
tc
then
return
end
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
end
function
s
.
cpcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
e
:
SetLabel
(
1
)
return
true
end
function
s
.
cpfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
(
c
:
GetType
()
==
TYPE_TRAP
or
c
:
GetType
()
==
TYPE_SPELL
)
and
c
:
IsAbleToRemoveAsCost
()
and
c
:
CheckActivateEffect
(
false
,
true
,
false
)
end
function
s
.
cptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
e
:
GetLabel
()
==
0
then
return
false
end
e
:
SetLabel
(
0
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_COST
)
e
:
SetLabelObject
(
tc
)
end
function
s
.
cpop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
if
not
tc
then
return
end
local
eff
=
tc
:
GetActivateEffect
()
local
op
=
eff
:
GetOperation
()
--Additional parameter checked in the script of "Valmonica" Normal Spells/Traps to correctly apply the LP gain effect
if
op
then
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
0
)
end
end
\ No newline at end of file
expansions/script/c100421032.lua
0 → 100644
View file @
04683c1f
--悪魔の聲
local
s
,
id
=
GetID
()
function
s
.
initial_effect
(
c
)
--Pendulum procedure
aux
.
EnablePendulumAttribute
(
c
)
--Can place Resonance Counters on it
c
:
EnableCounterPermit
(
0x69
,
LOCATION_PZONE
)
--Place 1 Resonance Counter on this card each time you take effect damage
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_DAMAGE
)
e1
:
SetRange
(
LOCATION_PZONE
)
e1
:
SetCondition
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
ep
==
tp
and
r
&
REASON_EFFECT
>
0
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsRace
,
tp
,
LOCATION_PZONE
,
0
,
1
,
e
:
GetHandler
(),
RACE_FAIRY
)
end
)
e1
:
SetOperation
(
s
.
ctop
)
c
:
RegisterEffect
(
e1
)
--Opponent's monsters lose 100 ATK for each Resonance Counter on your field
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e2
:
SetRange
(
LOCATION_PZONE
)
e2
:
SetTargetRange
(
0
,
LOCATION_MZONE
)
e2
:
SetValue
(
function
(
e
)
return
Duel
.
GetCounter
(
e
:
GetHandlerPlayer
(),
LOCATION_ONFIELD
,
0
,
0x69
)
*-
100
end
)
c
:
RegisterEffect
(
e2
)
--Place both this card and 1 "Angelo Valmonica" from your Deck in your Pendulum Zone
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_HAND
)
e3
:
SetCountLimit
(
1
,
121999032
)
e3
:
SetCost
(
s
.
pzcost
)
e3
:
SetTarget
(
s
.
pztg
)
e3
:
SetOperation
(
s
.
pzop
)
c
:
RegisterEffect
(
e3
)
--Apply the damage-inflicting effect of 1 "Valmonica" Normal Spell/Trap
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCountLimit
(
1
,
121900032
)
e4
:
SetCondition
(
function
(
e
)
return
e
:
GetHandler
():
GetFlagEffect
(
id
)
>
0
end
)
e4
:
SetCost
(
s
.
cpcost
)
e4
:
SetTarget
(
s
.
cptg
)
e4
:
SetOperation
(
s
.
cpop
)
c
:
RegisterEffect
(
e4
)
-- Register flag on summon
if
not
c121999032
.
global_check
then
c121999032
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
ge1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
ge1
:
SetLabel
(
id
)
ge1
:
SetOperation
(
aux
.
sumreg
)
Duel
.
RegisterEffect
(
ge1
,
0
)
local
ge2
=
ge1
:
Clone
()
ge2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
Duel
.
RegisterEffect
(
ge2
,
0
)
end
end
function
s
.
ctop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
s
.
addcounter
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
function
s
.
addcounter
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
c
:
AddCounter
(
0x69
,
1
)
Duel
.
RaiseEvent
(
c
,
EVENT_CUSTOM
+
121999035
,
e
,
0
,
tp
,
tp
,
1
)
end
function
s
.
pzcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
c
)
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
|
REASON_DISCARD
,
c
)
end
function
s
.
pzfilter
(
c
)
return
c
:
IsCode
(
121999031
)
and
not
c
:
IsForbidden
()
end
function
s
.
pztg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
and
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
)
and
Duel
.
IsExistingMatchingCard
(
s
.
pzfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
end
function
s
.
pzop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
(
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
and
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
)
and
c
:
IsRelateToEffect
(
e
))
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
pzfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
not
tc
then
return
end
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
end
function
s
.
cpcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
e
:
SetLabel
(
1
)
return
true
end
function
s
.
cpfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
(
c
:
GetType
()
==
TYPE_TRAP
or
c
:
GetType
()
==
TYPE_SPELL
)
and
c
:
IsAbleToRemoveAsCost
()
and
c
:
CheckActivateEffect
(
false
,
true
,
false
)
end
function
s
.
cptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
e
:
GetLabel
()
==
0
then
return
false
end
e
:
SetLabel
(
0
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_COST
)
e
:
SetLabelObject
(
tc
)
end
function
s
.
cpop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
if
not
tc
then
return
end
local
eff
=
tc
:
GetActivateEffect
()
local
op
=
eff
:
GetOperation
()
--Additional parameter checked in the script of "Valmonica" Normal Spells/Traps to correctly apply the damage-inflicting effect
if
op
then
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
1
)
end
end
expansions/script/c100421033.lua
0 → 100644
View file @
04683c1f
--ヴァルモニカの異神-ジュラルメ
local
s
,
id
=
GetID
()
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
c
:
SetSPSummonOnce
(
id
)
--Link Summon procedure
aux
.
AddLinkProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsLinkType
,
TYPE_EFFECT
),
1
)
--Cannot be Link Summoned unless you have a Fairy Monster Card with 3 or more Resonance Counters in your Pendulum Zone
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_SINGLE
)
e0
:
SetCode
(
EFFECT_SPSUMMON_COST
)
e0
:
SetCost
(
s
.
spcost
)
c
:
RegisterEffect
(
e0
)
--Destroy opponent's monsters up to the number of Resonance Counters in your Pendulum Zone
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCondition
(
function
(
e
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_LINK
)
end
)
e1
:
SetTarget
(
s
.
destg
)
e1
:
SetOperation
(
s
.
desop
)
c
:
RegisterEffect
(
e1
)
--This card can make a 2nd and 3rd attack this turn
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCondition
(
function
()
return
Duel
.
IsAbleToEnterBP
()
end
)
e2
:
SetCost
(
s
.
tripleatkcost
)
e2
:
SetTarget
(
s
.
tripleatktg
)
e2
:
SetOperation
(
s
.
tripleatkop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
spcfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_FAIRY
)
and
c
:
GetCounter
(
0x69
)
>=
3
end
function
s
.
spcost
(
e
,
c
,
tp
,
st
)
if
(
st
&
SUMMON_TYPE_LINK
)
~=
SUMMON_TYPE_LINK
then
return
true
end
return
Duel
.
IsExistingMatchingCard
(
s
.
spcfilter
,
tp
,
LOCATION_PZONE
,
0
,
1
,
nil
)
end
function
s
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsControler
(
1
-
tp
)
and
chkc
:
IsLocation
(
LOCATION_MZONE
)
end
local
ct
=
Duel
.
GetCounter
(
tp
,
1
,
0
,
0x69
)
if
chk
==
0
then
return
ct
>
0
and
Duel
.
IsExistingTarget
(
nil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
tg
=
Duel
.
SelectTarget
(
tp
,
nil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
ct
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
tg
,
#
tg
,
tp
,
0
)
end
function
s
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tg
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
):
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
if
#
tg
>
0
then
Duel
.
Destroy
(
tg
,
REASON_EFFECT
)
end
end
function
s
.
tripleatkcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
0
,
0x69
,
3
,
REASON_COST
)
end
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x69
,
3
,
REASON_COST
)
end
function
s
.
tripleatktg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
effs
=
{
e
:
GetHandler
():
IsHasEffect
(
EFFECT_EXTRA_ATTACK
)}
for
_
,
eff
in
ipairs
(
effs
)
do
if
eff
:
GetValue
()
>=
2
then
return
false
end
end
return
true
end
end
function
s
.
tripleatkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
--Can make a 2nd and 3rd attack this turn
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_EXTRA_ATTACK
)
e1
:
SetValue
(
2
)
e1
:
SetReset
(
RESET_EVENT
|
RESETS_STANDARD
|
RESET_PHASE
|
PHASE_END
)
c
:
RegisterEffect
(
e1
)
end
end
\ No newline at end of file
expansions/script/c100421034.lua
0 → 100644
View file @
04683c1f
--ヴァルモニカの神異-ゼブフェーラ
local
s
,
id
=
GetID
()
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
c
:
SetSPSummonOnce
(
id
)
--Link Summon procedure
aux
.
AddLinkProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsLinkType
,
TYPE_EFFECT
),
1
)
--Cannot be Link Summoned unless you have a Fiend Monster Card with 3 or more Resonance Counters in your Pendulum Zone
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_SINGLE
)
e0
:
SetCode
(
EFFECT_SPSUMMON_COST
)
e0
:
SetCost
(
s
.
spcost
)
c
:
RegisterEffect
(
e0
)
--Remove 3 Resonance Counters from your Pendulum Zone instead of destroying this card
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EFFECT_DESTROY_REPLACE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTarget
(
s
.
reptg
)
e1
:
SetValue
(
s
.
repval
)
e1
:
SetOperation
(
s
.
repop
)
c
:
RegisterEffect
(
e1
)
--Apply the effect of 1 "Valmonica" Normal Spell/Trap that is banished or in your GY
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetHintTiming
(
0
,
TIMING_STANDBY_PHASE
+
TIMING_MAIN_END
+
TIMINGS_CHECK_MONSTER
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCondition
(
function
(
e
,
tp
)
return
Duel
.
GetTurnPlayer
()
==
1
-
tp
end
)
e2
:
SetTarget
(
s
.
cptg
)
e2
:
SetOperation
(
s
.
cpop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
spcfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsRace
(
RACE_FIEND
)
and
c
:
GetCounter
(
0x69
)
>=
3
end
function
s
.
spcost
(
e
,
c
,
tp
,
st
)
if
(
st
&
SUMMON_TYPE_LINK
)
~=
SUMMON_TYPE_LINK
then
return
true
end
return
Duel
.
IsExistingMatchingCard
(
s
.
spcfilter
,
tp
,
LOCATION_PZONE
,
0
,
1
,
nil
)
end
function
s
.
filter1
(
c
,
tp
)
return
not
c
:
IsReason
(
REASON_REPLACE
)
and
c
:
IsLocation
(
LOCATION_ONFIELD
)
and
c
:
IsControler
(
tp
)
and
c
:
IsReason
(
REASON_EFFECT
+
REASON_BATTLE
)
end
function
s
.
reptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
g
=
eg
:
Filter
(
s
.
filter1
,
nil
,
tp
)
if
chk
==
0
then
return
#
g
>
0
and
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
0
,
0x69
,
3
,
REASON_EFFECT
)
end
return
Duel
.
SelectEffectYesNo
(
tp
,
c
,
96
)
end
function
s
.
repval
(
e
,
c
)
return
s
.
filter1
(
c
,
e
:
GetHandlerPlayer
())
end
function
s
.
repop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x69
,
3
,
REASON_EFFECT
)
end
function
s
.
cpfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
(
c
:
GetType
()
==
TYPE_TRAP
or
c
:
GetType
()
==
TYPE_SPELL
)
and
c
:
IsFaceup
()
and
c
:
CheckActivateEffect
(
false
,
true
,
false
)
end
function
s
.
cptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
|
LOCATION_REMOVED
)
and
chkc
:
IsControler
(
tp
)
and
s
.
cpfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
|
LOCATION_REMOVED
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
local
tc
=
Duel
.
SelectTarget
(
tp
,
s
.
cpfilter
,
tp
,
LOCATION_GRAVE
|
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
):
GetFirst
()
local
eff
=
tc
:
CheckActivateEffect
(
false
,
true
,
false
)
e
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
|
eff
:
GetProperty
())
local
tg
=
eff
:
GetTarget
()
if
tg
then
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
1
)
end
Duel
.
ClearOperationInfo
(
0
)
end
function
s
.
cpop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
not
tc
:
IsRelateToEffect
(
e
)
then
return
end
local
eff
=
tc
:
CheckActivateEffect
(
false
,
true
,
false
)
if
not
eff
then
return
end
local
op
=
eff
:
GetOperation
()
if
op
then
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
end
\ No newline at end of file
expansions/script/c100421035.lua
0 → 100644
View file @
04683c1f
--天魔の聲選器-『ヴァルモニカ』
local
s
,
id
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
,
EFFECT_COUNT_CODE_OATH
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
--Take control of 1 opponent's monster
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCode
(
EVENT_CUSTOM
+
id
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetCountLimit
(
1
,{
id
,
1
})
e2
:
SetCondition
(
s
.
ctrlcon
)
e2
:
SetTarget
(
s
.
ctrltg
)
e2
:
SetOperation
(
s
.
ctrlop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
thfilter
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsSetCard
(
0x19e
)
and
c
:
IsAbleToHand
()
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
0
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
sg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
sg
)
end
end
function
s
.
ctrlcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
ep
==
tp
and
eg
:
GetFirst
():
GetCounter
(
0x69
)
==
3
end
function
s
.
ctrltg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
1
-
tp
)
and
chkc
:
IsControlerCanBeChanged
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CONTROL
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_CONTROL
,
g
,
1
,
tp
,
0
)
end
function
s
.
ctrlop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
GetControl
(
tc
,
tp
,
PHASE_END
,
1
)
>
0
then
--It cannot declare an attack
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetDescription
(
3206
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_ATTACK
)
e1
:
SetCondition
(
function
(
e
)
return
e
:
GetHandler
():
IsControler
(
tp
)
end
)
e1
:
SetReset
(
RESET_EVENT
|
(
RESETS_STANDARD
&~
RESET_TURN_SET
)
|
RESET_PHASE
|
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
end
end
expansions/script/c100421037.lua
0 → 100644
View file @
04683c1f
--ヴァルモニカ・ヴェルサーレ
local
s
,
id
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_TOHAND
+
CATEGORY_SEARCH
+
CATEGORY_DAMAGE
+
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
,
EFFECT_COUNT_CODE_OATH
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
s
.
tgfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
not
c
:
IsCode
(
id
)
and
c
:
IsAbleToGrave
()
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
angle_or_delvin
)
--Additional parameter used by "Angelo Valmonica" and "Demone Valmonica"
local
op
=
nil
if
angle_or_delvin
then
op
=
angle_or_delvin
else
local
sel_player
=
Duel
.
IsExistingMatchingCard
(
Card
.
IsSetCard
,
tp
,
LOCATION_PZONE
,
0
,
1
,
nil
,
0x19e
)
and
tp
or
1
-
tp
local
offset
=
sel_player
==
1
-
tp
and
2
or
0
op
=
Duel
.
SelectOption
(
sel_player
,
aux
.
Stringid
(
id
,
1
+
offset
),
aux
.
Stringid
(
id
,
2
+
offset
))
end
if
op
==
0
then
--Gain 500 LP and excavate cards from the top of your Deck
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsSetCard
,
tp
,
LOCATION_DECK
,
0
,
nil
,
0x19e
)
if
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
5
))
then
local
spcard
,
seq
=
g
:
GetMaxGroup
(
Card
.
GetSequence
)
spcard
=
spcard
:
GetFirst
()
if
not
spcard
then
return
end
Duel
.
BreakEffect
()
Duel
.
ConfirmDecktop
(
tp
,
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
-
seq
)
if
spcard
:
IsAbleToHand
()
then
Duel
.
SendtoHand
(
spcard
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
spcard
)
else
Duel
.
SendtoGrave
(
spcard
,
REASON_RULE
)
end
end
elseif
op
==
1
then
--Take 500 damage and send 1 "Valmonica" card from your Deck to the GY
local
g
=
Duel
.
GetMatchingGroup
(
s
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
Duel
.
Damage
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
6
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
BreakEffect
()
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
end
\ No newline at end of file
expansions/script/c100421038.lua
0 → 100644
View file @
04683c1f
--ヴァルモニカ・イントナーレ
local
s
,
id
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_DAMAGE
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
,
EFFECT_COUNT_CODE_OATH
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
s
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
s
.
thfilter
(
c
)
return
c
:
IsLevel
(
4
)
and
c
:
IsAbleToHand
()
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
angle_or_delvin
)
--Additional parameter used by "Angelo Valmonica" and "Demone Valmonica"
local
op
=
nil
if
angle_or_delvin
then
op
=
angle_or_delvin
else
local
sel_player
=
Duel
.
IsExistingMatchingCard
(
Card
.
IsSetCard
,
tp
,
LOCATION_PZONE
,
0
,
1
,
nil
,
0x19e
)
and
tp
or
1
-
tp
local
offset
=
sel_player
==
1
-
tp
and
2
or
0
op
=
Duel
.
SelectOption
(
sel_player
,
aux
.
Stringid
(
id
,
1
+
offset
),
aux
.
Stringid
(
id
,
2
+
offset
))
end
if
op
==
0
then
--Gain 500 LP and Special Summon 1 monster from your GY
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
NecroValleyFilter
(
s
.
spfilter
),
tp
,
LOCATION_GRAVE
,
0
,
nil
,
e
,
tp
)
if
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
1
-
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
Select
(
1
-
tp
,
1
,
1
,
nil
)
Duel
.
BreakEffect
()
Duel
.
SpecialSummon
(
sg
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
elseif
op
==
1
then
--Take 500 damage and add 1 Level 4 monster from your GY to your hand
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
NecroValleyFilter
(
s
.
thfilter
),
tp
,
LOCATION_GRAVE
,
0
,
nil
)
if
Duel
.
Damage
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
5
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
hg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
BreakEffect
()
Duel
.
SendtoHand
(
hg
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
hg
)
end
end
end
\ No newline at end of file
expansions/script/c100421039.lua
0 → 100644
View file @
04683c1f
--律導のヴァルモニカ
local
s
,
id
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_DESTROY
+
CATEGORY_DAMAGE
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMING_MAIN_END
+
TIMINGS_CHECK_MONSTER
)
e1
:
SetCountLimit
(
1
,
id
,
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
s
.
condition
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
s
.
cfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
c
:
IsFaceup
()
and
(
c
:
IsType
(
TYPE_MONSTER
)
or
c
:
IsType
(
TYPE_PENDULUM
))
end
function
s
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
s
.
linkfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_LINK
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
angle_or_delvin
)
--Additional parameter used by "Angelo Valmonica" and "Demone Valmonica"
local
op
=
nil
if
angle_or_delvin
then
op
=
angle_or_delvin
else
local
both
=
Duel
.
IsExistingMatchingCard
(
s
.
linkfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
if
both
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
id
,
1
),
aux
.
Stringid
(
id
,
2
),
aux
.
Stringid
(
id
,
3
))
else
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
id
,
1
),
aux
.
Stringid
(
id
,
2
))
end
end
local
break_chk
=
nil
if
op
==
0
or
op
==
2
then
--Gain 500 LP and Destroy 1 Spell/Trap on the field
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsType
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
(),
TYPE_SPELL
+
TYPE_TRAP
)
if
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
4
))
then
break_chk
=
true
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
dg
,
true
)
Duel
.
BreakEffect
()
Duel
.
Destroy
(
dg
,
REASON_EFFECT
)
end
end
if
op
==
1
or
op
==
2
then
--Take 500 damage and return 1 monster on the field to the hand
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToHand
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
)
if
break_chk
then
Duel
.
BreakEffect
()
end
if
Duel
.
Damage
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
5
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
hg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
hg
,
true
)
Duel
.
BreakEffect
()
Duel
.
SendtoHand
(
hg
,
nil
,
REASON_EFFECT
)
end
end
end
expansions/script/c100421040.lua
0 → 100644
View file @
04683c1f
--選律のヴァルモニカ
local
s
,
id
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_DAMAGE
+
CATEGORY_DISABLE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMING_STANDBY_PHASE
+
TIMING_MAIN_END
+
TIMINGS_CHECK_MONSTER
)
e1
:
SetCountLimit
(
1
,
id
,
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
s
.
condition
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
s
.
cfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
c
:
IsFaceup
()
and
(
c
:
IsType
(
TYPE_MONSTER
)
or
c
:
IsType
(
TYPE_PENDULUM
))
end
function
s
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
s
.
target1
(
e
,
c
)
return
c
:
IsSetCard
(
0x19e
)
and
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
s
.
linkfilter
(
c
)
return
c
:
IsSetCard
(
0x19e
)
and
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_LINK
)
end
function
s
.
disfilter
(
c
)
return
c
:
IsType
(
TYPE_EFFECT
)
and
c
:
IsFaceup
()
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
angle_or_delvin
)
--Additional parameter used by "Angelo Valmonica" and "Demone Valmonica"
local
op
=
nil
if
angle_or_delvin
then
op
=
angle_or_delvin
else
local
both
=
Duel
.
IsExistingMatchingCard
(
s
.
linkfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
if
both
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
id
,
1
),
aux
.
Stringid
(
id
,
2
),
aux
.
Stringid
(
id
,
3
))
else
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
id
,
1
),
aux
.
Stringid
(
id
,
2
))
end
end
local
break_chk
=
nil
local
c
=
e
:
GetHandler
()
if
op
==
0
or
op
==
2
then
--Gain 500 LP and apply the targeting procetion effect
if
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
>
0
then
break_chk
=
true
Duel
.
RegisterFlagEffect
(
tp
,
id
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
,
0
,
1
)
--Your opponent cannot target "Valmonica" Monster Cards you control with card effects
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_IGNORE_IMMUNE
)
e1
:
SetCode
(
EFFECT_CANNOT_BE_EFFECT_TARGET
)
e1
:
SetTargetRange
(
LOCATION_ONFIELD
,
0
)
e1
:
SetTarget
(
s
.
target1
)
e1
:
SetValue
(
aux
.
tgoval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
if
op
==
1
or
op
==
2
then
--Take 500 damage and negate the effects of 1 opponent's Effect Monster
local
g
=
Duel
.
GetMatchingGroup
(
s
.
disfilter
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
if
break_chk
then
Duel
.
BreakEffect
()
end
if
Duel
.
Damage
(
tp
,
500
,
REASON_EFFECT
)
>
0
and
#
g
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
4
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DISABLE
)
local
nc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
if
nc
:
IsCanBeDisabledByEffect
(
e
)
then
Duel
.
NegateRelatedChain
(
nc
,
RESET_TURN_SET
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
nc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetValue
(
RESET_TURN_SET
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
nc
:
RegisterEffect
(
e2
)
end
end
end
end
\ No newline at end of file
expansions/script/c101203001.lua
0 → 100644
View file @
04683c1f
--スピリット・オブ・ユベル
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
78371393
)
--Special Summon (from hand : itself)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_ATTACK_ANNOUNCE
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCondition
(
s
.
spcon
)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
--Search
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetTarget
(
s
.
thtg
)
e2
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
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
)
c
:
RegisterEffect
(
e3
)
--battle
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
)
e4
:
SetCode
(
EFFECT_AVOID_BATTLE_DAMAGE
)
e4
:
SetValue
(
1
)
c
:
RegisterEffect
(
e4
)
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetType
(
EFFECT_TYPE_SINGLE
)
e5
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e5
:
SetValue
(
1
)
c
:
RegisterEffect
(
e5
)
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetAttacker
():
IsControler
(
1
-
tp
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
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
.
thfilter
(
c
)
return
c
:
IsAbleToHand
()
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
aux
.
IsCodeListed
(
c
,
78371393
)
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
))
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
)
else
Duel
.
SSet
(
tp
,
g
,
tp
,
true
)
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
())
end
function
s
.
tg
(
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
)
end
function
s
.
op
(
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
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
\ No newline at end of file
expansions/script/c101203002.lua
0 → 100644
View file @
04683c1f
--ガイストーチ・ゴーレム
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
78371393
)
c
:
SetSPSummonOnce
(
id
)
--SpecialSummon
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
:
SetCost
(
s
.
spcost
)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
--gain lp
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e2
:
SetCategory
(
CATEGORY_RECOVER
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e2
:
SetCode
(
EVENT_PRE_DAMAGE_CALCULATE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCondition
(
s
.
recon
)
e2
:
SetTarget
(
s
.
retg
)
e2
:
SetOperation
(
s
.
reop
)
c
:
RegisterEffect
(
e2
)
--rerival
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
3
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e3
:
SetRange
(
LOCATION_GRAVE
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetCondition
(
s
.
con
)
e3
:
SetTarget
(
s
.
tg
)
e3
:
SetOperation
(
s
.
op
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
costfilter
(
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
.
costfilter
,
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
)
Duel
.
ShuffleHand
(
tp
)
local
tc
=
g
:
GetFirst
()
tc
:
CreateEffectRelation
(
e
)
e
:
SetLabelObject
(
tc
)
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
)
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
end
end
function
s
.
recon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
ct
=
c
:
GetBattleTarget
()
return
ct
:
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
)
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
)
end
function
s
.
spfilter
(
c
,
tp
)
return
c
:
IsCode
(
78371393
)
end
function
s
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
s
.
spfilter
,
1
,
nil
,
tp
)
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
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
1
-
tp
,
false
,
false
,
POS_FACEUP
)
end
\ No newline at end of file
expansions/script/c101203003.lua
0 → 100644
View file @
04683c1f
--サクリファイス・D・ロータス
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
78371393
)
--SpecialSummon from deck
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCost
(
s
.
spcost
)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
--Destroy
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
71166481
,
1
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetCondition
(
s
.
chcon
)
e2
:
SetCost
(
s
.
spcost
)
e2
:
SetTarget
(
s
.
chtg
)
e2
:
SetOperation
(
s
.
chop
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon or to hand
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOHAND
)
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
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
spcost
(
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
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x2a4
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
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
)
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
.
chfilter
(
c
)
return
c
:
IsSetCard
(
0x2a4
)
and
c
:
IsType
(
TYPE_MONSTER
)
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
)
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
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
.
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
)
end
function
s
.
filter
(
c
)
return
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
)
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
end
function
s
.
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
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
\ No newline at end of file
expansions/script/c101203038.lua
0 → 100644
View file @
04683c1f
--ユベル-Das Ewig Liebe Wächter
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
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_DAMAGE
)
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
)
c
:
RegisterEffect
(
e1
)
--can not be destroyed
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_AVOID_BATTLE_DAMAGE
)
e2
:
SetValue
(
1
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
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
)
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
.
mfilter1
(
c
)
return
c
:
IsFusionSetCard
(
0x2a4
)
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
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_FUSION
)
end
function
s
.
daop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
val
=
c
:
GetMaterialCount
()
Duel
.
Damage
(
1
-
tp
,
val
*
500
,
REASON_EFFECT
)
end
function
s
.
batop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
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
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
end
\ No newline at end of file
expansions/script/c101203054.lua
0 → 100644
View file @
04683c1f
--ナイトメア・ペイン
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
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
)
c
:
RegisterEffect
(
e1
)
--attack limit
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_MUST_ATTACK
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetTargetRange
(
0
,
LOCATION_MZONE
)
e2
:
SetCondition
(
s
.
atkcon
)
c
:
RegisterEffect
(
e2
)
local
e4
=
e2
:
Clone
()
e4
:
SetCode
(
EFFECT_MUST_ATTACK_MONSTER
)
e4
:
SetValue
(
s
.
atklimit
)
c
:
RegisterEffect
(
e4
)
--reflect damage
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EFFECT_REFLECT_BATTLE_DAMAGE
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e3
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x2a4
))
c
:
RegisterEffect
(
e3
)
end
function
s
.
cfilter
(
c
,
tp
)
return
c
:
IsFaceupEx
()
and
c
:
IsAttribute
(
ATTRIBUTE_DARK
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
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
)
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
)
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
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
)
end
function
s
.
atkfilter
(
c
)
return
c
:
IsSetCard
(
0x2a4
)
end
function
s
.
atkcon
(
e
)
return
Duel
.
IsExistingMatchingCard
(
s
.
atkfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
s
.
atklimit
(
e
,
c
)
return
c
:
IsSetCard
(
0x2a4
)
end
\ No newline at end of file
expansions/script/c101203055.lua
0 → 100644
View file @
04683c1f
--マチュア・クロニクル
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
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
)
c
:
RegisterEffect
(
e1
)
--revial
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetCost
(
s
.
cost1
)
e2
:
SetTarget
(
s
.
sptg
)
e2
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e2
)
--recycle
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e3
:
SetCategory
(
CATEGORY_TOHAND
)
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
)
c
:
RegisterEffect
(
e3
)
--Remove
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e4
:
SetCategory
(
CATEGORY_REMOVE
)
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
)
c
:
RegisterEffect
(
e4
)
--Destroy
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
id
,
3
))
e5
:
SetCategory
(
CATEGORY_DESTROY
)
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
)
c
:
RegisterEffect
(
e5
)
--SearchCard
local
e6
=
Effect
.
CreateEffect
(
c
)
e6
:
SetDescription
(
aux
.
Stringid
(
id
,
4
))
e6
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
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
)
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
e
:
GetHandler
():
AddCounter
(
0x25
,
1
)
end
end
function
s
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
0
,
0x25
,
1
,
REASON_COST
)
end
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
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
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
)
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
)
end
end
function
s
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
0
,
0x25
,
2
,
REASON_COST
)
end
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
)
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
)
end
end
function
s
.
cost3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
0
,
0x25
,
3
,
REASON_COST
)
end
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
)
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
)
end
function
s
.
reop
(
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
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
)
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
)
end
end
function
s
.
cost5
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
0
,
0x25
,
5
,
REASON_COST
)
end
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x25
,
5
,
REASON_COST
)
end
function
s
.
filter
(
c
)
return
c
:
IsCode
(
48130397
)
and
c
:
IsAbleToHand
()
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
)
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
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
\ No newline at end of file
expansions/script/c101203073.lua
0 → 100644
View file @
04683c1f
--エターナル・フェイバリット
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
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_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
)
--fusion
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_FUSION_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
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x2a4
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
and
c
:
IsFaceup
()
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
,
e
,
tp
)
end
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
)
end
Duel
.
SpecialSummonComplete
()
end
function
s
.
sumop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
eg
:
IsContains
(
e
:
GetLabelObject
())
then
e
:
SetLabel
(
1
)
e
:
Reset
()
else
e
:
SetLabel
(
0
)
end
end
function
s
.
cedop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
CheckEvent
(
EVENT_SPSUMMON_SUCCESS
)
and
e
:
GetLabelObject
():
GetLabel
()
==
1
then
Duel
.
SetChainLimitTillChainEnd
(
aux
.
FALSE
)
end
e
:
Reset
()
end
function
s
.
filter1
(
c
)
return
c
:
IsCode
(
78371393
)
end
function
s
.
filter2
(
c
)
return
c
:
IsSetCard
(
0x2a4
)
and
c
:
IsCanBeFusionMaterial
()
end
function
s
.
fscon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
s
.
filter1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
s
.
filter2
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
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
)
end
function
s
.
mfilter0
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCanBeFusionMaterial
()
end
function
s
.
mfilter1
(
c
,
e
)
return
c
:
IsFaceup
()
and
c
:
IsCanBeFusionMaterial
()
and
not
c
:
IsImmuneToEffect
(
e
)
end
function
s
.
mfilter2
(
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
.
mfilter3
(
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
.
fstg
(
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
.
mfilter0
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
mg1
:
Merge
(
mg2
)
aux
.
FCheckAdditional
=
s
.
fcheck
local
res
=
Duel
.
IsExistingMatchingCard
(
s
.
mfilter2
,
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
.
mfilter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg3
,
mf
,
chkf
)
end
end
return
res
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
s
.
fsop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
chkf
=
tp
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
):
Filter
(
s
.
mfilter3
,
nil
,
e
)
local
mg2
=
Duel
.
GetMatchingGroup
(
s
.
mfilter1
,
tp
,
0
,
LOCATION_MZONE
,
nil
,
e
)
mg1
:
Merge
(
mg2
)
aux
.
FCheckAdditional
=
s
.
fcheck
local
sg1
=
Duel
.
GetMatchingGroup
(
s
.
mfilter2
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
,
mg1
,
nil
,
chkf
)
local
mg3
=
nil
local
sg2
=
nil
local
ce
=
Duel
.
GetChainMaterial
(
tp
)
if
ce
~=
nil
then
local
fgroup
=
ce
:
GetTarget
()
mg3
=
fgroup
(
ce
,
e
,
tp
)
local
mf
=
ce
:
GetValue
()
local
sg2
=
Duel
.
GetMatchingGroup
(
s
.
mfilter2
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
,
mg3
,
mf
,
chkf
)
end
if
sg1
:
GetCount
()
>
0
or
(
sg2
~=
nil
and
sg2
:
GetCount
()
>
0
)
then
local
sg
=
sg1
:
Clone
()
if
sg2
then
sg
:
Merge
(
sg2
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
tg
=
sg
:
Select
(
tp
,
1
,
1
,
nil
)
local
tc
=
tg
:
GetFirst
()
if
sg1
:
IsContains
(
tc
)
and
(
sg2
==
nil
or
not
sg2
:
IsContains
(
tc
)
or
not
Duel
.
SelectYesNo
(
tp
,
ce
:
GetDescription
()))
then
local
mat1
=
Duel
.
SelectFusionMaterial
(
tp
,
tc
,
mg1
,
nil
,
chkf
)
tc
:
SetMaterial
(
mat1
)
Duel
.
SendtoGrave
(
mat1
,
REASON_EFFECT
+
REASON_MATERIAL
+
REASON_FUSION
)
Duel
.
BreakEffect
()
Duel
.
SpecialSummon
(
tc
,
SUMMON_TYPE_FUSION
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
else
local
mat2
=
Duel
.
SelectFusionMaterial
(
tp
,
tc
,
mg3
,
nil
,
chkf
)
local
fop
=
ce
:
GetOperation
()
fop
(
ce
,
e
,
tp
,
tc
,
mat2
)
end
tc
:
CompleteProcedure
()
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment