Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-222DIY-cards
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ai
ygopro-222DIY-cards
Commits
002d5777
Commit
002d5777
authored
Aug 27, 2019
by
大崎甜花
Committed by
GitHub
Aug 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add files via upload
parent
60ca4593
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
2196 additions
and
2081 deletions
+2196
-2081
expansions/script/c21520082.lua
expansions/script/c21520082.lua
+153
-158
expansions/script/c21520083.lua
expansions/script/c21520083.lua
+194
-167
expansions/script/c21520085.lua
expansions/script/c21520085.lua
+148
-146
expansions/script/c21520087.lua
expansions/script/c21520087.lua
+237
-241
expansions/script/c21520088.lua
expansions/script/c21520088.lua
+256
-228
expansions/script/c21520183.lua
expansions/script/c21520183.lua
+215
-207
expansions/script/c21520189.lua
expansions/script/c21520189.lua
+191
-191
expansions/script/c24562471.lua
expansions/script/c24562471.lua
+52
-0
expansions/script/c33400007.lua
expansions/script/c33400007.lua
+69
-69
expansions/script/c33400013.lua
expansions/script/c33400013.lua
+90
-89
expansions/script/c33400103.lua
expansions/script/c33400103.lua
+66
-66
expansions/script/c65020067.lua
expansions/script/c65020067.lua
+79
-78
expansions/script/c65020068.lua
expansions/script/c65020068.lua
+80
-79
expansions/script/c65020069.lua
expansions/script/c65020069.lua
+100
-99
expansions/script/c65020070.lua
expansions/script/c65020070.lua
+102
-101
expansions/script/c65020071.lua
expansions/script/c65020071.lua
+71
-70
expansions/script/c65020072.lua
expansions/script/c65020072.lua
+93
-92
No files found.
expansions/script/c21520082.lua
View file @
002d5777
--空间感应者
function
c21520082
.
initial_effect
(
c
)
--fusion material
c
:
EnableReviveLimit
()
aux
.
AddFusionProcFunFunRep
(
c
,
c21520082
.
fsfilter1
,
c21520082
.
fsfilter2
,
1
,
99
,
true
)
--spsummon condition
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_SINGLE
)
e0
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e0
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e0
:
SetValue
(
c21520082
.
splimit
)
c
:
RegisterEffect
(
e0
)
--special summon rule
local
e00
=
Effect
.
CreateEffect
(
c
)
e00
:
SetType
(
EFFECT_TYPE_FIELD
)
e00
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e00
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e00
:
SetRange
(
LOCATION_EXTRA
)
e00
:
SetCondition
(
c21520082
.
sprcon
)
e00
:
SetOperation
(
c21520082
.
sprop
)
e00
:
SetValue
(
SUMMON_TYPE_FUSION
)
c
:
RegisterEffect
(
e00
)
--atk & def
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_MATERIAL_CHECK
)
e1
:
SetValue
(
c21520082
.
matcheck
)
c
:
RegisterEffect
(
e1
)
--self destroy
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCode
(
EFFECT_SELF_DESTROY
)
e2
:
SetCondition
(
c21520082
.
sdcon
)
c
:
RegisterEffect
(
e2
)
--to deck and power up
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
21520082
,
0
))
e3
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_ATKCHANGE
+
CATEGORY_DEFCHANGE
)
e3
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetHintTiming
(
TIMING_DAMAGE_STEP
+
TIMING_DAMAGE_CAL
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCost
(
c21520082
.
cost
)
e3
:
SetTarget
(
c21520082
.
tg
)
e3
:
SetOperation
(
c21520082
.
op
)
c
:
RegisterEffect
(
e3
)
end
c21520082
.
miracle_synchro_fusion
=
true
function
c21520082
.
fsfilter1
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsCanBeFusionMaterial
()
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsLevelAbove
(
6
)
and
c
:
IsType
(
TYPE_SYNCHRO
)
and
c
:
IsAttribute
(
ATTRIBUTE_WIND
)
end
function
c21520082
.
fsfilter2
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsCanBeFusionMaterial
()
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c21520082
.
splimit
(
e
,
se
,
sp
,
st
)
return
bit
.
band
(
st
,
SUMMON_TYPE_FUSION
)
==
SUMMON_TYPE_FUSION
or
se
:
GetHandler
()
==
e
:
GetHandler
()
end
function
c21520082
.
cfilter
(
c
,
tp
)
return
((
c
:
IsLevelAbove
(
6
)
and
c
:
IsType
(
TYPE_SYNCHRO
)
and
c
:
IsAttribute
(
ATTRIBUTE_WIND
)
and
c
:
IsRace
(
RACE_SPELLCASTER
))
or
c
:
IsRace
(
RACE_SPELLCASTER
))
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeFusionMaterial
()
and
c
:
IsReleasable
()
and
(
c
:
IsControler
(
tp
)
or
c
:
IsFaceup
())
end
function
c21520082
.
fcheck
(
c
,
sg
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsLevelAbove
(
6
)
and
c
:
IsType
(
TYPE_SYNCHRO
)
and
c
:
IsAttribute
(
ATTRIBUTE_WIND
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
sg
:
FilterCount
(
c21520082
.
fcheck2
,
c
)
+
1
==
sg
:
GetCount
()
end
function
c21520082
.
fcheck2
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c21520082
.
fgoal
(
c
,
tp
,
sg
)
return
sg
:
GetCount
()
>
1
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
sg
)
>
0
and
sg
:
IsExists
(
c21520082
.
fcheck
,
1
,
nil
,
sg
)
end
function
c21520082
.
fselect
(
c
,
tp
,
mg
,
sg
)
sg
:
AddCard
(
c
)
local
res
=
c21520082
.
fgoal
(
c
,
tp
,
sg
)
or
mg
:
IsExists
(
c21520082
.
fselect
,
1
,
sg
,
tp
,
mg
,
sg
)
sg
:
RemoveCard
(
c
)
return
res
end
function
c21520082
.
sprcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
local
mg
=
Duel
.
GetMatchingGroup
(
c21520082
.
cfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
,
tp
)
local
sg
=
Group
.
CreateGroup
()
return
mg
:
IsExists
(
c21520082
.
fselect
,
1
,
nil
,
tp
,
mg
,
sg
)
end
function
c21520082
.
sprop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
mg
=
Duel
.
GetMatchingGroup
(
c21520082
.
cfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
,
tp
)
local
sg
=
Group
.
CreateGroup
()
while
true
do
local
cg
=
mg
:
Filter
(
c21520082
.
fselect
,
sg
,
tp
,
mg
,
sg
)
if
cg
:
GetCount
()
==
0
or
(
c21520082
.
fgoal
(
c
,
tp
,
sg
)
and
not
Duel
.
SelectYesNo
(
tp
,
210
))
then
break
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
local
g
=
cg
:
Select
(
tp
,
1
,
1
,
nil
)
sg
:
Merge
(
g
)
end
c
:
SetMaterial
(
sg
)
Duel
.
Release
(
sg
,
REASON_COST
+
REASON_MATERIAL
+
REASON_FUSION
)
-- c:RegisterFlagEffect(21520082,RESET_EVENT+0xfc0000,0,1)
end
function
c21520082
.
matcheck
(
e
,
c
)
local
ct
=
c
:
GetMaterialCount
()
local
ae
=
Effect
.
CreateEffect
(
c
)
ae
:
SetType
(
EFFECT_TYPE_SINGLE
)
ae
:
SetCode
(
EFFECT_SET_BASE_ATTACK
)
ae
:
SetValue
(
ct
*
500
)
ae
:
SetReset
(
RESET_EVENT
+
0xff0000
)
c
:
RegisterEffect
(
ae
)
local
de
=
ae
:
Clone
()
de
:
SetCode
(
EFFECT_SET_BASE_DEFENSE
)
c
:
RegisterEffect
(
de
)
end
function
c21520082
.
sdcon
(
e
)
return
bit
.
band
(
e
:
GetHandler
():
GetSummonType
(),
SUMMON_TYPE_FUSION
)
~=
SUMMON_TYPE_FUSION
--and e:GetHandler():GetFlagEffect(21520082)==0
end
function
c21520082
.
rfliter
(
c
)
return
c
:
IsAbleToRemoveAsCost
()
and
c
:
IsType
(
TYPE_SPELL
)
end
function
c21520082
.
tdfliter
(
c
)
return
c
:
IsAbleToDeck
()
and
not
c
:
IsStatus
(
STATUS_DESTROY_CONFIRMED
+
STATUS_LEAVE_CONFIRMED
)
end
function
c21520082
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c21520082
.
rfliter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c21520082
.
rfliter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
c21520082
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsOnField
()
and
chkc
:
IsAbleToDeck
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsAbleToDeck
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsAbleToDeck
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
nil
,
1
,
0
,
LOCATION_ONFIELD
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_ATKCHANGE
,
nil
,
0
,
0
,
1000
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DEFCHANGE
,
nil
,
0
,
0
,
1000
)
end
function
c21520082
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
and
tc
:
IsRelateToEffect
(
e
)
and
c
:
IsRelateToEffect
(
e
)
then
if
not
tc
:
IsImmuneToEffect
(
e
)
then
local
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
21520082
,
1
),
aux
.
Stringid
(
21520082
,
2
))
Duel
.
SendtoDeck
(
tc
,
nil
,
op
,
REASON_EFFECT
)
end
local
ae
=
Effect
.
CreateEffect
(
c
)
ae
:
SetType
(
EFFECT_TYPE_SINGLE
)
ae
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
ae
:
SetValue
(
1000
)
ae
:
SetReset
(
RESET_EVENT
+
0xff0000
)
c
:
RegisterEffect
(
ae
)
local
de
=
ae
:
Clone
()
de
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
c
:
RegisterEffect
(
de
)
end
end
--空间感应者
function
c21520082
.
initial_effect
(
c
)
--fusion material
c
:
EnableReviveLimit
()
aux
.
AddFusionProcFunFunRep
(
c
,
c21520082
.
fsfilter1
,
c21520082
.
fsfilter2
,
1
,
99
,
true
)
--spsummon condition
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_SINGLE
)
e0
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e0
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e0
:
SetValue
(
c21520082
.
splimit
)
c
:
RegisterEffect
(
e0
)
--special summon rule
local
e00
=
Effect
.
CreateEffect
(
c
)
e00
:
SetType
(
EFFECT_TYPE_FIELD
)
e00
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e00
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e00
:
SetRange
(
LOCATION_EXTRA
)
e00
:
SetCondition
(
c21520082
.
sprcon
)
e00
:
SetTarget
(
c21520082
.
sprtg
)
e00
:
SetOperation
(
c21520082
.
sprop
)
e00
:
SetValue
(
SUMMON_TYPE_FUSION
)
c
:
RegisterEffect
(
e00
)
--atk & def
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_MATERIAL_CHECK
)
e1
:
SetValue
(
c21520082
.
matcheck
)
c
:
RegisterEffect
(
e1
)
--self destroy
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCode
(
EFFECT_SELF_DESTROY
)
e2
:
SetCondition
(
c21520082
.
sdcon
)
c
:
RegisterEffect
(
e2
)
--to deck and power up
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
21520082
,
0
))
e3
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_ATKCHANGE
+
CATEGORY_DEFCHANGE
)
e3
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetHintTiming
(
TIMING_DAMAGE_STEP
+
TIMING_DAMAGE_CAL
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCost
(
c21520082
.
cost
)
e3
:
SetTarget
(
c21520082
.
tg
)
e3
:
SetOperation
(
c21520082
.
op
)
c
:
RegisterEffect
(
e3
)
end
c21520082
.
miracle_synchro_fusion
=
true
function
c21520082
.
fsfilter1
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsCanBeFusionMaterial
()
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsLevelAbove
(
6
)
and
c
:
IsType
(
TYPE_SYNCHRO
)
and
c
:
IsAttribute
(
ATTRIBUTE_WIND
)
end
function
c21520082
.
fsfilter2
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsCanBeFusionMaterial
()
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c21520082
.
splimit
(
e
,
se
,
sp
,
st
)
return
bit
.
band
(
st
,
SUMMON_TYPE_FUSION
)
==
SUMMON_TYPE_FUSION
or
se
:
GetHandler
()
==
e
:
GetHandler
()
end
function
c21520082
.
cfilter
(
c
,
tp
)
return
((
c
:
IsLevelAbove
(
6
)
and
c
:
IsType
(
TYPE_SYNCHRO
)
and
c
:
IsAttribute
(
ATTRIBUTE_WIND
)
and
c
:
IsRace
(
RACE_SPELLCASTER
))
or
c
:
IsRace
(
RACE_SPELLCASTER
))
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeFusionMaterial
()
and
c
:
IsReleasable
()
and
(
c
:
IsControler
(
tp
)
or
c
:
IsFaceup
())
end
function
c21520082
.
fcheck
(
c
,
sg
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsLevelAbove
(
6
)
and
c
:
IsType
(
TYPE_SYNCHRO
)
and
c
:
IsAttribute
(
ATTRIBUTE_WIND
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
sg
:
FilterCount
(
c21520082
.
fcheck2
,
c
)
+
1
==
sg
:
GetCount
()
end
function
c21520082
.
fcheck2
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c21520082
.
fgoal
(
sg
,
tp
)
return
sg
:
GetCount
()
>
1
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
sg
)
>
0
and
sg
:
IsExists
(
c21520082
.
fcheck
,
1
,
nil
,
sg
)
end
function
c21520082
.
sprcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
local
mg
=
Duel
.
GetMatchingGroup
(
c21520082
.
cfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
,
tp
)
return
mg
:
CheckSubGroup
(
c21520082
.
fgoal
,
1
,
nil
,
tp
)
end
function
c21520082
.
sprtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
c
)
local
mg
=
Duel
.
GetMatchingGroup
(
c21520082
.
cfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
,
tp
)
local
cancel
=
Duel
.
GetCurrentChain
()
==
0
local
sg
=
mg
:
SelectSubGroup
(
tp
,
c21520082
.
fgoal
,
cancel
,
1
,
nil
,
tp
)
if
sg
then
sg
:
KeepAlive
()
e
:
SetLabelObject
(
sg
)
return
true
else
return
false
end
end
function
c21520082
.
sprop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
sg
=
e
:
GetLabelObject
()
c
:
SetMaterial
(
sg
)
Duel
.
Release
(
sg
,
REASON_COST
+
REASON_MATERIAL
+
REASON_FUSION
)
-- c:RegisterFlagEffect(21520082,RESET_EVENT+0xfc0000,0,1)
end
function
c21520082
.
matcheck
(
e
,
c
)
local
ct
=
c
:
GetMaterialCount
()
local
ae
=
Effect
.
CreateEffect
(
c
)
ae
:
SetType
(
EFFECT_TYPE_SINGLE
)
ae
:
SetCode
(
EFFECT_SET_BASE_ATTACK
)
ae
:
SetValue
(
ct
*
500
)
ae
:
SetReset
(
RESET_EVENT
+
0xff0000
)
c
:
RegisterEffect
(
ae
)
local
de
=
ae
:
Clone
()
de
:
SetCode
(
EFFECT_SET_BASE_DEFENSE
)
c
:
RegisterEffect
(
de
)
end
function
c21520082
.
sdcon
(
e
)
return
bit
.
band
(
e
:
GetHandler
():
GetSummonType
(),
SUMMON_TYPE_FUSION
)
~=
SUMMON_TYPE_FUSION
--and e:GetHandler():GetFlagEffect(21520082)==0
end
function
c21520082
.
rfliter
(
c
)
return
c
:
IsAbleToRemoveAsCost
()
and
c
:
IsType
(
TYPE_SPELL
)
end
function
c21520082
.
tdfliter
(
c
)
return
c
:
IsAbleToDeck
()
and
not
c
:
IsStatus
(
STATUS_DESTROY_CONFIRMED
+
STATUS_LEAVE_CONFIRMED
)
end
function
c21520082
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c21520082
.
rfliter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c21520082
.
rfliter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
c21520082
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsOnField
()
and
chkc
:
IsAbleToDeck
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsAbleToDeck
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsAbleToDeck
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
nil
,
1
,
0
,
LOCATION_ONFIELD
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_ATKCHANGE
,
nil
,
0
,
0
,
1000
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DEFCHANGE
,
nil
,
0
,
0
,
1000
)
end
function
c21520082
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
and
tc
:
IsRelateToEffect
(
e
)
and
c
:
IsRelateToEffect
(
e
)
then
if
not
tc
:
IsImmuneToEffect
(
e
)
then
local
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
21520082
,
1
),
aux
.
Stringid
(
21520082
,
2
))
Duel
.
SendtoDeck
(
tc
,
nil
,
op
,
REASON_EFFECT
)
end
local
ae
=
Effect
.
CreateEffect
(
c
)
ae
:
SetType
(
EFFECT_TYPE_SINGLE
)
ae
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
ae
:
SetValue
(
1000
)
ae
:
SetReset
(
RESET_EVENT
+
0xff0000
)
c
:
RegisterEffect
(
ae
)
local
de
=
ae
:
Clone
()
de
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
c
:
RegisterEffect
(
de
)
end
end
expansions/script/c21520083.lua
View file @
002d5777
--时间观望者
function
c21520083
.
initial_effect
(
c
)
--fusion material
c
:
EnableReviveLimit
()
aux
.
AddFusionProcFunFunRep
(
c
,
c21520083
.
fsfilter1
,
c21520083
.
fsfilter2
,
1
,
99
,
true
)
--spsummon condition
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_SINGLE
)
e0
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e0
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e0
:
SetValue
(
c21520083
.
splimit
)
c
:
RegisterEffect
(
e0
)
--special summon rule
local
e00
=
Effect
.
CreateEffect
(
c
)
e00
:
SetType
(
EFFECT_TYPE_FIELD
)
e00
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e00
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e00
:
SetRange
(
LOCATION_EXTRA
)
e00
:
SetCondition
(
c21520083
.
sprcon
)
e00
:
SetOperation
(
c21520083
.
sprop
)
e00
:
SetValue
(
SUMMON_TYPE_FUSION
)
c
:
RegisterEffect
(
e00
)
--atk & def
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_MATERIAL_CHECK
)
e1
:
SetValue
(
c21520083
.
matcheck
)
c
:
RegisterEffect
(
e1
)
--self destroy
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCode
(
EFFECT_SELF_DESTROY
)
e2
:
SetCondition
(
c21520083
.
sdcon
)
c
:
RegisterEffect
(
e2
)
--check deck and power up
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
21520083
,
0
))
e3
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_ATKCHANGE
+
CATEGORY_DEFCHANGE
)
e3
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetHintTiming
(
TIMING_DAMAGE_STEP
+
TIMING_DAMAGE_CAL
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetTarget
(
c21520083
.
tg
)
e3
:
SetOperation
(
c21520083
.
operation
)
c
:
RegisterEffect
(
e3
)
end
function
c21520083
.
fsfilter1
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsCanBeFusionMaterial
()
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsLevelAbove
(
6
)
and
c
:
IsType
(
TYPE_FUSION
)
and
c
:
IsAttribute
(
ATTRIBUTE_WIND
)
end
function
c21520083
.
fsfilter2
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsCanBeFusionMaterial
()
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c21520083
.
splimit
(
e
,
se
,
sp
,
st
)
return
bit
.
band
(
st
,
SUMMON_TYPE_FUSION
)
==
SUMMON_TYPE_FUSION
or
se
:
GetHandler
()
==
e
:
GetHandler
()
end
function
c21520083
.
cfilter
(
c
,
tp
)
return
((
c
:
IsLevelAbove
(
6
)
and
c
:
IsType
(
TYPE_FUSION
)
and
c
:
IsAttribute
(
ATTRIBUTE_WIND
)
and
c
:
IsRace
(
RACE_SPELLCASTER
))
or
c
:
IsRace
(
RACE_SPELLCASTER
))
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeFusionMaterial
()
and
c
:
IsReleasable
()
and
(
c
:
IsControler
(
tp
)
or
c
:
IsFaceup
())
end
function
c21520083
.
fcheck
(
c
,
sg
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsLevelAbove
(
6
)
and
c
:
IsType
(
TYPE_FUSION
)
and
c
:
IsAttribute
(
ATTRIBUTE_WIND
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
sg
:
FilterCount
(
c21520083
.
fcheck2
,
c
)
+
1
==
sg
:
GetCount
()
end
function
c21520083
.
fcheck2
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c21520083
.
fgoal
(
c
,
tp
,
sg
)
return
sg
:
GetCount
()
>
1
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
sg
)
>
0
and
sg
:
IsExists
(
c21520083
.
fcheck
,
1
,
nil
,
sg
)
end
function
c21520083
.
fselect
(
c
,
tp
,
mg
,
sg
)
sg
:
AddCard
(
c
)
local
res
=
c21520083
.
fgoal
(
c
,
tp
,
sg
)
or
mg
:
IsExists
(
c21520083
.
fselect
,
1
,
sg
,
tp
,
mg
,
sg
)
sg
:
RemoveCard
(
c
)
return
res
end
function
c21520083
.
sprcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
local
mg
=
Duel
.
GetMatchingGroup
(
c21520083
.
cfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
,
tp
)
local
sg
=
Group
.
CreateGroup
()
return
mg
:
IsExists
(
c21520083
.
fselect
,
1
,
nil
,
tp
,
mg
,
sg
)
end
function
c21520083
.
sprop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
mg
=
Duel
.
GetMatchingGroup
(
c21520083
.
cfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
,
tp
)
local
sg
=
Group
.
CreateGroup
()
while
true
do
local
cg
=
mg
:
Filter
(
c21520083
.
fselect
,
sg
,
tp
,
mg
,
sg
)
if
cg
:
GetCount
()
==
0
or
(
c21520083
.
fgoal
(
c
,
tp
,
sg
)
and
not
Duel
.
SelectYesNo
(
tp
,
210
))
then
break
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
local
g
=
cg
:
Select
(
tp
,
1
,
1
,
nil
)
sg
:
Merge
(
g
)
end
c
:
SetMaterial
(
sg
)
Duel
.
Release
(
sg
,
REASON_COST
+
REASON_MATERIAL
+
REASON_FUSION
)
end
function
c21520083
.
matcheck
(
e
,
c
)
local
ct
=
c
:
GetMaterialCount
()
local
ae
=
Effect
.
CreateEffect
(
c
)
ae
:
SetType
(
EFFECT_TYPE_SINGLE
)
ae
:
SetCode
(
EFFECT_SET_BASE_ATTACK
)
ae
:
SetValue
(
ct
*
500
)
ae
:
SetReset
(
RESET_EVENT
+
0xff0000
)
c
:
RegisterEffect
(
ae
)
local
de
=
ae
:
Clone
()
de
:
SetCode
(
EFFECT_SET_BASE_DEFENSE
)
c
:
RegisterEffect
(
de
)
end
function
c21520083
.
sdcon
(
e
)
return
bit
.
band
(
e
:
GetHandler
():
GetSummonType
(),
SUMMON_TYPE_FUSION
)
~=
SUMMON_TYPE_FUSION
end
function
c21520083
.
rfliter
(
c
)
return
c
:
IsAbleToRemoveAsCost
()
and
c
:
IsType
(
TYPE_SPELL
)
end
function
c21520083
.
tdfliter
(
c
)
return
c
:
IsAbleToDeck
()
and
not
c
:
IsStatus
(
STATUS_DESTROY_CONFIRMED
+
STATUS_LEAVE_CONFIRMED
)
end
function
c21520083
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
Duel
.
GetTurnPlayer
(),
LOCATION_DECK
,
0
)
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_RECOVER
,
nil
,
0
,
0
,
2000
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_ATKCHANGE
,
nil
,
0
,
0
,
500
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DEFCHANGE
,
nil
,
0
,
0
,
500
)
end
function
c21520083
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
player
=
Duel
.
GetTurnPlayer
()
local
g
=
Duel
.
GetFieldGroup
(
player
,
LOCATION_DECK
,
0
)
if
g
:
GetCount
()
>
0
and
c
:
IsRelateToEffect
(
e
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CARDTYPE
)
local
op
=
Duel
.
SelectOption
(
c
:
GetControler
(),
70
,
71
,
72
)
Duel
.
Hint
(
HINT_OPSELECTED
,
tp
,
op
+
70
)
local
ct
=
0
local
tc
=
Duel
.
GetDecktopGroup
(
player
,
1
):
GetFirst
()
Duel
.
ConfirmDecktop
(
player
,
1
)
Duel
.
MoveSequence
(
tc
,
1
)
while
((
op
==
0
and
tc
:
IsType
(
TYPE_MONSTER
))
or
(
op
==
1
and
tc
:
IsType
(
TYPE_SPELL
))
or
(
opt
==
2
and
tc
:
IsType
(
TYPE_TRAP
)))
do
local
ae
=
Effect
.
CreateEffect
(
c
)
ae
:
SetType
(
EFFECT_TYPE_SINGLE
)
ae
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
ae
:
SetValue
(
500
)
ae
:
SetReset
(
RESET_EVENT
+
0xff0000
)
c
:
RegisterEffect
(
ae
)
local
de
=
ae
:
Clone
()
de
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
c
:
RegisterEffect
(
de
)
c
:
SetHint
(
CHINT_NUMBER
,
ct
+
1
)
-- c:RegisterFlagEffect(2295831,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,66)
Duel
.
BreakEffect
()
if
not
Duel
.
SelectYesNo
(
c
:
GetControler
(),
aux
.
Stringid
(
21520083
,
1
))
then
return
end
--loop
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CARDTYPE
)
op
=
Duel
.
SelectOption
(
c
:
GetControler
(),
70
,
71
,
72
)
Duel
.
Hint
(
HINT_OPSELECTED
,
tp
,
op
+
70
)
ct
=
ct
+
1
tc
=
Duel
.
GetDecktopGroup
(
player
,
1
):
GetFirst
()
Duel
.
ConfirmDecktop
(
player
,
1
)
Duel
.
MoveSequence
(
tc
,
1
)
end
if
not
((
op
==
0
and
tc
:
IsType
(
TYPE_MONSTER
))
or
(
op
==
1
and
tc
:
IsType
(
TYPE_SPELL
))
or
(
opt
==
2
and
tc
:
IsType
(
TYPE_TRAP
)))
then
Duel
.
Recover
(
1
-
tp
,
500
*
ct
,
REASON_EFFECT
)
end
end
end
--时间观望者
function
c21520083
.
initial_effect
(
c
)
--fusion material
c
:
EnableReviveLimit
()
aux
.
AddFusionProcFunFunRep
(
c
,
c21520083
.
fsfilter1
,
c21520083
.
fsfilter2
,
1
,
99
,
true
)
--spsummon condition
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_SINGLE
)
e0
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e0
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e0
:
SetValue
(
c21520083
.
splimit
)
c
:
RegisterEffect
(
e0
)
--special summon rule
local
e00
=
Effect
.
CreateEffect
(
c
)
e00
:
SetType
(
EFFECT_TYPE_FIELD
)
e00
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e00
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e00
:
SetRange
(
LOCATION_EXTRA
)
e00
:
SetCondition
(
c21520083
.
sprcon
)
e00
:
SetTarget
(
c21520083
.
sprtg
)
e00
:
SetOperation
(
c21520083
.
sprop
)
e00
:
SetValue
(
SUMMON_TYPE_FUSION
)
c
:
RegisterEffect
(
e00
)
--atk & def
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_MATERIAL_CHECK
)
e1
:
SetValue
(
c21520083
.
matcheck
)
c
:
RegisterEffect
(
e1
)
--self destroy
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCode
(
EFFECT_SELF_DESTROY
)
e2
:
SetCondition
(
c21520083
.
sdcon
)
c
:
RegisterEffect
(
e2
)
--check deck and power up
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
21520083
,
0
))
e3
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_ATKCHANGE
+
CATEGORY_DEFCHANGE
)
e3
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetHintTiming
(
TIMING_DAMAGE_STEP
+
TIMING_DAMAGE_CAL
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetTarget
(
c21520083
.
tg
)
e3
:
SetOperation
(
c21520083
.
operation
)
c
:
RegisterEffect
(
e3
)
end
function
c21520083
.
fsfilter1
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsCanBeFusionMaterial
()
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsLevelAbove
(
6
)
and
c
:
IsType
(
TYPE_FUSION
)
and
c
:
IsAttribute
(
ATTRIBUTE_WIND
)
end
function
c21520083
.
fsfilter2
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsCanBeFusionMaterial
()
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c21520083
.
splimit
(
e
,
se
,
sp
,
st
)
return
bit
.
band
(
st
,
SUMMON_TYPE_FUSION
)
==
SUMMON_TYPE_FUSION
or
se
:
GetHandler
()
==
e
:
GetHandler
()
end
function
c21520083
.
cfilter
(
c
,
tp
)
return
((
c
:
IsLevelAbove
(
6
)
and
c
:
IsType
(
TYPE_FUSION
)
and
c
:
IsAttribute
(
ATTRIBUTE_WIND
)
and
c
:
IsRace
(
RACE_SPELLCASTER
))
or
c
:
IsRace
(
RACE_SPELLCASTER
))
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeFusionMaterial
()
and
c
:
IsReleasable
()
and
(
c
:
IsControler
(
tp
)
or
c
:
IsFaceup
())
end
function
c21520083
.
fcheck
(
c
,
sg
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsLevelAbove
(
6
)
and
c
:
IsType
(
TYPE_FUSION
)
and
c
:
IsAttribute
(
ATTRIBUTE_WIND
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
sg
:
FilterCount
(
c21520083
.
fcheck2
,
c
)
+
1
==
sg
:
GetCount
()
end
function
c21520083
.
fcheck2
(
c
)
return
c
:
IsRace
(
RACE_SPELLCASTER
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c21520083
.
fgoal
(
sg
,
tp
)
return
sg
:
GetCount
()
>
1
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
sg
)
>
0
and
sg
:
IsExists
(
c21520083
.
fcheck
,
1
,
nil
,
sg
)
end
function
c21520083
.
sprcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
local
mg
=
Duel
.
GetMatchingGroup
(
c21520083
.
cfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
,
tp
)
return
mg
:
CheckSubGroup
(
c21520083
.
fgoal
,
1
,
nil
,
tp
)
end
function
c21520083
.
sprtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
c
)
local
mg
=
Duel
.
GetMatchingGroup
(
c21520083
.
cfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
,
tp
)
local
cancel
=
Duel
.
GetCurrentChain
()
==
0
local
sg
=
mg
:
SelectSubGroup
(
tp
,
c21520083
.
fgoal
,
cancel
,
1
,
nil
,
tp
)
if
sg
then
sg
:
KeepAlive
()
e
:
SetLabelObject
(
sg
)
return
true
else
return
false
end
end
function
c21520083
.
sprop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
sg
=
e
:
GetLabelObject
()
c
:
SetMaterial
(
sg
)
Duel
.
Release
(
sg
,
REASON_COST
+
REASON_MATERIAL
+
REASON_FUSION
)
end
--[[
function c21520083.fgoal(c,tp,sg)
return sg:GetCount()>1 and Duel.GetLocationCountFromEx(tp,tp,sg)>0 and sg:IsExists(c21520083.fcheck,1,nil,sg)
end
function c21520083.fselect(c,tp,mg,sg)
sg:AddCard(c)
local res=c21520083.fgoal(c,tp,sg) or mg:IsExists(c21520083.fselect,1,sg,tp,mg,sg)
sg:RemoveCard(c)
return res
end
function c21520083.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c21520083.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp)
local sg=Group.CreateGroup()
return mg:IsExists(c21520083.fselect,1,nil,tp,mg,sg)
end
function c21520083.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c21520083.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp)
local sg=Group.CreateGroup()
while true do
local cg=mg:Filter(c21520083.fselect,sg,tp,mg,sg)
if cg:GetCount()==0
or (c21520083.fgoal(c,tp,sg) and not Duel.SelectYesNo(tp,210)) then break end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=cg:Select(tp,1,1,nil)
sg:Merge(g)
end
local sg=e:GetLabelObject()
c:SetMaterial(sg)
Duel.Release(sg,REASON_COST+REASON_MATERIAL+REASON_FUSION)
end--]]
function
c21520083
.
matcheck
(
e
,
c
)
local
ct
=
c
:
GetMaterialCount
()
local
ae
=
Effect
.
CreateEffect
(
c
)
ae
:
SetType
(
EFFECT_TYPE_SINGLE
)
ae
:
SetCode
(
EFFECT_SET_BASE_ATTACK
)
ae
:
SetValue
(
ct
*
500
)
ae
:
SetReset
(
RESET_EVENT
+
0xff0000
)
c
:
RegisterEffect
(
ae
)
local
de
=
ae
:
Clone
()
de
:
SetCode
(
EFFECT_SET_BASE_DEFENSE
)
c
:
RegisterEffect
(
de
)
end
function
c21520083
.
sdcon
(
e
)
return
bit
.
band
(
e
:
GetHandler
():
GetSummonType
(),
SUMMON_TYPE_FUSION
)
~=
SUMMON_TYPE_FUSION
end
function
c21520083
.
rfliter
(
c
)
return
c
:
IsAbleToRemoveAsCost
()
and
c
:
IsType
(
TYPE_SPELL
)
end
function
c21520083
.
tdfliter
(
c
)
return
c
:
IsAbleToDeck
()
and
not
c
:
IsStatus
(
STATUS_DESTROY_CONFIRMED
+
STATUS_LEAVE_CONFIRMED
)
end
function
c21520083
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
Duel
.
GetTurnPlayer
(),
LOCATION_DECK
,
0
)
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_RECOVER
,
nil
,
0
,
0
,
2000
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_ATKCHANGE
,
nil
,
0
,
0
,
500
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DEFCHANGE
,
nil
,
0
,
0
,
500
)
end
function
c21520083
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
player
=
Duel
.
GetTurnPlayer
()
local
g
=
Duel
.
GetFieldGroup
(
player
,
LOCATION_DECK
,
0
)
if
g
:
GetCount
()
>
0
and
c
:
IsRelateToEffect
(
e
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CARDTYPE
)
local
op
=
Duel
.
SelectOption
(
c
:
GetControler
(),
70
,
71
,
72
)
Duel
.
Hint
(
HINT_OPSELECTED
,
tp
,
op
+
70
)
local
ct
=
0
local
tc
=
Duel
.
GetDecktopGroup
(
player
,
1
):
GetFirst
()
Duel
.
ConfirmDecktop
(
player
,
1
)
Duel
.
MoveSequence
(
tc
,
1
)
while
((
op
==
0
and
tc
:
IsType
(
TYPE_MONSTER
))
or
(
op
==
1
and
tc
:
IsType
(
TYPE_SPELL
))
or
(
opt
==
2
and
tc
:
IsType
(
TYPE_TRAP
)))
do
local
ae
=
Effect
.
CreateEffect
(
c
)
ae
:
SetType
(
EFFECT_TYPE_SINGLE
)
ae
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
ae
:
SetValue
(
500
)
ae
:
SetReset
(
RESET_EVENT
+
0xff0000
)
c
:
RegisterEffect
(
ae
)
local
de
=
ae
:
Clone
()
de
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
c
:
RegisterEffect
(
de
)
c
:
SetHint
(
CHINT_NUMBER
,
ct
+
1
)
-- c:RegisterFlagEffect(2295831,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,66)
Duel
.
BreakEffect
()
if
not
Duel
.
SelectYesNo
(
c
:
GetControler
(),
aux
.
Stringid
(
21520083
,
1
))
then
return
end
--loop
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CARDTYPE
)
op
=
Duel
.
SelectOption
(
c
:
GetControler
(),
70
,
71
,
72
)
Duel
.
Hint
(
HINT_OPSELECTED
,
tp
,
op
+
70
)
ct
=
ct
+
1
tc
=
Duel
.
GetDecktopGroup
(
player
,
1
):
GetFirst
()
Duel
.
ConfirmDecktop
(
player
,
1
)
Duel
.
MoveSequence
(
tc
,
1
)
end
if
not
((
op
==
0
and
tc
:
IsType
(
TYPE_MONSTER
))
or
(
op
==
1
and
tc
:
IsType
(
TYPE_SPELL
))
or
(
opt
==
2
and
tc
:
IsType
(
TYPE_TRAP
)))
then
Duel
.
Recover
(
1
-
tp
,
500
*
ct
,
REASON_EFFECT
)
end
end
end
expansions/script/c21520085.lua
View file @
002d5777
--玄翼战影
function
c21520085
.
initial_effect
(
c
)
--synchro summon
aux
.
AddSynchroProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsAttribute
,
ATTRIBUTE_DARK
),
aux
.
NonTuner
(
Card
.
IsAttribute
,
ATTRIBUTE_DARK
),
1
)
c
:
EnableReviveLimit
()
--atk & def
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
21520085
,
0
))
e1
:
SetCategory
(
CATEGORY_ATKCHANGE
+
CATEGORY_DEFCHANGE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCondition
(
c21520085
.
adcon
)
e1
:
SetCost
(
c21520085
.
adcost
)
e1
:
SetOperation
(
c21520085
.
adop
)
c
:
RegisterEffect
(
e1
)
--atk up
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e2
:
SetValue
(
c21520085
.
atkval
)
c
:
RegisterEffect
(
e2
)
--damage
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
21520085
,
1
))
e3
:
SetCategory
(
CATEGORY_DAMAGE
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e3
:
SetCode
(
EVENT_DAMAGE_STEP_END
)
e3
:
SetCondition
(
c21520085
.
damcon
)
e3
:
SetTarget
(
c21520085
.
damtg
)
e3
:
SetOperation
(
c21520085
.
damop
)
c
:
RegisterEffect
(
e3
)
--extra attack chance
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
21520085
,
2
))
e4
:
SetCategory
(
CATEGORY_DAMAGE
)
e4
:
SetProperty
(
+
EFFECT_FLAG_DAMAGE_STEP
)
e4
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e4
:
SetHintTiming
(
TIMING_BATTLE_STEP_END
)
e4
:
SetCode
(
EVENT_FREE_CHAIN
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCondition
(
c21520085
.
exatkcon
)
e4
:
SetCost
(
c21520085
.
exatkcost
)
e4
:
SetOperation
(
c21520085
.
exatkop
)
c
:
RegisterEffect
(
e4
)
end
function
c21520085
.
adcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetSummonType
()
==
SUMMON_TYPE_SYNCHRO
end
function
c21520085
.
adfilter
(
c
)
return
c
:
IsAttribute
(
ATTRIBUTE_DARK
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c21520085
.
adcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c21520085
.
adfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c21520085
.
adfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
g
:
KeepAlive
()
e
:
SetLabelObject
(
g
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
c21520085
.
adop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
e
:
GetLabelObject
():
GetFirst
()
if
c
:
IsRelateToEffect
(
e
)
then
local
atk
=
tc
:
GetTextAttack
()
local
def
=
tc
:
GetTextDefense
()
if
atk
<
0
then
atk
=
0
end
if
def
<
0
then
def
=
0
end
--atk & def
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SET_BASE_ATTACK
)
e1
:
SetValue
(
atk
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_SET_BASE_DEFENSE
)
e2
:
SetValue
(
def
)
c
:
RegisterEffect
(
e2
)
local
g
=
Duel
.
GetMatchingGroup
(
c21520085
.
tdfilter
,
tp
,
LOCATION_GRAVE
,
0
,
nil
,
c
:
GetAttack
())
if
g
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
21520085
,
3
))
then
Duel
.
BreakEffect
()
Duel
.
PayLPCost
(
tp
,
math.floor
(
Duel
.
GetLP
(
tp
)
/
2
))
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
sg
=
g
:
Select
(
tp
,
1
,
c
:
GetMaterialCount
(),
nil
)
Duel
.
SendtoDeck
(
sg
,
nil
,
2
,
REASON_EFFECT
)
end
end
end
function
c21520085
.
tdfilter
(
c
,
atk
)
return
c
:
IsAbleToDeck
()
--and c:IsAttackBelow(atk) and c:IsType(TYPE_MONSTER) and not c:IsAttribute(ATTRIBUTE_DARK)
end
function
c21520085
.
atkval
(
e
,
c
)
return
Duel
.
GetMatchingGroupCount
(
Card
.
IsAttribute
,
e
:
GetHandlerPlayer
(),
LOCATION_GRAVE
,
0
,
nil
,
ATTRIBUTE_DARK
)
*
100
end
function
c21520085
.
damcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
gc
=
Duel
.
GetMatchingGroupCount
(
Card
.
IsType
,
tp
,
LOCATION_GRAVE
,
0
,
nil
,
TYPE_MONSTER
)
local
dgc
=
Duel
.
GetMatchingGroupCount
(
Card
.
IsAttribute
,
tp
,
LOCATION_GRAVE
,
0
,
nil
,
ATTRIBUTE_DARK
)
return
gc
==
dgc
and
gc
>
0
end
function
c21520085
.
damtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
local
dgc
=
Duel
.
GetMatchingGroupCount
(
Card
.
IsAttribute
,
tp
,
LOCATION_GRAVE
,
0
,
nil
,
ATTRIBUTE_DARK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DAMAGE
,
nil
,
0
,
1
-
tp
,
dgc
*
200
)
end
function
c21520085
.
damop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
local
dgc
=
Duel
.
GetMatchingGroupCount
(
Card
.
IsAttribute
,
tp
,
LOCATION_GRAVE
,
0
,
nil
,
ATTRIBUTE_DARK
)
Duel
.
Damage
(
1
-
tp
,
dgc
*
200
,
REASON_EFFECT
)
end
end
function
c21520085
.
exatkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
local
tp
=
Duel
.
GetTurnPlayer
()
return
e
:
GetHandler
():
GetAttackedCount
()
>
0
and
tp
==
e
:
GetHandler
():
GetControler
()
and
ph
>=
PHASE_BATTLE_START
and
ph
<=
PHASE_BATTLE
--and e:GetHandler():GetFlagEffect(21520085)~=0
end
function
c21520085
.
exatkcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c21520085
.
adfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c21520085
.
adfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
g
:
KeepAlive
()
e
:
SetLabelObject
(
g
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
c21520085
.
exatkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
e
:
GetLabelObject
():
GetFirst
()
if
c
:
IsRelateToEffect
(
e
)
then
local
atk
=
tc
:
GetTextAttack
()
if
atk
<
0
then
atk
=
0
end
--atk & def
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SET_BASE_ATTACK
)
e1
:
SetValue
(
atk
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_EXTRA_ATTACK
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
)
e2
:
SetValue
(
c
:
GetAttackedCount
())
c
:
RegisterEffect
(
e2
)
end
end
--玄翼战影
function
c21520085
.
initial_effect
(
c
)
--synchro summon
aux
.
AddSynchroProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsAttribute
,
ATTRIBUTE_DARK
),
aux
.
NonTuner
(
Card
.
IsAttribute
,
ATTRIBUTE_DARK
),
1
)
c
:
EnableReviveLimit
()
--atk & def
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
21520085
,
0
))
e1
:
SetCategory
(
CATEGORY_ATKCHANGE
+
CATEGORY_DEFCHANGE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCondition
(
c21520085
.
adcon
)
e1
:
SetCost
(
c21520085
.
adcost
)
e1
:
SetOperation
(
c21520085
.
adop
)
c
:
RegisterEffect
(
e1
)
--atk up
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e2
:
SetValue
(
c21520085
.
atkval
)
c
:
RegisterEffect
(
e2
)
--damage
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
21520085
,
1
))
e3
:
SetCategory
(
CATEGORY_DAMAGE
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e3
:
SetCode
(
EVENT_DAMAGE_STEP_END
)
e3
:
SetCondition
(
c21520085
.
damcon
)
e3
:
SetTarget
(
c21520085
.
damtg
)
e3
:
SetOperation
(
c21520085
.
damop
)
c
:
RegisterEffect
(
e3
)
--extra attack chance
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
21520085
,
2
))
e4
:
SetCategory
(
CATEGORY_DAMAGE
)
e4
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
)
e4
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e4
:
SetHintTiming
(
TIMING_BATTLE_STEP_END
)
e4
:
SetCode
(
EVENT_FREE_CHAIN
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCondition
(
c21520085
.
exatkcon
)
e4
:
SetCost
(
c21520085
.
exatkcost
)
e4
:
SetOperation
(
c21520085
.
exatkop
)
c
:
RegisterEffect
(
e4
)
end
function
c21520085
.
adcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetSummonType
()
==
SUMMON_TYPE_SYNCHRO
end
function
c21520085
.
adfilter
(
c
)
return
c
:
IsAttribute
(
ATTRIBUTE_DARK
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c21520085
.
adcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c21520085
.
adfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c21520085
.
adfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
g
:
KeepAlive
()
e
:
SetLabelObject
(
g
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
c21520085
.
adop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
e
:
GetLabelObject
():
GetFirst
()
if
c
:
IsRelateToEffect
(
e
)
then
local
atk
=
tc
:
GetTextAttack
()
local
def
=
tc
:
GetTextDefense
()
if
atk
<
0
then
atk
=
0
end
if
def
<
0
then
def
=
0
end
--atk & def
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SET_BASE_ATTACK
)
e1
:
SetValue
(
atk
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_SET_BASE_DEFENSE
)
e2
:
SetValue
(
def
)
c
:
RegisterEffect
(
e2
)
local
g
=
Duel
.
GetMatchingGroup
(
c21520085
.
tdfilter
,
tp
,
LOCATION_GRAVE
,
0
,
nil
,
c
:
GetAttack
())
if
g
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
21520085
,
3
))
then
Duel
.
BreakEffect
()
Duel
.
PayLPCost
(
tp
,
math.floor
(
Duel
.
GetLP
(
tp
)
/
2
))
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
sg
=
g
:
Select
(
tp
,
1
,
c
:
GetMaterialCount
(),
nil
)
Duel
.
SendtoDeck
(
sg
,
nil
,
2
,
REASON_EFFECT
)
end
end
end
function
c21520085
.
tdfilter
(
c
,
atk
)
return
c
:
IsAbleToDeck
()
--and c:IsAttackBelow(atk) and c:IsType(TYPE_MONSTER) and not c:IsAttribute(ATTRIBUTE_DARK)
end
function
c21520085
.
atkval
(
e
,
c
)
return
Duel
.
GetMatchingGroupCount
(
Card
.
IsAttribute
,
e
:
GetHandlerPlayer
(),
LOCATION_GRAVE
,
0
,
nil
,
ATTRIBUTE_DARK
)
*
100
end
function
c21520085
.
damcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
gc
=
Duel
.
GetMatchingGroupCount
(
Card
.
IsType
,
tp
,
LOCATION_GRAVE
,
0
,
nil
,
TYPE_MONSTER
)
local
dgc
=
Duel
.
GetMatchingGroupCount
(
Card
.
IsAttribute
,
tp
,
LOCATION_GRAVE
,
0
,
nil
,
ATTRIBUTE_DARK
)
return
gc
==
dgc
and
gc
>
0
end
function
c21520085
.
damtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
local
dgc
=
Duel
.
GetMatchingGroupCount
(
Card
.
IsAttribute
,
tp
,
LOCATION_GRAVE
,
0
,
nil
,
ATTRIBUTE_DARK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DAMAGE
,
nil
,
0
,
1
-
tp
,
dgc
*
200
)
end
function
c21520085
.
damop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
local
dgc
=
Duel
.
GetMatchingGroupCount
(
Card
.
IsAttribute
,
tp
,
LOCATION_GRAVE
,
0
,
nil
,
ATTRIBUTE_DARK
)
Duel
.
Damage
(
1
-
tp
,
dgc
*
200
,
REASON_EFFECT
)
end
end
function
c21520085
.
exatkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
local
tp
=
Duel
.
GetTurnPlayer
()
return
e
:
GetHandler
():
GetAttackedCount
()
>
0
and
tp
==
e
:
GetHandler
():
GetControler
()
and
ph
>=
PHASE_BATTLE_START
and
ph
<=
PHASE_BATTLE
end
function
c21520085
.
exatkcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c21520085
.
adfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
GetFlagEffect
(
21520085
)
==
0
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c21520085
.
adfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
g
:
KeepAlive
()
e
:
SetLabelObject
(
g
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
e
:
GetHandler
():
RegisterFlagEffect
(
21520085
,
RESET_CHAIN
,
0
,
1
)
end
function
c21520085
.
exatkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
e
:
GetLabelObject
():
GetFirst
()
if
c
:
IsRelateToEffect
(
e
)
then
local
atk
=
tc
:
GetTextAttack
()
if
atk
<
0
then
atk
=
0
end
--atk & def
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SET_BASE_ATTACK
)
e1
:
SetValue
(
atk
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_EXTRA_ATTACK
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
)
e2
:
SetValue
(
c
:
GetAttackedCount
())
c
:
RegisterEffect
(
e2
)
end
end
expansions/script/c21520087.lua
View file @
002d5777
--灵动君王
function
c21520087
.
initial_effect
(
c
)
--fusion material
c
:
EnableReviveLimit
()
aux
.
AddFusionProcFunRep
(
c
,
c21520087
.
fsfilter
,
2
,
true
)
--spsummon condition
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_FIELD
)
e0
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e0
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e0
:
SetRange
(
LOCATION_EXTRA
)
e0
:
SetCondition
(
c21520087
.
sprcon
)
e0
:
SetOperation
(
c21520087
.
sprop
)
c
:
RegisterEffect
(
e0
)
local
e01
=
Effect
.
CreateEffect
(
c
)
e01
:
SetType
(
EFFECT_TYPE_SINGLE
)
e01
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e01
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e01
:
SetValue
(
c21520087
.
splimit
)
c
:
RegisterEffect
(
e01
)
--indes
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e1
:
SetCondition
(
c21520087
.
indescon
)
e1
:
SetValue
(
1
)
c
:
RegisterEffect
(
e1
)
local
e1_2
=
e1
:
Clone
()
e1_2
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
c
:
RegisterEffect
(
e1_2
)
--water
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
21520087
,
0
))
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetLabel
(
ATTRIBUTE_WATER
)
e2
:
SetCode
(
EVENT_BATTLE_DAMAGE
)
e2
:
SetCondition
(
c21520087
.
con1
)
e2
:
SetCost
(
c21520087
.
cost
)
e2
:
SetTarget
(
c21520087
.
tg1
)
e2
:
SetOperation
(
c21520087
.
op1
)
c
:
RegisterEffect
(
e2
)
--fire
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
21520087
,
1
))
e3
:
SetCategory
(
CATEGORY_REMOVE
)
e3
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetLabel
(
ATTRIBUTE_FIRE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetCondition
(
c21520087
.
con2
)
e3
:
SetCost
(
c21520087
.
cost
)
e3
:
SetTarget
(
c21520087
.
tg2
)
e3
:
SetOperation
(
c21520087
.
op2
)
c
:
RegisterEffect
(
e3
)
--dark
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
21520087
,
2
))
e4
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_ATKCHANGE
+
CATEGORY_DEFCHANGE
)
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetLabel
(
ATTRIBUTE_DARK
)
e4
:
SetCountLimit
(
1
)
e4
:
SetCondition
(
c21520087
.
con2
)
e4
:
SetCost
(
c21520087
.
cost
)
e4
:
SetTarget
(
c21520087
.
tg3
)
e4
:
SetOperation
(
c21520087
.
op3
)
c
:
RegisterEffect
(
e4
)
--light
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
21520087
,
3
))
e5
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e5
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e5
:
SetType
(
EFFECT_TYPE_IGNITION
)
e5
:
SetRange
(
LOCATION_MZONE
)
e5
:
SetLabel
(
ATTRIBUTE_LIGHT
)
e5
:
SetCountLimit
(
1
)
e5
:
SetCondition
(
c21520087
.
con2
)
e5
:
SetCost
(
c21520087
.
cost
)
e5
:
SetTarget
(
c21520087
.
tg4
)
e5
:
SetOperation
(
c21520087
.
op4
)
c
:
RegisterEffect
(
e5
)
end
function
c21520087
.
splimit
(
e
,
se
,
sp
,
st
)
return
bit
.
band
(
st
,
SUMMON_TYPE_FUSION
)
==
SUMMON_TYPE_FUSION
end
function
c21520087
.
fsfilter
(
c
)
return
(
c
:
GetBaseAttack
()
>=
2400
and
c
:
GetBaseDefense
()
>=
1000
)
and
c
:
IsCanBeFusionMaterial
()
end
function
c21520087
.
spfilter
(
c
)
return
c21520087
.
fsfilter
(
c
)
and
c
:
IsAbleToDeckOrExtraAsCost
()
end
function
c21520087
.
fselect
(
c
,
tp
,
mg
,
sg
)
sg
:
AddCard
(
c
)
local
res
=
false
if
sg
:
GetCount
()
<
2
then
res
=
mg
:
IsExists
(
c21520087
.
fselect
,
1
,
sg
,
tp
,
mg
,
sg
)
else
res
=
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
sg
)
>
0
end
sg
:
RemoveCard
(
c
)
return
res
end
function
c21520087
.
sprcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
local
mg
=
Duel
.
GetMatchingGroup
(
c21520087
.
spfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
sg
=
Group
.
CreateGroup
()
return
mg
:
IsExists
(
c21520087
.
fselect
,
1
,
nil
,
tp
,
mg
,
sg
)
end
function
c21520087
.
sprop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
mg
=
Duel
.
GetMatchingGroup
(
c21520087
.
spfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
sg
=
Group
.
CreateGroup
()
while
sg
:
GetCount
()
<
2
do
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
mg
:
FilterSelect
(
tp
,
c21520087
.
fselect
,
1
,
1
,
sg
,
tp
,
mg
,
sg
)
sg
:
Merge
(
g
)
end
local
cg
=
sg
:
Filter
(
Card
.
IsFacedown
,
nil
)
if
cg
:
GetCount
()
>
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
cg
)
end
Duel
.
SendtoDeck
(
sg
,
nil
,
2
,
REASON_COST
)
end
function
c21520087
.
indescon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsStatus
(
STATUS_SPSUMMON_TURN
)
end
function
c21520087
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
PayLPCost
(
tp
,
math.floor
(
Duel
.
GetLP
(
tp
)
/
2
))
end
function
c21520087
.
effectfilter
(
c
,
attr
)
return
c
:
IsFaceup
()
and
c
:
IsAttribute
(
attr
)
end
function
c21520087
.
con1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
attr
=
e
:
GetLabel
()
return
Duel
.
IsExistingMatchingCard
(
c21520087
.
effectfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
,
attr
)
and
e
:
GetHandler
():
GetAttackedCount
()
>
0
and
ep
~=
tp
end
function
c21520087
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
>
0
end
end
function
c21520087
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
>
0
then
local
g
=
Duel
.
GetDecktopGroup
(
tp
,
1
)
local
tc
=
g
:
GetFirst
()
Duel
.
DisableShuffleCheck
()
Duel
.
ConfirmDecktop
(
tp
,
1
)
if
tc
:
IsType
(
TYPE_MONSTER
)
then
Duel
.
ShuffleDeck
(
tp
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EXTRA_ATTACK
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
)
e1
:
SetValue
(
c
:
GetAttackedCount
())
c
:
RegisterEffect
(
e1
)
end
end
end
function
c21520087
.
con2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
attr
=
e
:
GetLabel
()
return
Duel
.
IsExistingMatchingCard
(
c21520087
.
effectfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
,
attr
)
end
function
c21520087
.
tg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsAbleToRemove
()
and
chkc
:
IsOnField
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
0
,
LOCATION_ONFIELD
)
end
function
c21520087
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
if
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
>
0
then
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsCode
,
tp
,
LOCATION_DECK
,
LOCATION_DECK
,
nil
,
tc
:
GetCode
())
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
tp
,
Duel
.
GetFieldGroup
(
1
-
tp
,
LOCATION_DECK
,
0
))
Duel
.
ConfirmCards
(
1
-
tp
,
Duel
.
GetFieldGroup
(
tp
,
LOCATION_DECK
,
0
))
Duel
.
ShuffleDeck
(
tp
)
Duel
.
ShuffleDeck
(
1
-
tp
)
end
end
end
function
c21520087
.
tg3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
nil
,
1
,
1
-
tp
,
LOCATION_MZONE
)
end
function
c21520087
.
op3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_MZONE
)
if
c
:
IsRelateToEffect
(
e
)
and
g
:
GetCount
()
>
0
then
if
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
>
0
then
local
og
=
Duel
.
GetOperatedGroup
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e1
:
SetValue
(
1000
*
og
:
GetCount
())
c
:
RegisterEffect
(
e1
)
end
end
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e2
:
SetCountLimit
(
1
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e2
:
SetOperation
(
c21520087
.
rmop
)
Duel
.
RegisterEffect
(
e2
,
p
)
end
function
c21520087
.
rmop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToRemove
,
e
:
GetOwnerPlayer
(),
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
e
:
GetHandler
())
Duel
.
Remove
(
g
,
POS_FACEDOWN
,
REASON_EFFECT
)
end
function
c21520087
.
sprfilter
(
c
,
e
,
tp
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
c
:
IsFaceup
()
end
function
c21520087
.
tg4
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
c21520087
.
sprfilter
(
chkc
,
e
,
tp
)
and
chkc
:
IsLocation
(
LOCATION_REMOVED
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c21520087
.
sprfilter
,
tp
,
LOCATION_REMOVED
,
LOCATION_REMOVED
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c21520087
.
sprfilter
,
tp
,
LOCATION_REMOVED
,
LOCATION_REMOVED
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
LOCATION_REMOVED
)
end
function
c21520087
.
op4
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
if
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
>
0
then
local
val
=
math.floor
(
tc
:
GetAttack
()
/
1000
)
if
val
>
0
then
Duel
.
BreakEffect
()
local
g
=
Duel
.
GetDecktopGroup
(
1
-
tp
,
val
)
Duel
.
DisableShuffleCheck
()
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
end
end
--灵动君王
function
c21520087
.
initial_effect
(
c
)
--fusion material
c
:
EnableReviveLimit
()
aux
.
AddFusionProcFunRep
(
c
,
c21520087
.
fsfilter
,
2
,
true
)
--spsummon condition
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_FIELD
)
e0
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e0
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e0
:
SetRange
(
LOCATION_EXTRA
)
e0
:
SetCondition
(
c21520087
.
sprcon
)
e0
:
SetTarget
(
c21520087
.
sprtg
)
e0
:
SetOperation
(
c21520087
.
sprop
)
c
:
RegisterEffect
(
e0
)
local
e01
=
Effect
.
CreateEffect
(
c
)
e01
:
SetType
(
EFFECT_TYPE_SINGLE
)
e01
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e01
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e01
:
SetValue
(
c21520087
.
splimit
)
c
:
RegisterEffect
(
e01
)
--indes
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e1
:
SetCondition
(
c21520087
.
indescon
)
e1
:
SetValue
(
1
)
c
:
RegisterEffect
(
e1
)
local
e1_2
=
e1
:
Clone
()
e1_2
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
c
:
RegisterEffect
(
e1_2
)
--water
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
21520087
,
0
))
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetLabel
(
ATTRIBUTE_WATER
)
e2
:
SetCode
(
EVENT_BATTLE_DAMAGE
)
e2
:
SetCondition
(
c21520087
.
con1
)
e2
:
SetCost
(
c21520087
.
cost
)
e2
:
SetTarget
(
c21520087
.
tg1
)
e2
:
SetOperation
(
c21520087
.
op1
)
c
:
RegisterEffect
(
e2
)
--fire
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
21520087
,
1
))
e3
:
SetCategory
(
CATEGORY_REMOVE
)
e3
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetLabel
(
ATTRIBUTE_FIRE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetCondition
(
c21520087
.
con2
)
e3
:
SetCost
(
c21520087
.
cost
)
e3
:
SetTarget
(
c21520087
.
tg2
)
e3
:
SetOperation
(
c21520087
.
op2
)
c
:
RegisterEffect
(
e3
)
--dark
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
21520087
,
2
))
e4
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_ATKCHANGE
+
CATEGORY_DEFCHANGE
)
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetLabel
(
ATTRIBUTE_DARK
)
e4
:
SetCountLimit
(
1
)
e4
:
SetCondition
(
c21520087
.
con2
)
e4
:
SetCost
(
c21520087
.
cost
)
e4
:
SetTarget
(
c21520087
.
tg3
)
e4
:
SetOperation
(
c21520087
.
op3
)
c
:
RegisterEffect
(
e4
)
--light
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
21520087
,
3
))
e5
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e5
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e5
:
SetType
(
EFFECT_TYPE_IGNITION
)
e5
:
SetRange
(
LOCATION_MZONE
)
e5
:
SetLabel
(
ATTRIBUTE_LIGHT
)
e5
:
SetCountLimit
(
1
)
e5
:
SetCondition
(
c21520087
.
con2
)
e5
:
SetCost
(
c21520087
.
cost
)
e5
:
SetTarget
(
c21520087
.
tg4
)
e5
:
SetOperation
(
c21520087
.
op4
)
c
:
RegisterEffect
(
e5
)
end
function
c21520087
.
splimit
(
e
,
se
,
sp
,
st
)
return
bit
.
band
(
st
,
SUMMON_TYPE_FUSION
)
==
SUMMON_TYPE_FUSION
end
function
c21520087
.
fsfilter
(
c
)
return
(
c
:
GetBaseAttack
()
>=
2400
and
c
:
GetBaseDefense
()
>=
1000
)
and
c
:
IsCanBeFusionMaterial
()
end
function
c21520087
.
spfilter
(
c
)
return
c21520087
.
fsfilter
(
c
)
and
c
:
IsAbleToDeckOrExtraAsCost
()
end
function
c21520087
.
fgoal
(
sg
,
tp
)
return
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
sg
)
>
0
and
sg
:
IsExists
(
aux
.
TRUE
,
2
,
nil
)
end
function
c21520087
.
sprcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
local
mg
=
Duel
.
GetMatchingGroup
(
c21520087
.
spfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
return
mg
:
CheckSubGroup
(
c21520087
.
fgoal
,
1
,
nil
,
tp
)
end
function
c21520087
.
sprtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
c
)
local
mg
=
Duel
.
GetMatchingGroup
(
c21520087
.
spfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
cancel
=
Duel
.
GetCurrentChain
()
==
0
local
sg
=
mg
:
SelectSubGroup
(
tp
,
c21520087
.
fgoal
,
cancel
,
1
,
2
,
tp
)
if
sg
then
sg
:
KeepAlive
()
e
:
SetLabelObject
(
sg
)
return
true
else
return
false
end
end
function
c21520087
.
sprop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
sg
=
e
:
GetLabelObject
()
local
cg
=
sg
:
Filter
(
Card
.
IsFacedown
,
nil
)
if
cg
:
GetCount
()
>
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
cg
)
end
Duel
.
SendtoDeck
(
sg
,
nil
,
2
,
REASON_COST
)
end
function
c21520087
.
indescon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsStatus
(
STATUS_SPSUMMON_TURN
)
end
function
c21520087
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
PayLPCost
(
tp
,
math.floor
(
Duel
.
GetLP
(
tp
)
/
2
))
end
function
c21520087
.
effectfilter
(
c
,
attr
)
return
c
:
IsFaceup
()
and
c
:
IsAttribute
(
attr
)
end
function
c21520087
.
con1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
attr
=
e
:
GetLabel
()
return
Duel
.
IsExistingMatchingCard
(
c21520087
.
effectfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
,
attr
)
and
e
:
GetHandler
():
GetAttackedCount
()
>
0
and
ep
~=
tp
end
function
c21520087
.
tg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
>
0
end
end
function
c21520087
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
>
0
then
local
g
=
Duel
.
GetDecktopGroup
(
tp
,
1
)
local
tc
=
g
:
GetFirst
()
Duel
.
DisableShuffleCheck
()
Duel
.
ConfirmDecktop
(
tp
,
1
)
if
tc
:
IsType
(
TYPE_MONSTER
)
then
Duel
.
ShuffleDeck
(
tp
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EXTRA_ATTACK
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
)
e1
:
SetValue
(
c
:
GetAttackedCount
())
c
:
RegisterEffect
(
e1
)
end
end
end
function
c21520087
.
con2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
attr
=
e
:
GetLabel
()
return
Duel
.
IsExistingMatchingCard
(
c21520087
.
effectfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
,
attr
)
end
function
c21520087
.
tg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsAbleToRemove
()
and
chkc
:
IsOnField
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
0
,
LOCATION_ONFIELD
)
end
function
c21520087
.
op2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
if
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
>
0
then
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsCode
,
tp
,
LOCATION_DECK
,
LOCATION_DECK
,
nil
,
tc
:
GetCode
())
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
tp
,
Duel
.
GetFieldGroup
(
1
-
tp
,
LOCATION_DECK
,
0
))
Duel
.
ConfirmCards
(
1
-
tp
,
Duel
.
GetFieldGroup
(
tp
,
LOCATION_DECK
,
0
))
Duel
.
ShuffleDeck
(
tp
)
Duel
.
ShuffleDeck
(
1
-
tp
)
end
end
end
function
c21520087
.
tg3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
nil
,
1
,
1
-
tp
,
LOCATION_MZONE
)
end
function
c21520087
.
op3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_MZONE
)
if
c
:
IsRelateToEffect
(
e
)
and
g
:
GetCount
()
>
0
then
if
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
>
0
then
local
og
=
Duel
.
GetOperatedGroup
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
e1
:
SetValue
(
1000
*
og
:
GetCount
())
c
:
RegisterEffect
(
e1
)
end
end
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e2
:
SetCountLimit
(
1
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e2
:
SetOperation
(
c21520087
.
rmop
)
Duel
.
RegisterEffect
(
e2
,
p
)
end
function
c21520087
.
rmop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToRemove
,
e
:
GetOwnerPlayer
(),
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
e
:
GetHandler
())
Duel
.
Remove
(
g
,
POS_FACEDOWN
,
REASON_EFFECT
)
end
function
c21520087
.
sprfilter
(
c
,
e
,
tp
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
c
:
IsFaceup
()
end
function
c21520087
.
tg4
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
c21520087
.
sprfilter
(
chkc
,
e
,
tp
)
and
chkc
:
IsLocation
(
LOCATION_REMOVED
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c21520087
.
sprfilter
,
tp
,
LOCATION_REMOVED
,
LOCATION_REMOVED
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c21520087
.
sprfilter
,
tp
,
LOCATION_REMOVED
,
LOCATION_REMOVED
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
LOCATION_REMOVED
)
end
function
c21520087
.
op4
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
if
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
>
0
then
local
val
=
math.floor
(
tc
:
GetAttack
()
/
1000
)
if
val
>
0
then
Duel
.
BreakEffect
()
local
g
=
Duel
.
GetDecktopGroup
(
1
-
tp
,
val
)
Duel
.
DisableShuffleCheck
()
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
end
end
expansions/script/c21520088.lua
View file @
002d5777
--霸业皇者
function
c21520088
.
initial_effect
(
c
)
--fusion material
c
:
EnableReviveLimit
()
aux
.
AddFusionProcFunRep
(
c
,
c21520088
.
fsfilter
,
2
,
true
)
--spsummon condition
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_FIELD
)
e0
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e0
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e0
:
SetRange
(
LOCATION_EXTRA
)
e0
:
SetCondition
(
c21520088
.
sprcon
)
e0
:
SetOperation
(
c21520088
.
sprop
)
c
:
RegisterEffect
(
e0
)
local
e01
=
Effect
.
CreateEffect
(
c
)
e01
:
SetType
(
EFFECT_TYPE_SINGLE
)
e01
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e01
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e01
:
SetValue
(
c21520088
.
splimit
)
c
:
RegisterEffect
(
e01
)
--indes
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e1
:
SetCondition
(
c21520088
.
indescon
)
e1
:
SetValue
(
1
)
c
:
RegisterEffect
(
e1
)
local
e1_2
=
e1
:
Clone
()
e1_2
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
c
:
RegisterEffect
(
e1_2
)
--disable
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
-- e2:SetCountLimit(3)
e2
:
SetCost
(
c21520088
.
cost
)
e2
:
SetTarget
(
c21520088
.
tg
)
e2
:
SetOperation
(
c21520088
.
op
)
c
:
RegisterEffect
(
e2
)
end
function
c21520088
.
splimit
(
e
,
se
,
sp
,
st
)
return
bit
.
band
(
st
,
SUMMON_TYPE_FUSION
)
==
SUMMON_TYPE_FUSION
end
function
c21520088
.
fsfilter
(
c
)
return
(
c
:
GetBaseAttack
()
>=
2400
and
c
:
GetBaseDefense
()
>=
1000
)
and
c
:
IsCanBeFusionMaterial
()
end
function
c21520088
.
spfilter
(
c
)
return
c21520088
.
fsfilter
and
c
:
IsAbleToDeckOrExtraAsCost
()
end
function
c21520088
.
fselect
(
c
,
tp
,
mg
,
sg
)
sg
:
AddCard
(
c
)
local
res
=
false
if
sg
:
GetCount
()
<
2
then
res
=
mg
:
IsExists
(
c21520088
.
fselect
,
1
,
sg
,
tp
,
mg
,
sg
)
else
res
=
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
sg
)
>
0
end
sg
:
RemoveCard
(
c
)
return
res
end
function
c21520088
.
sprcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
local
mg
=
Duel
.
GetMatchingGroup
(
c21520088
.
spfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
sg
=
Group
.
CreateGroup
()
return
mg
:
IsExists
(
c21520088
.
fselect
,
1
,
nil
,
tp
,
mg
,
sg
)
end
function
c21520088
.
sprop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
mg
=
Duel
.
GetMatchingGroup
(
c21520088
.
spfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
sg
=
Group
.
CreateGroup
()
while
sg
:
GetCount
()
<
2
do
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
mg
:
FilterSelect
(
tp
,
c21520088
.
fselect
,
1
,
1
,
sg
,
tp
,
mg
,
sg
)
sg
:
Merge
(
g
)
end
local
cg
=
sg
:
Filter
(
Card
.
IsFacedown
,
nil
)
if
cg
:
GetCount
()
>
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
cg
)
end
Duel
.
SendtoDeck
(
sg
,
nil
,
2
,
REASON_COST
)
end
function
c21520088
.
indescon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsStatus
(
STATUS_SPSUMMON_TURN
)
end
function
c21520088
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemoveAsCost
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
Duel
.
PayLPCost
(
tp
,
math.floor
(
Duel
.
GetLP
(
tp
)
/
2
))
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemoveAsCost
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
local
tc
=
g
:
GetFirst
()
e
:
GetHandler
():
RegisterFlagEffect
(
21520088
,
RESET_CHAIN
,
0
,
1
)
tc
:
RegisterFlagEffect
(
21520088
,
RESET_CHAIN
,
0
,
1
,
e
:
GetHandler
():
GetFlagEffect
(
21520088
))
if
tc
:
IsType
(
TYPE_MONSTER
)
then
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
aux
.
Stringid
(
21520088
,
0
))
if
tc
:
IsAttribute
(
ATTRIBUTE_EARTH
)
then
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
1010
)
elseif
tc
:
IsAttribute
(
ATTRIBUTE_WATER
)
then
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
1011
)
elseif
tc
:
IsAttribute
(
ATTRIBUTE_FIRE
)
then
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
1012
)
elseif
tc
:
IsAttribute
(
ATTRIBUTE_WIND
)
then
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
1013
)
elseif
tc
:
IsAttribute
(
ATTRIBUTE_LIGHT
)
then
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
1014
)
elseif
tc
:
IsAttribute
(
ATTRIBUTE_DARK
)
then
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
1015
)
elseif
tc
:
IsAttribute
(
ATTRIBUTE_DEVINE
)
then
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
1016
)
end
elseif
tc
:
IsType
(
TYPE_SPELL
)
then
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
aux
.
Stringid
(
21520088
,
1
))
elseif
tc
:
IsType
(
TYPE_TRAP
)
then
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
aux
.
Stringid
(
21520088
,
2
))
end
end
function
c21520088
.
disfilter
(
c
,
ct
)
return
c
:
GetFlagEffectLabel
(
21520088
)
==
ct
end
function
c21520088
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
c21520088
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
ct
=
c
:
GetFlagEffect
(
21520088
)
local
tc
=
Duel
.
GetMatchingGroup
(
c21520088
.
disfilter
,
tp
,
0xff
,
0xff
,
nil
,
ct
):
GetFirst
()
c
:
ResetFlagEffect
(
21520088
)
ct
=
ct
-
1
while
ct
>
0
do
c
:
RegisterFlagEffect
(
21520088
,
RESET_CHAIN
,
0
,
1
)
ct
=
ct
-
1
end
if
c
:
IsRelateToEffect
(
e
)
then
if
tc
:
IsType
(
TYPE_MONSTER
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_DISABLE
)
-- e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1
:
SetTargetRange
(
0xff
,
0xff
)
e1
:
SetLabel
(
tc
:
GetAttribute
())
e1
:
SetTarget
(
c21520088
.
distgm
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_SOLVING
)
e2
:
SetLabel
(
tc
:
GetAttribute
())
e2
:
SetOperation
(
c21520088
.
disopm
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e2
,
tp
)
elseif
tc
:
IsType
(
TYPE_SPELL
)
then
--disable
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetTargetRange
(
LOCATION_SZONE
,
LOCATION_SZONE
)
e1
:
SetLabel
(
TYPE_SPELL
)
e1
:
SetTarget
(
c21520088
.
distgst
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
--disable effect
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_SOLVING
)
e2
:
SetLabel
(
TYPE_SPELL
)
e2
:
SetOperation
(
c21520088
.
disoperation
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e2
,
tp
)
--disable trap monster
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EFFECT_DISABLE_TRAPMONSTER
)
e3
:
SetLabel
(
TYPE_SPELL
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e3
:
SetTarget
(
c21520088
.
distgst
)
e3
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e3
,
tp
)
elseif
tc
:
IsType
(
TYPE_TRAP
)
then
--disable
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetTargetRange
(
LOCATION_SZONE
,
LOCATION_SZONE
)
e1
:
SetLabel
(
TYPE_TRAP
)
e1
:
SetTarget
(
c21520088
.
distgst
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
--disable effect
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_SOLVING
)
e2
:
SetLabel
(
TYPE_TRAP
)
e2
:
SetOperation
(
c21520088
.
disoperation
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e2
,
tp
)
--disable trap monster
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EFFECT_DISABLE_TRAPMONSTER
)
e3
:
SetLabel
(
TYPE_TRAP
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e3
:
SetTarget
(
c21520088
.
distgst
)
e3
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e3
,
tp
)
end
end
end
function
c21520088
.
distgm
(
e
,
c
)
return
c
~=
e
:
GetHandler
()
and
c
:
IsAttribute
(
e
:
GetLabel
())
and
(
c
:
IsType
(
TYPE_EFFECT
)
or
bit
.
band
(
c
:
GetOriginalType
(),
TYPE_EFFECT
)
==
TYPE_EFFECT
)
and
not
c
:
IsImmuneToEffect
(
e
)
end
function
c21520088
.
distgst
(
e
,
c
)
return
c
:
IsType
(
e
:
GetLabel
())
and
not
c
:
IsImmuneToEffect
(
e
)
end
function
c21520088
.
disopm
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
re
:
IsActiveType
(
TYPE_MONSTER
)
and
re
:
GetHandler
():
IsAttribute
(
e
:
GetLabel
())
and
re
:
GetHandler
()
~=
e
:
GetHandler
()
and
not
re
:
GetHandler
():
IsImmuneToEffect
(
e
)
then
Duel
.
NegateEffect
(
ev
)
end
end
function
c21520088
.
disoperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tl
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TRIGGERING_LOCATION
)
if
tl
==
LOCATION_SZONE
and
re
:
IsActiveType
(
TYPE_TRAP
)
then
Duel
.
NegateEffect
(
ev
)
end
end
--霸业皇者
function
c21520088
.
initial_effect
(
c
)
--fusion material
c
:
EnableReviveLimit
()
aux
.
AddFusionProcFunRep
(
c
,
c21520088
.
fsfilter
,
2
,
true
)
--spsummon condition
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_FIELD
)
e0
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e0
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e0
:
SetRange
(
LOCATION_EXTRA
)
e0
:
SetCondition
(
c21520088
.
sprcon
)
e0
:
SetTarget
(
c21520088
.
sprtg
)
e0
:
SetOperation
(
c21520088
.
sprop
)
c
:
RegisterEffect
(
e0
)
local
e01
=
Effect
.
CreateEffect
(
c
)
e01
:
SetType
(
EFFECT_TYPE_SINGLE
)
e01
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e01
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e01
:
SetValue
(
c21520088
.
splimit
)
c
:
RegisterEffect
(
e01
)
--indes
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e1
:
SetCondition
(
c21520088
.
indescon
)
e1
:
SetValue
(
1
)
c
:
RegisterEffect
(
e1
)
local
e1_2
=
e1
:
Clone
()
e1_2
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
c
:
RegisterEffect
(
e1_2
)
--disable
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
-- e2:SetCountLimit(3)
e2
:
SetCost
(
c21520088
.
cost
)
e2
:
SetTarget
(
c21520088
.
tg
)
e2
:
SetOperation
(
c21520088
.
op
)
c
:
RegisterEffect
(
e2
)
end
function
c21520088
.
splimit
(
e
,
se
,
sp
,
st
)
return
bit
.
band
(
st
,
SUMMON_TYPE_FUSION
)
==
SUMMON_TYPE_FUSION
end
function
c21520088
.
fsfilter
(
c
)
return
(
c
:
GetBaseAttack
()
>=
2400
and
c
:
GetBaseDefense
()
>=
1000
)
and
c
:
IsCanBeFusionMaterial
()
end
function
c21520088
.
spfilter
(
c
)
return
c21520088
.
fsfilter
(
c
)
and
c
:
IsAbleToDeckOrExtraAsCost
()
end
function
c21520088
.
fgoal
(
sg
,
tp
)
return
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
sg
)
>
0
and
sg
:
IsExists
(
aux
.
TRUE
,
2
,
nil
)
end
function
c21520088
.
sprcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
local
mg
=
Duel
.
GetMatchingGroup
(
c21520088
.
spfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
return
mg
:
CheckSubGroup
(
c21520088
.
fgoal
,
1
,
nil
,
tp
)
end
function
c21520088
.
sprtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
c
)
local
mg
=
Duel
.
GetMatchingGroup
(
c21520088
.
spfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
cancel
=
Duel
.
GetCurrentChain
()
==
0
local
sg
=
mg
:
SelectSubGroup
(
tp
,
c21520088
.
fgoal
,
cancel
,
1
,
2
,
tp
)
if
sg
then
sg
:
KeepAlive
()
e
:
SetLabelObject
(
sg
)
return
true
else
return
false
end
end
function
c21520088
.
sprop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
sg
=
e
:
GetLabelObject
()
local
cg
=
sg
:
Filter
(
Card
.
IsFacedown
,
nil
)
if
cg
:
GetCount
()
>
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
cg
)
end
Duel
.
SendtoDeck
(
sg
,
nil
,
2
,
REASON_COST
)
end
--[[nction c21520088.fselect(c,tp,mg,sg)
sg:AddCard(c)
local res=false
if sg:GetCount()<2 then
res=mg:IsExists(c21520088.fselect,1,sg,tp,mg,sg)
else
res=Duel.GetLocationCountFromEx(tp,tp,sg)>0
end
sg:RemoveCard(c)
return res
end
function c21520088.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c21520088.spfilter,tp,LOCATION_MZONE,0,nil)
local sg=Group.CreateGroup()
return mg:IsExists(c21520088.fselect,1,nil,tp,mg,sg)
end
function c21520088.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c21520088.spfilter,tp,LOCATION_MZONE,0,nil)
local sg=Group.CreateGroup()
while sg:GetCount()<2 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=mg:FilterSelect(tp,c21520088.fselect,1,1,sg,tp,mg,sg)
sg:Merge(g)
end
local cg=sg:Filter(Card.IsFacedown,nil)
if cg:GetCount()>0 then
Duel.ConfirmCards(1-tp,cg)
end
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end--]]
function
c21520088
.
indescon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsStatus
(
STATUS_SPSUMMON_TURN
)
end
function
c21520088
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemoveAsCost
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
Duel
.
PayLPCost
(
tp
,
math.floor
(
Duel
.
GetLP
(
tp
)
/
2
))
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemoveAsCost
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
local
tc
=
g
:
GetFirst
()
e
:
GetHandler
():
RegisterFlagEffect
(
21520088
,
RESET_CHAIN
,
0
,
1
)
tc
:
RegisterFlagEffect
(
21520088
,
RESET_CHAIN
,
0
,
1
,
e
:
GetHandler
():
GetFlagEffect
(
21520088
))
if
tc
:
IsType
(
TYPE_MONSTER
)
then
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
aux
.
Stringid
(
21520088
,
0
))
if
tc
:
IsAttribute
(
ATTRIBUTE_EARTH
)
then
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
1010
)
elseif
tc
:
IsAttribute
(
ATTRIBUTE_WATER
)
then
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
1011
)
elseif
tc
:
IsAttribute
(
ATTRIBUTE_FIRE
)
then
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
1012
)
elseif
tc
:
IsAttribute
(
ATTRIBUTE_WIND
)
then
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
1013
)
elseif
tc
:
IsAttribute
(
ATTRIBUTE_LIGHT
)
then
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
1014
)
elseif
tc
:
IsAttribute
(
ATTRIBUTE_DARK
)
then
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
1015
)
elseif
tc
:
IsAttribute
(
ATTRIBUTE_DEVINE
)
then
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
1016
)
end
elseif
tc
:
IsType
(
TYPE_SPELL
)
then
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
aux
.
Stringid
(
21520088
,
1
))
elseif
tc
:
IsType
(
TYPE_TRAP
)
then
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
aux
.
Stringid
(
21520088
,
2
))
end
end
function
c21520088
.
disfilter
(
c
,
ct
)
return
c
:
GetFlagEffectLabel
(
21520088
)
==
ct
end
function
c21520088
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
c21520088
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
ct
=
c
:
GetFlagEffect
(
21520088
)
local
tc
=
Duel
.
GetMatchingGroup
(
c21520088
.
disfilter
,
tp
,
0xff
,
0xff
,
nil
,
ct
):
GetFirst
()
c
:
ResetFlagEffect
(
21520088
)
ct
=
ct
-
1
while
ct
>
0
do
c
:
RegisterFlagEffect
(
21520088
,
RESET_CHAIN
,
0
,
1
)
ct
=
ct
-
1
end
if
c
:
IsRelateToEffect
(
e
)
then
if
tc
:
IsType
(
TYPE_MONSTER
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_DISABLE
)
-- e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1
:
SetTargetRange
(
0xff
,
0xff
)
e1
:
SetLabel
(
tc
:
GetAttribute
())
e1
:
SetTarget
(
c21520088
.
distgm
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_SOLVING
)
e2
:
SetLabel
(
tc
:
GetAttribute
())
e2
:
SetOperation
(
c21520088
.
disopm
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e2
,
tp
)
elseif
tc
:
IsType
(
TYPE_SPELL
)
then
--disable
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetTargetRange
(
LOCATION_SZONE
,
LOCATION_SZONE
)
e1
:
SetLabel
(
TYPE_SPELL
)
e1
:
SetTarget
(
c21520088
.
distgst
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
--disable effect
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_SOLVING
)
e2
:
SetLabel
(
TYPE_SPELL
)
e2
:
SetOperation
(
c21520088
.
disoperation
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e2
,
tp
)
--disable trap monster
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EFFECT_DISABLE_TRAPMONSTER
)
e3
:
SetLabel
(
TYPE_SPELL
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e3
:
SetTarget
(
c21520088
.
distgst
)
e3
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e3
,
tp
)
elseif
tc
:
IsType
(
TYPE_TRAP
)
then
--disable
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetTargetRange
(
LOCATION_SZONE
,
LOCATION_SZONE
)
e1
:
SetLabel
(
TYPE_TRAP
)
e1
:
SetTarget
(
c21520088
.
distgst
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
--disable effect
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_SOLVING
)
e2
:
SetLabel
(
TYPE_TRAP
)
e2
:
SetOperation
(
c21520088
.
disoperation
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e2
,
tp
)
--disable trap monster
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EFFECT_DISABLE_TRAPMONSTER
)
e3
:
SetLabel
(
TYPE_TRAP
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e3
:
SetTarget
(
c21520088
.
distgst
)
e3
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e3
,
tp
)
end
end
end
function
c21520088
.
distgm
(
e
,
c
)
return
c
~=
e
:
GetHandler
()
and
c
:
IsAttribute
(
e
:
GetLabel
())
and
(
c
:
IsType
(
TYPE_EFFECT
)
or
bit
.
band
(
c
:
GetOriginalType
(),
TYPE_EFFECT
)
==
TYPE_EFFECT
)
and
not
c
:
IsImmuneToEffect
(
e
)
end
function
c21520088
.
distgst
(
e
,
c
)
return
c
:
IsType
(
e
:
GetLabel
())
and
not
c
:
IsImmuneToEffect
(
e
)
end
function
c21520088
.
disopm
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
re
:
IsActiveType
(
TYPE_MONSTER
)
and
re
:
GetHandler
():
IsAttribute
(
e
:
GetLabel
())
and
re
:
GetHandler
()
~=
e
:
GetHandler
()
and
not
re
:
GetHandler
():
IsImmuneToEffect
(
e
)
then
Duel
.
NegateEffect
(
ev
)
end
end
function
c21520088
.
disoperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tl
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TRIGGERING_LOCATION
)
if
tl
==
LOCATION_SZONE
and
re
:
IsActiveType
(
TYPE_TRAP
)
then
Duel
.
NegateEffect
(
ev
)
end
end
expansions/script/c21520183.lua
View file @
002d5777
--曲形魔-克莱因
function
c21520183
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
aux
.
AddXyzProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsRace
,
RACE_FIEND
),
10
,
3
,
nil
,
nil
,
99
)
--spsummon condition
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e1
:
SetValue
(
c21520183
.
splimit
)
c
:
RegisterEffect
(
e1
)
--special summon rule
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e2
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e2
:
SetRange
(
LOCATION_GRAVE
+
LOCATION_EXTRA
)
e2
:
SetCondition
(
c21520183
.
spcon
)
e2
:
SetOperation
(
c21520183
.
spop
)
c
:
RegisterEffect
(
e2
)
--draw
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetCategory
(
CATEGORY_DRAW
)
e3
:
SetDescription
(
aux
.
Stringid
(
21520183
,
0
))
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCost
(
c21520183
.
drcost
)
e3
:
SetTarget
(
c21520183
.
drtg
)
e3
:
SetOperation
(
c21520183
.
drop
)
c
:
RegisterEffect
(
e3
)
--atk & def
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
)
e4
:
SetCode
(
EFFECT_SET_ATTACK
)
e4
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetValue
(
c21520183
.
adval
)
c
:
RegisterEffect
(
e4
)
local
e5
=
e4
:
Clone
()
e5
:
SetCode
(
EFFECT_SET_DEFENSE
)
c
:
RegisterEffect
(
e5
)
--imune
local
e6
=
Effect
.
CreateEffect
(
c
)
e6
:
SetType
(
EFFECT_TYPE_SINGLE
)
e6
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e6
:
SetRange
(
LOCATION_MZONE
)
e6
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e6
:
SetCondition
(
c21520183
.
econ
)
e6
:
SetValue
(
c21520183
.
efilter
)
c
:
RegisterEffect
(
e6
)
--material
local
e7
=
Effect
.
CreateEffect
(
c
)
e7
:
SetDescription
(
aux
.
Stringid
(
21520183
,
1
))
e7
:
SetType
(
EFFECT_TYPE_IGNITION
)
e7
:
SetRange
(
LOCATION_MZONE
)
e7
:
SetCountLimit
(
1
,
21520183
)
e7
:
SetCost
(
c21520183
.
cost
)
e7
:
SetTarget
(
c21520183
.
target
)
e7
:
SetOperation
(
c21520183
.
operation
)
c
:
RegisterEffect
(
e7
)
--destroy replace
local
e8
=
Effect
.
CreateEffect
(
c
)
e8
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_SINGLE
)
e8
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e8
:
SetCode
(
EFFECT_DESTROY_REPLACE
)
e8
:
SetRange
(
LOCATION_MZONE
)
e8
:
SetTarget
(
c21520183
.
reptg
)
c
:
RegisterEffect
(
e8
)
end
function
c21520183
.
splimit
(
e
,
se
,
sp
,
st
)
return
bit
.
band
(
st
,
SUMMON_TYPE_XYZ
)
==
SUMMON_TYPE_XYZ
or
se
:
GetHandler
()
==
e
:
GetHandler
()
end
function
c21520183
.
spfilter
(
c
)
return
(
c
:
IsSetCard
(
0x490
)
or
c
:
IsRace
(
RACE_FIEND
))
and
c
:
IsAbleToRemoveAsCost
()
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c21520183
.
spcheck
(
c
,
sg
)
return
c
:
IsSetCard
(
0x490
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
sg
:
FilterCount
(
c21520183
.
spcheck2
,
c
)
+
1
==
sg
:
GetCount
()
and
sg
:
FilterCount
(
Card
.
IsSetCard
,
c
,
0x490
)
>=
2
end
function
c21520183
.
spcheck2
(
c
)
return
c
:
IsRace
(
RACE_FIEND
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c21520183
.
spgoal
(
sg
,
tp
,
loc
)
if
loc
==
LOCATION_EXTRA
then
return
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
sg
)
>
0
and
sg
:
IsExists
(
c21520183
.
spcheck
,
1
,
nil
,
sg
)
else
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
sg
:
IsExists
(
c21520183
.
spcheck
,
1
,
nil
,
sg
)
end
end
function
c21520183
.
spcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
local
mg
=
Duel
.
GetMatchingGroup
(
c21520183
.
spfilter
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
0
,
e
:
GetHandler
())
local
sg
=
Group
.
CreateGroup
()
return
mg
:
CheckSubGroup
(
c21520183
.
spgoal
,
1
,
nil
,
tp
)
end
function
c21520183
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
mg
=
Duel
.
GetMatchingGroup
(
c21520183
.
spfilter
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
0
,
e
:
GetHandler
())
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
cancel
=
Duel
.
GetCurrentChain
()
==
0
local
sg
=
mg
:
SelectSubGroup
(
tp
,
c21520183
.
spgoal
,
cancel
,
1
,
nil
,
tp
,
c
:
GetLocation
())
c
:
SetMaterial
(
sg
)
Duel
.
Remove
(
sg
,
POS_FACEUP
,
REASON_COST
)
end
--[[nction c21520183.spcheck(c,sg)
return c:IsSetCard(0x490) and c:IsType(TYPE_MONSTER) and sg:FilterCount(c21520183.spcheck2,c)+1==sg:GetCount()
and sg:FilterCount(Card.IsSetCard,c,0x490)>=2
end
function c21520183.spcheck2(c)
return c:IsRace(RACE_FIEND) and c:IsType(TYPE_MONSTER)
end
function c21520183.spgoal(c,tp,sg)
return sg:GetCount()>1 and Duel.GetLocationCountFromEx(tp,tp,sg)>0 and sg:IsExists(c21520183.spcheck,1,nil,sg)
end
function c21520183.spselect(c,tp,mg,sg)
sg:AddCard(c)
local res=c21520183.spgoal(c,tp,sg) or mg:IsExists(c21520183.spselect,1,sg,tp,mg,sg)
sg:RemoveCard(c)
return res
end
function c21520183.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c21520183.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,e:GetHandler())
local sg=Group.CreateGroup()
return mg:IsExists(c21520183.spselect,1,nil,tp,mg,sg)
end
function c21520183.spop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c21520183.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,e:GetHandler())
local sg=Group.CreateGroup()
while true do
local cg=mg:Filter(c21520183.spselect,sg,tp,mg,sg)
if cg:GetCount()==0
or (c21520183.spgoal(c,tp,sg) and not Duel.SelectYesNo(tp,210)) then break end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=cg:Select(tp,1,1,nil)
sg:Merge(g)
end
c:SetMaterial(sg)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end--]]
function
c21520183
.
drcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
CheckRemoveOverlayCard
(
tp
,
1
,
REASON_COST
)
end
e
:
GetHandler
():
RemoveOverlayCard
(
tp
,
1
,
1
,
REASON_COST
)
end
function
c21520183
.
drtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c21520183
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
function
c21520183
.
adval
(
e
,
c
)
return
Duel
.
GetMatchingGroupCount
(
Card
.
IsFaceup
,
c
:
GetControler
(),
LOCATION_REMOVED
,
LOCATION_REMOVED
,
nil
)
*
361
end
function
c21520183
.
econ
(
e
)
return
e
:
GetHandler
():
GetOverlayCount
()
>
0
end
function
c21520183
.
efilter
(
e
,
te
)
return
not
te
:
IsActiveType
(
TYPE_COUNTER
)
and
te
:
GetHandler
()
~=
e
:
GetHandler
()
end
function
c21520183
.
filter
(
c
)
return
not
c
:
IsType
(
TYPE_TOKEN
)
and
c
:
IsAbleToChangeControler
()
and
c
:
IsFaceup
()
end
function
c21520183
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
GetAttackAnnouncedCount
()
==
0
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetCode
(
EFFECT_CANNOT_ATTACK_ANNOUNCE
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
)
e
:
GetHandler
():
RegisterEffect
(
e1
)
end
function
c21520183
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c21520183
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
e
:
GetHandler
())
and
e
:
GetHandler
():
IsType
(
TYPE_XYZ
)
end
end
function
c21520183
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
ct
=
c
:
GetOverlayCount
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c21520183
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
ct
+
1
,
e
:
GetHandler
())
local
tc
=
g
:
GetFirst
()
while
tc
do
if
c
:
IsRelateToEffect
(
e
)
and
not
tc
:
IsImmuneToEffect
(
e
)
then
local
og
=
tc
:
GetOverlayGroup
()
if
og
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
og
,
REASON_RULE
)
end
Duel
.
Overlay
(
c
,
Group
.
FromCards
(
tc
))
end
tc
=
g
:
GetNext
()
end
end
function
c21520183
.
reptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
ct
=
math.ceil
(
e
:
GetHandler
():
GetOverlayCount
()
/
2
)
return
e
:
GetHandler
():
CheckRemoveOverlayCard
(
tp
,
ct
,
REASON_EFFECT
)
end
local
c
=
e
:
GetHandler
()
if
c
:
GetOverlayCount
()
>
0
then
local
ct
=
math.ceil
(
c
:
GetOverlayCount
()
/
2
)
c
:
RemoveOverlayCard
(
tp
,
ct
,
ct
,
REASON_EFFECT
)
return
true
else
return
false
end
end
--曲形魔-克莱因
function
c21520183
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
aux
.
AddXyzProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsRace
,
RACE_FIEND
),
10
,
3
,
nil
,
nil
,
99
)
--spsummon condition
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e1
:
SetValue
(
c21520183
.
splimit
)
c
:
RegisterEffect
(
e1
)
--special summon rule
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e2
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
+
EFFECT_FLAG_IGNORE_IMMUNE
)
e2
:
SetRange
(
LOCATION_GRAVE
+
LOCATION_EXTRA
)
e2
:
SetCondition
(
c21520183
.
spcon
)
e2
:
SetTarget
(
c21520183
.
sptg
)
e2
:
SetOperation
(
c21520183
.
spop
)
c
:
RegisterEffect
(
e2
)
--draw
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetCategory
(
CATEGORY_DRAW
)
e3
:
SetDescription
(
aux
.
Stringid
(
21520183
,
0
))
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCost
(
c21520183
.
drcost
)
e3
:
SetTarget
(
c21520183
.
drtg
)
e3
:
SetOperation
(
c21520183
.
drop
)
c
:
RegisterEffect
(
e3
)
--atk & def
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
)
e4
:
SetCode
(
EFFECT_SET_ATTACK
)
e4
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetValue
(
c21520183
.
adval
)
c
:
RegisterEffect
(
e4
)
local
e5
=
e4
:
Clone
()
e5
:
SetCode
(
EFFECT_SET_DEFENSE
)
c
:
RegisterEffect
(
e5
)
--imune
local
e6
=
Effect
.
CreateEffect
(
c
)
e6
:
SetType
(
EFFECT_TYPE_SINGLE
)
e6
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e6
:
SetRange
(
LOCATION_MZONE
)
e6
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e6
:
SetCondition
(
c21520183
.
econ
)
e6
:
SetValue
(
c21520183
.
efilter
)
c
:
RegisterEffect
(
e6
)
--material
local
e7
=
Effect
.
CreateEffect
(
c
)
e7
:
SetDescription
(
aux
.
Stringid
(
21520183
,
1
))
e7
:
SetType
(
EFFECT_TYPE_IGNITION
)
e7
:
SetRange
(
LOCATION_MZONE
)
e7
:
SetCountLimit
(
1
,
21520183
)
e7
:
SetCost
(
c21520183
.
cost
)
e7
:
SetTarget
(
c21520183
.
target
)
e7
:
SetOperation
(
c21520183
.
operation
)
c
:
RegisterEffect
(
e7
)
--destroy replace
local
e8
=
Effect
.
CreateEffect
(
c
)
e8
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_SINGLE
)
e8
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e8
:
SetCode
(
EFFECT_DESTROY_REPLACE
)
e8
:
SetRange
(
LOCATION_MZONE
)
e8
:
SetTarget
(
c21520183
.
reptg
)
c
:
RegisterEffect
(
e8
)
end
function
c21520183
.
splimit
(
e
,
se
,
sp
,
st
)
return
bit
.
band
(
st
,
SUMMON_TYPE_XYZ
)
==
SUMMON_TYPE_XYZ
or
se
:
GetHandler
()
==
e
:
GetHandler
()
end
function
c21520183
.
spfilter
(
c
)
return
(
c
:
IsSetCard
(
0x490
)
or
c
:
IsRace
(
RACE_FIEND
))
and
c
:
IsAbleToRemoveAsCost
()
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c21520183
.
spcheck
(
c
,
sg
)
return
c
:
IsSetCard
(
0x490
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
sg
:
FilterCount
(
c21520183
.
spcheck2
,
c
)
+
1
==
sg
:
GetCount
()
and
sg
:
FilterCount
(
Card
.
IsSetCard
,
c
,
0x490
)
>=
2
end
function
c21520183
.
spcheck2
(
c
)
return
c
:
IsRace
(
RACE_FIEND
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c21520183
.
spgoal
(
sg
,
tp
,
loc
)
if
loc
==
LOCATION_EXTRA
then
return
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
sg
)
>
0
and
sg
:
IsExists
(
c21520183
.
spcheck
,
1
,
nil
,
sg
)
else
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
sg
:
IsExists
(
c21520183
.
spcheck
,
1
,
nil
,
sg
)
end
end
function
c21520183
.
spcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
local
mg
=
Duel
.
GetMatchingGroup
(
c21520183
.
spfilter
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
0
,
e
:
GetHandler
())
return
mg
:
CheckSubGroup
(
c21520183
.
spgoal
,
1
,
nil
,
tp
)
end
function
c21520183
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
c
)
local
mg
=
Duel
.
GetMatchingGroup
(
c21520183
.
spfilter
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
0
,
e
:
GetHandler
())
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
cancel
=
Duel
.
GetCurrentChain
()
==
0
local
sg
=
mg
:
SelectSubGroup
(
tp
,
c21520183
.
spgoal
,
cancel
,
1
,
nil
,
tp
,
c
:
GetLocation
())
if
sg
then
sg
:
KeepAlive
()
e
:
SetLabelObject
(
sg
)
return
true
else
return
false
end
end
function
c21520183
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
sg
=
e
:
GetLabelObject
()
c
:
SetMaterial
(
sg
)
Duel
.
Remove
(
sg
,
POS_FACEUP
,
REASON_COST
)
end
--[[nction c21520183.spcheck(c,sg)
return c:IsSetCard(0x490) and c:IsType(TYPE_MONSTER) and sg:FilterCount(c21520183.spcheck2,c)+1==sg:GetCount()
and sg:FilterCount(Card.IsSetCard,c,0x490)>=2
end
function c21520183.spcheck2(c)
return c:IsRace(RACE_FIEND) and c:IsType(TYPE_MONSTER)
end
function c21520183.spgoal(c,tp,sg)
return sg:GetCount()>1 and Duel.GetLocationCountFromEx(tp,tp,sg)>0 and sg:IsExists(c21520183.spcheck,1,nil,sg)
end
function c21520183.spselect(c,tp,mg,sg)
sg:AddCard(c)
local res=c21520183.spgoal(c,tp,sg) or mg:IsExists(c21520183.spselect,1,sg,tp,mg,sg)
sg:RemoveCard(c)
return res
end
function c21520183.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c21520183.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,e:GetHandler())
local sg=Group.CreateGroup()
return mg:IsExists(c21520183.spselect,1,nil,tp,mg,sg)
end
function c21520183.spop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c21520183.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,e:GetHandler())
local sg=Group.CreateGroup()
while true do
local cg=mg:Filter(c21520183.spselect,sg,tp,mg,sg)
if cg:GetCount()==0
or (c21520183.spgoal(c,tp,sg) and not Duel.SelectYesNo(tp,210)) then break end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=cg:Select(tp,1,1,nil)
sg:Merge(g)
end
c:SetMaterial(sg)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end--]]
function
c21520183
.
drcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
CheckRemoveOverlayCard
(
tp
,
1
,
REASON_COST
)
end
e
:
GetHandler
():
RemoveOverlayCard
(
tp
,
1
,
1
,
REASON_COST
)
end
function
c21520183
.
drtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c21520183
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
function
c21520183
.
adval
(
e
,
c
)
return
Duel
.
GetMatchingGroupCount
(
Card
.
IsFaceup
,
c
:
GetControler
(),
LOCATION_REMOVED
,
LOCATION_REMOVED
,
nil
)
*
361
end
function
c21520183
.
econ
(
e
)
return
e
:
GetHandler
():
GetOverlayCount
()
>
0
end
function
c21520183
.
efilter
(
e
,
te
)
return
not
te
:
IsActiveType
(
TYPE_COUNTER
)
and
te
:
GetHandler
()
~=
e
:
GetHandler
()
end
function
c21520183
.
filter
(
c
)
return
not
c
:
IsType
(
TYPE_TOKEN
)
and
c
:
IsAbleToChangeControler
()
and
c
:
IsFaceup
()
end
function
c21520183
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
GetAttackAnnouncedCount
()
==
0
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetCode
(
EFFECT_CANNOT_ATTACK_ANNOUNCE
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
)
e
:
GetHandler
():
RegisterEffect
(
e1
)
end
function
c21520183
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c21520183
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
e
:
GetHandler
())
and
e
:
GetHandler
():
IsType
(
TYPE_XYZ
)
end
end
function
c21520183
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
then
return
end
local
ct
=
c
:
GetOverlayCount
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c21520183
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
ct
+
1
,
e
:
GetHandler
())
local
tc
=
g
:
GetFirst
()
while
tc
do
if
c
:
IsRelateToEffect
(
e
)
and
not
tc
:
IsImmuneToEffect
(
e
)
then
local
og
=
tc
:
GetOverlayGroup
()
if
og
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
og
,
REASON_RULE
)
end
Duel
.
Overlay
(
c
,
Group
.
FromCards
(
tc
))
end
tc
=
g
:
GetNext
()
end
end
function
c21520183
.
reptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
ct
=
math.ceil
(
e
:
GetHandler
():
GetOverlayCount
()
/
2
)
return
e
:
GetHandler
():
CheckRemoveOverlayCard
(
tp
,
ct
,
REASON_EFFECT
)
end
local
c
=
e
:
GetHandler
()
if
c
:
GetOverlayCount
()
>
0
then
local
ct
=
math.ceil
(
c
:
GetOverlayCount
()
/
2
)
c
:
RemoveOverlayCard
(
tp
,
ct
,
ct
,
REASON_EFFECT
)
return
true
else
return
false
end
end
expansions/script/c21520189.lua
View file @
002d5777
--艺形魔-纸死神
function
c21520189
.
initial_effect
(
c
)
--spsumon 1 shapevil
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_DESTROY
+
CATEGORY_RECOVER
)
e1
:
SetDescription
(
aux
.
Stringid
(
21520189
,
0
))
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
21520189
)
e1
:
SetCondition
(
c21520189
.
sdrcon
)
e1
:
SetCost
(
c21520189
.
sdrcost
)
e1
:
SetTarget
(
c21520189
.
sdrtg
)
e1
:
SetOperation
(
c21520189
.
sdrop
)
c
:
RegisterEffect
(
e1
)
--to grave
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
21520189
,
1
))
e2
:
SetCategory
(
CATEGORY_TOGRAVE
+
CATEGORY_DECKDES
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
21520189
)
e2
:
SetTarget
(
c21520189
.
tgtg
)
e2
:
SetOperation
(
c21520189
.
tgop
)
c
:
RegisterEffect
(
e2
)
local
e2_2
=
e2
:
Clone
()
e2_2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2_2
)
--SPECIAL_SUMMON
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
21520189
,
2
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetCondition
(
c21520189
.
spcon
)
e3
:
SetTarget
(
c21520189
.
sptg
)
e3
:
SetOperation
(
c21520189
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
c21520189
.
pfilter
(
c
)
return
c
:
IsAttribute
(
ATTRIBUTE_LIGHT
+
ATTRIBUTE_DARK
)
and
not
c
:
IsPublic
()
end
function
c21520189
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x490
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c21520189
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetType
()
&
(
TYPE_SPELL
+
TYPE_CONTINUOUS
)
==
TYPE_SPELL
+
TYPE_CONTINUOUS
end
function
c21520189
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
c21520189
.
spfilter
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c21520189
.
spfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
+
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
)
>
0
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c21520189
.
spfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
function
c21520189
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
local
atk
=
tc
:
GetBaseAttack
()
if
atk
<
0
then
atk
=
0
end
local
b1
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
local
b2
=
(
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
GetLP
(
1
-
tp
)
>
atk
)
if
c
:
IsRelateToEffect
(
e
)
and
tc
:
IsRelateToEffect
(
e
)
then
local
op
=
2
if
b1
and
b2
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
21520189
,
3
),
aux
.
Stringid
(
21520189
,
4
))
elseif
not
b1
and
b2
then
op
=
1
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
aux
.
Stringid
(
21520189
,
4
))
elseif
b1
and
not
b2
then
op
=
0
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
aux
.
Stringid
(
21520189
,
3
))
end
if
op
==
0
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
elseif
op
==
1
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
1
-
tp
,
false
,
false
,
POS_FACEUP
)
end
Duel
.
Damage
(
tc
:
GetControler
(),
atk
,
REASON_EFFECT
)
end
end
function
c21520189
.
fieldfilter
(
c
)
return
c
:
IsCode
(
21520181
)
and
c
:
IsFaceup
()
end
function
c21520189
.
sdrcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
IsExistingMatchingCard
(
c21520189
.
fieldfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
then
return
Duel
.
GetTurnPlayer
()
==
tp
or
Duel
.
GetTurnPlayer
()
==
1
-
tp
else
return
Duel
.
GetTurnPlayer
()
==
tp
end
end
function
c21520189
.
sdrcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsDiscardable
()
end
Duel
.
SendtoGrave
(
e
:
GetHandler
(),
REASON_DISCARD
+
REASON_COST
)
end
function
c21520189
.
sdrtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c21520189
.
pfilter
,
tp
,
LOCATION_HAND
,
0
,
3
,
e
:
GetHandler
())
and
Duel
.
IsExistingMatchingCard
(
c21520189
.
spfilter
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
,
e
,
tp
)
end
--
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
LOCATION_GRAVE
)
end
function
c21520189
.
sdrop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
hg
=
Duel
.
GetMatchingGroup
(
c21520189
.
pfilter
,
tp
,
LOCATION_HAND
,
0
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
c21520189
.
spfilter
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
and
hg
:
GetCount
()
>
2
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CONFIRM
)
local
pg
=
hg
:
Select
(
tp
,
3
,
3
,
nil
)
Duel
.
ConfirmCards
(
1
-
tp
,
pg
)
Duel
.
ShuffleHand
(
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
local
p
=
tp
local
tc
=
sg
:
GetFirst
()
local
op
=
2
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
)
>
0
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
21520189
,
3
),
aux
.
Stringid
(
21520189
,
4
))
elseif
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
)
==
0
then
op
=
0
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
aux
.
Stringid
(
21520189
,
3
))
elseif
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
==
0
and
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
)
>
0
then
op
=
1
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
aux
.
Stringid
(
21520189
,
4
))
end
if
op
==
1
then
p
=
1
-
tp
end
if
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
p
,
false
,
false
,
POS_FACEUP
)
>
0
then
--can not activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
c21520189
.
aclimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
+
RESET_OPPO_TURN
)
tc
:
RegisterEffect
(
e1
)
--destroy
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_DESTROY
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e2
:
SetCode
(
EVENT_BATTLE_DAMAGE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTarget
(
c21520189
.
destg
)
e2
:
SetOperation
(
c21520189
.
desop
)
tc
:
RegisterEffect
(
e2
)
end
end
end
function
c21520189
.
aclimit
(
e
,
re
,
tp
)
return
re
:
GetActivateLocation
()
==
LOCATION_GRAVE
end
function
c21520189
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
>=
1
end
end
function
c21520189
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsDistruable
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
Destroy
(
sg
,
REASON_EFFECT
)
Duel
.
BreakEffect
()
Duel
.
Destroy
(
c
,
REASON_EFFECT
)
end
end
function
c21520189
.
tgtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
>=
6
end
end
function
c21520189
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetDecktopGroup
(
tp
,
6
)
Duel
.
ConfirmDecktop
(
tp
,
6
)
local
tc
=
g
:
GetFirst
()
local
tgg
=
Group
.
CreateGroup
()
while
tc
do
if
tc
:
IsType
(
TYPE_MONSTER
)
and
tc
:
IsSetCard
(
0x490
)
then
tgg
:
AddCard
(
tc
)
end
tc
=
g
:
GetNext
()
end
local
ct
=
Duel
.
SendtoGrave
(
tgg
,
REASON_EFFECT
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
otg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToGrave
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
ct
,
nil
)
Duel
.
SendtoGrave
(
otg
,
REASON_EFFECT
)
Duel
.
ShuffleDeck
(
tp
)
end
--艺形魔-纸死神
function
c21520189
.
initial_effect
(
c
)
--spsumon 1 shapevil
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_DESTROY
+
CATEGORY_RECOVER
)
e1
:
SetDescription
(
aux
.
Stringid
(
21520189
,
0
))
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
21520189
)
e1
:
SetCondition
(
c21520189
.
sdrcon
)
e1
:
SetCost
(
c21520189
.
sdrcost
)
e1
:
SetTarget
(
c21520189
.
sdrtg
)
e1
:
SetOperation
(
c21520189
.
sdrop
)
c
:
RegisterEffect
(
e1
)
--to grave
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
21520189
,
1
))
e2
:
SetCategory
(
CATEGORY_TOGRAVE
+
CATEGORY_DECKDES
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
21520189
)
e2
:
SetTarget
(
c21520189
.
tgtg
)
e2
:
SetOperation
(
c21520189
.
tgop
)
c
:
RegisterEffect
(
e2
)
local
e2_2
=
e2
:
Clone
()
e2_2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2_2
)
--SPECIAL_SUMMON
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
21520189
,
2
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetCondition
(
c21520189
.
spcon
)
e3
:
SetTarget
(
c21520189
.
sptg
)
e3
:
SetOperation
(
c21520189
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
c21520189
.
pfilter
(
c
)
return
c
:
IsAttribute
(
ATTRIBUTE_LIGHT
+
ATTRIBUTE_DARK
)
and
not
c
:
IsPublic
()
end
function
c21520189
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x490
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c21520189
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetType
()
&
(
TYPE_SPELL
+
TYPE_CONTINUOUS
)
==
TYPE_SPELL
+
TYPE_CONTINUOUS
end
function
c21520189
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
c21520189
.
spfilter
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c21520189
.
spfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
+
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
)
>
0
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c21520189
.
spfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
function
c21520189
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
local
atk
=
tc
:
GetBaseAttack
()
if
atk
<
0
then
atk
=
0
end
local
b1
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
local
b2
=
(
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
GetLP
(
1
-
tp
)
>
atk
)
if
c
:
IsRelateToEffect
(
e
)
and
tc
:
IsRelateToEffect
(
e
)
then
local
op
=
2
if
b1
and
b2
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
21520189
,
3
),
aux
.
Stringid
(
21520189
,
4
))
elseif
not
b1
and
b2
then
op
=
1
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
aux
.
Stringid
(
21520189
,
4
))
elseif
b1
and
not
b2
then
op
=
0
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
aux
.
Stringid
(
21520189
,
3
))
end
if
op
==
0
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
elseif
op
==
1
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
1
-
tp
,
false
,
false
,
POS_FACEUP
)
end
Duel
.
Damage
(
tc
:
GetControler
(),
atk
,
REASON_EFFECT
)
end
end
function
c21520189
.
fieldfilter
(
c
)
return
c
:
IsCode
(
21520181
)
and
c
:
IsFaceup
()
end
function
c21520189
.
sdrcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
IsExistingMatchingCard
(
c21520189
.
fieldfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
then
return
Duel
.
GetTurnPlayer
()
==
tp
or
Duel
.
GetTurnPlayer
()
==
1
-
tp
else
return
Duel
.
GetTurnPlayer
()
==
tp
end
end
function
c21520189
.
sdrcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsDiscardable
()
end
Duel
.
SendtoGrave
(
e
:
GetHandler
(),
REASON_DISCARD
+
REASON_COST
)
end
function
c21520189
.
sdrtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c21520189
.
pfilter
,
tp
,
LOCATION_HAND
,
0
,
3
,
e
:
GetHandler
())
and
Duel
.
IsExistingMatchingCard
(
c21520189
.
spfilter
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
,
e
,
tp
)
end
--
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
LOCATION_GRAVE
)
end
function
c21520189
.
sdrop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
hg
=
Duel
.
GetMatchingGroup
(
c21520189
.
pfilter
,
tp
,
LOCATION_HAND
,
0
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
c21520189
.
spfilter
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
and
hg
:
GetCount
()
>
2
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CONFIRM
)
local
pg
=
hg
:
Select
(
tp
,
3
,
3
,
nil
)
Duel
.
ConfirmCards
(
1
-
tp
,
pg
)
Duel
.
ShuffleHand
(
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
local
p
=
tp
local
tc
=
sg
:
GetFirst
()
local
op
=
2
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
)
>
0
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
21520189
,
3
),
aux
.
Stringid
(
21520189
,
4
))
elseif
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
)
==
0
then
op
=
0
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
aux
.
Stringid
(
21520189
,
3
))
elseif
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
==
0
and
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
)
>
0
then
op
=
1
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
aux
.
Stringid
(
21520189
,
4
))
end
if
op
==
1
then
p
=
1
-
tp
end
if
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
p
,
false
,
false
,
POS_FACEUP
)
>
0
then
--can not activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
c21520189
.
aclimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
+
RESET_OPPO_TURN
)
tc
:
RegisterEffect
(
e1
)
--destroy
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_DESTROY
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e2
:
SetCode
(
EVENT_BATTLE_DAMAGE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTarget
(
c21520189
.
destg
)
e2
:
SetOperation
(
c21520189
.
desop
)
tc
:
RegisterEffect
(
e2
)
end
end
end
function
c21520189
.
aclimit
(
e
,
re
,
tp
)
return
re
:
GetActivateLocation
()
==
LOCATION_GRAVE
end
function
c21520189
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
>=
1
end
end
function
c21520189
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsDistruable
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
Destroy
(
sg
,
REASON_EFFECT
)
Duel
.
BreakEffect
()
Duel
.
Destroy
(
c
,
REASON_EFFECT
)
end
end
function
c21520189
.
tgtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
>=
6
end
end
function
c21520189
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetDecktopGroup
(
tp
,
6
)
Duel
.
ConfirmDecktop
(
tp
,
6
)
local
tc
=
g
:
GetFirst
()
local
tgg
=
Group
.
CreateGroup
()
while
tc
do
if
tc
:
IsType
(
TYPE_MONSTER
)
and
tc
:
IsSetCard
(
0x490
)
then
tgg
:
AddCard
(
tc
)
end
tc
=
g
:
GetNext
()
end
local
ct
=
Duel
.
SendtoGrave
(
tgg
,
REASON_EFFECT
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
otg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToGrave
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
ct
,
ct
,
nil
)
Duel
.
SendtoGrave
(
otg
,
REASON_EFFECT
)
Duel
.
ShuffleDeck
(
tp
)
end
expansions/script/c24562471.lua
0 → 100644
View file @
002d5777
--+++++猛毒性 球系
function
c24562471
.
initial_effect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
24562471
,
0
))
e2
:
SetCategory
(
CATEGORY_DRAW
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_F
)
e2
:
SetCode
(
EVENT_DAMAGE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCountLimit
(
1
,
24562471
)
e2
:
SetCondition
(
c24562471
.
drcon
)
e2
:
SetTarget
(
c24562471
.
drtg
)
e2
:
SetOperation
(
c24562471
.
drop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
24562471
,
1
))
e3
:
SetCategory
(
CATEGORY_DAMAGE
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetCode
(
EVENT_PHASE
+
PHASE_BATTLE_START
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e3
:
SetCountLimit
(
1
)
e3
:
SetTarget
(
c24562471
.
target
)
e3
:
SetOperation
(
c24562471
.
operation
)
c
:
RegisterEffect
(
e3
)
end
function
c24562471
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetTargetPlayer
(
1
-
tp
)
Duel
.
SetTargetParam
(
600
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DAMAGE
,
nil
,
0
,
1
-
tp
,
600
)
end
function
c24562471
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Damage
(
p
,
d
,
REASON_EFFECT
)
end
function
c24562471
.
drcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
bit
.
band
(
r
,
REASON_EFFECT
)
~=
0
then
return
re
and
re
:
GetHandler
():
IsSetCard
(
0x9390
)
and
ep
~=
tp
else
return
ep
~=
tp
end
end
function
c24562471
.
drtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c24562471
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TRIGGERING_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Draw
(
p
,
d
,
REASON_EFFECT
)
end
\ No newline at end of file
expansions/script/c33400007.lua
View file @
002d5777
--时崎狂三-祈福
function
c33400007
.
initial_effect
(
c
)
--link summon
aux
.
AddLinkProcedure
(
c
,
c33400007
.
mfilter
,
2
)
c
:
EnableReviveLimit
()
--activate from hand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_QP_ACT_IN_NTPHAND
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTarget
(
aux
.
TargetBoolFunction
(
c33400007
.
afilter
))
e1
:
SetTargetRange
(
LOCATION_HAND
,
0
)
c
:
RegisterEffect
(
e1
)
--extra summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
33400007
,
0
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_EXTRA_SUMMON_COUNT
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTargetRange
(
LOCATION_HAND
,
0
)
e2
:
SetValue
(
c33400007
.
sumval
)
c
:
RegisterEffect
(
e2
)
--search
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
33400007
,
0
))
e3
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
,
33400007
)
e3
:
SetLabel
(
2
)
e3
:
SetCost
(
c33400007
.
thcost
)
e3
:
SetTarget
(
c33400007
.
thtg
)
e3
:
SetOperation
(
c33400007
.
thop
)
c
:
RegisterEffect
(
e3
)
end
function
c33400007
.
mfilter
(
c
)
return
c
:
IsLinkSetCard
(
0x3341
)
end
function
c33400007
.
afilter
(
c
)
return
c
:
IsSetCard
(
0x3340
)
and
c
:
IsType
(
TYPE_QUICKPLAY
)
end
function
c33400007
.
sumval
(
e
,
c
)
local
sumzone
=
e
:
GetHandler
():
GetLinkedZone
()
local
relzone
=-
bit
.
lshift
(
1
,
e
:
GetHandler
():
GetSequence
())
return
0
,
sumzone
,
relzone
end
function
c33400007
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
and
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
0
,
0x34f
,
ct
,
REASON_COST
)
end
local
ct
=
e
:
GetLabel
()
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x34f
,
ct
,
REASON_COST
)
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
end
function
c33400007
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x3341
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
c33400007
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c33400007
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c33400007
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c33400007
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
--时崎狂三-祈福
function
c33400007
.
initial_effect
(
c
)
--link summon
aux
.
AddLinkProcedure
(
c
,
c33400007
.
mfilter
,
2
)
c
:
EnableReviveLimit
()
--activate from hand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_QP_ACT_IN_NTPHAND
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTarget
(
aux
.
TargetBoolFunction
(
c33400007
.
afilter
))
e1
:
SetTargetRange
(
LOCATION_HAND
,
0
)
c
:
RegisterEffect
(
e1
)
--extra summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
33400007
,
0
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_EXTRA_SUMMON_COUNT
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTargetRange
(
LOCATION_HAND
,
0
)
e2
:
SetValue
(
c33400007
.
sumval
)
c
:
RegisterEffect
(
e2
)
--search
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
33400007
,
0
))
e3
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
,
33400007
)
e3
:
SetLabel
(
2
)
e3
:
SetCost
(
c33400007
.
thcost
)
e3
:
SetTarget
(
c33400007
.
thtg
)
e3
:
SetOperation
(
c33400007
.
thop
)
c
:
RegisterEffect
(
e3
)
end
function
c33400007
.
mfilter
(
c
)
return
c
:
IsLinkSetCard
(
0x3341
)
end
function
c33400007
.
afilter
(
c
)
return
c
:
IsSetCard
(
0x3340
)
and
c
:
IsType
(
TYPE_QUICKPLAY
)
end
function
c33400007
.
sumval
(
e
,
c
)
local
sumzone
=
e
:
GetHandler
():
GetLinkedZone
()
local
relzone
=-
bit
.
lshift
(
1
,
e
:
GetHandler
():
GetSequence
())
return
0
,
sumzone
,
relzone
end
function
c33400007
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
ct
=
e
:
GetLabel
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
and
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
0
,
0x34f
,
ct
,
REASON_COST
)
end
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x34f
,
ct
,
REASON_COST
)
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
end
function
c33400007
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x3341
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
c33400007
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c33400007
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c33400007
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c33400007
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
\ No newline at end of file
expansions/script/c33400013.lua
View file @
002d5777
--时崎狂三 校服
function
c33400013
.
initial_effect
(
c
)
--synchro summon
aux
.
AddSynchroProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsSetCard
,
0x341
),
aux
.
NonTuner
(
nil
),
1
)
c
:
EnableReviveLimit
()
--CANNOT_ATTACK
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
33400013
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCost
(
c33400013
.
cost1
)
e1
:
SetOperation
(
c33400013
.
activate1
)
c
:
RegisterEffect
(
e1
)
--set counter
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
33400013
,
1
))
e2
:
SetCategory
(
CATEGORY_COUNTER
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_TO_GRAVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetTarget
(
c33400013
.
addct
)
e2
:
SetOperation
(
c33400013
.
addc
)
c
:
RegisterEffect
(
e2
)
--protection
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
33400013
,
1
))
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetRange
(
LOCATION_GRAVE
)
e3
:
SetCost
(
aux
.
bfgcost
)
e3
:
SetOperation
(
c33400013
.
activate3
)
c
:
RegisterEffect
(
e3
)
end
function
c33400013
.
tgfilter
(
e
,
c
)
return
c
:
IsFaceup
()
and
c
:
IsLocation
(
LOCATION_MZONE
)
and
c
:
IsSetCard
(
0x341
)
end
function
c33400013
.
activate3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e1
:
SetTargetRange
(
LOCATION_ONFIELD
,
0
)
e1
:
SetTarget
(
c33400013
.
tgfilter
)
e1
:
SetValue
(
1
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
--e2
function
c33400013
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCanAddCounter
(
0x34f
,
4
)
end
function
c33400013
.
addct
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsOnField
()
and
c33400013
.
filter
(
chkc
)
end
if
chk
==
0
then
return
true
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
c33400013
.
filter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COUNTER
,
nil
,
4
,
0
,
0x34f
)
end
function
c33400013
.
addc
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
and
tc
:
IsFaceup
()
and
tc
:
IsRelateToEffect
(
e
)
then
tc
:
AddCounter
(
0x34f
,
4
)
end
end
--e1
function
c33400013
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsReleasable
()
end
Duel
.
SendtoGrave
(
e
:
GetHandler
(),
REASON_COST
)
end
function
c33400013
.
activate1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
tp
~=
Duel
.
GetTurnPlayer
()
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_ATTACK_ANNOUNCE
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetTargetRange
(
0
,
1
)
Duel
.
RegisterEffect
(
e1
,
tp
)
else
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_ATTACK_ANNOUNCE
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetTargetRange
(
0
,
1
)
Duel
.
RegisterEffect
(
e1
,
1
-
tp
)
end
end
--时崎狂三 校服
function
c33400013
.
initial_effect
(
c
)
--synchro summon
aux
.
AddSynchroProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsSetCard
,
0x341
),
aux
.
NonTuner
(
nil
),
1
)
c
:
EnableReviveLimit
()
--CANNOT_ATTACK
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
33400013
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCost
(
c33400013
.
cost1
)
e1
:
SetOperation
(
c33400013
.
activate1
)
c
:
RegisterEffect
(
e1
)
--set counter
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
33400013
,
1
))
e2
:
SetCategory
(
CATEGORY_COUNTER
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_TO_GRAVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCountLimit
(
1
,
33400013
+
10000
)
e2
:
SetTarget
(
c33400013
.
addct
)
e2
:
SetOperation
(
c33400013
.
addc
)
c
:
RegisterEffect
(
e2
)
--protection
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
33400013
,
1
))
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetRange
(
LOCATION_GRAVE
)
e3
:
SetCost
(
aux
.
bfgcost
)
e3
:
SetOperation
(
c33400013
.
activate3
)
c
:
RegisterEffect
(
e3
)
end
function
c33400013
.
tgfilter
(
e
,
c
)
return
c
:
IsFaceup
()
and
c
:
IsLocation
(
LOCATION_MZONE
)
and
c
:
IsSetCard
(
0x341
)
end
function
c33400013
.
activate3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e1
:
SetTargetRange
(
LOCATION_ONFIELD
,
0
)
e1
:
SetTarget
(
c33400013
.
tgfilter
)
e1
:
SetValue
(
1
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
--e2
function
c33400013
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCanAddCounter
(
0x34f
,
4
)
end
function
c33400013
.
addct
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsOnField
()
and
c33400013
.
filter
(
chkc
)
end
if
chk
==
0
then
return
true
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
c33400013
.
filter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_COUNTER
,
nil
,
4
,
0
,
0x34f
)
end
function
c33400013
.
addc
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
and
tc
:
IsFaceup
()
and
tc
:
IsRelateToEffect
(
e
)
then
tc
:
AddCounter
(
0x34f
,
4
)
end
end
--e1
function
c33400013
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsReleasable
()
end
Duel
.
SendtoGrave
(
e
:
GetHandler
(),
REASON_COST
)
end
function
c33400013
.
activate1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
tp
~=
Duel
.
GetTurnPlayer
()
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_ATTACK_ANNOUNCE
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetTargetRange
(
0
,
1
)
Duel
.
RegisterEffect
(
e1
,
tp
)
else
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_ATTACK_ANNOUNCE
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetTargetRange
(
0
,
1
)
Duel
.
RegisterEffect
(
e1
,
1
-
tp
)
end
end
expansions/script/c33400103.lua
View file @
002d5777
--刻刻帝---「三之弹」
function
c33400103
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_ATKCHANGE
+
CATEGORY_DEFCHANGE
+
CATEGORY_LVCHANGE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetHintTiming
(
TIMING_DAMAGE_STEP
,
TIMING_DAMAGE_STEP
+
TIMINGS_CHECK_MONSTER
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCountLimit
(
1
,
33400103
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetTarget
(
c33400103
.
target
)
e1
:
SetOperation
(
c33400103
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c33400103
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x3341
)
end
function
c33400103
.
filter
(
c
)
return
c
:
IsFaceup
()
end
function
c33400103
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c33400103
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
0
,
0x
1003
,
1
,
REASON_COST
)
end
local
sc
=
Duel
.
GetMatchingGroupCount
(
c33400103
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
chkc
then
return
chkc
:
IsControler
(
1
-
tp
)
and
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
c33400102
.
filter
(
chkc
)
end
if
chk
==
0
then
return
sc
>
0
and
Duel
.
IsExistingTarget
(
c33400102
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
-
1
,
nil
)
end
local
cn
=
Duel
.
GetCounter
(
tp
,
1
,
0
,
0x34f
)
local
lvt
=
{}
for
i
=
1
,
7
do
if
i
<=
cn
and
i
<=
sc
then
lvt
[
i
]
=
i
end
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
33400103
,
1
))
local
sc1
=
Duel
.
AnnounceNumber
(
tp
,
table.unpack
(
lvt
))
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x34f
,
sc1
,
REASON_COST
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c33400103
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
sc1
,
sc1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_ATKCHANGE
+
CATEGORY_DEFCHANGE
+
CATEGORY_LVCHANGE
,
g
,
g
:
GetCount
(),
0
,
0
)
local
v
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
):
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
end
function
c33400103
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
):
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
if
g
:
GetCount
()
>
0
then
local
sc
=
g
:
GetFirst
()
while
sc
do
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SET_ATTACK_FINAL
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e1
:
SetValue
(
sc
:
GetAttack
()
*
2
)
sc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_SET_DEFENSE_FINAL
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e2
:
SetValue
(
sc
:
GetDefense
()
*
2
)
sc
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_CHANGE_LEVEL
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e3
:
SetValue
(
sc
:
GetLevel
()
*
2
)
sc
:
RegisterEffect
(
e3
)
sc
=
g
:
GetNext
()
end
end
--刻刻帝---「三之弹」
function
c33400103
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_ATKCHANGE
+
CATEGORY_DEFCHANGE
+
CATEGORY_LVCHANGE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetHintTiming
(
TIMING_DAMAGE_STEP
,
TIMING_DAMAGE_STEP
+
TIMINGS_CHECK_MONSTER
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCountLimit
(
1
,
33400103
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetTarget
(
c33400103
.
target
)
e1
:
SetOperation
(
c33400103
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c33400103
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x3341
)
end
function
c33400103
.
filter
(
c
)
return
c
:
IsFaceup
()
end
function
c33400103
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c33400103
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
0
,
0x
34f
,
1
,
REASON_COST
)
end
local
sc
=
Duel
.
GetMatchingGroupCount
(
c33400103
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
chkc
then
return
chkc
:
IsControler
(
1
-
tp
)
and
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
c33400102
.
filter
(
chkc
)
end
if
chk
==
0
then
return
sc
>
0
and
Duel
.
IsExistingTarget
(
c33400102
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
-
1
,
nil
)
end
local
cn
=
Duel
.
GetCounter
(
tp
,
1
,
0
,
0x34f
)
local
lvt
=
{}
for
i
=
1
,
7
do
if
i
<=
cn
and
i
<=
sc
then
lvt
[
i
]
=
i
end
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
33400103
,
1
))
local
sc1
=
Duel
.
AnnounceNumber
(
tp
,
table.unpack
(
lvt
))
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x34f
,
sc1
,
REASON_COST
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c33400103
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
sc1
,
sc1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_ATKCHANGE
+
CATEGORY_DEFCHANGE
+
CATEGORY_LVCHANGE
,
g
,
g
:
GetCount
(),
0
,
0
)
local
v
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
):
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
end
function
c33400103
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
):
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
if
g
:
GetCount
()
>
0
then
local
sc
=
g
:
GetFirst
()
while
sc
do
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SET_ATTACK_FINAL
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e1
:
SetValue
(
sc
:
GetAttack
()
*
2
)
sc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_SET_DEFENSE_FINAL
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e2
:
SetValue
(
sc
:
GetDefense
()
*
2
)
sc
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_CHANGE_LEVEL
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e3
:
SetValue
(
sc
:
GetLevel
()
*
2
)
sc
:
RegisterEffect
(
e3
)
sc
=
g
:
GetNext
()
end
end
end
\ No newline at end of file
expansions/script/c65020067.lua
View file @
002d5777
--夜之晶月辉印
function
c65020067
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
c65020067
.
target
)
e1
:
SetOperation
(
c65020067
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c65020067
.
thfil
(
c
)
return
c
:
IsSetCard
(
0x9da3
)
and
c
:
IsAbleToHand
()
end
function
c65020067
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c65020067
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020067
,
0
,
0x21
,
0
,
2000
,
4
,
RACE_WYRM
,
ATTRIBUTE_DARK
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c65020067
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c65020067
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
and
Duel
.
SendtoHand
(
g
,
tp
,
REASON_EFFECT
)
~=
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
BreakEffect
()
if
not
c
:
IsRelateToEffect
(
e
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020067
,
0
,
0x21
,
0
,
2000
,
4
,
RACE_WYRM
,
ATTRIBUTE_DARK
)
then
return
end
c
:
AddMonsterAttribute
(
TYPE_EFFECT
+
TYPE_TRAP
)
Duel
.
SpecialSummonStep
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
)
e1
:
SetCondition
(
c65020067
.
con
)
e1
:
SetCost
(
c65020067
.
cost
)
e1
:
SetTarget
(
c65020067
.
xyztg
)
e1
:
SetOperation
(
c65020067
.
xyzop
)
c
:
RegisterEffect
(
e1
,
true
)
Duel
.
SpecialSummonComplete
()
end
end
function
c65020067
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
return
Duel
.
GetTurnPlayer
()
~=
tp
and
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
end
function
c65020067
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
GetFlagEffect
(
65020067
)
==
0
end
c
:
RegisterFlagEffect
(
65020067
,
RESET_CHAIN
,
0
,
1
)
end
function
c65020067
.
xyzfilter2
(
c
,
mg
)
return
c
:
IsXyzSummonable
(
mg
)
and
c
:
IsType
(
TYPE_XYZ
)
end
function
c65020067
.
xyzfilter1
(
c
,
tp
)
return
c
:
IsSetCard
(
0x9da3
)
and
c
:
IsFaceup
()
and
not
c
:
IsType
(
TYPE_TOKEN
)
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
c
)
>
0
end
function
c65020067
.
xyztg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
g
=
Duel
.
GetMatchingGroup
(
c65020067
.
xyzfilter1
,
tp
,
LOCATION_MZONE
,
0
,
nil
,
tp
)
return
Duel
.
IsExistingMatchingCard
(
c65020067
.
xyzfilter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
g
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
c65020067
.
xyzop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c65020067
.
xyzfilter1
,
tp
,
LOCATION_MZONE
,
0
,
nil
,
tp
)
if
g
:
GetCount
()
<=
0
then
return
end
local
xyzg
=
Duel
.
GetMatchingGroup
(
c65020067
.
xyzfilter2
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
g
)
if
xyzg
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
xyz
=
xyzg
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
XyzSummon
(
tp
,
xyz
,
g
,
1
,
10
)
end
--夜之晶月辉印
function
c65020067
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
c65020067
.
target
)
e1
:
SetOperation
(
c65020067
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c65020067
.
thfil
(
c
)
return
c
:
IsSetCard
(
0x9da3
)
and
c
:
IsAbleToHand
()
end
function
c65020067
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c65020067
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020067
,
0
,
0x21
,
0
,
2000
,
4
,
RACE_WYRM
,
ATTRIBUTE_DARK
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c65020067
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c65020067
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
and
Duel
.
SendtoHand
(
g
,
tp
,
REASON_EFFECT
)
~=
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
BreakEffect
()
if
not
c
:
IsRelateToEffect
(
e
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020067
,
0
,
0x21
,
0
,
2000
,
4
,
RACE_WYRM
,
ATTRIBUTE_DARK
)
then
return
end
c
:
AddMonsterAttribute
(
TYPE_EFFECT
+
TYPE_TRAP
)
Duel
.
SpecialSummonStep
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetCondition
(
c65020067
.
con
)
e1
:
SetCost
(
c65020067
.
cost
)
e1
:
SetTarget
(
c65020067
.
xyztg
)
e1
:
SetOperation
(
c65020067
.
xyzop
)
c
:
RegisterEffect
(
e1
,
true
)
Duel
.
SpecialSummonComplete
()
end
end
function
c65020067
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
return
Duel
.
GetTurnPlayer
()
~=
tp
and
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
end
function
c65020067
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
GetFlagEffect
(
65020067
)
==
0
end
c
:
RegisterFlagEffect
(
65020067
,
RESET_CHAIN
,
0
,
1
)
end
function
c65020067
.
xyzfilter2
(
c
,
mg
)
return
c
:
IsXyzSummonable
(
mg
)
and
c
:
IsType
(
TYPE_XYZ
)
end
function
c65020067
.
xyzfilter1
(
c
,
tp
)
return
c
:
IsSetCard
(
0x9da3
)
and
c
:
IsFaceup
()
and
not
c
:
IsType
(
TYPE_TOKEN
)
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
c
)
>
0
end
function
c65020067
.
xyztg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
g
=
Duel
.
GetMatchingGroup
(
c65020067
.
xyzfilter1
,
tp
,
LOCATION_MZONE
,
0
,
nil
,
tp
)
return
Duel
.
IsExistingMatchingCard
(
c65020067
.
xyzfilter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
g
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
c65020067
.
xyzop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c65020067
.
xyzfilter1
,
tp
,
LOCATION_MZONE
,
0
,
nil
,
tp
)
if
g
:
GetCount
()
<=
0
then
return
end
local
xyzg
=
Duel
.
GetMatchingGroup
(
c65020067
.
xyzfilter2
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
g
)
if
xyzg
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
xyz
=
xyzg
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
XyzSummon
(
tp
,
xyz
,
g
,
1
,
10
)
end
end
\ No newline at end of file
expansions/script/c65020068.lua
View file @
002d5777
--雪之晶月辉印
function
c65020068
.
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
:
SetTarget
(
c65020068
.
target
)
e1
:
SetOperation
(
c65020068
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c65020068
.
thfil
(
c
)
return
c
:
IsSetCard
(
0x9da3
)
and
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_CONTINUOUS
)
and
c
:
IsSSetable
()
end
function
c65020068
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c65020068
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020068
,
0
,
0x21
,
1600
,
1000
,
4
,
RACE_AQUA
,
ATTRIBUTE_DARK
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c65020068
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c65020068
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
and
Duel
.
SSet
(
tp
,
g
:
GetFirst
())
~=
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
BreakEffect
()
if
not
c
:
IsRelateToEffect
(
e
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020068
,
0
,
0x21
,
1600
,
1000
,
4
,
RACE_AQUA
,
ATTRIBUTE_DARK
)
then
return
end
c
:
AddMonsterAttribute
(
TYPE_EFFECT
+
TYPE_TRAP
)
Duel
.
SpecialSummonStep
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
)
e1
:
SetCondition
(
c65020068
.
con
)
e1
:
SetCost
(
c65020068
.
cost
)
e1
:
SetTarget
(
c65020068
.
xyztg
)
e1
:
SetOperation
(
c65020068
.
xyzop
)
c
:
RegisterEffect
(
e1
,
true
)
Duel
.
SpecialSummonComplete
()
end
end
function
c65020068
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
return
Duel
.
GetTurnPlayer
()
~=
tp
and
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
end
function
c65020068
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
GetFlagEffect
(
65020068
)
==
0
end
c
:
RegisterFlagEffect
(
65020068
,
RESET_CHAIN
,
0
,
1
)
end
function
c65020068
.
xyzfilter2
(
c
,
mg
)
return
c
:
IsXyzSummonable
(
mg
)
and
c
:
IsType
(
TYPE_XYZ
)
end
function
c65020068
.
xyzfilter1
(
c
,
tp
)
return
c
:
IsSetCard
(
0x9da3
)
and
c
:
IsFaceup
()
and
not
c
:
IsType
(
TYPE_TOKEN
)
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
c
)
>
0
end
function
c65020068
.
xyztg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
g
=
Duel
.
GetMatchingGroup
(
c65020068
.
xyzfilter1
,
tp
,
LOCATION_MZONE
,
0
,
nil
,
tp
)
return
Duel
.
IsExistingMatchingCard
(
c65020068
.
xyzfilter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
g
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
c65020068
.
xyzop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c65020068
.
xyzfilter1
,
tp
,
LOCATION_MZONE
,
0
,
nil
,
tp
)
if
g
:
GetCount
()
<=
0
then
return
end
local
xyzg
=
Duel
.
GetMatchingGroup
(
c65020068
.
xyzfilter2
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
g
)
if
xyzg
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
xyz
=
xyzg
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
XyzSummon
(
tp
,
xyz
,
g
,
1
,
10
)
end
end
--雪之晶月辉印
function
c65020068
.
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
:
SetTarget
(
c65020068
.
target
)
e1
:
SetOperation
(
c65020068
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c65020068
.
thfil
(
c
)
return
c
:
IsSetCard
(
0x9da3
)
and
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_CONTINUOUS
)
and
c
:
IsSSetable
()
end
function
c65020068
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c65020068
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020068
,
0
,
0x21
,
1600
,
1000
,
4
,
RACE_AQUA
,
ATTRIBUTE_DARK
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c65020068
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c65020068
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
and
Duel
.
SSet
(
tp
,
g
:
GetFirst
())
~=
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
BreakEffect
()
if
not
c
:
IsRelateToEffect
(
e
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020068
,
0
,
0x21
,
1600
,
1000
,
4
,
RACE_AQUA
,
ATTRIBUTE_DARK
)
then
return
end
c
:
AddMonsterAttribute
(
TYPE_EFFECT
+
TYPE_TRAP
)
Duel
.
SpecialSummonStep
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetCondition
(
c65020068
.
con
)
e1
:
SetCost
(
c65020068
.
cost
)
e1
:
SetTarget
(
c65020068
.
xyztg
)
e1
:
SetOperation
(
c65020068
.
xyzop
)
c
:
RegisterEffect
(
e1
,
true
)
Duel
.
SpecialSummonComplete
()
end
end
function
c65020068
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
return
Duel
.
GetTurnPlayer
()
~=
tp
and
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
end
function
c65020068
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
GetFlagEffect
(
65020068
)
==
0
end
c
:
RegisterFlagEffect
(
65020068
,
RESET_CHAIN
,
0
,
1
)
end
function
c65020068
.
xyzfilter2
(
c
,
mg
)
return
c
:
IsXyzSummonable
(
mg
)
and
c
:
IsType
(
TYPE_XYZ
)
end
function
c65020068
.
xyzfilter1
(
c
,
tp
)
return
c
:
IsSetCard
(
0x9da3
)
and
c
:
IsFaceup
()
and
not
c
:
IsType
(
TYPE_TOKEN
)
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
c
)
>
0
end
function
c65020068
.
xyztg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
g
=
Duel
.
GetMatchingGroup
(
c65020068
.
xyzfilter1
,
tp
,
LOCATION_MZONE
,
0
,
nil
,
tp
)
return
Duel
.
IsExistingMatchingCard
(
c65020068
.
xyzfilter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
g
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
c65020068
.
xyzop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c65020068
.
xyzfilter1
,
tp
,
LOCATION_MZONE
,
0
,
nil
,
tp
)
if
g
:
GetCount
()
<=
0
then
return
end
local
xyzg
=
Duel
.
GetMatchingGroup
(
c65020068
.
xyzfilter2
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
g
)
if
xyzg
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
xyz
=
xyzg
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
XyzSummon
(
tp
,
xyz
,
g
,
1
,
10
)
end
end
expansions/script/c65020069.lua
View file @
002d5777
--幻之晶月辉印
function
c65020069
.
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
:
SetTarget
(
c65020069
.
target
)
e1
:
SetOperation
(
c65020069
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c65020069
.
thfil
(
c
)
return
c
:
IsSetCard
(
0x9da3
)
and
c
:
IsAbleToGrave
()
end
function
c65020069
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c65020069
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020069
,
0
,
0x21
,
1900
,
500
,
4
,
RACE_PSYCHO
,
ATTRIBUTE_DARK
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c65020069
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c65020069
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
and
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
~=
0
then
Duel
.
BreakEffect
()
if
not
c
:
IsRelateToEffect
(
e
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020069
,
0
,
0x21
,
1900
,
500
,
4
,
RACE_PSYCHO
,
ATTRIBUTE_DARK
)
then
return
end
c
:
AddMonsterAttribute
(
TYPE_EFFECT
+
TYPE_TRAP
)
Duel
.
SpecialSummonStep
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCondition
(
c65020069
.
con
)
e1
:
SetCost
(
c65020069
.
cost
)
e1
:
SetTarget
(
c65020069
.
linktg
)
e1
:
SetOperation
(
c65020069
.
linkop
)
c
:
RegisterEffect
(
e1
,
true
)
Duel
.
SpecialSummonComplete
()
end
end
function
c65020069
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
return
Duel
.
GetTurnPlayer
()
~=
tp
and
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
end
function
c65020069
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
GetFlagEffect
(
65020069
)
==
0
end
c
:
RegisterFlagEffect
(
65020069
,
RESET_CHAIN
,
0
,
1
)
end
function
c65020069
.
matfilter
(
c
)
return
c
:
IsFaceup
()
end
function
c65020069
.
lkfilter
(
c
)
return
c
:
IsSetCard
(
0x9da3
)
and
c
:
IsType
(
TYPE_LINK
)
and
c
:
IsSpecialSummonable
(
SUMMON_TYPE_LINK
)
end
function
c65020069
.
linktg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
el
=
{}
local
mg
=
Duel
.
GetMatchingGroup
(
c65020069
.
matfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
0
,
mg
)
for
tc
in
aux
.
Next
(
g
)
do
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_BE_LINK_MATERIAL
)
tc
:
RegisterEffect
(
e1
)
table.insert
(
el
,
e1
)
end
local
res
=
Duel
.
IsExistingMatchingCard
(
c65020069
.
lkfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
)
for
_
,
e
in
ipairs
(
el
)
do
e
:
Reset
()
end
return
res
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
c65020069
.
linkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
el
=
{}
local
mg
=
Duel
.
GetMatchingGroup
(
c65020069
.
matfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
0
,
mg
)
for
tc
in
aux
.
Next
(
g
)
do
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_BE_LINK_MATERIAL
)
tc
:
RegisterEffect
(
e1
)
table.insert
(
el
,
e1
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
xg
=
Duel
.
SelectMatchingCard
(
tp
,
c65020069
.
lkfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
)
local
tc
=
xg
:
GetFirst
()
if
tc
then
Duel
.
SpecialSummonRule
(
tp
,
tc
,
SUMMON_TYPE_LINK
)
end
for
_
,
e
in
ipairs
(
el
)
do
e
:
Reset
()
end
--幻之晶月辉印
function
c65020069
.
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
:
SetTarget
(
c65020069
.
target
)
e1
:
SetOperation
(
c65020069
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c65020069
.
thfil
(
c
)
return
c
:
IsSetCard
(
0x9da3
)
and
c
:
IsAbleToGrave
()
end
function
c65020069
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c65020069
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020069
,
0
,
0x21
,
1900
,
500
,
4
,
RACE_PSYCHO
,
ATTRIBUTE_DARK
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c65020069
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c65020069
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
and
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
~=
0
then
Duel
.
BreakEffect
()
if
not
c
:
IsRelateToEffect
(
e
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020069
,
0
,
0x21
,
1900
,
500
,
4
,
RACE_PSYCHO
,
ATTRIBUTE_DARK
)
then
return
end
c
:
AddMonsterAttribute
(
TYPE_EFFECT
+
TYPE_TRAP
)
Duel
.
SpecialSummonStep
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetCondition
(
c65020069
.
con
)
e1
:
SetCost
(
c65020069
.
cost
)
e1
:
SetTarget
(
c65020069
.
linktg
)
e1
:
SetOperation
(
c65020069
.
linkop
)
c
:
RegisterEffect
(
e1
,
true
)
Duel
.
SpecialSummonComplete
()
end
end
function
c65020069
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
return
Duel
.
GetTurnPlayer
()
~=
tp
and
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
end
function
c65020069
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
GetFlagEffect
(
65020069
)
==
0
end
c
:
RegisterFlagEffect
(
65020069
,
RESET_CHAIN
,
0
,
1
)
end
function
c65020069
.
matfilter
(
c
)
return
c
:
IsFaceup
()
end
function
c65020069
.
lkfilter
(
c
)
return
c
:
IsSetCard
(
0x9da3
)
and
c
:
IsType
(
TYPE_LINK
)
and
c
:
IsSpecialSummonable
(
SUMMON_TYPE_LINK
)
end
function
c65020069
.
linktg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
el
=
{}
local
mg
=
Duel
.
GetMatchingGroup
(
c65020069
.
matfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
0
,
mg
)
for
tc
in
aux
.
Next
(
g
)
do
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_BE_LINK_MATERIAL
)
tc
:
RegisterEffect
(
e1
)
table.insert
(
el
,
e1
)
end
local
res
=
Duel
.
IsExistingMatchingCard
(
c65020069
.
lkfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
)
for
_
,
e
in
ipairs
(
el
)
do
e
:
Reset
()
end
return
res
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
c65020069
.
linkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
el
=
{}
local
mg
=
Duel
.
GetMatchingGroup
(
c65020069
.
matfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
0
,
mg
)
for
tc
in
aux
.
Next
(
g
)
do
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_BE_LINK_MATERIAL
)
tc
:
RegisterEffect
(
e1
)
table.insert
(
el
,
e1
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
xg
=
Duel
.
SelectMatchingCard
(
tp
,
c65020069
.
lkfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
)
local
tc
=
xg
:
GetFirst
()
if
tc
then
Duel
.
SpecialSummonRule
(
tp
,
tc
,
SUMMON_TYPE_LINK
)
end
for
_
,
e
in
ipairs
(
el
)
do
e
:
Reset
()
end
end
\ No newline at end of file
expansions/script/c65020070.lua
View file @
002d5777
--星之晶月辉印
function
c65020070
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
c65020070
.
target
)
e1
:
SetOperation
(
c65020070
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c65020070
.
thfil
(
c
)
return
c
:
IsSetCard
(
0x9da3
)
and
c
:
IsAbleToHand
()
end
function
c65020070
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c65020070
.
thfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020070
,
0
,
0x21
,
1500
,
1500
,
4
,
RACE_WARRIOR
,
ATTRIBUTE_DARK
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c65020070
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c65020070
.
thfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
and
Duel
.
SendtoHand
(
g
,
tp
,
REASON_EFFECT
)
~=
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
BreakEffect
()
if
not
c
:
IsRelateToEffect
(
e
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020070
,
0
,
0x21
,
1500
,
1500
,
4
,
RACE_WARRIOR
,
ATTRIBUTE_DARK
)
then
return
end
c
:
AddMonsterAttribute
(
TYPE_EFFECT
+
TYPE_TRAP
)
Duel
.
SpecialSummonStep
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCondition
(
c65020070
.
con
)
e1
:
SetCost
(
c65020070
.
cost
)
e1
:
SetTarget
(
c65020070
.
linktg
)
e1
:
SetOperation
(
c65020070
.
linkop
)
c
:
RegisterEffect
(
e1
,
true
)
Duel
.
SpecialSummonComplete
()
end
end
function
c65020070
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
return
Duel
.
GetTurnPlayer
()
~=
tp
and
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
end
function
c65020070
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
GetFlagEffect
(
65020070
)
==
0
end
c
:
RegisterFlagEffect
(
65020070
,
RESET_CHAIN
,
0
,
1
)
end
function
c65020070
.
matfilter
(
c
)
return
c
:
IsFaceup
()
end
function
c65020070
.
lkfilter
(
c
)
return
c
:
IsSetCard
(
0x9da3
)
and
c
:
IsType
(
TYPE_LINK
)
and
c
:
IsSpecialSummonable
(
SUMMON_TYPE_LINK
)
end
function
c65020070
.
linktg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
el
=
{}
local
mg
=
Duel
.
GetMatchingGroup
(
c65020070
.
matfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
0
,
mg
)
for
tc
in
aux
.
Next
(
g
)
do
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_BE_LINK_MATERIAL
)
tc
:
RegisterEffect
(
e1
)
table.insert
(
el
,
e1
)
end
local
res
=
Duel
.
IsExistingMatchingCard
(
c65020070
.
lkfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
)
for
_
,
e
in
ipairs
(
el
)
do
e
:
Reset
()
end
return
res
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
c65020070
.
linkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
el
=
{}
local
mg
=
Duel
.
GetMatchingGroup
(
c65020070
.
matfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
0
,
mg
)
for
tc
in
aux
.
Next
(
g
)
do
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_BE_LINK_MATERIAL
)
tc
:
RegisterEffect
(
e1
)
table.insert
(
el
,
e1
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
xg
=
Duel
.
SelectMatchingCard
(
tp
,
c65020070
.
lkfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
)
local
tc
=
xg
:
GetFirst
()
if
tc
then
Duel
.
SpecialSummonRule
(
tp
,
tc
,
SUMMON_TYPE_LINK
)
end
for
_
,
e
in
ipairs
(
el
)
do
e
:
Reset
()
end
end
--星之晶月辉印
function
c65020070
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
c65020070
.
target
)
e1
:
SetOperation
(
c65020070
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c65020070
.
thfil
(
c
)
return
c
:
IsSetCard
(
0x9da3
)
and
c
:
IsAbleToHand
()
end
function
c65020070
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c65020070
.
thfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020070
,
0
,
0x21
,
1500
,
1500
,
4
,
RACE_WARRIOR
,
ATTRIBUTE_DARK
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c65020070
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c65020070
.
thfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
and
Duel
.
SendtoHand
(
g
,
tp
,
REASON_EFFECT
)
~=
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
BreakEffect
()
if
not
c
:
IsRelateToEffect
(
e
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020070
,
0
,
0x21
,
1500
,
1500
,
4
,
RACE_WARRIOR
,
ATTRIBUTE_DARK
)
then
return
end
c
:
AddMonsterAttribute
(
TYPE_EFFECT
+
TYPE_TRAP
)
Duel
.
SpecialSummonStep
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetCondition
(
c65020070
.
con
)
e1
:
SetCost
(
c65020070
.
cost
)
e1
:
SetTarget
(
c65020070
.
linktg
)
e1
:
SetOperation
(
c65020070
.
linkop
)
c
:
RegisterEffect
(
e1
,
true
)
Duel
.
SpecialSummonComplete
()
end
end
function
c65020070
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
return
Duel
.
GetTurnPlayer
()
~=
tp
and
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
end
function
c65020070
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
GetFlagEffect
(
65020070
)
==
0
end
c
:
RegisterFlagEffect
(
65020070
,
RESET_CHAIN
,
0
,
1
)
end
function
c65020070
.
matfilter
(
c
)
return
c
:
IsFaceup
()
end
function
c65020070
.
lkfilter
(
c
)
return
c
:
IsSetCard
(
0x9da3
)
and
c
:
IsType
(
TYPE_LINK
)
and
c
:
IsSpecialSummonable
(
SUMMON_TYPE_LINK
)
end
function
c65020070
.
linktg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
el
=
{}
local
mg
=
Duel
.
GetMatchingGroup
(
c65020070
.
matfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
0
,
mg
)
for
tc
in
aux
.
Next
(
g
)
do
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_BE_LINK_MATERIAL
)
tc
:
RegisterEffect
(
e1
)
table.insert
(
el
,
e1
)
end
local
res
=
Duel
.
IsExistingMatchingCard
(
c65020070
.
lkfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
)
for
_
,
e
in
ipairs
(
el
)
do
e
:
Reset
()
end
return
res
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
c65020070
.
linkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
el
=
{}
local
mg
=
Duel
.
GetMatchingGroup
(
c65020070
.
matfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
0
,
mg
)
for
tc
in
aux
.
Next
(
g
)
do
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_BE_LINK_MATERIAL
)
tc
:
RegisterEffect
(
e1
)
table.insert
(
el
,
e1
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
xg
=
Duel
.
SelectMatchingCard
(
tp
,
c65020070
.
lkfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
)
local
tc
=
xg
:
GetFirst
()
if
tc
then
Duel
.
SpecialSummonRule
(
tp
,
tc
,
SUMMON_TYPE_LINK
)
end
for
_
,
e
in
ipairs
(
el
)
do
e
:
Reset
()
end
end
expansions/script/c65020071.lua
View file @
002d5777
--晶之晶月辉印
function
c65020071
.
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
:
SetTarget
(
c65020071
.
target
)
e1
:
SetOperation
(
c65020071
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c65020071
.
thfil
(
c
)
return
c
:
IsSetCard
(
0x9da3
)
and
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_CONTINUOUS
)
and
c
:
IsSSetable
()
end
function
c65020071
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c65020071
.
thfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020071
,
0
,
0x21
,
500
,
1800
,
4
,
RACE_ROCK
,
ATTRIBUTE_DARK
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c65020071
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c65020071
.
thfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
and
Duel
.
SSet
(
tp
,
g
)
~=
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
BreakEffect
()
if
not
c
:
IsRelateToEffect
(
e
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020071
,
0
,
0x21
,
500
,
1800
,
4
,
RACE_ROCK
,
ATTRIBUTE_DARK
)
then
return
end
c
:
AddMonsterAttribute
(
TYPE_EFFECT
+
TYPE_TRAP
)
Duel
.
SpecialSummonStep
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
)
e1
:
SetCondition
(
c65020071
.
con
)
e1
:
SetTarget
(
c65020071
.
destg
)
e1
:
SetOperation
(
c65020071
.
desop
)
c
:
RegisterEffect
(
e1
,
true
)
Duel
.
SpecialSummonComplete
()
end
end
function
c65020071
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
return
Duel
.
GetTurnPlayer
()
~=
tp
and
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
end
function
c65020071
.
desfilter
(
c
)
return
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
end
function
c65020071
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
false
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c65020071
.
desfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
e
:
GetHandler
())
and
Duel
.
IsExistingTarget
(
aux
.
TRUE
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g1
=
Duel
.
SelectTarget
(
tp
,
c65020071
.
desfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g2
=
Duel
.
SelectTarget
(
tp
,
aux
.
TRUE
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
g1
:
Merge
(
g2
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g1
,
2
,
0
,
0
)
end
function
c65020071
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
):
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
if
g
:
GetCount
()
>
0
then
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
--晶之晶月辉印
function
c65020071
.
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
:
SetTarget
(
c65020071
.
target
)
e1
:
SetOperation
(
c65020071
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c65020071
.
thfil
(
c
)
return
c
:
IsSetCard
(
0x9da3
)
and
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_CONTINUOUS
)
and
c
:
IsSSetable
()
end
function
c65020071
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c65020071
.
thfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020071
,
0
,
0x21
,
500
,
1800
,
4
,
RACE_ROCK
,
ATTRIBUTE_DARK
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c65020071
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c65020071
.
thfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
and
Duel
.
SSet
(
tp
,
g
)
~=
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
BreakEffect
()
if
not
c
:
IsRelateToEffect
(
e
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020071
,
0
,
0x21
,
500
,
1800
,
4
,
RACE_ROCK
,
ATTRIBUTE_DARK
)
then
return
end
c
:
AddMonsterAttribute
(
TYPE_EFFECT
+
TYPE_TRAP
)
Duel
.
SpecialSummonStep
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
)
e1
:
SetCondition
(
c65020071
.
con
)
e1
:
SetTarget
(
c65020071
.
destg
)
e1
:
SetOperation
(
c65020071
.
desop
)
c
:
RegisterEffect
(
e1
,
true
)
Duel
.
SpecialSummonComplete
()
end
end
function
c65020071
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
return
Duel
.
GetTurnPlayer
()
~=
tp
and
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
end
function
c65020071
.
desfilter
(
c
)
return
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
end
function
c65020071
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
false
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c65020071
.
desfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
e
:
GetHandler
())
and
Duel
.
IsExistingTarget
(
aux
.
TRUE
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g1
=
Duel
.
SelectTarget
(
tp
,
c65020071
.
desfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g2
=
Duel
.
SelectTarget
(
tp
,
aux
.
TRUE
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
g1
:
Merge
(
g2
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g1
,
2
,
0
,
0
)
end
function
c65020071
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
):
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
if
g
:
GetCount
()
>
0
then
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c65020072.lua
View file @
002d5777
--花之晶月辉印
function
c65020072
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOGRAVE
+
CATEGORY_DRAW
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
c65020072
.
target
)
e1
:
SetOperation
(
c65020072
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c65020072
.
thfil
(
c
)
return
c
:
IsAbleToGrave
()
and
c
:
IsSetCard
(
0x9da3
)
end
function
c65020072
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
2
)
and
Duel
.
IsExistingMatchingCard
(
c65020072
.
thfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020072
,
0
,
0x21
,
1700
,
1200
,
4
,
RACE_PLANT
,
ATTRIBUTE_DARK
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
2
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c65020072
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
Duel
.
IsPlayerCanDraw
(
tp
,
2
)
then
return
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c65020072
.
thfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
e
:
GetHandler
())
if
g
:
GetCount
()
>
0
and
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
~=
0
and
Duel
.
Draw
(
tp
,
2
,
REASON_EFFECT
)
~=
0
then
Duel
.
BreakEffect
()
if
not
c
:
IsRelateToEffect
(
e
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020072
,
0
,
0x21
,
1700
,
1200
,
4
,
RACE_PLANT
,
ATTRIBUTE_DARK
)
then
return
end
c
:
AddMonsterAttribute
(
TYPE_EFFECT
+
TYPE_TRAP
)
Duel
.
SpecialSummonStep
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
)
e1
:
SetCondition
(
c65020072
.
con
)
e1
:
SetTarget
(
c65020072
.
distg
)
e1
:
SetOperation
(
c65020072
.
disop
)
c
:
RegisterEffect
(
e1
,
true
)
Duel
.
SpecialSummonComplete
()
end
end
function
c65020072
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
return
Duel
.
GetTurnPlayer
()
~=
tp
and
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
end
function
c65020072
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
end
function
c65020072
.
distg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
false
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c65020072
.
filter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
e
:
GetHandler
())
and
Duel
.
IsExistingTarget
(
aux
.
disfilter1
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SELF
)
Duel
.
SelectTarget
(
tp
,
aux
.
disfilter1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_OPPO
)
Duel
.
SelectTarget
(
tp
,
aux
.
disfilter1
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
end
function
c65020072
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
):
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
if
g
:
GetCount
()
~=
2
then
return
end
for
tc
in
aux
.
Next
(
g
)
do
Duel
.
NegateRelatedChain
(
tc
,
RESET_TURN_SET
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetValue
(
RESET_TURN_SET
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e2
)
if
tc
:
IsType
(
TYPE_TRAPMONSTER
)
then
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e3
:
SetCode
(
EFFECT_DISABLE_TRAPMONSTER
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e3
)
end
end
--花之晶月辉印
function
c65020072
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOGRAVE
+
CATEGORY_DRAW
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
c65020072
.
target
)
e1
:
SetOperation
(
c65020072
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c65020072
.
thfil
(
c
)
return
c
:
IsAbleToGrave
()
and
c
:
IsSetCard
(
0x9da3
)
end
function
c65020072
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
2
)
and
Duel
.
IsExistingMatchingCard
(
c65020072
.
thfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020072
,
0
,
0x21
,
1700
,
1200
,
4
,
RACE_PLANT
,
ATTRIBUTE_DARK
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
2
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c65020072
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
Duel
.
IsPlayerCanDraw
(
tp
,
2
)
then
return
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c65020072
.
thfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
e
:
GetHandler
())
if
g
:
GetCount
()
>
0
and
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
~=
0
and
Duel
.
Draw
(
tp
,
2
,
REASON_EFFECT
)
~=
0
then
Duel
.
BreakEffect
()
if
not
c
:
IsRelateToEffect
(
e
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
65020072
,
0
,
0x21
,
1700
,
1200
,
4
,
RACE_PLANT
,
ATTRIBUTE_DARK
)
then
return
end
c
:
AddMonsterAttribute
(
TYPE_EFFECT
+
TYPE_TRAP
)
Duel
.
SpecialSummonStep
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetCondition
(
c65020072
.
con
)
e1
:
SetTarget
(
c65020072
.
distg
)
e1
:
SetOperation
(
c65020072
.
disop
)
c
:
RegisterEffect
(
e1
,
true
)
Duel
.
SpecialSummonComplete
()
end
end
function
c65020072
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
return
Duel
.
GetTurnPlayer
()
~=
tp
and
(
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
)
end
function
c65020072
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
end
function
c65020072
.
distg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
false
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c65020072
.
filter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
e
:
GetHandler
())
and
Duel
.
IsExistingTarget
(
aux
.
disfilter1
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SELF
)
Duel
.
SelectTarget
(
tp
,
aux
.
filter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_OPPO
)
Duel
.
SelectTarget
(
tp
,
aux
.
disfilter1
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
end
function
c65020072
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
):
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
if
g
:
GetCount
()
~=
2
then
return
end
for
tc
in
aux
.
Next
(
g
)
do
Duel
.
NegateRelatedChain
(
tc
,
RESET_TURN_SET
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetValue
(
RESET_TURN_SET
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e2
)
if
tc
:
IsType
(
TYPE_TRAPMONSTER
)
then
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e3
:
SetCode
(
EFFECT_DISABLE_TRAPMONSTER
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e3
)
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