Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro-2pick
Commits
d9d3234f
Commit
d9d3234f
authored
Nov 15, 2017
by
Momobako
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
b2fixes
parent
c09b4b74
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
2307 additions
and
2045 deletions
+2307
-2045
expansions/script/c60151101.lua
expansions/script/c60151101.lua
+145
-122
expansions/script/c60151102.lua
expansions/script/c60151102.lua
+122
-98
expansions/script/c60151103.lua
expansions/script/c60151103.lua
+138
-117
expansions/script/c60151104.lua
expansions/script/c60151104.lua
+147
-123
expansions/script/c60151105.lua
expansions/script/c60151105.lua
+128
-104
expansions/script/c60151106.lua
expansions/script/c60151106.lua
+233
-209
expansions/script/c60151107.lua
expansions/script/c60151107.lua
+163
-140
expansions/script/c60151108.lua
expansions/script/c60151108.lua
+208
-188
expansions/script/c60151121.lua
expansions/script/c60151121.lua
+132
-117
expansions/script/c60151123.lua
expansions/script/c60151123.lua
+129
-115
expansions/script/c60151125.lua
expansions/script/c60151125.lua
+138
-125
expansions/script/c60151127.lua
expansions/script/c60151127.lua
+144
-127
expansions/script/c60151128.lua
expansions/script/c60151128.lua
+171
-156
expansions/script/c60151196.lua
expansions/script/c60151196.lua
+84
-82
expansions/script/c60151197.lua
expansions/script/c60151197.lua
+76
-75
expansions/script/c60151198.lua
expansions/script/c60151198.lua
+68
-65
expansions/script/c60151199.lua
expansions/script/c60151199.lua
+81
-82
No files found.
expansions/script/c60151101.lua
View file @
d9d3234f
--├变节者 米拉┤
function
c60151101
.
initial_effect
(
c
)
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
6011101
)
e1
:
SetTarget
(
c60151101
.
cointg
)
e1
:
SetOperation
(
c60151101
.
coinop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
60151101
,
1
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
60151101
)
e3
:
SetCondition
(
c60151101
.
spcon
)
e3
:
SetTarget
(
c60151101
.
sptg
)
e3
:
SetOperation
(
c60151101
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
c60151101
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151101
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151101
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
end
function
c60151101
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151101
.
filter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
c60151101
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151101
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
local
c
=
e
:
GetHandler
()
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151101
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151101
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
if
res
==
1
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151101
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
if
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
local
g2
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
if
g2
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151101
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g2
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
end
end
end
function
c60151101
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
and
re
:
GetHandler
()
~=
e
:
GetHandler
()
and
re
:
GetHandler
():
IsSetCard
(
0x9b23
)
end
function
c60151101
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x9b23
)
and
not
c
:
IsCode
(
60151101
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c60151101
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
GetMZoneCount
(
tp
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c60151101
.
spfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
)
end
function
c60151101
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetMZoneCount
(
tp
)
<=
0
then
return
end
local
c
=
e
:
GetHandler
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151101
.
spfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
tc
=
g
:
GetFirst
()
if
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_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
,
true
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e2
,
true
)
local
e11
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e11
:
SetType
(
EFFECT_TYPE_SINGLE
)
e11
:
SetCode
(
EFFECT_CANNOT_BE_XYZ_MATERIAL
)
e11
:
SetValue
(
c60151101
.
xyzlimit
)
e11
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e11
,
true
)
local
e12
=
e11
:
Clone
()
e12
:
SetCode
(
EFFECT_CANNOT_BE_SYNCHRO_MATERIAL
)
tc
:
RegisterEffect
(
e12
,
true
)
Duel
.
SpecialSummonComplete
()
end
end
function
c60151101
.
xyzlimit
(
e
,
c
)
if
not
c
then
return
false
end
return
not
c
:
IsSetCard
(
0x9b23
)
--├变节者 米拉┤
function
c60151101
.
initial_effect
(
c
)
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
+
CATEGORY_TOGRAVE
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
6011101
)
e1
:
SetCondition
(
c60151101
.
coincon
)
e1
:
SetTarget
(
c60151101
.
cointg
)
e1
:
SetOperation
(
c60151101
.
coinop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
local
e111
=
Effect
.
CreateEffect
(
c
)
e111
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e111
:
SetCategory
(
CATEGORY_TOGRAVE
+
CATEGORY_TOHAND
)
e111
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e111
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e111
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e111
:
SetCountLimit
(
1
,
6011101
)
e111
:
SetCondition
(
c60151101
.
coincon2
)
e111
:
SetTarget
(
c60151101
.
cointg
)
e111
:
SetOperation
(
c60151101
.
coinop
)
c
:
RegisterEffect
(
e111
)
local
e222
=
e111
:
Clone
()
e222
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e222
)
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
60151101
,
1
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
60151101
)
e3
:
SetCondition
(
c60151101
.
spcon
)
e3
:
SetTarget
(
c60151101
.
sptg
)
e3
:
SetOperation
(
c60151101
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
c60151101
.
coincon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151101
.
coincon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151101
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151101
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151101
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
function
c60151101
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151101
.
filter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
c60151101
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151101
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
local
c
=
e
:
GetHandler
()
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151101
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151101
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
if
res
==
1
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151101
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
if
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
local
g2
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
if
g2
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151101
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g2
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
end
end
end
function
c60151101
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
and
re
:
GetHandler
()
~=
e
:
GetHandler
()
and
re
:
GetHandler
():
IsSetCard
(
0x9b23
)
end
function
c60151101
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x9b23
)
and
not
c
:
IsCode
(
60151101
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c60151101
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c60151101
.
spfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
)
end
function
c60151101
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
local
c
=
e
:
GetHandler
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151101
.
spfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
tc
=
g
:
GetFirst
()
if
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_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
,
true
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e2
,
true
)
local
e11
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e11
:
SetType
(
EFFECT_TYPE_SINGLE
)
e11
:
SetCode
(
EFFECT_CANNOT_BE_XYZ_MATERIAL
)
e11
:
SetValue
(
c60151101
.
xyzlimit
)
e11
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e11
,
true
)
local
e12
=
e11
:
Clone
()
e12
:
SetCode
(
EFFECT_CANNOT_BE_SYNCHRO_MATERIAL
)
tc
:
RegisterEffect
(
e12
,
true
)
Duel
.
SpecialSummonComplete
()
end
end
function
c60151101
.
xyzlimit
(
e
,
c
)
if
not
c
then
return
false
end
return
not
c
:
IsSetCard
(
0x9b23
)
end
\ No newline at end of file
expansions/script/c60151102.lua
View file @
d9d3234f
--├随想者 提亚┤
function
c60151102
.
initial_effect
(
c
)
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
6011102
)
e1
:
SetTarget
(
c60151102
.
cointg
)
e1
:
SetOperation
(
c60151102
.
coinop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
60151102
,
1
))
e3
:
SetCategory
(
CATEGORY_DRAW
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
60151102
)
e3
:
SetCondition
(
c60151102
.
spcon
)
e3
:
SetTarget
(
c60151102
.
sptg
)
e3
:
SetOperation
(
c60151102
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
c60151102
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151102
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151102
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
end
function
c60151102
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151102
.
filter
(
c
)
return
c
:
IsDestructable
()
end
function
c60151102
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151102
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151102
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151102
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
if
res
==
1
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151102
.
filter
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
if
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
~=
0
then
local
g2
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
if
g2
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151101
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g2
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
end
end
end
function
c60151102
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
and
re
:
GetHandler
()
~=
e
:
GetHandler
()
and
re
:
GetHandler
():
IsSetCard
(
0x9b23
)
end
function
c60151102
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
2
)
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
2
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
2
)
end
function
c60151102
.
spop
(
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
)
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151102
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
--├随想者 提亚┤
function
c60151102
.
initial_effect
(
c
)
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
+
CATEGORY_DESTROY
+
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
6011102
)
e1
:
SetCondition
(
c60151102
.
coincon
)
e1
:
SetTarget
(
c60151102
.
cointg
)
e1
:
SetOperation
(
c60151102
.
coinop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
local
e111
=
Effect
.
CreateEffect
(
c
)
e111
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e111
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_TOGRAVE
)
e111
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e111
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e111
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e111
:
SetCountLimit
(
1
,
6011102
)
e111
:
SetCondition
(
c60151102
.
coincon2
)
e111
:
SetTarget
(
c60151102
.
cointg
)
e111
:
SetOperation
(
c60151102
.
coinop
)
c
:
RegisterEffect
(
e111
)
local
e222
=
e111
:
Clone
()
e222
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e222
)
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
60151102
,
1
))
e3
:
SetCategory
(
CATEGORY_DRAW
+
CATEGORY_TOGRAVE
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
60151102
)
e3
:
SetCondition
(
c60151102
.
spcon
)
e3
:
SetTarget
(
c60151102
.
sptg
)
e3
:
SetOperation
(
c60151102
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
c60151102
.
coincon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151102
.
coincon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151102
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151102
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151102
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
nil
,
1
,
1
-
tp
,
LOCATION_ONFIELD
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
function
c60151102
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151102
.
filter
(
c
)
return
c
:
IsDestructable
()
end
function
c60151102
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151102
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151102
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151102
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
if
res
==
1
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151102
.
filter
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
if
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
~=
0
then
local
g2
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
if
g2
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151101
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g2
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
end
end
end
function
c60151102
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
and
re
:
GetHandler
()
~=
e
:
GetHandler
()
and
re
:
GetHandler
():
IsSetCard
(
0x9b23
)
end
function
c60151102
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
2
)
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
2
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
2
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
function
c60151102
.
spop
(
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
)
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151102
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
end
\ No newline at end of file
expansions/script/c60151103.lua
View file @
d9d3234f
--├风语者 妲修斯┤
function
c60151103
.
initial_effect
(
c
)
c
:
EnableUnsummonable
()
--special summon
local
e11
=
Effect
.
CreateEffect
(
c
)
e11
:
SetType
(
EFFECT_TYPE_FIELD
)
e11
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e11
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e11
:
SetRange
(
LOCATION_HAND
)
e11
:
SetCountLimit
(
1
,
60111031
)
e11
:
SetCondition
(
c60151103
.
spcon2
)
c
:
RegisterEffect
(
e11
)
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
6011103
)
e1
:
SetTarget
(
c60151103
.
cointg
)
e1
:
SetOperation
(
c60151103
.
coinop
)
c
:
RegisterEffect
(
e1
)
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
60151103
,
1
))
e3
:
SetCategory
(
CATEGORY_TOHAND
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
60151103
)
e3
:
SetCondition
(
c60151103
.
spcon
)
e3
:
SetTarget
(
c60151103
.
sptg
)
e3
:
SetOperation
(
c60151103
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
c60151103
.
sfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x9b23
)
and
c
:
GetCode
()
~=
60151103
end
function
c60151103
.
spcon2
(
e
,
c
)
if
c
==
nil
then
return
true
end
return
Duel
.
GetMZoneCount
(
c
:
GetControler
())
>
0
and
Duel
.
IsExistingMatchingCard
(
c60151103
.
sfilter
,
c
:
GetControler
(),
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
c60151103
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151103
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151103
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
end
function
c60151103
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151103
.
filter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
c60151103
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151103
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151103
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151103
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
if
res
==
1
then
local
g
=
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_HAND
):
RandomSelect
(
tp
,
1
)
if
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
~=
0
then
local
g2
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
if
g2
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151101
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g2
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
end
end
function
c60151103
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
and
re
:
GetHandler
()
~=
e
:
GetHandler
()
and
re
:
GetHandler
():
IsSetCard
(
0x9b23
)
end
function
c60151103
.
spfilter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsCode
(
60151103
)
and
c
:
IsAbleToHand
()
end
function
c60151103
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60151103
.
spfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
end
function
c60151103
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151103
.
spfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
if
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151101
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151103
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
end
end
--├风语者 妲修斯┤
function
c60151103
.
initial_effect
(
c
)
c
:
EnableUnsummonable
()
--special summon
local
e11
=
Effect
.
CreateEffect
(
c
)
e11
:
SetType
(
EFFECT_TYPE_FIELD
)
e11
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e11
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e11
:
SetRange
(
LOCATION_HAND
)
e11
:
SetCountLimit
(
1
,
60111031
)
e11
:
SetCondition
(
c60151103
.
spcon2
)
c
:
RegisterEffect
(
e11
)
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
+
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
6011103
)
e1
:
SetCondition
(
c60151103
.
coincon
)
e1
:
SetTarget
(
c60151103
.
cointg
)
e1
:
SetOperation
(
c60151103
.
coinop
)
c
:
RegisterEffect
(
e1
)
local
e111
=
Effect
.
CreateEffect
(
c
)
e111
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e111
:
SetCategory
(
CATEGORY_TOGRAVE
)
e111
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e111
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e111
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e111
:
SetCountLimit
(
1
,
6011103
)
e111
:
SetCondition
(
c60151103
.
coincon2
)
e111
:
SetTarget
(
c60151103
.
cointg
)
e111
:
SetOperation
(
c60151103
.
coinop
)
c
:
RegisterEffect
(
e111
)
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
60151103
,
1
))
e3
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_TOGRAVE
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
60151103
)
e3
:
SetCondition
(
c60151103
.
spcon
)
e3
:
SetTarget
(
c60151103
.
sptg
)
e3
:
SetOperation
(
c60151103
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
c60151103
.
coincon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151103
.
coincon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151103
.
sfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x9b23
)
and
c
:
GetCode
()
~=
60151103
end
function
c60151103
.
spcon2
(
e
,
c
)
if
c
==
nil
then
return
true
end
return
Duel
.
GetLocationCount
(
c
:
GetControler
(),
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c60151103
.
sfilter
,
c
:
GetControler
(),
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
c60151103
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151103
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151103
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
1
-
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
function
c60151103
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151103
.
filter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
c60151103
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151103
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151103
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151103
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
if
res
==
1
then
local
g
=
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_HAND
):
RandomSelect
(
tp
,
1
)
if
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
~=
0
then
local
g2
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
if
g2
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151101
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g2
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
end
end
function
c60151103
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
and
re
:
GetHandler
()
~=
e
:
GetHandler
()
and
re
:
GetHandler
():
IsSetCard
(
0x9b23
)
end
function
c60151103
.
spfilter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsCode
(
60151103
)
and
c
:
IsAbleToHand
()
end
function
c60151103
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60151103
.
spfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
function
c60151103
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151103
.
spfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
if
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151101
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151103
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
end
end
end
\ No newline at end of file
expansions/script/c60151104.lua
View file @
d9d3234f
--├执策者 菲尼亚┤
function
c60151104
.
initial_effect
(
c
)
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
6011104
)
e1
:
SetTarget
(
c60151104
.
cointg
)
e1
:
SetOperation
(
c60151104
.
coinop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
60151104
,
1
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
60151104
)
e3
:
SetCondition
(
c60151104
.
spcon
)
e3
:
SetTarget
(
c60151104
.
sptg
)
e3
:
SetOperation
(
c60151104
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
c60151104
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151104
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151104
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
end
function
c60151104
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151104
.
filter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsAbleToHand
()
end
function
c60151104
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151104
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151104
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151104
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
if
res
==
1
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151104
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
if
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
~=
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
local
g2
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
if
g2
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151101
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g2
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
end
end
end
function
c60151104
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
and
re
:
GetHandler
()
~=
e
:
GetHandler
()
and
re
:
GetHandler
():
IsSetCard
(
0x9b23
)
end
function
c60151104
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x9b23
)
and
not
c
:
IsCode
(
60151104
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c60151104
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
GetMZoneCount
(
tp
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c60151104
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c60151104
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetMZoneCount
(
tp
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151104
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
tc
=
g
:
GetFirst
()
if
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_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
,
true
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e2
,
true
)
local
e11
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e11
:
SetType
(
EFFECT_TYPE_SINGLE
)
e11
:
SetCode
(
EFFECT_CANNOT_BE_XYZ_MATERIAL
)
e11
:
SetValue
(
c60151104
.
xyzlimit
)
e11
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e11
,
true
)
local
e12
=
e11
:
Clone
()
e12
:
SetCode
(
EFFECT_CANNOT_BE_SYNCHRO_MATERIAL
)
tc
:
RegisterEffect
(
e12
,
true
)
Duel
.
SpecialSummonComplete
()
end
end
function
c60151104
.
xyzlimit
(
e
,
c
)
if
not
c
then
return
false
end
return
not
c
:
IsSetCard
(
0x9b23
)
--├执策者 菲尼亚┤
function
c60151104
.
initial_effect
(
c
)
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
+
CATEGORY_TOGRAVE
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
6011104
)
e1
:
SetCondition
(
c60151104
.
coincon
)
e1
:
SetTarget
(
c60151104
.
cointg
)
e1
:
SetOperation
(
c60151104
.
coinop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
local
e111
=
Effect
.
CreateEffect
(
c
)
e111
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e111
:
SetCategory
(
CATEGORY_TOGRAVE
+
CATEGORY_TOHAND
)
e111
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e111
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e111
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e111
:
SetCountLimit
(
1
,
6011104
)
e111
:
SetCondition
(
c60151104
.
coincon2
)
e111
:
SetTarget
(
c60151104
.
cointg
)
e111
:
SetOperation
(
c60151104
.
coinop
)
c
:
RegisterEffect
(
e111
)
local
e222
=
e111
:
Clone
()
e222
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e222
)
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
60151104
,
1
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
60151104
)
e3
:
SetCondition
(
c60151104
.
spcon
)
e3
:
SetTarget
(
c60151104
.
sptg
)
e3
:
SetOperation
(
c60151104
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
c60151104
.
coincon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151104
.
coincon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151104
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151104
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151104
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
function
c60151104
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151104
.
filter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsAbleToHand
()
end
function
c60151104
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151104
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151104
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151104
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
if
res
==
1
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151104
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
if
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
~=
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
local
g2
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
if
g2
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151101
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g2
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
end
end
end
function
c60151104
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
and
re
:
GetHandler
()
~=
e
:
GetHandler
()
and
re
:
GetHandler
():
IsSetCard
(
0x9b23
)
end
function
c60151104
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x9b23
)
and
not
c
:
IsCode
(
60151104
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c60151104
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c60151104
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
function
c60151104
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151104
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
tc
=
g
:
GetFirst
()
if
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_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
,
true
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e2
,
true
)
local
e11
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e11
:
SetType
(
EFFECT_TYPE_SINGLE
)
e11
:
SetCode
(
EFFECT_CANNOT_BE_XYZ_MATERIAL
)
e11
:
SetValue
(
c60151104
.
xyzlimit
)
e11
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e11
,
true
)
local
e12
=
e11
:
Clone
()
e12
:
SetCode
(
EFFECT_CANNOT_BE_SYNCHRO_MATERIAL
)
tc
:
RegisterEffect
(
e12
,
true
)
Duel
.
SpecialSummonComplete
()
end
end
function
c60151104
.
xyzlimit
(
e
,
c
)
if
not
c
then
return
false
end
return
not
c
:
IsSetCard
(
0x9b23
)
end
\ No newline at end of file
expansions/script/c60151105.lua
View file @
d9d3234f
--├谋略者 蕾尔拉┤
function
c60151105
.
initial_effect
(
c
)
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
6011105
)
e1
:
SetTarget
(
c60151105
.
cointg
)
e1
:
SetOperation
(
c60151105
.
coinop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
60151105
,
1
))
e3
:
SetCategory
(
CATEGORY_TOHAND
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
60151105
)
e3
:
SetCondition
(
c60151105
.
spcon
)
e3
:
SetTarget
(
c60151105
.
sptg
)
e3
:
SetOperation
(
c60151105
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
c60151105
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151105
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151105
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
end
function
c60151105
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151105
.
filter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToGrave
()
end
function
c60151105
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151105
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151105
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151105
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
if
res
==
1
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151105
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
if
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
~=
0
then
local
g2
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
if
g2
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151101
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g2
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
end
end
end
function
c60151105
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
and
re
:
GetHandler
()
~=
e
:
GetHandler
()
and
re
:
GetHandler
():
IsSetCard
(
0x9b23
)
end
function
c60151105
.
spfilter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsAbleToHand
()
end
function
c60151105
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60151105
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c60151105
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151105
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
if
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151101
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151105
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
end
end
--├谋略者 蕾尔拉┤
function
c60151105
.
initial_effect
(
c
)
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
+
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
6011105
)
e1
:
SetCondition
(
c60151105
.
coincon
)
e1
:
SetTarget
(
c60151105
.
cointg
)
e1
:
SetOperation
(
c60151105
.
coinop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
local
e111
=
Effect
.
CreateEffect
(
c
)
e111
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e111
:
SetCategory
(
CATEGORY_TOGRAVE
)
e111
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e111
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e111
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e111
:
SetCountLimit
(
1
,
6011105
)
e111
:
SetCondition
(
c60151105
.
coincon2
)
e111
:
SetTarget
(
c60151105
.
cointg
)
e111
:
SetOperation
(
c60151105
.
coinop
)
c
:
RegisterEffect
(
e111
)
local
e222
=
e111
:
Clone
()
e222
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e222
)
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
60151105
,
1
))
e3
:
SetCategory
(
CATEGORY_TOHAND
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
60151105
)
e3
:
SetCondition
(
c60151105
.
spcon
)
e3
:
SetTarget
(
c60151105
.
sptg
)
e3
:
SetOperation
(
c60151105
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
c60151105
.
coincon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151105
.
coincon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151105
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151105
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151105
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c60151105
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151105
.
filter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToGrave
()
end
function
c60151105
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151105
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151105
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151105
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
if
res
==
1
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151105
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
if
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
~=
0
then
local
g2
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
if
g2
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151101
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g2
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
end
end
end
function
c60151105
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
and
re
:
GetHandler
()
~=
e
:
GetHandler
()
and
re
:
GetHandler
():
IsSetCard
(
0x9b23
)
end
function
c60151105
.
spfilter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsAbleToHand
()
end
function
c60151105
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60151105
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
function
c60151105
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151105
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
if
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151101
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151105
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
end
end
end
\ No newline at end of file
expansions/script/c60151106.lua
View file @
d9d3234f
--├红枫指挥官 文┤
function
c60151106
.
initial_effect
(
c
)
--sp
local
e12
=
Effect
.
CreateEffect
(
c
)
e12
:
SetType
(
EFFECT_TYPE_FIELD
)
e12
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e12
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e12
:
SetRange
(
LOCATION_HAND
)
e12
:
SetCountLimit
(
1
,
60111061
)
e12
:
SetCondition
(
c60151106
.
spcon2
)
e12
:
SetOperation
(
c60151106
.
spop2
)
c
:
RegisterEffect
(
e12
)
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
6011106
)
e1
:
SetTarget
(
c60151106
.
cointg
)
e1
:
SetOperation
(
c60151106
.
coinop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
60151106
,
1
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
60151106
)
e3
:
SetCondition
(
c60151106
.
spcon
)
e3
:
SetTarget
(
c60151106
.
sptg
)
e3
:
SetOperation
(
c60151106
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
c60151106
.
spfilter2
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsCode
(
60151106
)
and
c
:
IsAbleToGrave
()
end
function
c60151106
.
spcon2
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
if
Duel
.
GetMZoneCount
(
tp
)
<
1
and
Duel
.
GetMZoneCount
(
tp
)
>-
2
then
return
Duel
.
IsExistingMatchingCard
(
c60151106
.
spfilter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c60151106
.
spfilter2
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
else
return
Duel
.
GetMZoneCount
(
tp
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c60151106
.
spfilter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
2
,
nil
)
end
end
function
c60151106
.
spop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
if
Duel
.
GetMZoneCount
(
tp
)
<
1
and
Duel
.
GetMZoneCount
(
tp
)
>-
2
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151106
.
spfilter2
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
local
tc
=
g1
:
GetFirst
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
c60151106
.
spfilter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
tc
)
local
g
=
Group
.
CreateGroup
()
g
:
Merge
(
g1
)
g
:
Merge
(
g2
)
local
tc2
=
g
:
GetFirst
()
while
tc2
do
if
not
tc2
:
IsFaceup
()
then
Duel
.
ConfirmCards
(
1
-
tp
,
tc2
)
end
tc2
=
g
:
GetNext
()
end
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151106
.
spfilter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
2
,
2
,
nil
)
local
tc
=
g1
:
GetFirst
()
while
tc
do
if
not
tc
:
IsFaceup
()
then
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
tc
=
g1
:
GetNext
()
end
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
function
c60151106
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151106
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151106
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
end
function
c60151106
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151106
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
GetLevel
()
==
4
and
not
c
:
IsCode
(
60151106
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c60151106
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151106
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151106
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151106
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
if
res
==
1
then
if
Duel
.
GetMZoneCount
(
tp
)
<=
0
then
return
end
if
Duel
.
GetMZoneCount
(
tp
)
<
2
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151106
.
spfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
tc
=
g
:
GetFirst
()
while
tc
do
if
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_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
,
true
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e2
,
true
)
local
e11
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e11
:
SetType
(
EFFECT_TYPE_SINGLE
)
e11
:
SetCode
(
EFFECT_CANNOT_BE_XYZ_MATERIAL
)
e11
:
SetValue
(
c60151106
.
xyzlimit
)
e11
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e11
,
true
)
local
e12
=
e11
:
Clone
()
e12
:
SetCode
(
EFFECT_CANNOT_BE_SYNCHRO_MATERIAL
)
tc
:
RegisterEffect
(
e12
,
true
)
Duel
.
SpecialSummonComplete
()
end
tc
=
g
:
GetNext
()
end
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151106
.
spfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
2
,
nil
,
e
,
tp
)
local
tc
=
g
:
GetFirst
()
while
tc
do
if
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_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
,
true
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e2
,
true
)
local
e11
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e11
:
SetType
(
EFFECT_TYPE_SINGLE
)
e11
:
SetCode
(
EFFECT_CANNOT_BE_XYZ_MATERIAL
)
e11
:
SetValue
(
c60151106
.
xyzlimit
)
e11
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e11
,
true
)
local
e12
=
e11
:
Clone
()
e12
:
SetCode
(
EFFECT_CANNOT_BE_SYNCHRO_MATERIAL
)
tc
:
RegisterEffect
(
e12
,
true
)
Duel
.
SpecialSummonComplete
()
end
tc
=
g
:
GetNext
()
end
end
end
end
function
c60151106
.
xyzlimit
(
e
,
c
)
if
not
c
then
return
false
end
return
not
c
:
IsSetCard
(
0x9b23
)
end
function
c60151106
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
and
re
:
GetHandler
()
~=
e
:
GetHandler
()
and
re
:
GetHandler
():
IsSetCard
(
0x9b23
)
end
function
c60151106
.
filter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsAbleToDeck
()
end
function
c60151106
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
IsExistingMatchingCard
(
c60151106
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c60151106
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151106
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
2
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_EFFECT
)
Duel
.
ShuffleDeck
(
tp
)
if
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
~=
0
then
local
g2
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
if
g2
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151101
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g2
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
end
--├红枫指挥官 文┤
function
c60151106
.
initial_effect
(
c
)
--sp
local
e12
=
Effect
.
CreateEffect
(
c
)
e12
:
SetType
(
EFFECT_TYPE_FIELD
)
e12
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e12
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e12
:
SetRange
(
LOCATION_HAND
)
e12
:
SetCountLimit
(
1
,
60111061
)
e12
:
SetCondition
(
c60151106
.
spcon2
)
e12
:
SetOperation
(
c60151106
.
spop2
)
c
:
RegisterEffect
(
e12
)
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
+
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
6011106
)
e1
:
SetCondition
(
c60151106
.
coincon
)
e1
:
SetTarget
(
c60151106
.
cointg
)
e1
:
SetOperation
(
c60151106
.
coinop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
local
e111
=
Effect
.
CreateEffect
(
c
)
e111
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e111
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e111
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e111
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e111
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e111
:
SetCountLimit
(
1
,
6011106
)
e111
:
SetCondition
(
c60151106
.
coincon2
)
e111
:
SetTarget
(
c60151106
.
cointg
)
e111
:
SetOperation
(
c60151106
.
coinop
)
c
:
RegisterEffect
(
e111
)
local
e222
=
e111
:
Clone
()
e222
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e222
)
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
60151106
,
1
))
e3
:
SetCategory
(
CATEGORY_DRAW
+
CATEGORY_TODECK
+
CATEGORY_TOGRAVE
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
60151106
)
e3
:
SetCondition
(
c60151106
.
spcon
)
e3
:
SetTarget
(
c60151106
.
sptg
)
e3
:
SetOperation
(
c60151106
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
c60151106
.
coincon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151106
.
coincon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151106
.
spfilter2
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsCode
(
60151106
)
and
c
:
IsAbleToGrave
()
end
function
c60151106
.
spcon2
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<
1
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>-
2
then
return
Duel
.
IsExistingMatchingCard
(
c60151106
.
spfilter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c60151106
.
spfilter2
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
else
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c60151106
.
spfilter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
2
,
nil
)
end
end
function
c60151106
.
spop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<
1
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>-
2
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151106
.
spfilter2
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
local
tc
=
g1
:
GetFirst
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
c60151106
.
spfilter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
tc
)
local
g
=
Group
.
CreateGroup
()
g
:
Merge
(
g1
)
g
:
Merge
(
g2
)
local
tc2
=
g
:
GetFirst
()
while
tc2
do
if
not
tc2
:
IsFaceup
()
then
Duel
.
ConfirmCards
(
1
-
tp
,
tc2
)
end
tc2
=
g
:
GetNext
()
end
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151106
.
spfilter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
2
,
2
,
nil
)
local
tc
=
g1
:
GetFirst
()
while
tc
do
if
not
tc
:
IsFaceup
()
then
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
tc
=
g1
:
GetNext
()
end
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
function
c60151106
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151106
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151106
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
)
end
function
c60151106
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151106
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
GetLevel
()
==
4
and
not
c
:
IsCode
(
60151106
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c60151106
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151106
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151106
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151106
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
if
res
==
1
then
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<
2
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151106
.
spfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
tc
=
g
:
GetFirst
()
while
tc
do
if
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_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
,
true
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e2
,
true
)
local
e11
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e11
:
SetType
(
EFFECT_TYPE_SINGLE
)
e11
:
SetCode
(
EFFECT_CANNOT_BE_XYZ_MATERIAL
)
e11
:
SetValue
(
c60151106
.
xyzlimit
)
e11
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e11
,
true
)
local
e12
=
e11
:
Clone
()
e12
:
SetCode
(
EFFECT_CANNOT_BE_SYNCHRO_MATERIAL
)
tc
:
RegisterEffect
(
e12
,
true
)
Duel
.
SpecialSummonComplete
()
end
tc
=
g
:
GetNext
()
end
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151106
.
spfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
2
,
nil
,
e
,
tp
)
local
tc
=
g
:
GetFirst
()
while
tc
do
if
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_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
,
true
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e2
,
true
)
local
e11
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e11
:
SetType
(
EFFECT_TYPE_SINGLE
)
e11
:
SetCode
(
EFFECT_CANNOT_BE_XYZ_MATERIAL
)
e11
:
SetValue
(
c60151106
.
xyzlimit
)
e11
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e11
,
true
)
local
e12
=
e11
:
Clone
()
e12
:
SetCode
(
EFFECT_CANNOT_BE_SYNCHRO_MATERIAL
)
tc
:
RegisterEffect
(
e12
,
true
)
Duel
.
SpecialSummonComplete
()
end
tc
=
g
:
GetNext
()
end
end
end
end
function
c60151106
.
xyzlimit
(
e
,
c
)
if
not
c
then
return
false
end
return
not
c
:
IsSetCard
(
0x9b23
)
end
function
c60151106
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
and
re
:
GetHandler
()
~=
e
:
GetHandler
()
and
re
:
GetHandler
():
IsSetCard
(
0x9b23
)
end
function
c60151106
.
filter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsAbleToDeck
()
end
function
c60151106
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
IsExistingMatchingCard
(
c60151106
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
function
c60151106
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151106
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
2
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_EFFECT
)
Duel
.
ShuffleDeck
(
tp
)
if
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
~=
0
then
local
g2
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
if
g2
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151101
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g2
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
end
end
\ No newline at end of file
expansions/script/c60151107.lua
View file @
d9d3234f
--├红瑰执行官 音┤
function
c60151107
.
initial_effect
(
c
)
--sp
local
e12
=
Effect
.
CreateEffect
(
c
)
e12
:
SetType
(
EFFECT_TYPE_FIELD
)
e12
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e12
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e12
:
SetRange
(
LOCATION_GRAVE
)
e12
:
SetCountLimit
(
1
,
60111071
)
e12
:
SetCondition
(
c60151107
.
spcon2
)
e12
:
SetOperation
(
c60151107
.
spop2
)
c
:
RegisterEffect
(
e12
)
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
6011107
)
e1
:
SetTarget
(
c60151107
.
cointg
)
e1
:
SetOperation
(
c60151107
.
coinop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
60151107
,
1
))
e3
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_DRAW
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
60151107
)
e3
:
SetCondition
(
c60151107
.
spcon
)
e3
:
SetTarget
(
c60151107
.
sptg
)
e3
:
SetOperation
(
c60151107
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
c60151107
.
spfilter2
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsCode
(
60151107
)
and
c
:
IsAbleToGrave
()
end
function
c60151107
.
spcon2
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
if
Duel
.
GetMZoneCount
(
tp
)
<
1
and
Duel
.
GetMZoneCount
(
tp
)
>-
2
then
return
Duel
.
IsExistingMatchingCard
(
c60151107
.
spfilter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c60151107
.
spfilter2
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
else
return
Duel
.
GetMZoneCount
(
tp
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c60151107
.
spfilter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
2
,
nil
)
end
end
function
c60151107
.
spop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
if
Duel
.
GetMZoneCount
(
tp
)
<
1
and
Duel
.
GetMZoneCount
(
tp
)
>-
2
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151107
.
spfilter2
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
local
tc
=
g1
:
GetFirst
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
c60151107
.
spfilter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
tc
)
local
g
=
Group
.
CreateGroup
()
g
:
Merge
(
g1
)
g
:
Merge
(
g2
)
local
tc2
=
g
:
GetFirst
()
while
tc2
do
if
not
tc2
:
IsFaceup
()
then
Duel
.
ConfirmCards
(
1
-
tp
,
tc2
)
end
tc2
=
g
:
GetNext
()
end
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151107
.
spfilter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
2
,
2
,
nil
)
local
tc
=
g1
:
GetFirst
()
while
tc
do
if
not
tc
:
IsFaceup
()
then
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
tc
=
g1
:
GetNext
()
end
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
function
c60151107
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151107
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151107
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
end
function
c60151107
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151107
.
filter
(
c
,
atk
,
def
)
return
c
:
IsFaceup
()
and
(
c
:
IsAttackBelow
(
atk
)
or
c
:
IsDefenseBelow
(
atk
))
and
c
:
IsDestructable
()
end
function
c60151107
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151107
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151107
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151107
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
if
res
==
1
then
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
c60151107
.
filter
,
tp
,
0
,
LOCATION_MZONE
,
c
,
c
:
GetAttack
())
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
end
function
c60151107
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
and
re
:
GetHandler
()
~=
e
:
GetHandler
()
and
re
:
GetHandler
():
IsSetCard
(
0x9b23
)
end
function
c60151107
.
filter3
(
c
)
return
c
:
IsDestructable
()
end
function
c60151107
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60151107
.
filter3
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
end
local
g
=
Duel
.
GetMatchingGroup
(
c60151107
.
filter3
,
tp
,
0
,
LOCATION_ONFIELD
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
end
function
c60151107
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151107
.
filter3
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
--├红瑰执行官 音┤
function
c60151107
.
initial_effect
(
c
)
--sp
local
e12
=
Effect
.
CreateEffect
(
c
)
e12
:
SetType
(
EFFECT_TYPE_FIELD
)
e12
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e12
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e12
:
SetRange
(
LOCATION_GRAVE
)
e12
:
SetCountLimit
(
1
,
60111071
)
e12
:
SetCondition
(
c60151107
.
spcon2
)
e12
:
SetOperation
(
c60151107
.
spop2
)
c
:
RegisterEffect
(
e12
)
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
+
CATEGORY_DESTROY
+
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
6011107
)
e1
:
SetCondition
(
c60151107
.
coincon
)
e1
:
SetTarget
(
c60151107
.
cointg
)
e1
:
SetOperation
(
c60151107
.
coinop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
local
e111
=
Effect
.
CreateEffect
(
c
)
e111
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e111
:
SetCategory
(
CATEGORY_DESTROY
)
e111
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e111
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e111
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e111
:
SetCountLimit
(
1
,
6011107
)
e111
:
SetCondition
(
c60151107
.
coincon2
)
e111
:
SetTarget
(
c60151107
.
cointg
)
e111
:
SetOperation
(
c60151107
.
coinop
)
c
:
RegisterEffect
(
e111
)
local
e222
=
e111
:
Clone
()
e222
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e222
)
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
60151107
,
1
))
e3
:
SetCategory
(
CATEGORY_DESTROY
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
60151107
)
e3
:
SetCondition
(
c60151107
.
spcon
)
e3
:
SetTarget
(
c60151107
.
sptg
)
e3
:
SetOperation
(
c60151107
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
c60151107
.
coincon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151107
.
coincon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151107
.
spfilter2
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsCode
(
60151107
)
and
c
:
IsAbleToGrave
()
end
function
c60151107
.
spcon2
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<
1
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>-
2
then
return
Duel
.
IsExistingMatchingCard
(
c60151107
.
spfilter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c60151107
.
spfilter2
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
else
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c60151107
.
spfilter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
2
,
nil
)
end
end
function
c60151107
.
spop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<
1
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>-
2
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151107
.
spfilter2
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
local
tc
=
g1
:
GetFirst
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
c60151107
.
spfilter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
tc
)
local
g
=
Group
.
CreateGroup
()
g
:
Merge
(
g1
)
g
:
Merge
(
g2
)
local
tc2
=
g
:
GetFirst
()
while
tc2
do
if
not
tc2
:
IsFaceup
()
then
Duel
.
ConfirmCards
(
1
-
tp
,
tc2
)
end
tc2
=
g
:
GetNext
()
end
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151107
.
spfilter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
2
,
2
,
nil
)
local
tc
=
g1
:
GetFirst
()
while
tc
do
if
not
tc
:
IsFaceup
()
then
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
tc
=
g1
:
GetNext
()
end
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
function
c60151107
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151107
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151107
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
nil
,
1
,
1
-
tp
,
LOCATION_ONFIELD
)
end
function
c60151107
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151107
.
filter
(
c
,
atk
,
def
)
return
c
:
IsFaceup
()
and
(
c
:
IsAttackBelow
(
atk
)
or
c
:
IsDefenseBelow
(
atk
))
and
c
:
IsDestructable
()
end
function
c60151107
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151107
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151107
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151107
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
if
res
==
1
then
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
c60151107
.
filter
,
tp
,
0
,
LOCATION_MZONE
,
c
,
c
:
GetAttack
())
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
end
function
c60151107
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
and
re
:
GetHandler
()
~=
e
:
GetHandler
()
and
re
:
GetHandler
():
IsSetCard
(
0x9b23
)
end
function
c60151107
.
filter3
(
c
)
return
c
:
IsDestructable
()
end
function
c60151107
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60151107
.
filter3
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
end
local
g
=
Duel
.
GetMatchingGroup
(
c60151107
.
filter3
,
tp
,
0
,
LOCATION_ONFIELD
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
end
function
c60151107
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151107
.
filter3
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c60151108.lua
View file @
d9d3234f
--├黑魔司令 谢赛伽特┤
function
c60151108
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--cannot special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
c
:
RegisterEffect
(
e1
)
--special summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e2
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e2
:
SetRange
(
LOCATION_HAND
)
e2
:
SetCondition
(
c60151108
.
spcon
)
e2
:
SetOperation
(
c60151108
.
spop
)
e2
:
SetValue
(
1
)
c
:
RegisterEffect
(
e2
)
--summon success
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e3
:
SetCondition
(
c60151108
.
sumsuccon
)
e3
:
SetOperation
(
c60151108
.
sumsuc
)
c
:
RegisterEffect
(
e3
)
--coin
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetCategory
(
CATEGORY_COIN
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e4
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e4
:
SetCountLimit
(
1
,
60151108
)
e4
:
SetTarget
(
c60151108
.
cointg
)
e4
:
SetOperation
(
c60151108
.
coinop
)
c
:
RegisterEffect
(
e4
)
--
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
60151108
,
1
))
e5
:
SetCategory
(
CATEGORY_TOHAND
)
e5
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e5
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e5
:
SetCode
(
EVENT_TO_GRAVE
)
e5
:
SetCountLimit
(
1
,
6011108
)
e5
:
SetCondition
(
c60151108
.
spcon2
)
e5
:
SetTarget
(
c60151108
.
sptg2
)
e5
:
SetOperation
(
c60151108
.
spop2
)
c
:
RegisterEffect
(
e5
)
end
function
c60151108
.
cfilter
(
c
)
return
not
c
:
IsAbleToDeckOrExtraAsCost
()
end
function
c60151108
.
cfilter2
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsSetCard
(
0x9b23
)
end
function
c60151108
.
spcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60151108
.
cfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
return
Duel
.
GetMZoneCount
(
tp
)
>
0
and
g
:
GetCount
()
>
0
and
not
g
:
IsExists
(
c60151108
.
cfilter
,
1
,
nil
)
end
function
c60151108
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
g
=
Duel
.
GetMatchingGroup
(
c60151108
.
cfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
local
ct
=
g
:
GetClassCount
(
Card
.
GetCode
)
if
ct
>
0
then
local
a
=
Group
.
CreateGroup
()
for
i
=
1
,
ct
do
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g1
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
g
:
Remove
(
Card
.
IsCode
,
nil
,
g1
:
GetFirst
():
GetCode
())
if
g1
:
GetFirst
():
IsAbleToDeckOrExtraAsCost
()
then
a
:
Merge
(
g1
)
end
end
Duel
.
SendtoDeck
(
a
,
nil
,
2
,
REASON_COST
)
local
a1
=
a
:
GetCount
()
for
i
=
1
,
a1
do
e
:
GetHandler
():
RegisterFlagEffect
(
60151108
,
RESET_EVENT
+
0xfe0000
+
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
end
end
function
c60151108
.
sumsuccon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_SPECIAL
)
+
1
end
function
c60151108
.
sumsuc
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ct
=
e
:
GetHandler
():
GetFlagEffect
(
60151108
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
+
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EFFECT_SET_BASE_ATTACK
)
e1
:
SetValue
(
ct
*
400
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e
:
GetHandler
():
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_SET_BASE_DEFENSE
)
e
:
GetHandler
():
RegisterEffect
(
e2
)
end
function
c60151108
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151108
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151108
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
end
function
c60151108
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151108
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151108
.
filter3
(
c
)
return
true
end
function
c60151108
.
filter4
(
c
,
tp
)
return
c
:
GetOwner
()
==
tp
and
c
:
IsLocation
(
LOCATION_GRAVE
)
end
function
c60151108
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151108
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151108
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
if
res
==
1
then
local
ct1
=
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_ONFIELD
+
LOCATION_HAND
,
0
)
local
ct2
=
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_ONFIELD
+
LOCATION_HAND
)
local
a
=
Group
.
CreateGroup
()
if
ct1
>
ct2
then
local
g2
=
Duel
.
GetMatchingGroup
(
c60151108
.
filter3
,
tp
,
LOCATION_ONFIELD
+
LOCATION_HAND
,
0
,
nil
)
if
g2
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g2
:
Select
(
tp
,
ct1
-
ct2
,
ct1
-
ct2
,
nil
)
Duel
.
HintSelection
(
sg
)
Duel
.
SendtoGrave
(
sg
,
REASON_RULE
)
Duel
.
BreakEffect
()
local
og
=
Duel
.
GetOperatedGroup
()
local
ct
=
og
:
FilterCount
(
c60151108
.
filter4
,
nil
,
tp
)
if
ct
>
0
then
Duel
.
Draw
(
tp
,
ct
-
1
,
REASON_EFFECT
)
end
end
elseif
ct1
<
ct2
then
local
g2
=
Duel
.
GetMatchingGroup
(
c60151108
.
filter3
,
1
-
tp
,
LOCATION_ONFIELD
+
LOCATION_HAND
,
0
,
nil
)
if
g2
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
1
-
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g2
:
Select
(
1
-
tp
,
ct2
-
ct1
,
ct2
-
ct1
,
nil
)
Duel
.
HintSelection
(
sg
)
Duel
.
SendtoGrave
(
sg
,
REASON_RULE
)
Duel
.
BreakEffect
()
local
og
=
Duel
.
GetOperatedGroup
()
local
ct
=
og
:
FilterCount
(
c60151108
.
filter4
,
nil
,
tp
)
if
ct
>
0
then
Duel
.
Draw
(
tp
,
ct
-
1
,
REASON_EFFECT
)
end
end
else
return
false
end
end
end
function
c60151108
.
spcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
and
re
:
GetHandler
()
~=
e
:
GetHandler
()
and
re
:
GetHandler
():
IsSetCard
(
0x9b23
)
end
function
c60151108
.
sptg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
true
end
end
function
c60151108
.
spop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
60151199
)
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x9b23
))
e2
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e2
,
tp
)
--├黑魔司令 谢赛伽特┤
function
c60151108
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--cannot special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
c
:
RegisterEffect
(
e1
)
--special summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e2
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e2
:
SetRange
(
LOCATION_HAND
)
e2
:
SetCondition
(
c60151108
.
spcon
)
e2
:
SetOperation
(
c60151108
.
spop
)
e2
:
SetValue
(
1
)
c
:
RegisterEffect
(
e2
)
--summon success
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e3
:
SetCondition
(
c60151108
.
sumsuccon
)
e3
:
SetOperation
(
c60151108
.
sumsuc
)
c
:
RegisterEffect
(
e3
)
--coin
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetCategory
(
CATEGORY_COIN
+
CATEGORY_TOGRAVE
+
CATEGORY_DRAW
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e4
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e4
:
SetCountLimit
(
1
,
60151108
)
e4
:
SetCondition
(
c60151108
.
coincon
)
e4
:
SetTarget
(
c60151108
.
cointg
)
e4
:
SetOperation
(
c60151108
.
coinop
)
c
:
RegisterEffect
(
e4
)
local
e444
=
Effect
.
CreateEffect
(
c
)
e444
:
SetCategory
(
CATEGORY_TOGRAVE
+
CATEGORY_DRAW
)
e444
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e444
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e444
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e444
:
SetCountLimit
(
1
,
60151108
)
e444
:
SetCondition
(
c60151108
.
coincon2
)
e444
:
SetTarget
(
c60151108
.
cointg
)
e444
:
SetOperation
(
c60151108
.
coinop
)
c
:
RegisterEffect
(
e444
)
--
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
60151108
,
1
))
e5
:
SetCategory
(
CATEGORY_TOHAND
)
e5
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e5
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e5
:
SetCode
(
EVENT_TO_GRAVE
)
e5
:
SetCountLimit
(
1
,
6011108
)
e5
:
SetCondition
(
c60151108
.
spcon2
)
e5
:
SetTarget
(
c60151108
.
sptg2
)
e5
:
SetOperation
(
c60151108
.
spop2
)
c
:
RegisterEffect
(
e5
)
end
function
c60151108
.
coincon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151108
.
coincon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151108
.
cfilter
(
c
)
return
not
c
:
IsAbleToDeckOrExtraAsCost
()
end
function
c60151108
.
cfilter2
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsSetCard
(
0x9b23
)
end
function
c60151108
.
spcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60151108
.
cfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
g
:
GetCount
()
>
0
and
not
g
:
IsExists
(
c60151108
.
cfilter
,
1
,
nil
)
end
function
c60151108
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
g
=
Duel
.
GetMatchingGroup
(
c60151108
.
cfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
local
ct
=
g
:
GetClassCount
(
Card
.
GetCode
)
if
ct
>
0
then
local
a
=
Group
.
CreateGroup
()
for
i
=
1
,
ct
do
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g1
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
g
:
Remove
(
Card
.
IsCode
,
nil
,
g1
:
GetFirst
():
GetCode
())
if
g1
:
GetFirst
():
IsAbleToDeckOrExtraAsCost
()
then
a
:
Merge
(
g1
)
end
end
Duel
.
SendtoDeck
(
a
,
nil
,
2
,
REASON_COST
)
local
a1
=
a
:
GetCount
()
for
i
=
1
,
a1
do
e
:
GetHandler
():
RegisterFlagEffect
(
60151108
,
RESET_EVENT
+
0xfe0000
+
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
end
end
function
c60151108
.
sumsuccon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetSummonType
()
==
SUMMON_TYPE_SPECIAL
+
1
end
function
c60151108
.
sumsuc
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ct
=
e
:
GetHandler
():
GetFlagEffect
(
60151108
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
+
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EFFECT_SET_BASE_ATTACK
)
e1
:
SetValue
(
ct
*
400
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e
:
GetHandler
():
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_SET_BASE_DEFENSE
)
e
:
GetHandler
():
RegisterEffect
(
e2
)
end
function
c60151108
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151108
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151108
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
1
-
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
function
c60151108
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151108
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151108
.
filter3
(
c
)
return
true
end
function
c60151108
.
filter4
(
c
,
tp
)
return
c
:
GetOwner
()
==
tp
and
c
:
IsLocation
(
LOCATION_GRAVE
)
end
function
c60151108
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsFacedown
()
then
return
end
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151108
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151108
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
if
res
==
1
then
local
ct1
=
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_ONFIELD
+
LOCATION_HAND
,
0
)
local
ct2
=
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_ONFIELD
+
LOCATION_HAND
)
local
a
=
Group
.
CreateGroup
()
if
ct1
>
ct2
then
local
g2
=
Duel
.
GetMatchingGroup
(
c60151108
.
filter3
,
tp
,
LOCATION_ONFIELD
+
LOCATION_HAND
,
0
,
nil
)
if
g2
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g2
:
Select
(
tp
,
ct1
-
ct2
,
ct1
-
ct2
,
nil
)
Duel
.
HintSelection
(
sg
)
Duel
.
SendtoGrave
(
sg
,
REASON_RULE
)
Duel
.
BreakEffect
()
local
og
=
Duel
.
GetOperatedGroup
()
local
ct
=
og
:
FilterCount
(
c60151108
.
filter4
,
nil
,
tp
)
if
ct
>
0
then
Duel
.
Draw
(
tp
,
ct
-
1
,
REASON_EFFECT
)
end
end
elseif
ct1
<
ct2
then
local
g2
=
Duel
.
GetMatchingGroup
(
c60151108
.
filter3
,
1
-
tp
,
LOCATION_ONFIELD
+
LOCATION_HAND
,
0
,
nil
)
if
g2
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
1
-
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g2
:
Select
(
1
-
tp
,
ct2
-
ct1
,
ct2
-
ct1
,
nil
)
Duel
.
HintSelection
(
sg
)
Duel
.
SendtoGrave
(
sg
,
REASON_RULE
)
Duel
.
BreakEffect
()
local
og
=
Duel
.
GetOperatedGroup
()
local
ct
=
og
:
FilterCount
(
c60151108
.
filter4
,
nil
,
tp
)
if
ct
>
0
then
Duel
.
Draw
(
tp
,
ct
-
1
,
REASON_EFFECT
)
end
end
else
return
false
end
end
end
function
c60151108
.
spcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
and
re
:
GetHandler
()
~=
e
:
GetHandler
()
and
re
:
GetHandler
():
IsSetCard
(
0x9b23
)
end
function
c60151108
.
sptg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
true
end
end
function
c60151108
.
spop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
60151199
)
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x9b23
))
e2
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
\ No newline at end of file
expansions/script/c60151121.lua
View file @
d9d3234f
--├军团亚席 钢铁之布欧娜┤
function
c60151121
.
initial_effect
(
c
)
--xyz summon
aux
.
AddXyzProcedure
(
c
,
c60151121
.
xyzfilter
,
4
,
2
)
c
:
EnableReviveLimit
()
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCondition
(
c60151121
.
atkcon
)
e1
:
SetTarget
(
c60151121
.
cointg
)
e1
:
SetOperation
(
c60151121
.
coinop
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
0x1e0
)
e2
:
SetTarget
(
c60151121
.
thtg
)
e2
:
SetOperation
(
c60151121
.
thop
)
c
:
RegisterEffect
(
e2
)
end
function
c60151121
.
xyzfilter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
end
function
c60151121
.
atkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_XYZ
)
end
function
c60151121
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151121
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151121
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
end
function
c60151121
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151121
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151121
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151121
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151121
,
0
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151121
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
end
if
res
==
1
then
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
local
tc
=
g
:
GetFirst
()
while
tc
do
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SET_ATTACK_FINAL
)
e1
:
SetValue
(
tc
:
GetAttack
()
/
2
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_SET_DEFENSE_FINAL
)
e2
:
SetValue
(
tc
:
GetDefense
()
/
2
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e2
)
tc
=
g
:
GetNext
()
end
local
e11
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e11
:
SetType
(
EFFECT_TYPE_SINGLE
)
e11
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e11
:
SetValue
(
e
:
GetHandler
():
GetAttack
()
/
2
)
e11
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
)
e
:
GetHandler
():
RegisterEffect
(
e11
)
end
end
function
c60151121
.
filter3
(
c
)
return
not
c
:
IsCode
(
60151121
)
and
c
:
IsAbleToGrave
()
end
function
c60151121
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
e
:
GetHandler
():
CheckRemoveOverlayCard
(
tp
,
1
,
REASON_EFFECT
)
end
end
function
c60151121
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
RemoveOverlayCard
(
tp
,
1
,
1
,
REASON_EFFECT
)
then
Duel
.
BreakEffect
()
--indes
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetDescription
(
aux
.
Stringid
(
60151121
,
1
))
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
1
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
)
e
:
GetHandler
():
RegisterEffect
(
e1
)
--battle indestructable
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e2
:
SetValue
(
1
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
)
e
:
GetHandler
():
RegisterEffect
(
e2
)
end
--├军团亚席 钢铁之布欧娜┤
function
c60151121
.
initial_effect
(
c
)
--xyz summon
aux
.
AddXyzProcedure
(
c
,
c60151121
.
xyzfilter
,
4
,
2
)
c
:
EnableReviveLimit
()
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
+
CATEGORY_ATKCHANGE
+
CATEGORY_DEFCHANGE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCondition
(
c60151121
.
atkcon
)
e1
:
SetTarget
(
c60151121
.
cointg
)
e1
:
SetOperation
(
c60151121
.
coinop
)
c
:
RegisterEffect
(
e1
)
local
e111
=
Effect
.
CreateEffect
(
c
)
e111
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e111
:
SetCategory
(
CATEGORY_ATKCHANGE
+
CATEGORY_DEFCHANGE
)
e111
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e111
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e111
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e111
:
SetCondition
(
c60151121
.
atkcon2
)
e111
:
SetTarget
(
c60151121
.
cointg
)
e111
:
SetOperation
(
c60151121
.
coinop
)
c
:
RegisterEffect
(
e111
)
--to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
0x1e0
)
e2
:
SetTarget
(
c60151121
.
thtg
)
e2
:
SetOperation
(
c60151121
.
thop
)
c
:
RegisterEffect
(
e2
)
end
function
c60151121
.
xyzfilter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
end
function
c60151121
.
atkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetSummonType
()
==
SUMMON_TYPE_XYZ
and
not
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151121
.
atkcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetSummonType
()
==
SUMMON_TYPE_XYZ
and
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151121
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151121
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151121
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_ATKCHANGE
+
CATEGORY_DEFCHANGE
,
nil
,
1
,
1
-
tp
,
LOCATION_MZONE
)
end
function
c60151121
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151121
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151121
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151121
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151121
,
0
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151121
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
end
if
res
==
1
then
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
local
tc
=
g
:
GetFirst
()
while
tc
do
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SET_ATTACK_FINAL
)
e1
:
SetValue
(
tc
:
GetAttack
()
/
2
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_SET_DEFENSE_FINAL
)
e2
:
SetValue
(
tc
:
GetDefense
()
/
2
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e2
)
tc
=
g
:
GetNext
()
end
local
e11
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e11
:
SetType
(
EFFECT_TYPE_SINGLE
)
e11
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e11
:
SetValue
(
e
:
GetHandler
():
GetAttack
()
/
2
)
e11
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
)
e
:
GetHandler
():
RegisterEffect
(
e11
)
end
end
function
c60151121
.
filter3
(
c
)
return
not
c
:
IsCode
(
60151121
)
and
c
:
IsAbleToGrave
()
end
function
c60151121
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
e
:
GetHandler
():
CheckRemoveOverlayCard
(
tp
,
1
,
REASON_EFFECT
)
end
end
function
c60151121
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
RemoveOverlayCard
(
tp
,
1
,
1
,
REASON_EFFECT
)
then
Duel
.
BreakEffect
()
--indes
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetDescription
(
aux
.
Stringid
(
60151121
,
1
))
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
1
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
)
e
:
GetHandler
():
RegisterEffect
(
e1
)
--battle indestructable
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e2
:
SetValue
(
1
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
)
e
:
GetHandler
():
RegisterEffect
(
e2
)
end
end
\ No newline at end of file
expansions/script/c60151123.lua
View file @
d9d3234f
--├军团亚席 极舞之赛尔菲┤
function
c60151123
.
initial_effect
(
c
)
--synchro summon
aux
.
AddSynchroProcedure
(
c
,
c60151123
.
tfilter
,
aux
.
NonTuner
(
Card
.
IsSetCard
,
0x9b23
),
1
)
c
:
EnableReviveLimit
()
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCondition
(
c60151123
.
atkcon
)
e1
:
SetTarget
(
c60151123
.
cointg
)
e1
:
SetOperation
(
c60151123
.
coinop
)
c
:
RegisterEffect
(
e1
)
--remove
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_ATKCHANGE
+
CATEGORY_TOGRAVE
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGETEFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetHintTiming
(
0
,
0x1e0
)
e2
:
SetTarget
(
c60151123
.
rmtg
)
e2
:
SetOperation
(
c60151123
.
rmop
)
c
:
RegisterEffect
(
e2
)
end
function
c60151123
.
tfilter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
end
function
c60151123
.
atkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_SYNCHRO
)
end
function
c60151123
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151123
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151123
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
end
function
c60151123
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151123
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151123
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151123
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151123
,
0
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151123
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
end
if
res
==
1
then
--attack all
local
e4
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e4
:
SetDescription
(
aux
.
Stringid
(
60151123
,
1
))
e4
:
SetType
(
EFFECT_TYPE_SINGLE
)
e4
:
SetCode
(
EFFECT_ATTACK_ALL
)
e4
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e4
:
SetValue
(
1
)
e4
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e
:
GetHandler
():
RegisterEffect
(
e4
)
end
end
function
c60151123
.
filter3
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsCode
(
60151123
)
and
c
:
IsAbleToGrave
()
end
function
c60151123
.
rmtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c60151123
.
filter3
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_ATKCHANGE
,
g
,
1
,
0
,
0
)
end
function
c60151123
.
rmop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151123
.
filter3
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
if
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
then
Duel
.
BreakEffect
()
local
tc
=
Duel
.
GetFirstTarget
()
local
tc2
=
g1
:
GetFirst
()
local
atk
=
tc2
:
GetAttack
()
local
def
=
tc2
:
GetDefense
()
if
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
-
atk
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
e2
:
SetValue
(
-
atk
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e2
)
end
end
end
--├军团亚席 极舞之赛尔菲┤
function
c60151123
.
initial_effect
(
c
)
--synchro summon
aux
.
AddSynchroProcedure
(
c
,
c60151123
.
tfilter
,
aux
.
NonTuner
(
Card
.
IsSetCard
,
0x9b23
),
1
)
c
:
EnableReviveLimit
()
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
+
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCondition
(
c60151123
.
atkcon
)
e1
:
SetTarget
(
c60151123
.
cointg
)
e1
:
SetOperation
(
c60151123
.
coinop
)
c
:
RegisterEffect
(
e1
)
local
e111
=
Effect
.
CreateEffect
(
c
)
e111
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e111
:
SetCategory
(
CATEGORY_TOGRAVE
)
e111
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e111
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e111
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e111
:
SetCondition
(
c60151123
.
atkcon2
)
e111
:
SetTarget
(
c60151123
.
cointg
)
e111
:
SetOperation
(
c60151123
.
coinop
)
c
:
RegisterEffect
(
e111
)
--remove
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_ATKCHANGE
+
CATEGORY_TOGRAVE
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetHintTiming
(
0
,
0x1e0
)
e2
:
SetTarget
(
c60151123
.
rmtg
)
e2
:
SetOperation
(
c60151123
.
rmop
)
c
:
RegisterEffect
(
e2
)
end
function
c60151123
.
tfilter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
end
function
c60151123
.
atkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetSummonType
()
==
SUMMON_TYPE_SYNCHRO
and
not
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151123
.
atkcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetSummonType
()
==
SUMMON_TYPE_SYNCHRO
and
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151123
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151123
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151123
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
end
function
c60151123
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151123
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151123
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151123
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151123
,
0
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151123
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
end
if
res
==
1
then
--attack all
local
e4
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e4
:
SetDescription
(
aux
.
Stringid
(
60151123
,
1
))
e4
:
SetType
(
EFFECT_TYPE_SINGLE
)
e4
:
SetCode
(
EFFECT_ATTACK_ALL
)
e4
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e4
:
SetValue
(
1
)
e4
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e
:
GetHandler
():
RegisterEffect
(
e4
)
end
end
function
c60151123
.
filter3
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsCode
(
60151123
)
and
c
:
IsAbleToGrave
()
end
function
c60151123
.
rmtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c60151123
.
filter3
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_ATKCHANGE
,
g
,
1
,
0
,
0
)
end
function
c60151123
.
rmop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151123
.
filter3
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
if
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
then
Duel
.
BreakEffect
()
local
tc
=
Duel
.
GetFirstTarget
()
local
tc2
=
g1
:
GetFirst
()
local
atk
=
tc2
:
GetAttack
()
local
def
=
tc2
:
GetDefense
()
if
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
-
atk
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
e2
:
SetValue
(
-
atk
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e2
)
end
end
end
end
\ No newline at end of file
expansions/script/c60151125.lua
View file @
d9d3234f
--├军团次席 断罪者卡斯芙┤
function
c60151125
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
0
,
60151125
)
--xyz summon
aux
.
AddXyzProcedure
(
c
,
c60151125
.
xyzfilter
,
8
,
2
)
c
:
EnableReviveLimit
()
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCondition
(
c60151125
.
atkcon
)
e1
:
SetTarget
(
c60151125
.
cointg
)
e1
:
SetOperation
(
c60151125
.
coinop
)
c
:
RegisterEffect
(
e1
)
end
function
c60151125
.
xyzfilter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
end
function
c60151125
.
atkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_XYZ
)
end
function
c60151125
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151125
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151125
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
end
function
c60151125
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151125
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151125
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151125
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
local
e11
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e11
:
SetType
(
EFFECT_TYPE_SINGLE
)
e11
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e11
:
SetValue
(
1000
)
e11
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e
:
GetHandler
():
RegisterEffect
(
e11
)
end
if
res
==
1
then
--disable and destroy
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151123
,
1
))
e1
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_FIELD
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EVENT_CHAIN_ACTIVATING
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e1
:
SetCondition
(
c60151125
.
indcon
)
e1
:
SetOperation
(
c60151125
.
disop
)
c
:
RegisterEffect
(
e1
)
end
end
function
c60151125
.
indcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetOverlayCount
()
>
0
end
function
c60151125
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
ep
==
tp
then
return
end
local
loc
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TRIGGERING_LOCATION
)
if
(
loc
==
LOCATION_MZONE
or
loc
==
LOCATION_SZONE
)
then
Duel
.
Hint
(
HINT_CARD
,
0
,
60151125
)
local
res
=
0
res
=
Duel
.
TossCoin
(
tp
,
1
)
if
res
==
0
then
e
:
GetHandler
():
RemoveOverlayCard
(
tp
,
1
,
1
,
REASON_EFFECT
)
end
if
res
==
1
then
local
rc
=
re
:
GetHandler
()
Duel
.
NegateEffect
(
ev
)
if
rc
:
IsRelateToEffect
(
re
)
and
not
rc
:
IsImmuneToEffect
(
e
)
then
if
rc
:
IsType
(
TYPE_MONSTER
)
then
local
og
=
rc
:
GetOverlayGroup
()
if
og
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
og
,
REASON_RULE
)
end
Duel
.
Overlay
(
e
:
GetHandler
(),
Group
.
FromCards
(
rc
))
end
if
rc
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
then
rc
:
CancelToGrave
()
Duel
.
Overlay
(
e
:
GetHandler
(),
Group
.
FromCards
(
rc
))
end
end
end
end
end
function
c60151125
.
filter3
(
c
)
return
not
c
:
IsCode
(
60151125
)
and
c
:
IsAbleToGrave
()
end
function
c60151125
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
e
:
GetHandler
():
CheckRemoveOverlayCard
(
tp
,
1
,
REASON_EFFECT
)
end
end
function
c60151125
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
e
:
GetHandler
():
RemoveOverlayCard
(
tp
,
1
,
1
,
REASON_EFFECT
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_NEGATE
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_CHAIN_ACTIVATING
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetOperation
(
c60151125
.
activate
)
Duel
.
RegisterEffect
(
e1
,
1
-
tp
)
end
end
function
c60151125
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
loc
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TRIGGERING_LOCATION
)
if
(
loc
==
LOCATION_HAND
or
loc
==
LOCATION_GRAVE
or
loc
==
LOCATION_DECK
or
loc
==
LOCATION_REMOVED
or
loc
==
LOCATION_EXTRA
or
loc
==
LOCATION_OVERLAY
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x9b23
)
then
Duel
.
NegateEffect
(
ev
)
end
--├军团次席 断罪者卡斯芙┤
function
c60151125
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
0
,
60151125
)
--xyz summon
aux
.
AddXyzProcedure
(
c
,
c60151125
.
xyzfilter
,
8
,
2
)
c
:
EnableReviveLimit
()
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
+
CATEGORY_ATKCHANGE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCondition
(
c60151125
.
atkcon
)
e1
:
SetTarget
(
c60151125
.
cointg
)
e1
:
SetOperation
(
c60151125
.
coinop
)
c
:
RegisterEffect
(
e1
)
local
e111
=
Effect
.
CreateEffect
(
c
)
e111
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e111
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e111
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e111
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e111
:
SetCondition
(
c60151125
.
atkcon2
)
e111
:
SetTarget
(
c60151125
.
cointg
)
e111
:
SetOperation
(
c60151125
.
coinop
)
c
:
RegisterEffect
(
e111
)
end
function
c60151125
.
xyzfilter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
end
function
c60151125
.
atkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetSummonType
()
==
SUMMON_TYPE_XYZ
and
not
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151125
.
atkcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetSummonType
()
==
SUMMON_TYPE_XYZ
and
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151125
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151125
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151125
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
end
function
c60151125
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151125
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151125
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151125
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
local
e11
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e11
:
SetType
(
EFFECT_TYPE_SINGLE
)
e11
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e11
:
SetValue
(
1000
)
e11
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e
:
GetHandler
():
RegisterEffect
(
e11
)
end
if
res
==
1
then
--disable and destroy
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151123
,
1
))
e1
:
SetCategory
(
CATEGORY_DISABLE
)
e1
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_FIELD
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EVENT_CHAIN_ACTIVATING
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e1
:
SetCondition
(
c60151125
.
indcon
)
e1
:
SetOperation
(
c60151125
.
disop
)
c
:
RegisterEffect
(
e1
)
end
end
function
c60151125
.
indcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetOverlayCount
()
>
0
end
function
c60151125
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
ep
==
tp
then
return
end
local
loc
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TRIGGERING_LOCATION
)
if
(
loc
==
LOCATION_MZONE
or
loc
==
LOCATION_SZONE
)
then
Duel
.
Hint
(
HINT_CARD
,
0
,
60151125
)
local
res
=
0
res
=
Duel
.
TossCoin
(
tp
,
1
)
if
res
==
0
then
e
:
GetHandler
():
RemoveOverlayCard
(
tp
,
1
,
1
,
REASON_EFFECT
)
end
if
res
==
1
then
local
rc
=
re
:
GetHandler
()
Duel
.
NegateEffect
(
ev
)
if
rc
:
IsRelateToEffect
(
re
)
and
not
rc
:
IsImmuneToEffect
(
e
)
then
if
rc
:
IsType
(
TYPE_MONSTER
)
then
local
og
=
rc
:
GetOverlayGroup
()
if
og
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
og
,
REASON_RULE
)
end
Duel
.
Overlay
(
e
:
GetHandler
(),
Group
.
FromCards
(
rc
))
end
if
rc
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
then
rc
:
CancelToGrave
()
Duel
.
Overlay
(
e
:
GetHandler
(),
Group
.
FromCards
(
rc
))
end
end
end
end
end
function
c60151125
.
filter3
(
c
)
return
not
c
:
IsCode
(
60151125
)
and
c
:
IsAbleToGrave
()
end
function
c60151125
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
e
:
GetHandler
():
CheckRemoveOverlayCard
(
tp
,
1
,
REASON_EFFECT
)
end
end
function
c60151125
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
e
:
GetHandler
():
RemoveOverlayCard
(
tp
,
1
,
1
,
REASON_EFFECT
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_NEGATE
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_CHAIN_ACTIVATING
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetOperation
(
c60151125
.
activate
)
Duel
.
RegisterEffect
(
e1
,
1
-
tp
)
end
end
function
c60151125
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
loc
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TRIGGERING_LOCATION
)
if
(
loc
==
LOCATION_HAND
or
loc
==
LOCATION_GRAVE
or
loc
==
LOCATION_DECK
or
loc
==
LOCATION_REMOVED
or
loc
==
LOCATION_EXTRA
or
loc
==
LOCATION_OVERLAY
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x9b23
)
then
Duel
.
NegateEffect
(
ev
)
end
end
\ No newline at end of file
expansions/script/c60151127.lua
View file @
d9d3234f
--├军团次席 律法者丽安塔┤
function
c60151127
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
0
,
60151127
)
--synchro summon
aux
.
AddSynchroProcedure
(
c
,
c60151127
.
tfilter
,
aux
.
NonTuner
(
Card
.
IsSetCard
,
0x9b23
),
2
)
c
:
EnableReviveLimit
()
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCondition
(
c60151127
.
atkcon
)
e1
:
SetTarget
(
c60151127
.
cointg
)
e1
:
SetOperation
(
c60151127
.
coinop
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
0x1e0
)
e2
:
SetTarget
(
c60151127
.
destg
)
e2
:
SetOperation
(
c60151127
.
desop
)
c
:
RegisterEffect
(
e2
)
end
function
c60151127
.
tfilter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
end
function
c60151127
.
atkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_SYNCHRO
)
end
function
c60151127
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151127
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151127
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
end
function
c60151127
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151127
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151127
.
filter
(
c
)
return
c
:
IsSummonType
(
SUMMON_TYPE_SPECIAL
)
and
c
:
IsDestructable
()
end
function
c60151127
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151127
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
local
g
=
Duel
.
GetMatchingGroup
(
c60151127
.
filter
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
if
res
==
1
then
--disable and destroy
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151123
,
1
))
e1
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_FIELD
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EVENT_SPSUMMON
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e1
:
SetCondition
(
c60151127
.
condition
)
e1
:
SetOperation
(
c60151127
.
disop
)
c
:
RegisterEffect
(
e1
)
end
end
function
c60151127
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
tp
~=
ep
end
function
c60151127
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_CARD
,
0
,
60151127
)
local
res
=
0
res
=
Duel
.
TossCoin
(
tp
,
1
)
if
res
==
0
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151127
,
0
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151127
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
end
if
res
==
1
then
Duel
.
NegateSummon
(
eg
)
Duel
.
SendtoDeck
(
eg
,
nil
,
2
,
REASON_EFFECT
)
end
end
function
c60151127
.
filter3
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToDeck
()
end
function
c60151127
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60151127
.
filter3
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c60151127
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
local
g
=
Duel
.
GetMatchingGroup
(
c60151127
.
filter3
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
local
g1
=
Duel
.
GetMatchingGroup
(
c60151127
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
g1
,
1
,
0
,
0
)
end
function
c60151127
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151127
.
filter3
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_EFFECT
)
Duel
.
ShuffleDeck
(
tp
)
if
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151127
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151127
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
end
--├军团次席 律法者丽安塔┤
function
c60151127
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
0
,
60151127
)
--synchro summon
aux
.
AddSynchroProcedure
(
c
,
c60151127
.
tfilter
,
aux
.
NonTuner
(
Card
.
IsSetCard
,
0x9b23
),
2
)
c
:
EnableReviveLimit
()
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e1
:
SetCategory
(
CATEGORY_COIN
+
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCondition
(
c60151127
.
atkcon
)
e1
:
SetTarget
(
c60151127
.
cointg
)
e1
:
SetOperation
(
c60151127
.
coinop
)
c
:
RegisterEffect
(
e1
)
local
e111
=
Effect
.
CreateEffect
(
c
)
e111
:
SetDescription
(
aux
.
Stringid
(
60151101
,
2
))
e111
:
SetCategory
(
CATEGORY_DESTROY
)
e111
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e111
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e111
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e111
:
SetCondition
(
c60151127
.
atkcon2
)
e111
:
SetTarget
(
c60151127
.
cointg
)
e111
:
SetOperation
(
c60151127
.
coinop
)
c
:
RegisterEffect
(
e111
)
--to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_DRAW
+
CATEGORY_TOGRAVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
0x1e0
)
e2
:
SetTarget
(
c60151127
.
destg
)
e2
:
SetOperation
(
c60151127
.
desop
)
c
:
RegisterEffect
(
e2
)
end
function
c60151127
.
tfilter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
end
function
c60151127
.
atkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetSummonType
()
==
SUMMON_TYPE_SYNCHRO
and
not
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151127
.
atkcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetSummonType
()
==
SUMMON_TYPE_SYNCHRO
and
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151127
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151127
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151127
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
nil
,
1
,
1
-
tp
,
LOCATION_MZONE
)
end
end
function
c60151127
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151127
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151127
.
filter
(
c
)
return
bit
.
band
(
c
:
GetSummonType
(),
SUMMON_TYPE_SPECIAL
)
==
SUMMON_TYPE_SPECIAL
and
c
:
IsDestructable
()
end
function
c60151127
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151127
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
local
g
=
Duel
.
GetMatchingGroup
(
c60151127
.
filter
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
if
res
==
1
then
--disable and destroy
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60151123
,
1
))
e1
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_FIELD
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EVENT_SPSUMMON
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e1
:
SetCondition
(
c60151127
.
condition
)
e1
:
SetOperation
(
c60151127
.
disop
)
c
:
RegisterEffect
(
e1
)
end
end
function
c60151127
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
tp
~=
ep
end
function
c60151127
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_CARD
,
0
,
60151127
)
local
res
=
0
res
=
Duel
.
TossCoin
(
tp
,
1
)
if
res
==
0
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151127
,
0
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151127
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
end
if
res
==
1
then
Duel
.
NegateSummon
(
eg
)
Duel
.
SendtoDeck
(
eg
,
nil
,
2
,
REASON_EFFECT
)
end
end
function
c60151127
.
filter3
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToDeck
()
end
function
c60151127
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60151127
.
filter3
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c60151127
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
local
g
=
Duel
.
GetMatchingGroup
(
c60151127
.
filter3
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
local
g1
=
Duel
.
GetMatchingGroup
(
c60151127
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
g1
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
function
c60151127
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151127
.
filter3
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_EFFECT
)
Duel
.
ShuffleDeck
(
tp
)
if
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151127
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151127
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
end
end
\ No newline at end of file
expansions/script/c60151128.lua
View file @
d9d3234f
--├军团首席 全能之玛特咖┤
function
c60151128
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
0
,
60151128
)
--xyz summon
aux
.
AddXyzProcedure
(
c
,
c60151128
.
xyzfilter
,
12
,
2
)
c
:
EnableReviveLimit
()
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_COIN
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
+
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_CANNOT_NEGATE
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCondition
(
c60151128
.
atkcon
)
e1
:
SetTarget
(
c60151128
.
cointg
)
e1
:
SetOperation
(
c60151128
.
coinop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_DISABLE
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCondition
(
c60151128
.
atkcon2
)
e2
:
SetTarget
(
c60151128
.
target
)
e2
:
SetOperation
(
c60151128
.
activate
)
c
:
RegisterEffect
(
e2
)
--destroy replace
local
e7
=
Effect
.
CreateEffect
(
c
)
e7
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e7
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e7
:
SetCode
(
EFFECT_DESTROY_REPLACE
)
e7
:
SetRange
(
LOCATION_MZONE
)
e7
:
SetTarget
(
c60151128
.
reptg
)
c
:
RegisterEffect
(
e7
)
end
function
c60151128
.
xyzfilter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
end
function
c60151128
.
atkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_XYZ
)
and
e
:
GetHandler
():
GetOverlayGroup
():
IsExists
(
Card
.
IsSetCard
,
1
,
nil
,
0x9b23
)
end
function
c60151128
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151128
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151128
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
end
function
c60151128
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151128
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151128
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
if
res
==
1
then
--
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetDescription
(
aux
.
Stringid
(
60151123
,
1
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetTargetRange
(
0
,
1
)
e2
:
SetValue
(
aux
.
TRUE
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e2
:
SetCondition
(
c60151128
.
limcon
)
e
:
GetHandler
():
RegisterEffect
(
e2
)
end
end
function
c60151128
.
limcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetCurrentChain
()
<
1
end
function
c60151128
.
atkcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetOverlayGroup
():
IsExists
(
Card
.
IsSetCard
,
1
,
nil
,
0x9b23
)
end
function
c60151128
.
filter
(
c
,
e
,
tp
)
return
c
:
GetSummonPlayer
()
==
tp
and
not
c
:
IsDisabled
()
and
(
not
e
or
(
c
:
IsRelateToEffect
(
e
)
and
c
:
IsLocation
(
LOCATION_MZONE
)))
end
function
c60151128
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
local
a
=
eg
:
FilterCount
(
c60151128
.
filter
,
nil
,
nil
,
1
-
tp
)
local
b
=
Duel
.
GetMatchingGroupCount
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
return
eg
:
IsExists
(
c60151128
.
filter
,
1
,
nil
,
nil
,
1
-
tp
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
b
>=
a
and
c
:
GetFlagEffect
(
60151128
)
==
0
end
local
g
=
eg
:
Filter
(
c60151128
.
filter
,
nil
,
nil
,
1
-
tp
)
local
g1
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
Duel
.
SetTargetCard
(
g
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
g1
,
g
:
GetCount
(),
0
,
0
)
c
:
RegisterFlagEffect
(
60151128
,
RESET_CHAIN
,
0
,
1
)
end
function
c60151128
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tg
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
)
local
g
=
tg
:
Filter
(
c60151128
.
filter
,
nil
,
e
,
1
-
tp
)
local
b
=
Duel
.
GetMatchingGroupCount
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
if
g
:
GetCount
()
>
0
and
b
>
0
and
b
>=
g
:
GetCount
()
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
g
:
GetCount
(),
g
:
GetCount
(),
nil
)
if
g1
:
GetCount
()
>
0
then
if
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
then
local
tc
=
g
:
GetFirst
()
while
tc
do
if
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
and
not
tc
:
IsDisabled
()
then
Duel
.
NegateRelatedChain
(
tc
,
RESET_TURN_SET
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetValue
(
RESET_TURN_SET
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
60151128
,
1
))
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_CLIENT_HINT
)
e3
:
SetCode
(
EFFECT_CANNOT_BE_FUSION_MATERIAL
)
e3
:
SetValue
(
1
)
e3
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e3
)
local
e4
=
e3
:
Clone
()
e4
:
SetCode
(
EFFECT_CANNOT_BE_SYNCHRO_MATERIAL
)
tc
:
RegisterEffect
(
e4
)
local
e5
=
e3
:
Clone
()
e5
:
SetCode
(
EFFECT_CANNOT_BE_XYZ_MATERIAL
)
tc
:
RegisterEffect
(
e5
)
end
tc
=
g
:
GetNext
()
end
end
end
end
end
function
c60151128
.
reptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsReason
(
REASON_BATTLE
+
REASON_EFFECT
)
and
c
:
CheckRemoveOverlayCard
(
tp
,
1
,
REASON_EFFECT
)
end
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151128
,
2
))
then
c
:
RemoveOverlayCard
(
tp
,
1
,
1
,
REASON_EFFECT
)
return
true
else
return
false
end
--├军团首席 全能之玛特咖┤
function
c60151128
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
0
,
60151128
)
--xyz summon
aux
.
AddXyzProcedure
(
c
,
c60151128
.
xyzfilter
,
12
,
2
)
c
:
EnableReviveLimit
()
--coin
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_COIN
+
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
+
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_CANNOT_NEGATE
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCondition
(
c60151128
.
atkcon
)
e1
:
SetTarget
(
c60151128
.
cointg
)
e1
:
SetOperation
(
c60151128
.
coinop
)
c
:
RegisterEffect
(
e1
)
local
e111
=
Effect
.
CreateEffect
(
c
)
e111
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e111
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
+
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_CANNOT_NEGATE
)
e111
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e111
:
SetCondition
(
c60151128
.
atkcon2
)
e111
:
SetTarget
(
c60151128
.
cointg
)
e111
:
SetOperation
(
c60151128
.
coinop
)
c
:
RegisterEffect
(
e111
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_DISABLE
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCondition
(
c60151128
.
atkcon2
)
e2
:
SetTarget
(
c60151128
.
target
)
e2
:
SetOperation
(
c60151128
.
activate
)
c
:
RegisterEffect
(
e2
)
--destroy replace
local
e7
=
Effect
.
CreateEffect
(
c
)
e7
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e7
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e7
:
SetCode
(
EFFECT_DESTROY_REPLACE
)
e7
:
SetRange
(
LOCATION_MZONE
)
e7
:
SetTarget
(
c60151128
.
reptg
)
c
:
RegisterEffect
(
e7
)
end
function
c60151128
.
xyzfilter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
end
function
c60151128
.
atkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetSummonType
()
==
SUMMON_TYPE_XYZ
and
e
:
GetHandler
():
GetOverlayGroup
():
IsExists
(
Card
.
IsSetCard
,
1
,
nil
,
0x9b23
)
and
not
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151128
.
atkcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetSummonType
()
==
SUMMON_TYPE_XYZ
and
e
:
GetHandler
():
GetOverlayGroup
():
IsExists
(
Card
.
IsSetCard
,
1
,
nil
,
0x9b23
)
and
e
:
GetHandler
():
IsHasEffect
(
60151199
)
end
function
c60151128
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
e
:
GetHandler
():
IsHasEffect
(
60151199
)
then
Duel
.
SetChainLimit
(
c60151128
.
chlimit
)
Duel
.
RegisterFlagEffect
(
tp
,
60151128
,
RESET_CHAIN
,
0
,
1
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
local
sg
=
Duel
.
GetMatchingGroup
(
aux
.
TRUE
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
sg
,
sg
:
GetCount
(),
0
,
0
)
end
end
function
c60151128
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60151128
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
res
=
0
if
Duel
.
GetFlagEffect
(
tp
,
60151128
)
>
0
then
res
=
1
else
res
=
Duel
.
TossCoin
(
tp
,
1
)
end
if
res
==
0
then
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
if
res
==
1
then
--
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetDescription
(
aux
.
Stringid
(
60151123
,
1
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetTargetRange
(
0
,
1
)
e2
:
SetValue
(
aux
.
TRUE
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e2
:
SetCondition
(
c60151128
.
limcon
)
e
:
GetHandler
():
RegisterEffect
(
e2
)
end
end
function
c60151128
.
limcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetCurrentChain
()
<
1
end
function
c60151128
.
atkcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetOverlayGroup
():
IsExists
(
Card
.
IsSetCard
,
1
,
nil
,
0x9b23
)
end
function
c60151128
.
filter
(
c
,
e
,
tp
)
return
c
:
GetSummonPlayer
()
==
tp
and
not
c
:
IsDisabled
()
and
(
not
e
or
(
c
:
IsRelateToEffect
(
e
)
and
c
:
IsLocation
(
LOCATION_MZONE
)))
end
function
c60151128
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
local
a
=
eg
:
FilterCount
(
c60151128
.
filter
,
nil
,
nil
,
1
-
tp
)
local
b
=
Duel
.
GetMatchingGroupCount
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
return
eg
:
IsExists
(
c60151128
.
filter
,
1
,
nil
,
nil
,
1
-
tp
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
b
>=
a
and
c
:
GetFlagEffect
(
60151128
)
==
0
end
local
g
=
eg
:
Filter
(
c60151128
.
filter
,
nil
,
nil
,
1
-
tp
)
local
g1
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
Duel
.
SetTargetCard
(
g
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
g1
,
g
:
GetCount
(),
0
,
0
)
c
:
RegisterFlagEffect
(
60151128
,
RESET_CHAIN
,
0
,
1
)
end
function
c60151128
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tg
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
)
local
g
=
tg
:
Filter
(
c60151128
.
filter
,
nil
,
e
,
1
-
tp
)
local
b
=
Duel
.
GetMatchingGroupCount
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
if
g
:
GetCount
()
>
0
and
b
>
0
and
b
>=
g
:
GetCount
()
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
g
:
GetCount
(),
g
:
GetCount
(),
nil
)
if
g1
:
GetCount
()
>
0
then
if
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
then
local
tc
=
g
:
GetFirst
()
while
tc
do
if
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
and
not
tc
:
IsDisabled
()
then
Duel
.
NegateRelatedChain
(
tc
,
RESET_TURN_SET
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetValue
(
RESET_TURN_SET
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
60151128
,
1
))
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_CLIENT_HINT
)
e3
:
SetCode
(
EFFECT_CANNOT_BE_FUSION_MATERIAL
)
e3
:
SetValue
(
1
)
e3
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e3
)
local
e4
=
e3
:
Clone
()
e4
:
SetCode
(
EFFECT_CANNOT_BE_SYNCHRO_MATERIAL
)
tc
:
RegisterEffect
(
e4
)
local
e5
=
e3
:
Clone
()
e5
:
SetCode
(
EFFECT_CANNOT_BE_XYZ_MATERIAL
)
tc
:
RegisterEffect
(
e5
)
end
tc
=
g
:
GetNext
()
end
end
end
end
end
function
c60151128
.
reptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsReason
(
REASON_BATTLE
+
REASON_EFFECT
)
and
c
:
CheckRemoveOverlayCard
(
tp
,
1
,
REASON_EFFECT
)
end
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151128
,
2
))
then
c
:
RemoveOverlayCard
(
tp
,
1
,
1
,
REASON_EFFECT
)
return
true
else
return
false
end
end
\ No newline at end of file
expansions/script/c60151196.lua
View file @
d9d3234f
--├宁静的行程┤
function
c60151196
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCountLimit
(
1
,
60151196
)
e1
:
SetTarget
(
c60151196
.
target
)
e1
:
SetOperation
(
c60151196
.
activate
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_TO_GRAVE
)
e2
:
SetCountLimit
(
1
,
60151196
)
e2
:
SetCondition
(
c60151196
.
drcon
)
e2
:
SetTarget
(
c60151196
.
drtg
)
e2
:
SetOperation
(
c60151196
.
drop
)
c
:
RegisterEffect
(
e2
)
end
function
c60151196
.
tgfilter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsAbleToGrave
()
end
function
c60151196
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60151196
.
tgfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c60151196
.
tgfilter2
(
c
,
ttype
)
return
c
:
IsType
(
ttype
)
and
c
:
IsFaceup
()
and
c
:
IsAbleToDeck
()
end
function
c60151196
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151196
.
tgfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
e
:
GetHandler
())
local
tc
=
g
:
GetFirst
()
if
tc
and
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
~=
0
and
tc
:
IsLocation
(
LOCATION_GRAVE
)
then
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Draw
(
p
,
d
,
REASON_EFFECT
)
local
ttype
=
bit
.
band
(
tc
:
GetType
(),
0x7
)
local
g2
=
Duel
.
GetMatchingGroup
(
c60151196
.
tgfilter2
,
tp
,
0
,
LOCATION_ONFIELD
,
nil
,
ttype
)
if
g2
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151196
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
sg
=
g2
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
sg
)
Duel
.
SendtoDeck
(
sg
,
nil
,
2
,
REASON_EFFECT
)
end
end
end
function
c60151196
.
drcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
end
function
c60151196
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsAbleToHand
()
end
function
c60151196
.
drtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60151196
.
thfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
end
function
c60151196
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151196
.
thfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
e
:
GetHandler
())
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
if
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
~=
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
local
g2
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
if
g2
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151101
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g2
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
end
--├宁静的行程┤
function
c60151196
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TOGRAVE
+
CATEGORY_DRAW
+
CATEGORY_TODECK
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCountLimit
(
1
,
60151196
)
e1
:
SetTarget
(
c60151196
.
target
)
e1
:
SetOperation
(
c60151196
.
activate
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_TOGRAVE
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_TO_GRAVE
)
e2
:
SetCountLimit
(
1
,
60151196
)
e2
:
SetCondition
(
c60151196
.
drcon
)
e2
:
SetTarget
(
c60151196
.
drtg
)
e2
:
SetOperation
(
c60151196
.
drop
)
c
:
RegisterEffect
(
e2
)
end
function
c60151196
.
tgfilter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsAbleToGrave
()
end
function
c60151196
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60151196
.
tgfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
nil
,
1
,
1
-
tp
,
LOCATION_ONFIELD
)
end
function
c60151196
.
tgfilter2
(
c
,
ttype
)
return
c
:
IsType
(
ttype
)
and
c
:
IsFaceup
()
and
c
:
IsAbleToDeck
()
end
function
c60151196
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151196
.
tgfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
e
:
GetHandler
())
local
tc
=
g
:
GetFirst
()
if
tc
and
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
~=
0
and
tc
:
IsLocation
(
LOCATION_GRAVE
)
then
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Draw
(
p
,
d
,
REASON_EFFECT
)
local
ttype
=
bit
.
band
(
tc
:
GetType
(),
0x7
)
local
g2
=
Duel
.
GetMatchingGroup
(
c60151196
.
tgfilter2
,
tp
,
0
,
LOCATION_ONFIELD
,
nil
,
ttype
)
if
g2
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151196
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
sg
=
g2
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
sg
)
Duel
.
SendtoDeck
(
sg
,
nil
,
2
,
REASON_EFFECT
)
end
end
end
function
c60151196
.
drcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
end
function
c60151196
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsAbleToHand
()
end
function
c60151196
.
drtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60151196
.
thfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
function
c60151196
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151196
.
thfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
e
:
GetHandler
())
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
if
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
~=
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
local
g2
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
if
g2
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151101
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g2
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
end
end
\ No newline at end of file
expansions/script/c60151197.lua
View file @
d9d3234f
--├腹心反击┤
function
c60151197
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_BE_BATTLE_TARGET
)
e1
:
SetCountLimit
(
1
,
60151197
)
e1
:
SetCondition
(
c60151197
.
condition
)
e1
:
SetTarget
(
c60151197
.
target
)
e1
:
SetOperation
(
c60151197
.
activate
)
c
:
RegisterEffect
(
e1
)
local
e12
=
e1
:
Clone
()
e12
:
SetCode
(
EVENT_BECOME_TARGET
)
c
:
RegisterEffect
(
e12
)
--draw
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60151197
,
1
))
e2
:
SetCategory
(
CATEGORY_DRAW
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_TO_GRAVE
)
e2
:
SetCountLimit
(
1
,
60151197
)
e2
:
SetCondition
(
c60151197
.
drcon
)
e2
:
SetTarget
(
c60151197
.
drtg
)
e2
:
SetOperation
(
c60151197
.
drop
)
c
:
RegisterEffect
(
e2
)
end
function
c60151197
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
eg
:
GetFirst
()
return
tc
:
IsControler
(
tp
)
and
tc
:
IsFaceup
()
and
tc
:
IsSetCard
(
0x9b23
)
and
tc
:
IsType
(
TYPE_MONSTER
)
and
tc
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60151197
.
tgfilter
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151197
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60151197
.
tgfilter
,
tp
,
0
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
function
c60151197
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g2
=
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
Duel
.
ConfirmCards
(
tp
,
g2
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151197
.
tgfilter
,
tp
,
0
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
if
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
~=
0
then
local
g3
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
0
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
nil
)
local
g1
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
if
g3
:
GetCount
()
>
0
and
g1
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151197
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g1
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
sg
)
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
Duel
.
Hint
(
HINT_SELECTMSG
,
1
-
tp
,
HINTMSG_TOGRAVE
)
local
sg2
=
g3
:
Select
(
1
-
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
sg2
)
Duel
.
SendtoGrave
(
sg2
,
REASON_RULE
)
end
end
end
Duel
.
ShuffleHand
(
1
-
tp
)
end
function
c60151197
.
drcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
end
function
c60151197
.
drtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c60151197
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Draw
(
p
,
d
,
REASON_EFFECT
)
--├腹心反击┤
function
c60151197
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_BE_BATTLE_TARGET
)
e1
:
SetCountLimit
(
1
,
60151197
)
e1
:
SetCondition
(
c60151197
.
condition
)
e1
:
SetTarget
(
c60151197
.
target
)
e1
:
SetOperation
(
c60151197
.
activate
)
c
:
RegisterEffect
(
e1
)
local
e12
=
e1
:
Clone
()
e12
:
SetCode
(
EVENT_BECOME_TARGET
)
c
:
RegisterEffect
(
e12
)
--draw
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60151197
,
1
))
e2
:
SetCategory
(
CATEGORY_DRAW
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_TO_GRAVE
)
e2
:
SetCountLimit
(
1
,
60151197
)
e2
:
SetCondition
(
c60151197
.
drcon
)
e2
:
SetTarget
(
c60151197
.
drtg
)
e2
:
SetOperation
(
c60151197
.
drop
)
c
:
RegisterEffect
(
e2
)
end
function
c60151197
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
eg
:
GetFirst
()
return
tc
:
IsControler
(
tp
)
and
tc
:
IsFaceup
()
and
tc
:
IsSetCard
(
0x9b23
)
and
tc
:
IsType
(
TYPE_MONSTER
)
and
tc
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60151197
.
tgfilter
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151197
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60151197
.
tgfilter
,
tp
,
0
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
1
-
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
function
c60151197
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g2
=
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
Duel
.
ConfirmCards
(
tp
,
g2
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60151197
.
tgfilter
,
tp
,
0
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
if
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
~=
0
then
local
g3
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
0
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
nil
)
local
g1
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
e
:
GetHandler
())
if
g3
:
GetCount
()
>
0
and
g1
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151197
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g1
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
sg
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
Duel
.
Hint
(
HINT_SELECTMSG
,
1
-
tp
,
HINTMSG_TOGRAVE
)
local
sg2
=
g3
:
Select
(
1
-
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
sg2
)
Duel
.
SendtoGrave
(
sg2
,
REASON_RULE
)
end
end
end
Duel
.
ShuffleHand
(
1
-
tp
)
end
function
c60151197
.
drcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
end
function
c60151197
.
drtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c60151197
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Draw
(
p
,
d
,
REASON_EFFECT
)
end
\ No newline at end of file
expansions/script/c60151198.lua
View file @
d9d3234f
--├深夜行军┤
function
c60151198
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e1
:
SetCountLimit
(
1
,
60151198
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetTarget
(
c60151198
.
target
)
e1
:
SetOperation
(
c60151198
.
operation
)
c
:
RegisterEffect
(
e1
)
--draw
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60151198
,
1
))
e2
:
SetCategory
(
CATEGORY_DRAW
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_TO_GRAVE
)
e2
:
SetCountLimit
(
1
,
60151198
)
e2
:
SetCondition
(
c60151198
.
drcon
)
e2
:
SetTarget
(
c60151198
.
drtg
)
e2
:
SetOperation
(
c60151198
.
drop
)
c
:
RegisterEffect
(
e2
)
end
function
c60151198
.
filter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c60151198
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
GetMZoneCount
(
tp
)
>
0
and
Duel
.
IsExistingTarget
(
c60151198
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c60151198
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
function
c60151198
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151198
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
if
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151198
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151198
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
e
:
GetHandler
())
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
end
end
function
c60151198
.
drcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
end
function
c60151198
.
drtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c60151198
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Draw
(
p
,
d
,
REASON_EFFECT
)
end
--├深夜行军┤
function
c60151198
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e1
:
SetCountLimit
(
1
,
60151198
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetTarget
(
c60151198
.
target
)
e1
:
SetOperation
(
c60151198
.
operation
)
c
:
RegisterEffect
(
e1
)
--draw
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60151198
,
1
))
e2
:
SetCategory
(
CATEGORY_DRAW
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_TO_GRAVE
)
e2
:
SetCountLimit
(
1
,
60151198
)
e2
:
SetCondition
(
c60151198
.
drcon
)
e2
:
SetTarget
(
c60151198
.
drtg
)
e2
:
SetOperation
(
c60151198
.
drop
)
c
:
RegisterEffect
(
e2
)
end
function
c60151198
.
filter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c60151198
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingTarget
(
c60151198
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c60151198
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
function
c60151198
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151198
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
c
:
IsRelateToEffect
(
e
)
and
tc
:
IsRelateToEffect
(
e
)
then
if
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
~=
0
then
local
g2
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
nil
)
if
g2
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151101
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g2
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
end
end
function
c60151198
.
drcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
end
function
c60151198
.
drtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c60151198
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Draw
(
p
,
d
,
REASON_EFFECT
)
end
\ No newline at end of file
expansions/script/c60151199.lua
View file @
d9d3234f
--├军团┤
function
c60151199
.
initial_effect
(
c
)
c
:
EnableCounterPermit
(
0x1b
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
60151199
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetTarget
(
c60151199
.
cointg
)
e1
:
SetOperation
(
c60151199
.
coinop
)
c
:
RegisterEffect
(
e1
)
--counter
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_TO_GRAVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_CAL
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCondition
(
c60151199
.
ctcon
)
e2
:
SetOperation
(
c60151199
.
ctop
)
c
:
RegisterEffect
(
e2
)
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
60151199
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e3
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x9b23
))
c
:
RegisterEffect
(
e3
)
--special summon
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetCategory
(
CATEGORY_DRAW
)
e5
:
SetDescription
(
aux
.
Stringid
(
60151199
,
0
))
e5
:
SetType
(
EFFECT_TYPE_IGNITION
)
e5
:
SetRange
(
LOCATION_SZONE
)
e5
:
SetCountLimit
(
1
)
e5
:
SetCost
(
c60151199
.
cost3
)
e5
:
SetOperation
(
c60151199
.
op3
)
c
:
RegisterEffect
(
e5
)
end
function
c60151199
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
function
c60151199
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151199
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
local
c
=
e
:
GetHandler
()
local
res
=
0
res
=
Duel
.
TossCoin
(
tp
,
1
)
if
res
==
0
then
Duel
.
SendtoHand
(
c
,
nil
,
REASON_EFFECT
)
end
end
function
c60151199
.
cfilter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
(
c
:
IsReason
(
REASON_EFFECT
))
end
function
c60151199
.
ctcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
and
eg
:
IsExists
(
c60151199
.
cfilter
,
1
,
nil
)
and
re
:
GetHandler
():
IsSetCard
(
0x9b23
)
end
function
c60151199
.
ctop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
eg
then
return
end
local
ct
=
eg
:
FilterCount
(
c60151199
.
cfilter
,
nil
)
e
:
GetHandler
():
AddCounter
(
0x1b
,
ct
)
end
function
c60151199
.
cost3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsCanRemoveCounter
(
tp
,
0x1b
,
3
,
REASON_COST
)
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
e
:
GetHandler
():
RemoveCounter
(
tp
,
0x1b
,
3
,
REASON_COST
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c60151199
.
op3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
if
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151101
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151199
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
--├军团┤
function
c60151199
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
60151199
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetTarget
(
c60151199
.
cointg
)
e1
:
SetOperation
(
c60151199
.
coinop
)
c
:
RegisterEffect
(
e1
)
--counter
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_TO_GRAVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_CAL
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCondition
(
c60151199
.
ctcon
)
e2
:
SetOperation
(
c60151199
.
ctop
)
c
:
RegisterEffect
(
e2
)
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
60151199
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e3
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x9b23
))
c
:
RegisterEffect
(
e3
)
--special summon
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetCategory
(
CATEGORY_DRAW
)
e5
:
SetDescription
(
aux
.
Stringid
(
60151199
,
0
))
e5
:
SetType
(
EFFECT_TYPE_IGNITION
)
e5
:
SetRange
(
LOCATION_SZONE
)
e5
:
SetCountLimit
(
1
)
e5
:
SetCost
(
c60151199
.
cost3
)
e5
:
SetOperation
(
c60151199
.
op3
)
c
:
RegisterEffect
(
e5
)
end
function
c60151199
.
cointg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COIN
,
nil
,
0
,
tp
,
1
)
end
function
c60151199
.
filter2
(
c
)
return
c
:
IsAbleToGrave
()
end
function
c60151199
.
coinop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
local
c
=
e
:
GetHandler
()
local
res
=
0
res
=
Duel
.
TossCoin
(
tp
,
1
)
if
res
==
0
then
Duel
.
SendtoHand
(
c
,
nil
,
REASON_EFFECT
)
end
end
function
c60151199
.
cfilter
(
c
)
return
c
:
IsSetCard
(
0x9b23
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
(
c
:
IsReason
(
REASON_EFFECT
))
end
function
c60151199
.
ctcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
and
eg
:
IsExists
(
c60151199
.
cfilter
,
1
,
nil
)
and
re
:
GetHandler
():
IsSetCard
(
0x9b23
)
end
function
c60151199
.
ctop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
eg
then
return
end
local
ct
=
eg
:
FilterCount
(
c60151199
.
cfilter
,
nil
)
e
:
GetHandler
():
AddCounter
(
0x101b
,
ct
)
end
function
c60151199
.
cost3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsCanRemoveCounter
(
tp
,
0x101b
,
3
,
REASON_COST
)
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
e
:
GetHandler
():
RemoveCounter
(
tp
,
0x101b
,
3
,
REASON_COST
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c60151199
.
op3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
if
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60151101
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60151199
.
filter2
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
end
end
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment