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