Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-222DIY-cards
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alstroemeria-silentlove
ygopro-222DIY-cards
Commits
998871fc
Commit
998871fc
authored
Jun 25, 2019
by
2924713558
Committed by
GitHub
Jun 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add files via upload
parent
e7a2b28c
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
5382 additions
and
4387 deletions
+5382
-4387
expansions/script/c10199990.lua
expansions/script/c10199990.lua
+3163
-2170
expansions/script/c11200112.lua
expansions/script/c11200112.lua
+36
-31
expansions/script/c40008674.lua
expansions/script/c40008674.lua
+224
-223
expansions/script/c40008680.lua
expansions/script/c40008680.lua
+224
-223
expansions/script/c40008683.lua
expansions/script/c40008683.lua
+243
-242
expansions/script/c40008688.lua
expansions/script/c40008688.lua
+233
-232
expansions/script/c40008694.lua
expansions/script/c40008694.lua
+238
-237
expansions/script/c40008697.lua
expansions/script/c40008697.lua
+225
-224
expansions/script/c81011020.lua
expansions/script/c81011020.lua
+104
-104
expansions/script/c9980197.lua
expansions/script/c9980197.lua
+130
-137
expansions/script/c9980573.lua
expansions/script/c9980573.lua
+128
-128
expansions/script/c9980577.lua
expansions/script/c9980577.lua
+49
-50
expansions/script/c9980580.lua
expansions/script/c9980580.lua
+85
-86
expansions/script/c9980581.lua
expansions/script/c9980581.lua
+105
-106
expansions/script/c9980705.lua
expansions/script/c9980705.lua
+75
-75
expansions/script/c9980712.lua
expansions/script/c9980712.lua
+120
-119
No files found.
expansions/script/c10199990.lua
View file @
998871fc
This source diff could not be displayed because it is too large. You can
view the blob
instead.
expansions/script/c11200112.lua
View file @
998871fc
--虚构之炎
function
c11200112
.
initial_effect
(
c
)
local
e1
=
aux
.
AddRitualProcGreater2
(
c
,
c11200112
.
filter
,
LOCATION_HAND
+
LOCATION_GRAVE
+
LOCATION_DECK
+
LOCATION_REMOVED
,
c11200112
.
mfilter
)
e1
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e1
:
SetCost
(
c11200112
.
cost
)
e1
:
SetCountLimit
(
1
,
11200112
)
end
function
c11200112
.
filter
(
c
)
return
c
:
IsCode
(
11200103
,
11200104
)
end
function
c11200112
.
mfilter
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
end
function
c11200112
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetActivityCount
(
tp
,
ACTIVITY_SUMMON
)
==
0
and
Duel
.
GetActivityCount
(
tp
,
ACTIVITY_SPSUMMON
)
==
0
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_OATH
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e2
:
SetLabelObject
(
e
)
e2
:
SetTarget
(
c11200112
.
splimit
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c11200112
.
splimit
(
e
,
c
,
sump
,
sumtype
,
sumpos
,
targetp
,
se
)
return
se
~=
e
:
GetLabelObject
()
end
--虚构之炎
function
c11200112
.
initial_effect
(
c
)
local
e1
=
aux
.
AddRitualProcGreater2Code2
(
c
,
11200103
,
11200104
,
LOCATION_HAND
+
LOCATION_GRAVE
+
LOCATION_DECK
+
LOCATION_REMOVED
,
c11200112
.
mfilter
)
e1
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e1
:
SetCost
(
c11200112
.
cost
)
e1
:
SetCountLimit
(
1
,
11200112
+
EFFECT_COUNT_CODE_OATH
)
end
function
c11200112
.
mfilter
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
end
function
c11200112
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetActivityCount
(
tp
,
ACTIVITY_SUMMON
)
==
0
and
Duel
.
GetActivityCount
(
tp
,
ACTIVITY_FLIPSUMMON
)
==
0
and
Duel
.
GetActivityCount
(
tp
,
ACTIVITY_SPSUMMON
)
==
0
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_OATH
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetLabelObject
(
e
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c11200112
.
sumlimit
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_OATH
)
e2
:
SetCode
(
EFFECT_CANNOT_SUMMON
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e2
:
SetTargetRange
(
1
,
0
)
Duel
.
RegisterEffect
(
e2
,
tp
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EFFECT_CANNOT_FLIP_SUMMON
)
Duel
.
RegisterEffect
(
e3
,
tp
)
end
function
c11200112
.
sumlimit
(
e
,
c
,
sump
,
sumtype
,
sumpos
,
targetp
,
se
)
return
e
:
GetLabelObject
()
~=
se
end
expansions/script/c40008674.lua
View file @
998871fc
--炼狱骑士团 暗刃龙
function
c40008674
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
40008674
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
+
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
40008674
)
e1
:
SetCost
(
c40008674
.
cost1
)
e1
:
SetCondition
(
c40008674
.
spcon1
)
e1
:
SetTarget
(
c40008674
.
target
)
e1
:
SetOperation
(
c40008674
.
activate
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
40008674
,
2
))
e4
:
SetCategory
(
CATEGORY_DRAW
)
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_GRAVE
)
e4
:
SetCost
(
c40008674
.
thcost
)
e4
:
SetCountLimit
(
1
,
40008675
)
e4
:
SetTarget
(
c40008674
.
thtg
)
e4
:
SetOperation
(
c40008674
.
thop
)
c
:
RegisterEffect
(
e4
)
end
function
c40008674
.
spcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
end
function
c40008674
.
spcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
Duel
.
GetTurnPlayer
()
~=
e
:
GetHandlerPlayer
()
end
function
c40008674
.
spcon3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
Duel
.
GetTurnPlayer
()
==
e
:
GetHandlerPlayer
()
end
function
c40008674
.
cosfilter3
(
c
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c40008674
.
cost3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008674
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008674
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008674
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008674
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008674
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008674
.
cosfilter1
(
c
,
tp
)
if
c
:
IsLocation
(
LOCATION_HAND
)
then
return
c
:
IsDiscardable
()
end
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c40008674
.
cosfilter2
(
c
)
return
c
:
IsCode
(
40008674
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008674
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008674
.
costfilter1
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
,
0
,
1
,
nil
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c40008674
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008674
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
local
g1
=
Duel
.
GetMatchingGroup
(
c40008674
.
costfilter1
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
,
0
,
nil
,
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DISCARD
)
local
tc
=
g1
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
SendtoGrave
(
tc
,
REASON_COST
)
else
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
SendtoGrave
(
tc
,
REASON_COST
+
REASON_DISCARD
)
end
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008674
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
end
function
c40008674
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
cid
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_CHAIN_ID
)
if
cid
~=
e
:
GetLabel
()
then
return
end
if
e
:
GetOwner
():
IsRelateToChain
(
ev
)
then
e
:
GetOwner
():
CancelToGrave
(
false
)
end
end
function
c40008674
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008676
,
0
,
0x4011
,
1100
,
0
,
2
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c40008674
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008676
,
0
,
0x4011
,
1100
,
0
,
2
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
then
return
end
local
token
=
Duel
.
CreateToken
(
tp
,
40008676
)
if
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
Duel
.
Equip
(
tp
,
c
,
token
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetValue
(
c40008674
.
eqlimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
40008674
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_BATTLE_START
+
TIMING_BATTLE_END
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCondition
(
c40008674
.
sccon
)
e2
:
SetTarget
(
c40008674
.
sctg
)
e2
:
SetOperation
(
c40008674
.
scop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_GRANT
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e3
:
SetTarget
(
c40008674
.
eftg
)
e3
:
SetLabelObject
(
e2
)
c
:
RegisterEffect
(
e3
)
else
c
:
CancelToGrave
(
false
)
Duel
.
SpecialSummonComplete
()
end
end
function
c40008674
.
eqlimit
(
e
,
c
)
return
c
:
GetControler
()
==
e
:
GetHandlerPlayer
()
or
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008674
.
eftg
(
e
,
c
)
return
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008674
.
sccon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
if
Duel
.
GetTurnPlayer
()
==
tp
then
return
(
ph
>=
PHASE_BATTLE_START
and
ph
<=
PHASE_BATTLE
)
else
return
(
ph
>=
PHASE_BATTLE_START
and
ph
<=
PHASE_BATTLE
)
or
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
end
end
function
c40008674
.
sctg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsSynchroSummonable
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
:
GetHandler
())
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
c40008674
.
scop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
GetControler
()
~=
tp
or
not
c
:
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsSynchroSummonable
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
c
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SynchroSummon
(
tp
,
sg
:
GetFirst
(),
c
)
end
end
function
c40008674
.
cfilter
(
c
,
tp
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008674
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToRemoveAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c40008674
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
c
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008674
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
c
,
tp
)
g
:
AddCard
(
c
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
c40008674
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c40008674
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
==
0
then
return
end
local
tc
=
Duel
.
GetOperatedGroup
():
GetFirst
()
if
tc
:
IsSetCard
(
0xf14
)
then
if
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
40008674
,
3
))
then
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
Duel
.
BreakEffect
()
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
end
--炼狱骑士团 暗刃龙
function
c40008674
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
40008674
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
+
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
40008674
)
e1
:
SetCost
(
c40008674
.
cost1
)
e1
:
SetCondition
(
c40008674
.
spcon1
)
e1
:
SetTarget
(
c40008674
.
target
)
e1
:
SetOperation
(
c40008674
.
activate
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
40008674
,
2
))
e4
:
SetCategory
(
CATEGORY_DRAW
)
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_GRAVE
)
e4
:
SetCost
(
c40008674
.
thcost
)
e4
:
SetCountLimit
(
1
,
40008675
)
e4
:
SetTarget
(
c40008674
.
thtg
)
e4
:
SetOperation
(
c40008674
.
thop
)
c
:
RegisterEffect
(
e4
)
end
function
c40008674
.
spcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
end
function
c40008674
.
spcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
Duel
.
GetTurnPlayer
()
~=
e
:
GetHandlerPlayer
()
end
function
c40008674
.
spcon3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
Duel
.
GetTurnPlayer
()
==
e
:
GetHandlerPlayer
()
end
function
c40008674
.
cosfilter3
(
c
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c40008674
.
cost3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008674
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008674
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008674
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008674
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008674
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008674
.
cosfilter1
(
c
,
tp
)
if
c
:
IsLocation
(
LOCATION_HAND
)
then
return
c
:
IsDiscardable
()
end
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c40008674
.
cosfilter2
(
c
)
return
c
:
IsCode
(
40008674
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008674
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008674
.
costfilter1
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
,
0
,
1
,
nil
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c40008674
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008674
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
local
g1
=
Duel
.
GetMatchingGroup
(
c40008674
.
costfilter1
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
,
0
,
nil
,
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DISCARD
)
local
tc
=
g1
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
SendtoGrave
(
tc
,
REASON_COST
)
else
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
SendtoGrave
(
tc
,
REASON_COST
+
REASON_DISCARD
)
end
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008674
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
end
function
c40008674
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
cid
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_CHAIN_ID
)
if
cid
~=
e
:
GetLabel
()
then
return
end
if
e
:
GetOwner
():
IsRelateToChain
(
ev
)
then
e
:
GetOwner
():
CancelToGrave
(
false
)
end
end
function
c40008674
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008676
,
0
,
0x4011
,
1100
,
0
,
2
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c40008674
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008676
,
0
,
0x4011
,
1100
,
0
,
2
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
then
return
end
local
token
=
Duel
.
CreateToken
(
tp
,
40008676
)
if
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
Duel
.
Equip
(
tp
,
c
,
token
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetValue
(
c40008674
.
eqlimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
40008674
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_BATTLE_START
+
TIMING_BATTLE_END
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCondition
(
c40008674
.
sccon
)
e2
:
SetTarget
(
c40008674
.
sctg
)
e2
:
SetOperation
(
c40008674
.
scop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_GRANT
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e3
:
SetTarget
(
c40008674
.
eftg
)
e3
:
SetLabelObject
(
e2
)
c
:
RegisterEffect
(
e3
)
else
c
:
CancelToGrave
(
false
)
Duel
.
SpecialSummonComplete
()
end
end
function
c40008674
.
eqlimit
(
e
,
c
)
return
c
:
GetControler
()
==
e
:
GetHandlerPlayer
()
or
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008674
.
eftg
(
e
,
c
)
return
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008674
.
sccon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
if
Duel
.
GetTurnPlayer
()
==
tp
then
return
(
ph
>=
PHASE_BATTLE_START
and
ph
<=
PHASE_BATTLE
)
else
return
(
ph
>=
PHASE_BATTLE_START
and
ph
<=
PHASE_BATTLE
)
or
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
end
end
function
c40008674
.
sctg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsSynchroSummonable
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
:
GetHandler
())
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
c40008674
.
scop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
GetControler
()
~=
tp
or
not
c
:
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsSynchroSummonable
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
c
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SynchroSummon
(
tp
,
sg
:
GetFirst
(),
c
)
end
end
function
c40008674
.
cfilter
(
c
,
tp
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008674
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToRemoveAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c40008674
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
c
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008674
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
c
,
tp
)
g
:
AddCard
(
c
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
c40008674
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c40008674
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
==
0
then
return
end
local
tc
=
Duel
.
GetOperatedGroup
():
GetFirst
()
if
tc
:
IsSetCard
(
0xf14
)
then
if
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
40008674
,
3
))
then
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
Duel
.
BreakEffect
()
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
end
expansions/script/c40008680.lua
View file @
998871fc
--炼狱骑士团 十字弓弩龙
function
c40008680
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
40008680
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
+
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
40008680
)
e1
:
SetCost
(
c40008680
.
cost1
)
e1
:
SetCondition
(
c40008680
.
spcon1
)
e1
:
SetTarget
(
c40008680
.
target
)
e1
:
SetOperation
(
c40008680
.
activate
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
40008680
,
2
))
e4
:
SetCategory
(
CATEGORY_DRAW
)
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_GRAVE
)
e4
:
SetCost
(
c40008680
.
thcost
)
e4
:
SetCountLimit
(
1
,
40008681
)
e4
:
SetTarget
(
c40008680
.
destg
)
e4
:
SetOperation
(
c40008680
.
desop
)
c
:
RegisterEffect
(
e4
)
end
function
c40008680
.
spcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
end
function
c40008680
.
spcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
Duel
.
GetTurnPlayer
()
~=
e
:
GetHandlerPlayer
()
end
function
c40008680
.
spcon3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
Duel
.
GetTurnPlayer
()
==
e
:
GetHandlerPlayer
()
end
function
c40008680
.
cosfilter3
(
c
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c40008680
.
cost3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008680
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008680
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008680
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008680
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008680
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008680
.
cosfilter1
(
c
,
tp
)
if
c
:
IsLocation
(
LOCATION_HAND
)
then
return
c
:
IsDiscardable
()
end
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c40008680
.
cosfilter2
(
c
)
return
c
:
IsCode
(
40008680
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008680
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008680
.
costfilter1
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
,
0
,
1
,
nil
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c40008680
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008680
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
local
g1
=
Duel
.
GetMatchingGroup
(
c40008680
.
costfilter1
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
,
0
,
nil
,
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DISCARD
)
local
tc
=
g1
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
SendtoGrave
(
tc
,
REASON_COST
)
else
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
SendtoGrave
(
tc
,
REASON_COST
+
REASON_DISCARD
)
end
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008680
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
end
function
c40008680
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
cid
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_CHAIN_ID
)
if
cid
~=
e
:
GetLabel
()
then
return
end
if
e
:
GetOwner
():
IsRelateToChain
(
ev
)
then
e
:
GetOwner
():
CancelToGrave
(
false
)
end
end
function
c40008680
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008682
,
0
,
0x4011
,
1300
,
0
,
3
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c40008680
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008682
,
0
,
0x4011
,
1300
,
0
,
3
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
then
return
end
local
token
=
Duel
.
CreateToken
(
tp
,
40008682
)
if
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
Duel
.
Equip
(
tp
,
c
,
token
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetValue
(
c40008680
.
eqlimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
40008680
,
1
))
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetTarget
(
c40008680
.
thtg
)
e2
:
SetOperation
(
c40008680
.
thop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_GRANT
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e3
:
SetTarget
(
c40008680
.
eftg
)
e3
:
SetLabelObject
(
e2
)
c
:
RegisterEffect
(
e3
)
else
c
:
CancelToGrave
(
false
)
Duel
.
SpecialSummonComplete
()
end
end
function
c40008680
.
eqlimit
(
e
,
c
)
return
c
:
GetControler
()
==
e
:
GetHandlerPlayer
()
or
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008680
.
eftg
(
e
,
c
)
return
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008680
.
thfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsAbleToHand
()
end
function
c40008680
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsOnField
()
and
chkc
:
IsControler
(
1
-
tp
)
and
c40008680
.
thfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c40008680
.
thfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c40008680
.
thfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
0
)
end
function
c40008680
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
end
end
function
c40008680
.
cfilter
(
c
,
tp
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008680
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToRemoveAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c40008680
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
c
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008680
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
c
,
tp
)
g
:
AddCard
(
c
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
c40008680
.
filter
(
c
)
return
c
:
IsFacedown
()
end
function
c40008680
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsOnField
()
and
c40008680
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c40008680
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c40008680
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
end
function
c40008680
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
if
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
==
0
then
return
end
local
tc
=
Duel
.
GetOperatedGroup
():
GetFirst
()
if
tc
:
IsType
(
TYPE_SPELL
)
then
if
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
40008680
,
3
))
then
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
Duel
.
BreakEffect
()
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
end
end
--炼狱骑士团 十字弓弩龙
function
c40008680
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
40008680
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
+
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
40008680
)
e1
:
SetCost
(
c40008680
.
cost1
)
e1
:
SetCondition
(
c40008680
.
spcon1
)
e1
:
SetTarget
(
c40008680
.
target
)
e1
:
SetOperation
(
c40008680
.
activate
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
40008680
,
2
))
e4
:
SetCategory
(
CATEGORY_DRAW
)
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_GRAVE
)
e4
:
SetCost
(
c40008680
.
thcost
)
e4
:
SetCountLimit
(
1
,
40008681
)
e4
:
SetTarget
(
c40008680
.
destg
)
e4
:
SetOperation
(
c40008680
.
desop
)
c
:
RegisterEffect
(
e4
)
end
function
c40008680
.
spcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
end
function
c40008680
.
spcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
Duel
.
GetTurnPlayer
()
~=
e
:
GetHandlerPlayer
()
end
function
c40008680
.
spcon3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
Duel
.
GetTurnPlayer
()
==
e
:
GetHandlerPlayer
()
end
function
c40008680
.
cosfilter3
(
c
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c40008680
.
cost3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008680
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008680
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008680
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008680
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008680
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008680
.
cosfilter1
(
c
,
tp
)
if
c
:
IsLocation
(
LOCATION_HAND
)
then
return
c
:
IsDiscardable
()
end
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c40008680
.
cosfilter2
(
c
)
return
c
:
IsCode
(
40008680
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008680
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008680
.
costfilter1
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
,
0
,
1
,
nil
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c40008680
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008680
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
local
g1
=
Duel
.
GetMatchingGroup
(
c40008680
.
costfilter1
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
,
0
,
nil
,
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DISCARD
)
local
tc
=
g1
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
SendtoGrave
(
tc
,
REASON_COST
)
else
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
SendtoGrave
(
tc
,
REASON_COST
+
REASON_DISCARD
)
end
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008680
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
end
function
c40008680
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
cid
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_CHAIN_ID
)
if
cid
~=
e
:
GetLabel
()
then
return
end
if
e
:
GetOwner
():
IsRelateToChain
(
ev
)
then
e
:
GetOwner
():
CancelToGrave
(
false
)
end
end
function
c40008680
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008682
,
0
,
0x4011
,
1300
,
0
,
3
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c40008680
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008682
,
0
,
0x4011
,
1300
,
0
,
3
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
then
return
end
local
token
=
Duel
.
CreateToken
(
tp
,
40008682
)
if
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
Duel
.
Equip
(
tp
,
c
,
token
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetValue
(
c40008680
.
eqlimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
40008680
,
1
))
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetCountLimit
(
1
)
e2
:
SetTarget
(
c40008680
.
thtg
)
e2
:
SetOperation
(
c40008680
.
thop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_GRANT
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e3
:
SetTarget
(
c40008680
.
eftg
)
e3
:
SetLabelObject
(
e2
)
c
:
RegisterEffect
(
e3
)
else
c
:
CancelToGrave
(
false
)
Duel
.
SpecialSummonComplete
()
end
end
function
c40008680
.
eqlimit
(
e
,
c
)
return
c
:
GetControler
()
==
e
:
GetHandlerPlayer
()
or
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008680
.
eftg
(
e
,
c
)
return
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008680
.
thfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsAbleToHand
()
end
function
c40008680
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsOnField
()
and
chkc
:
IsControler
(
1
-
tp
)
and
c40008680
.
thfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c40008680
.
thfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c40008680
.
thfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
0
)
end
function
c40008680
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
end
end
function
c40008680
.
cfilter
(
c
,
tp
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008680
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToRemoveAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c40008680
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
c
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008680
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
c
,
tp
)
g
:
AddCard
(
c
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
c40008680
.
filter
(
c
)
return
c
:
IsFacedown
()
end
function
c40008680
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsOnField
()
and
c40008680
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c40008680
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c40008680
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
end
function
c40008680
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
if
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
==
0
then
return
end
local
tc
=
Duel
.
GetOperatedGroup
():
GetFirst
()
if
tc
:
IsType
(
TYPE_SPELL
)
then
if
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
40008680
,
3
))
then
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
Duel
.
BreakEffect
()
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
end
end
expansions/script/c40008683.lua
View file @
998871fc
--炼狱骑士团 银杖龙
function
c40008683
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
40008683
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
+
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
40008683
)
e1
:
SetCost
(
c40008683
.
cost1
)
e1
:
SetCondition
(
c40008683
.
spcon1
)
e1
:
SetTarget
(
c40008683
.
target
)
e1
:
SetOperation
(
c40008683
.
activate
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
40008683
,
2
))
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e4
:
SetRange
(
LOCATION_GRAVE
)
e4
:
SetCost
(
c40008683
.
thcost
)
e4
:
SetCountLimit
(
1
,
40008684
)
e2
:
SetCondition
(
c40008683
.
dbcon
)
e4
:
SetTarget
(
c40008683
.
dbtg
)
e4
:
SetOperation
(
c40008683
.
dbop
)
c
:
RegisterEffect
(
e4
)
end
function
c40008683
.
spcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
end
function
c40008683
.
spcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
Duel
.
GetTurnPlayer
()
~=
tp
end
function
c40008683
.
spcon3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
not
Duel
.
GetTurnPlayer
()
~=
tp
end
function
c40008683
.
cosfilter3
(
c
)
return
c
:
IsSetCard
(
0xf14
)
and
(
c
:
IsAbleToGraveAsCost
()
or
c
:
IsDiscardable
())
end
function
c40008683
.
cost3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008683
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008683
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
+
REASON_DISCARD
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008683
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008683
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008683
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008683
.
cosfilter1
(
c
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c40008683
.
cosfilter2
(
c
)
return
c
:
IsCode
(
40008683
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008683
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008683
.
cosfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c40008683
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008683
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c40008683
.
cosfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
SendtoGrave
(
g1
,
REASON_COST
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008683
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008683
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
cid
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_CHAIN_ID
)
if
cid
~=
e
:
GetLabel
()
then
return
end
if
e
:
GetOwner
():
IsRelateToChain
(
ev
)
then
e
:
GetOwner
():
CancelToGrave
(
false
)
end
end
function
c40008683
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008685
,
0
,
0x4011
,
700
,
0
,
1
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c40008683
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008685
,
0
,
0x4011
,
700
,
0
,
1
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
then
return
end
local
token
=
Duel
.
CreateToken
(
tp
,
40008685
)
if
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
Duel
.
Equip
(
tp
,
c
,
token
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetValue
(
c40008683
.
eqlimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
40008683
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_BATTLE_START
+
TIMING_BATTLE_END
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCondition
(
c40008683
.
sccon
)
e2
:
SetTarget
(
c40008683
.
sctg
)
e2
:
SetOperation
(
c40008683
.
scop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_GRANT
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e3
:
SetTarget
(
c40008683
.
eftg
)
e3
:
SetLabelObject
(
e2
)
c
:
RegisterEffect
(
e3
)
else
c
:
CancelToGrave
(
false
)
Duel
.
SpecialSummonComplete
()
end
end
function
c40008683
.
eqlimit
(
e
,
c
)
return
c
:
GetControler
()
==
e
:
GetHandlerPlayer
()
or
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008683
.
eftg
(
e
,
c
)
return
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008683
.
sccon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
if
Duel
.
GetTurnPlayer
()
==
tp
then
return
(
ph
>=
PHASE_BATTLE_START
and
ph
<=
PHASE_BATTLE
)
else
return
(
ph
>=
PHASE_BATTLE_START
and
ph
<=
PHASE_BATTLE
)
or
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
end
end
function
c40008683
.
sctg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsSynchroSummonable
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
:
GetHandler
())
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
c40008683
.
scop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
GetControler
()
~=
tp
or
not
c
:
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsSynchroSummonable
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
c
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SynchroSummon
(
tp
,
sg
:
GetFirst
(),
c
)
end
end
function
c40008683
.
cfilter
(
c
,
tp
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008683
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToRemoveAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c40008683
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
c
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008683
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
c
,
tp
)
g
:
AddCard
(
c
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
c40008683
.
dbcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsAbleToEnterBP
()
end
function
c40008683
.
dbfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
GetFlagEffect
(
40008683
)
==
0
end
function
c40008683
.
dbtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsControler
(
tp
)
and
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
c40008683
.
dbfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c40008683
.
dbfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
c40008683
.
dbfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
end
function
c40008683
.
dbop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_ATTACK
)
e1
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e1
:
SetTarget
(
c40008683
.
ftarget
)
e1
:
SetLabel
(
tc
:
GetFieldID
())
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
if
tc
:
IsRelateToEffect
(
e
)
then
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetCode
(
EFFECT_DIRECT_ATTACK
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e2
)
end
if
tc
:
IsSetCard
(
0xf14
)
then
if
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
40008683
,
3
))
then
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
Duel
.
BreakEffect
()
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
end
function
c40008683
.
ftarget
(
e
,
c
)
return
e
:
GetLabel
()
~=
c
:
GetFieldID
()
end
--炼狱骑士团 银杖龙
function
c40008683
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
40008683
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
+
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
40008683
)
e1
:
SetCost
(
c40008683
.
cost1
)
e1
:
SetCondition
(
c40008683
.
spcon1
)
e1
:
SetTarget
(
c40008683
.
target
)
e1
:
SetOperation
(
c40008683
.
activate
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
40008683
,
2
))
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e4
:
SetRange
(
LOCATION_GRAVE
)
e4
:
SetCost
(
c40008683
.
thcost
)
e4
:
SetCountLimit
(
1
,
40008684
)
e2
:
SetCondition
(
c40008683
.
dbcon
)
e4
:
SetTarget
(
c40008683
.
dbtg
)
e4
:
SetOperation
(
c40008683
.
dbop
)
c
:
RegisterEffect
(
e4
)
end
function
c40008683
.
spcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
end
function
c40008683
.
spcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
Duel
.
GetTurnPlayer
()
~=
tp
end
function
c40008683
.
spcon3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
not
Duel
.
GetTurnPlayer
()
~=
tp
end
function
c40008683
.
cosfilter3
(
c
)
return
c
:
IsSetCard
(
0xf14
)
and
(
c
:
IsAbleToGraveAsCost
()
or
c
:
IsDiscardable
())
end
function
c40008683
.
cost3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008683
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008683
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
+
REASON_DISCARD
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008683
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008683
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008683
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008683
.
cosfilter1
(
c
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c40008683
.
cosfilter2
(
c
)
return
c
:
IsCode
(
40008683
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008683
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008683
.
cosfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c40008683
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008683
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c40008683
.
cosfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
SendtoGrave
(
g1
,
REASON_COST
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008683
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008683
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
cid
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_CHAIN_ID
)
if
cid
~=
e
:
GetLabel
()
then
return
end
if
e
:
GetOwner
():
IsRelateToChain
(
ev
)
then
e
:
GetOwner
():
CancelToGrave
(
false
)
end
end
function
c40008683
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008685
,
0
,
0x4011
,
700
,
0
,
1
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c40008683
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008685
,
0
,
0x4011
,
700
,
0
,
1
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
then
return
end
local
token
=
Duel
.
CreateToken
(
tp
,
40008685
)
if
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
Duel
.
Equip
(
tp
,
c
,
token
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetValue
(
c40008683
.
eqlimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
40008683
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_BATTLE_START
+
TIMING_BATTLE_END
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCondition
(
c40008683
.
sccon
)
e2
:
SetTarget
(
c40008683
.
sctg
)
e2
:
SetOperation
(
c40008683
.
scop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_GRANT
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e3
:
SetTarget
(
c40008683
.
eftg
)
e3
:
SetLabelObject
(
e2
)
c
:
RegisterEffect
(
e3
)
else
c
:
CancelToGrave
(
false
)
Duel
.
SpecialSummonComplete
()
end
end
function
c40008683
.
eqlimit
(
e
,
c
)
return
c
:
GetControler
()
==
e
:
GetHandlerPlayer
()
or
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008683
.
eftg
(
e
,
c
)
return
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008683
.
sccon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
if
Duel
.
GetTurnPlayer
()
==
tp
then
return
(
ph
>=
PHASE_BATTLE_START
and
ph
<=
PHASE_BATTLE
)
else
return
(
ph
>=
PHASE_BATTLE_START
and
ph
<=
PHASE_BATTLE
)
or
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
end
end
function
c40008683
.
sctg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsSynchroSummonable
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
:
GetHandler
())
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
c40008683
.
scop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
GetControler
()
~=
tp
or
not
c
:
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsSynchroSummonable
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
c
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SynchroSummon
(
tp
,
sg
:
GetFirst
(),
c
)
end
end
function
c40008683
.
cfilter
(
c
,
tp
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008683
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToRemoveAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c40008683
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
c
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008683
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
c
,
tp
)
g
:
AddCard
(
c
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
c40008683
.
dbcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsAbleToEnterBP
()
end
function
c40008683
.
dbfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
GetFlagEffect
(
40008683
)
==
0
end
function
c40008683
.
dbtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsControler
(
tp
)
and
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
c40008683
.
dbfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c40008683
.
dbfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
c40008683
.
dbfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
end
function
c40008683
.
dbop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_ATTACK
)
e1
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e1
:
SetTarget
(
c40008683
.
ftarget
)
e1
:
SetLabel
(
tc
:
GetFieldID
())
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
if
tc
:
IsRelateToEffect
(
e
)
then
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetCode
(
EFFECT_DIRECT_ATTACK
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e2
)
end
if
tc
:
IsSetCard
(
0xf14
)
then
if
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
40008683
,
3
))
then
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
Duel
.
BreakEffect
()
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
end
function
c40008683
.
ftarget
(
e
,
c
)
return
e
:
GetLabel
()
~=
c
:
GetFieldID
()
end
expansions/script/c40008688.lua
View file @
998871fc
--炼狱骑士团 血斧龙
function
c40008688
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
40008688
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
+
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
40008688
)
e1
:
SetCost
(
c40008688
.
cost1
)
e1
:
SetCondition
(
c40008688
.
spcon1
)
e1
:
SetTarget
(
c40008688
.
target
)
e1
:
SetOperation
(
c40008688
.
activate
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
40008688
,
2
))
e4
:
SetCategory
(
CATEGORY_DRAW
)
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_GRAVE
)
e4
:
SetCost
(
c40008688
.
thcost
)
e4
:
SetCountLimit
(
1
,
40008689
)
e4
:
SetTarget
(
c40008688
.
destg
)
e4
:
SetOperation
(
c40008688
.
desop
)
c
:
RegisterEffect
(
e4
)
end
function
c40008688
.
spcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
end
function
c40008688
.
spcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
Duel
.
GetTurnPlayer
()
~=
e
:
GetHandlerPlayer
()
end
function
c40008688
.
spcon3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
Duel
.
GetTurnPlayer
()
==
e
:
GetHandlerPlayer
()
end
function
c40008688
.
cosfilter3
(
c
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c40008688
.
cost3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008688
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008688
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008688
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008688
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008688
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008688
.
cosfilter1
(
c
,
tp
)
if
c
:
IsLocation
(
LOCATION_HAND
)
then
return
c
:
IsDiscardable
()
end
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c40008688
.
cosfilter2
(
c
)
return
c
:
IsCode
(
40008688
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008688
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008688
.
costfilter1
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
,
0
,
1
,
nil
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c40008688
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008688
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
local
g1
=
Duel
.
GetMatchingGroup
(
c40008688
.
costfilter1
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
,
0
,
nil
,
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DISCARD
)
local
tc
=
g1
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
SendtoGrave
(
tc
,
REASON_COST
)
else
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
SendtoGrave
(
tc
,
REASON_COST
+
REASON_DISCARD
)
end
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008688
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
end
function
c40008688
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
cid
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_CHAIN_ID
)
if
cid
~=
e
:
GetLabel
()
then
return
end
if
e
:
GetOwner
():
IsRelateToChain
(
ev
)
then
e
:
GetOwner
():
CancelToGrave
(
false
)
end
end
function
c40008688
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008690
,
0
,
0x4011
,
1500
,
0
,
4
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c40008688
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008690
,
0
,
0x4011
,
1500
,
0
,
4
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
then
return
end
local
token
=
Duel
.
CreateToken
(
tp
,
40008690
)
if
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
Duel
.
Equip
(
tp
,
c
,
token
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetValue
(
c40008688
.
eqlimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
40008688
,
1
))
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetTarget
(
c40008688
.
thtg
)
e2
:
SetOperation
(
c40008688
.
thop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_GRANT
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e3
:
SetTarget
(
c40008688
.
eftg
)
e3
:
SetLabelObject
(
e2
)
c
:
RegisterEffect
(
e3
)
else
c
:
CancelToGrave
(
false
)
Duel
.
SpecialSummonComplete
()
end
end
function
c40008688
.
eqlimit
(
e
,
c
)
return
c
:
GetControler
()
==
e
:
GetHandlerPlayer
()
or
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008688
.
eftg
(
e
,
c
)
return
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008688
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0xf14
)
and
not
c
:
IsCode
(
40008688
)
and
c
:
IsAbleToHand
()
end
function
c40008688
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c40008688
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008688
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
c40008688
.
cfilter
(
c
,
tp
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008688
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToRemoveAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c40008688
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
c
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008688
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
c
,
tp
)
g
:
AddCard
(
c
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
c40008688
.
filter
(
c
)
return
c
:
IsFaceup
()
end
function
c40008688
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
c40008688
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c40008688
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
c40008688
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
end
end
function
c40008688
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
and
tc
:
IsControler
(
tp
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e1
:
SetValue
(
c40008688
.
efilter
)
e1
:
SetOwnerPlayer
(
tp
)
tc
:
RegisterEffect
(
e1
)
end
if
tc
:
IsSetCard
(
0xf14
)
then
if
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
40008688
,
3
))
then
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
Duel
.
BreakEffect
()
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
end
function
c40008688
.
efilter
(
e
,
re
)
return
e
:
GetOwnerPlayer
()
~=
re
:
GetOwnerPlayer
()
end
--炼狱骑士团 血斧龙
function
c40008688
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
40008688
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
+
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
40008688
)
e1
:
SetCost
(
c40008688
.
cost1
)
e1
:
SetCondition
(
c40008688
.
spcon1
)
e1
:
SetTarget
(
c40008688
.
target
)
e1
:
SetOperation
(
c40008688
.
activate
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
40008688
,
2
))
e4
:
SetCategory
(
CATEGORY_DRAW
)
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_GRAVE
)
e4
:
SetCost
(
c40008688
.
thcost
)
e4
:
SetCountLimit
(
1
,
40008689
)
e4
:
SetTarget
(
c40008688
.
destg
)
e4
:
SetOperation
(
c40008688
.
desop
)
c
:
RegisterEffect
(
e4
)
end
function
c40008688
.
spcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
end
function
c40008688
.
spcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
Duel
.
GetTurnPlayer
()
~=
e
:
GetHandlerPlayer
()
end
function
c40008688
.
spcon3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
Duel
.
GetTurnPlayer
()
==
e
:
GetHandlerPlayer
()
end
function
c40008688
.
cosfilter3
(
c
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c40008688
.
cost3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008688
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008688
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008688
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008688
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008688
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008688
.
cosfilter1
(
c
,
tp
)
if
c
:
IsLocation
(
LOCATION_HAND
)
then
return
c
:
IsDiscardable
()
end
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c40008688
.
cosfilter2
(
c
)
return
c
:
IsCode
(
40008688
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008688
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008688
.
costfilter1
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
,
0
,
1
,
nil
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c40008688
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008688
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
local
g1
=
Duel
.
GetMatchingGroup
(
c40008688
.
costfilter1
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
,
0
,
nil
,
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DISCARD
)
local
tc
=
g1
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
SendtoGrave
(
tc
,
REASON_COST
)
else
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
SendtoGrave
(
tc
,
REASON_COST
+
REASON_DISCARD
)
end
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008688
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
end
function
c40008688
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
cid
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_CHAIN_ID
)
if
cid
~=
e
:
GetLabel
()
then
return
end
if
e
:
GetOwner
():
IsRelateToChain
(
ev
)
then
e
:
GetOwner
():
CancelToGrave
(
false
)
end
end
function
c40008688
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008690
,
0
,
0x4011
,
1500
,
0
,
4
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c40008688
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008690
,
0
,
0x4011
,
1500
,
0
,
4
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
then
return
end
local
token
=
Duel
.
CreateToken
(
tp
,
40008690
)
if
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
Duel
.
Equip
(
tp
,
c
,
token
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetValue
(
c40008688
.
eqlimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
40008688
,
1
))
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetCountLimit
(
1
)
e2
:
SetTarget
(
c40008688
.
thtg
)
e2
:
SetOperation
(
c40008688
.
thop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_GRANT
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e3
:
SetTarget
(
c40008688
.
eftg
)
e3
:
SetLabelObject
(
e2
)
c
:
RegisterEffect
(
e3
)
else
c
:
CancelToGrave
(
false
)
Duel
.
SpecialSummonComplete
()
end
end
function
c40008688
.
eqlimit
(
e
,
c
)
return
c
:
GetControler
()
==
e
:
GetHandlerPlayer
()
or
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008688
.
eftg
(
e
,
c
)
return
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008688
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0xf14
)
and
not
c
:
IsCode
(
40008688
)
and
c
:
IsAbleToHand
()
end
function
c40008688
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c40008688
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008688
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
c40008688
.
cfilter
(
c
,
tp
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008688
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToRemoveAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c40008688
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
c
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008688
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
c
,
tp
)
g
:
AddCard
(
c
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
c40008688
.
filter
(
c
)
return
c
:
IsFaceup
()
end
function
c40008688
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
c40008688
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c40008688
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
c40008688
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
end
end
function
c40008688
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
and
tc
:
IsControler
(
tp
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e1
:
SetValue
(
c40008688
.
efilter
)
e1
:
SetOwnerPlayer
(
tp
)
tc
:
RegisterEffect
(
e1
)
end
if
tc
:
IsSetCard
(
0xf14
)
then
if
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
40008688
,
3
))
then
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
Duel
.
BreakEffect
()
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
end
function
c40008688
.
efilter
(
e
,
re
)
return
e
:
GetOwnerPlayer
()
~=
re
:
GetOwnerPlayer
()
end
expansions/script/c40008694.lua
View file @
998871fc
--炼狱骑士团 巨剪龙
function
c40008694
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
40008694
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
+
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
40008694
)
e1
:
SetCost
(
c40008694
.
cost1
)
e1
:
SetCondition
(
c40008694
.
spcon1
)
e1
:
SetTarget
(
c40008694
.
target
)
e1
:
SetOperation
(
c40008694
.
activate
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
40008694
,
2
))
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_GRAVE
)
e4
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e4
:
SetCost
(
c40008694
.
thcost
)
e4
:
SetCountLimit
(
1
,
40008695
)
e4
:
SetTarget
(
c40008694
.
thtg
)
e4
:
SetOperation
(
c40008694
.
thop
)
c
:
RegisterEffect
(
e4
)
end
function
c40008694
.
spcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
end
function
c40008694
.
spcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
Duel
.
GetTurnPlayer
()
~=
e
:
GetHandlerPlayer
()
end
function
c40008694
.
spcon3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
Duel
.
GetTurnPlayer
()
==
e
:
GetHandlerPlayer
()
end
function
c40008694
.
cosfilter3
(
c
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c40008694
.
cost3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008694
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008694
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008694
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008694
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008694
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008694
.
cosfilter1
(
c
,
tp
)
if
c
:
IsLocation
(
LOCATION_HAND
)
then
return
c
:
IsDiscardable
()
end
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c40008694
.
cosfilter2
(
c
)
return
c
:
IsCode
(
40008694
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008694
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008694
.
costfilter1
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
,
0
,
1
,
nil
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c40008694
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008694
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
local
g1
=
Duel
.
GetMatchingGroup
(
c40008694
.
costfilter1
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
,
0
,
nil
,
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DISCARD
)
local
tc
=
g1
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
SendtoGrave
(
tc
,
REASON_COST
)
else
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
SendtoGrave
(
tc
,
REASON_COST
+
REASON_DISCARD
)
end
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008694
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
end
function
c40008694
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
cid
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_CHAIN_ID
)
if
cid
~=
e
:
GetLabel
()
then
return
end
if
e
:
GetOwner
():
IsRelateToChain
(
ev
)
then
e
:
GetOwner
():
CancelToGrave
(
false
)
end
end
function
c40008694
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008696
,
0
,
0x4011
,
1100
,
0
,
2
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c40008694
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008696
,
0
,
0x4011
,
1100
,
0
,
2
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
then
return
end
local
token
=
Duel
.
CreateToken
(
tp
,
40008696
)
if
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
Duel
.
Equip
(
tp
,
c
,
token
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetValue
(
c40008694
.
eqlimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
40008694
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_BATTLE_START
+
TIMING_BATTLE_END
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCondition
(
c40008694
.
sccon
)
e2
:
SetTarget
(
c40008694
.
sctg
)
e2
:
SetOperation
(
c40008694
.
scop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_GRANT
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e3
:
SetTarget
(
c40008694
.
eftg
)
e3
:
SetLabelObject
(
e2
)
c
:
RegisterEffect
(
e3
)
else
c
:
CancelToGrave
(
false
)
Duel
.
SpecialSummonComplete
()
end
end
function
c40008694
.
eqlimit
(
e
,
c
)
return
c
:
GetControler
()
==
e
:
GetHandlerPlayer
()
or
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008694
.
eftg
(
e
,
c
)
return
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008694
.
sccon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
if
Duel
.
GetTurnPlayer
()
==
tp
then
return
(
ph
>=
PHASE_BATTLE_START
and
ph
<=
PHASE_BATTLE
)
else
return
(
ph
>=
PHASE_BATTLE_START
and
ph
<=
PHASE_BATTLE
)
or
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
end
end
function
c40008694
.
sctg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsSynchroSummonable
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
:
GetHandler
())
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
c40008694
.
scop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
GetControler
()
~=
tp
or
not
c
:
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsSynchroSummonable
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
c
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SynchroSummon
(
tp
,
sg
:
GetFirst
(),
c
)
end
end
function
c40008694
.
cfilter
(
c
,
tp
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008694
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToRemoveAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c40008694
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
c
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008694
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
c
,
tp
)
g
:
AddCard
(
c
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
c40008694
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
nil
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
Duel
.
SelectTarget
(
tp
,
nil
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
end
function
c40008694
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UNRELEASABLE_SUM
)
e1
:
SetValue
(
1
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_UNRELEASABLE_NONSUM
)
tc
:
RegisterEffect
(
e2
)
local
e5
=
e1
:
Clone
()
e5
:
SetCode
(
EFFECT_AVOID_BATTLE_DAMAGE
)
c
:
RegisterEffect
(
e5
)
if
tc
:
IsSetCard
(
0xf14
)
then
if
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
40008694
,
3
))
then
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
Duel
.
BreakEffect
()
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
end
end
--炼狱骑士团 巨剪龙
function
c40008694
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
40008694
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
+
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
40008694
)
e1
:
SetCost
(
c40008694
.
cost1
)
e1
:
SetCondition
(
c40008694
.
spcon1
)
e1
:
SetTarget
(
c40008694
.
target
)
e1
:
SetOperation
(
c40008694
.
activate
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
40008694
,
2
))
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_GRAVE
)
e4
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e4
:
SetCost
(
c40008694
.
thcost
)
e4
:
SetCountLimit
(
1
,
40008695
)
e4
:
SetTarget
(
c40008694
.
thtg
)
e4
:
SetOperation
(
c40008694
.
thop
)
c
:
RegisterEffect
(
e4
)
end
function
c40008694
.
spcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
end
function
c40008694
.
spcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
Duel
.
GetTurnPlayer
()
~=
e
:
GetHandlerPlayer
()
end
function
c40008694
.
spcon3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
Duel
.
GetTurnPlayer
()
==
e
:
GetHandlerPlayer
()
end
function
c40008694
.
cosfilter3
(
c
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c40008694
.
cost3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008694
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008694
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008694
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008694
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008694
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008694
.
cosfilter1
(
c
,
tp
)
if
c
:
IsLocation
(
LOCATION_HAND
)
then
return
c
:
IsDiscardable
()
end
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c40008694
.
cosfilter2
(
c
)
return
c
:
IsCode
(
40008694
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008694
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008694
.
costfilter1
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
,
0
,
1
,
nil
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c40008694
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008694
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
local
g1
=
Duel
.
GetMatchingGroup
(
c40008694
.
costfilter1
,
tp
,
LOCATION_HAND
+
LOCATION_DECK
,
0
,
nil
,
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DISCARD
)
local
tc
=
g1
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
SendtoGrave
(
tc
,
REASON_COST
)
else
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
SendtoGrave
(
tc
,
REASON_COST
+
REASON_DISCARD
)
end
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008694
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
end
function
c40008694
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
cid
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_CHAIN_ID
)
if
cid
~=
e
:
GetLabel
()
then
return
end
if
e
:
GetOwner
():
IsRelateToChain
(
ev
)
then
e
:
GetOwner
():
CancelToGrave
(
false
)
end
end
function
c40008694
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008696
,
0
,
0x4011
,
1100
,
0
,
2
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c40008694
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008696
,
0
,
0x4011
,
1100
,
0
,
2
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
then
return
end
local
token
=
Duel
.
CreateToken
(
tp
,
40008696
)
if
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
Duel
.
Equip
(
tp
,
c
,
token
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetValue
(
c40008694
.
eqlimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
40008694
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_BATTLE_START
+
TIMING_BATTLE_END
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCondition
(
c40008694
.
sccon
)
e2
:
SetTarget
(
c40008694
.
sctg
)
e2
:
SetOperation
(
c40008694
.
scop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_GRANT
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e3
:
SetTarget
(
c40008694
.
eftg
)
e3
:
SetLabelObject
(
e2
)
c
:
RegisterEffect
(
e3
)
else
c
:
CancelToGrave
(
false
)
Duel
.
SpecialSummonComplete
()
end
end
function
c40008694
.
eqlimit
(
e
,
c
)
return
c
:
GetControler
()
==
e
:
GetHandlerPlayer
()
or
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008694
.
eftg
(
e
,
c
)
return
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008694
.
sccon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
if
Duel
.
GetTurnPlayer
()
==
tp
then
return
(
ph
>=
PHASE_BATTLE_START
and
ph
<=
PHASE_BATTLE
)
else
return
(
ph
>=
PHASE_BATTLE_START
and
ph
<=
PHASE_BATTLE
)
or
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
end
end
function
c40008694
.
sctg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsSynchroSummonable
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
:
GetHandler
())
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
c40008694
.
scop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
GetControler
()
~=
tp
or
not
c
:
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsSynchroSummonable
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
c
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SynchroSummon
(
tp
,
sg
:
GetFirst
(),
c
)
end
end
function
c40008694
.
cfilter
(
c
,
tp
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008694
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToRemoveAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c40008694
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
c
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008694
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
c
,
tp
)
g
:
AddCard
(
c
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
c40008694
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
nil
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
Duel
.
SelectTarget
(
tp
,
nil
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
end
function
c40008694
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UNRELEASABLE_SUM
)
e1
:
SetValue
(
1
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_UNRELEASABLE_NONSUM
)
tc
:
RegisterEffect
(
e2
)
local
e5
=
e1
:
Clone
()
e5
:
SetCode
(
EFFECT_AVOID_BATTLE_DAMAGE
)
c
:
RegisterEffect
(
e5
)
if
tc
:
IsSetCard
(
0xf14
)
then
if
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
40008694
,
3
))
then
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
Duel
.
BreakEffect
()
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
end
end
expansions/script/c40008697.lua
View file @
998871fc
--炼狱骑士团 刚链索命龙
function
c40008697
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
40008697
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
+
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
40008697
)
e1
:
SetCost
(
c40008697
.
cost1
)
e1
:
SetCondition
(
c40008697
.
spcon1
)
e1
:
SetTarget
(
c40008697
.
target
)
e1
:
SetOperation
(
c40008697
.
activate
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
40008697
,
2
))
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e4
:
SetRange
(
LOCATION_GRAVE
)
e4
:
SetCost
(
c40008697
.
thcost
)
e4
:
SetCountLimit
(
1
,
40008698
)
e2
:
SetCondition
(
c40008697
.
dbcon
)
e4
:
SetTarget
(
c40008697
.
dbtg
)
e4
:
SetOperation
(
c40008697
.
dbop
)
c
:
RegisterEffect
(
e4
)
end
function
c40008697
.
spcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
end
function
c40008697
.
spcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
Duel
.
GetTurnPlayer
()
~=
tp
end
function
c40008697
.
spcon3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
not
Duel
.
GetTurnPlayer
()
~=
tp
end
function
c40008697
.
cosfilter3
(
c
)
return
c
:
IsSetCard
(
0xf14
)
and
(
c
:
IsAbleToGraveAsCost
()
or
c
:
IsDiscardable
())
end
function
c40008697
.
cost3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008697
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008697
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
+
REASON_DISCARD
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008697
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008697
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008697
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008697
.
cosfilter1
(
c
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c40008697
.
cosfilter2
(
c
)
return
c
:
IsCode
(
40008697
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008697
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008697
.
cosfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c40008697
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008697
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c40008697
.
cosfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
SendtoGrave
(
g1
,
REASON_COST
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008697
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008697
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
cid
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_CHAIN_ID
)
if
cid
~=
e
:
GetLabel
()
then
return
end
if
e
:
GetOwner
():
IsRelateToChain
(
ev
)
then
e
:
GetOwner
():
CancelToGrave
(
false
)
end
end
function
c40008697
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008699
,
0
,
0x4011
,
1900
,
0
,
5
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c40008697
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008699
,
0
,
0x4011
,
1900
,
0
,
5
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
then
return
end
local
token
=
Duel
.
CreateToken
(
tp
,
40008699
)
if
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
Duel
.
Equip
(
tp
,
c
,
token
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetValue
(
c40008697
.
eqlimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
40008697
,
1
))
e2
:
SetCategory
(
CATEGORY_TOGRAVE
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetTarget
(
c40008688
.
thtg
)
e2
:
SetOperation
(
c40008688
.
thop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_GRANT
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e3
:
SetTarget
(
c40008697
.
eftg
)
e3
:
SetLabelObject
(
e2
)
c
:
RegisterEffect
(
e3
)
else
c
:
CancelToGrave
(
false
)
Duel
.
SpecialSummonComplete
()
end
end
function
c40008697
.
eqlimit
(
e
,
c
)
return
c
:
GetControler
()
==
e
:
GetHandlerPlayer
()
or
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008697
.
eftg
(
e
,
c
)
return
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008697
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0xf14
)
and
not
c
:
IsCode
(
40008697
)
and
c
:
IsAbleToGrave
()
end
function
c40008697
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008697
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c40008697
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008697
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
end
function
c40008697
.
cfilter
(
c
,
tp
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008697
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToRemoveAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c40008697
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
c
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008697
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
c
,
tp
)
g
:
AddCard
(
c
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
c40008697
.
dbcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsAbleToEnterBP
()
end
function
c40008697
.
dbfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
GetFlagEffect
(
40008697
)
==
0
end
function
c40008697
.
dbtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsControler
(
tp
)
and
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
c40008697
.
dbfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c40008697
.
dbfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
c40008697
.
dbfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
end
function
c40008697
.
dbop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetTargetRange
(
0
,
1
)
e1
:
SetValue
(
c40008697
.
aclimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_DAMAGE
)
Duel
.
RegisterEffect
(
e1
,
tp
)
if
tc
:
IsSetCard
(
0xf14
)
then
if
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
40008697
,
3
))
then
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
Duel
.
BreakEffect
()
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
end
function
c40008697
.
aclimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_TRAP
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
and
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsImmuneToEffect
(
e
)
end
--炼狱骑士团 刚链索命龙
function
c40008697
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
40008697
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
+
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
40008697
)
e1
:
SetCost
(
c40008697
.
cost1
)
e1
:
SetCondition
(
c40008697
.
spcon1
)
e1
:
SetTarget
(
c40008697
.
target
)
e1
:
SetOperation
(
c40008697
.
activate
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
40008697
,
2
))
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e4
:
SetRange
(
LOCATION_GRAVE
)
e4
:
SetCost
(
c40008697
.
thcost
)
e4
:
SetCountLimit
(
1
,
40008698
)
e2
:
SetCondition
(
c40008697
.
dbcon
)
e4
:
SetTarget
(
c40008697
.
dbtg
)
e4
:
SetOperation
(
c40008697
.
dbop
)
c
:
RegisterEffect
(
e4
)
end
function
c40008697
.
spcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
end
function
c40008697
.
spcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
Duel
.
GetTurnPlayer
()
~=
tp
end
function
c40008697
.
spcon3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
40008677
)
and
not
Duel
.
GetTurnPlayer
()
~=
tp
end
function
c40008697
.
cosfilter3
(
c
)
return
c
:
IsSetCard
(
0xf14
)
and
(
c
:
IsAbleToGraveAsCost
()
or
c
:
IsDiscardable
())
end
function
c40008697
.
cost3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008697
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008697
.
cosfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
+
REASON_DISCARD
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008697
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008697
.
cost1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008697
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008697
.
cosfilter1
(
c
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c40008697
.
cosfilter2
(
c
)
return
c
:
IsCode
(
40008697
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008697
.
cost2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008697
.
cosfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c40008697
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008697
.
cosfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c40008697
.
cosfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
Duel
.
SendtoGrave
(
g1
,
REASON_COST
)
local
c
=
e
:
GetHandler
()
local
cid
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_CHAIN_ID
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_REMAIN_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_OATH
)
e1
:
SetReset
(
RESET_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_DISABLED
)
e2
:
SetOperation
(
c40008697
.
tgop
)
e2
:
SetLabel
(
cid
)
e2
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
c40008697
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
cid
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_CHAIN_ID
)
if
cid
~=
e
:
GetLabel
()
then
return
end
if
e
:
GetOwner
():
IsRelateToChain
(
ev
)
then
e
:
GetOwner
():
CancelToGrave
(
false
)
end
end
function
c40008697
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008699
,
0
,
0x4011
,
1900
,
0
,
5
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c40008697
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
40008699
,
0
,
0x4011
,
1900
,
0
,
5
,
RACE_DRAGON
,
ATTRIBUTE_FIRE
,
POS_FACEUP
)
then
return
end
local
token
=
Duel
.
CreateToken
(
tp
,
40008699
)
if
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
Duel
.
Equip
(
tp
,
c
,
token
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetValue
(
c40008697
.
eqlimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
40008697
,
1
))
e2
:
SetCategory
(
CATEGORY_TOGRAVE
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetCountLimit
(
1
)
e2
:
SetTarget
(
c40008688
.
thtg
)
e2
:
SetOperation
(
c40008688
.
thop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_GRANT
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e3
:
SetTarget
(
c40008697
.
eftg
)
e3
:
SetLabelObject
(
e2
)
c
:
RegisterEffect
(
e3
)
else
c
:
CancelToGrave
(
false
)
Duel
.
SpecialSummonComplete
()
end
end
function
c40008697
.
eqlimit
(
e
,
c
)
return
c
:
GetControler
()
==
e
:
GetHandlerPlayer
()
or
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008697
.
eftg
(
e
,
c
)
return
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
function
c40008697
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0xf14
)
and
not
c
:
IsCode
(
40008697
)
and
c
:
IsAbleToGrave
()
end
function
c40008697
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c40008697
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c40008697
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008697
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
end
function
c40008697
.
cfilter
(
c
,
tp
)
return
c
:
IsSetCard
(
0xf14
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c40008697
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToRemoveAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c40008697
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
c
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c40008697
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
c
,
tp
)
g
:
AddCard
(
c
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
c40008697
.
dbcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsAbleToEnterBP
()
end
function
c40008697
.
dbfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
GetFlagEffect
(
40008697
)
==
0
end
function
c40008697
.
dbtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsControler
(
tp
)
and
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
c40008697
.
dbfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c40008697
.
dbfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
c40008697
.
dbfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
end
function
c40008697
.
dbop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetTargetRange
(
0
,
1
)
e1
:
SetValue
(
c40008697
.
aclimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_DAMAGE
)
Duel
.
RegisterEffect
(
e1
,
tp
)
if
tc
:
IsSetCard
(
0xf14
)
then
if
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
40008697
,
3
))
then
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
Duel
.
BreakEffect
()
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
end
function
c40008697
.
aclimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_TRAP
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
and
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsImmuneToEffect
(
e
)
end
expansions/script/c81011020.lua
View file @
998871fc
--绫濑亚梦·幼驯染
function
c81011020
.
initial_effect
(
c
)
--fusion material
c
:
EnableReviveLimit
()
aux
.
AddFusionProcFunRep
(
c
,
c8101102
3
.
ffilter
,
3
,
true
)
--name
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCountLimit
(
1
)
e1
:
SetTarget
(
c81011020
.
nmtg
)
e1
:
SetOperation
(
c81011020
.
nmop
)
c
:
RegisterEffect
(
e1
)
--token
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
+
CATEGORY_REMOVE
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
81011020
)
e2
:
SetCondition
(
c81011020
.
tkcon
)
e2
:
SetTarget
(
c81011020
.
tktg
)
e2
:
SetOperation
(
c81011020
.
tkop
)
c
:
RegisterEffect
(
e2
)
--special summon
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
81011920
+
EFFECT_COUNT_CODE_SINGLE
)
e3
:
SetTarget
(
c81011020
.
sptg
)
e3
:
SetOperation
(
c81011020
.
spop
)
c
:
RegisterEffect
(
e3
)
local
e4
=
e3
:
Clone
()
e4
:
SetCode
(
EVENT_REMOVE
)
c
:
RegisterEffect
(
e4
)
end
function
c81011020
.
ffilter
(
c
,
fc
,
sub
,
mg
,
sg
)
return
(
not
c
:
IsType
(
TYPE_TOKEN
))
and
(
not
sg
or
sg
:
FilterCount
(
aux
.
TRUE
,
c
)
==
0
or
sg
:
IsExists
(
Card
.
IsFusionCode
,
1
,
c
,
c
:
GetFusionCode
()))
end
function
c81011020
.
nmfilter
(
c
,
cd
)
return
(
c
:
IsFaceup
()
or
c
:
IsLocation
(
LOCATION_GRAVE
))
and
not
c
:
IsCode
(
cd
)
end
function
c81011020
.
nmtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
cd
=
e
:
GetHandler
():
GetCode
()
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
+
LOCATION_GRAVE
)
and
c81011020
.
nmfilter
(
chkc
,
cd
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c81011020
.
nmfilter
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
1
,
nil
,
cd
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
Duel
.
SelectTarget
(
tp
,
c81011020
.
nmfilter
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
cd
)
end
function
c81011020
.
nmop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
c
:
IsRelateToEffect
(
e
)
and
c
:
IsFaceup
()
and
tc
:
IsRelateToEffect
(
e
)
and
(
tc
:
IsLocation
(
LOCATION_GRAVE
)
or
tc
:
IsFaceup
())
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CHANGE_CODE
)
e1
:
SetValue
(
tc
:
GetOriginalCode
())
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
end
end
function
c81011020
.
tkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
Card
.
IsSummonType
,
1
,
e
:
GetHandler
(),
SUMMON_TYPE_FUSION
)
end
function
c81011020
.
tktg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
81011019
,
0
,
0x4011
,
2800
,
2000
,
8
,
RACE_PLANT
,
ATTRIBUTE_EARTH
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
end
function
c81011020
.
tkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
if
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
81011019
,
0
,
0x4011
,
2800
,
2000
,
8
,
RACE_PLANT
,
ATTRIBUTE_EARTH
)
then
local
token
=
Duel
.
CreateToken
(
tp
,
81011019
)
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
BreakEffect
()
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c81011020
.
thfilter2
(
c
)
return
c
:
IsCode
(
81011021
)
and
c
:
IsAbleToHand
()
end
function
c81011020
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c81011020
.
thfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c81011020
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c81011020
.
thfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
--绫濑亚梦·幼驯染
function
c81011020
.
initial_effect
(
c
)
--fusion material
c
:
EnableReviveLimit
()
aux
.
AddFusionProcFunRep
(
c
,
c8101102
0
.
ffilter
,
3
,
true
)
--name
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCountLimit
(
1
)
e1
:
SetTarget
(
c81011020
.
nmtg
)
e1
:
SetOperation
(
c81011020
.
nmop
)
c
:
RegisterEffect
(
e1
)
--token
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
+
CATEGORY_REMOVE
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
,
81011020
)
e2
:
SetCondition
(
c81011020
.
tkcon
)
e2
:
SetTarget
(
c81011020
.
tktg
)
e2
:
SetOperation
(
c81011020
.
tkop
)
c
:
RegisterEffect
(
e2
)
--special summon
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
,
81011920
+
EFFECT_COUNT_CODE_SINGLE
)
e3
:
SetTarget
(
c81011020
.
sptg
)
e3
:
SetOperation
(
c81011020
.
spop
)
c
:
RegisterEffect
(
e3
)
local
e4
=
e3
:
Clone
()
e4
:
SetCode
(
EVENT_REMOVE
)
c
:
RegisterEffect
(
e4
)
end
function
c81011020
.
ffilter
(
c
,
fc
,
sub
,
mg
,
sg
)
return
(
not
c
:
IsType
(
TYPE_TOKEN
))
and
(
not
sg
or
sg
:
FilterCount
(
aux
.
TRUE
,
c
)
==
0
or
sg
:
IsExists
(
Card
.
IsFusionCode
,
1
,
c
,
c
:
GetFusionCode
()))
end
function
c81011020
.
nmfilter
(
c
,
cd
)
return
(
c
:
IsFaceup
()
or
c
:
IsLocation
(
LOCATION_GRAVE
))
and
not
c
:
IsCode
(
cd
)
end
function
c81011020
.
nmtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
cd
=
e
:
GetHandler
():
GetCode
()
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
+
LOCATION_GRAVE
)
and
c81011020
.
nmfilter
(
chkc
,
cd
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c81011020
.
nmfilter
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
1
,
nil
,
cd
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
Duel
.
SelectTarget
(
tp
,
c81011020
.
nmfilter
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
cd
)
end
function
c81011020
.
nmop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
c
:
IsRelateToEffect
(
e
)
and
c
:
IsFaceup
()
and
tc
:
IsRelateToEffect
(
e
)
and
(
tc
:
IsLocation
(
LOCATION_GRAVE
)
or
tc
:
IsFaceup
())
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CHANGE_CODE
)
e1
:
SetValue
(
tc
:
GetOriginalCode
())
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
end
end
function
c81011020
.
tkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
Card
.
IsSummonType
,
1
,
e
:
GetHandler
(),
SUMMON_TYPE_FUSION
)
end
function
c81011020
.
tktg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
81011019
,
0
,
0x4011
,
2800
,
2000
,
8
,
RACE_PLANT
,
ATTRIBUTE_EARTH
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
end
function
c81011020
.
tkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
if
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
81011019
,
0
,
0x4011
,
2800
,
2000
,
8
,
RACE_PLANT
,
ATTRIBUTE_EARTH
)
then
local
token
=
Duel
.
CreateToken
(
tp
,
81011019
)
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
BreakEffect
()
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c81011020
.
thfilter2
(
c
)
return
c
:
IsCode
(
81011021
)
and
c
:
IsAbleToHand
()
end
function
c81011020
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c81011020
.
thfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c81011020
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c81011020
.
thfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
expansions/script/c9980197.lua
View file @
998871fc
--第三领域
function
c9980197
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
--special summon
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
9980197
,
0
))
e5
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e5
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e5
:
SetType
(
EFFECT_TYPE_IGNITION
)
e5
:
SetRange
(
LOCATION_SZONE
)
e5
:
SetCountLimit
(
1
)
e5
:
SetTarget
(
c9980197
.
sptg
)
e5
:
SetOperation
(
c9980197
.
spop
)
c
:
RegisterEffect
(
e5
)
--spsummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
9980197
,
1
))
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_DESTROYED
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCondition
(
c9980197
.
thcon
)
e2
:
SetTarget
(
c9980197
.
thtg
)
e2
:
SetOperation
(
c9980197
.
thop
)
c
:
RegisterEffect
(
e2
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
9980197
,
2
))
e1
:
SetCategory
(
CATEGORY_TOGRAVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e1
:
SetCost
(
c9980197
.
cost
)
e1
:
SetTarget
(
c9980197
.
target
)
e1
:
SetOperation
(
c9980197
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c9980197
.
cfilter2
(
c
,
tp
)
return
c
:
IsSetCard
(
0x6bc8
)
and
c
:
IsReason
(
REASON_BATTLE
+
REASON_EFFECT
)
and
c
:
IsPreviousPosition
(
POS_FACEUP
)
and
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
and
c
:
GetPreviousControler
()
==
tp
end
function
c9980197
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c9980197
.
cfilter2
,
1
,
nil
,
tp
)
end
function
c9980197
.
filter3
(
c
,
e
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x6bc8
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c9980197
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_SZONE
)
and
chkc
:
IsControler
(
tp
)
and
c9980197
.
filter3
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingTarget
(
c9980197
.
filter3
,
tp
,
LOCATION_SZONE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c9980197
.
filter3
,
tp
,
LOCATION_SZONE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
function
c9980197
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
Duel
.
IsExistingMatchingCard
(
c9980197
.
filter3
,
tp
,
LOCATION_SZONE
,
0
,
5
,
nil
)
then
return
end
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
end
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980197
,
3
))
end
function
c9980197
.
cfilter
(
c
,
tp
)
return
c
:
IsReason
(
REASON_BATTLE
+
REASON_EFFECT
)
and
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
and
c
:
GetPreviousControler
()
==
tp
end
function
c9980197
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c9980197
.
cfilter
,
1
,
nil
,
tp
)
end
function
c9980197
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x6bc8
)
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsAbleToHand
()
end
function
c9980197
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c9980197
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c9980197
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c9980197
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980197
,
3
))
end
function
c9980197
.
costfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x6bc8
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c9980197
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
e
:
SetLabel
(
1
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c9980197
.
costfilter
,
tp
,
LOCATION_SZONE
,
0
,
4
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c9980197
.
costfilter
,
tp
,
LOCATION_SZONE
,
0
,
4
,
4
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
end
function
c9980197
.
filter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x6bc8
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c9980197
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
e
:
GetLabel
()
~=
1
then
return
Duel
.
IsExistingMatchingCard
(
c9980197
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
else
e
:
SetLabel
(
0
)
return
Duel
.
IsExistingMatchingCard
(
c9980197
.
filter
,
tp
,
LOCATION_SZONE
,
0
,
1
,
nil
,
e
,
tp
)
end
end
e
:
SetLabel
(
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
end
function
c9980197
.
ctfilter
(
c
,
tp
)
return
c
:
GetPreviousControler
()
==
tp
and
c
:
IsLocation
(
LOCATION_GRAVE
)
end
function
c9980197
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_ONFIELD
)
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
g
=
Duel
.
GetOperatedGroup
()
local
ct
=
g
:
FilterCount
(
c9980197
.
ctfilter
,
nil
,
1
-
tp
)
if
ft
>
ct
then
ft
=
ct
end
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
59822133
)
then
ft
=
1
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
g
=
Duel
.
SelectMatchingCard
(
tp
,
c9980197
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
ft
,
ft
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
BreakEffect
()
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980197
,
3
))
end
--第三领域
function
c9980197
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
--special summon
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
9980197
,
0
))
e5
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e5
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e5
:
SetType
(
EFFECT_TYPE_IGNITION
)
e5
:
SetRange
(
LOCATION_SZONE
)
e5
:
SetCountLimit
(
1
)
e5
:
SetTarget
(
c9980197
.
sptg
)
e5
:
SetOperation
(
c9980197
.
spop
)
c
:
RegisterEffect
(
e5
)
--spsummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
9980197
,
1
))
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_DESTROYED
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCondition
(
c9980197
.
thcon
)
e2
:
SetTarget
(
c9980197
.
thtg
)
e2
:
SetOperation
(
c9980197
.
thop
)
c
:
RegisterEffect
(
e2
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
9980197
,
2
))
e1
:
SetCategory
(
CATEGORY_TOGRAVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e1
:
SetCost
(
c9980197
.
cost
)
e1
:
SetTarget
(
c9980197
.
target
)
e1
:
SetOperation
(
c9980197
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c9980197
.
filter3
(
c
,
e
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x6bc8
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c9980197
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_SZONE
)
and
chkc
:
IsControler
(
tp
)
and
c9980197
.
filter3
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingTarget
(
c9980197
.
filter3
,
tp
,
LOCATION_SZONE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c9980197
.
filter3
,
tp
,
LOCATION_SZONE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
function
c9980197
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
Duel
.
IsExistingMatchingCard
(
c9980197
.
filter3
,
tp
,
LOCATION_SZONE
,
0
,
5
,
nil
)
then
return
end
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
end
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980197
,
3
))
end
function
c9980197
.
cfilter
(
c
,
tp
)
return
c
:
IsReason
(
REASON_BATTLE
+
REASON_EFFECT
)
and
c
:
IsPreviousLocation
(
LOCATION_MZONE
)
and
c
:
GetPreviousControler
()
==
tp
end
function
c9980197
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c9980197
.
cfilter
,
1
,
nil
,
tp
)
end
function
c9980197
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x6bc8
)
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsAbleToHand
()
end
function
c9980197
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c9980197
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c9980197
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c9980197
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980197
,
3
))
end
function
c9980197
.
costfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x6bc8
)
and
c
:
IsAbleToGraveAsCost
()
end
function
c9980197
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
e
:
SetLabel
(
1
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c9980197
.
costfilter
,
tp
,
LOCATION_SZONE
,
0
,
4
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c9980197
.
costfilter
,
tp
,
LOCATION_SZONE
,
0
,
4
,
4
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
end
function
c9980197
.
filter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x6bc8
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c9980197
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
e
:
GetLabel
()
~=
1
then
return
Duel
.
IsExistingMatchingCard
(
c9980197
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
else
e
:
SetLabel
(
0
)
return
Duel
.
IsExistingMatchingCard
(
c9980197
.
filter
,
tp
,
LOCATION_SZONE
,
0
,
1
,
nil
,
e
,
tp
)
end
end
e
:
SetLabel
(
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
end
function
c9980197
.
ctfilter
(
c
,
tp
)
return
c
:
GetPreviousControler
()
==
tp
and
c
:
IsLocation
(
LOCATION_GRAVE
)
end
function
c9980197
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_ONFIELD
)
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
g
=
Duel
.
GetOperatedGroup
()
local
ct
=
g
:
FilterCount
(
c9980197
.
ctfilter
,
nil
,
1
-
tp
)
if
ft
>
ct
then
ft
=
ct
end
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
59822133
)
then
ft
=
1
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
g
=
Duel
.
SelectMatchingCard
(
tp
,
c9980197
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
ft
,
ft
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
BreakEffect
()
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980197
,
3
))
end
expansions/script/c9980573.lua
View file @
998871fc
--MRS拟态甲斗-骑士形态
function
c9980573
.
initial_effect
(
c
)
--special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e1
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
9980573
)
e1
:
SetCondition
(
c9980573
.
spcon
)
c
:
RegisterEffect
(
e1
)
--damage
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_DAMAGE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
9980573
)
e1
:
SetTarget
(
c9980573
.
target
)
e1
:
SetOperation
(
c9980573
.
operation
)
c
:
RegisterEffect
(
e1
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
9980573
,
1
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_GRAVE
)
e1
:
SetCost
(
aux
.
bfgcost
)
e1
:
SetCountLimit
(
1
,
99805730
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetTarget
(
c9980573
.
sptg
)
e1
:
SetOperation
(
c9980573
.
spop
)
c
:
RegisterEffect
(
e1
)
--summon success
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e4
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e4
:
SetOperation
(
c9980573
.
sumsuc
)
c
:
RegisterEffect
(
e4
)
local
e5
=
e4
:
Clone
()
e5
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e5
)
end
function
c9980573
.
sumsuc
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980573
,
2
))
end
function
c9980573
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0xcbca
)
and
not
c
:
IsCode
(
9980573
)
end
function
c9980573
.
spcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
return
Duel
.
GetLocationCount
(
c
:
GetControler
(),
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c9980573
.
filter
,
c
:
GetControler
(),
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
c9980573
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetTargetPlayer
(
1
-
tp
)
Duel
.
SetTargetParam
(
1000
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DAMAGE
,
nil
,
0
,
1
-
tp
,
1000
)
end
function
c9980573
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
if
Duel
.
Damage
(
p
,
d
,
REASON_EFFECT
)
>
0
then
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980573
,
3
))
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
)
local
tc
=
g
:
GetFirst
()
if
tc
then
Duel
.
BreakEffect
()
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
-
1000
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
tc
:
RegisterEffect
(
e2
)
end
end
if
Duel
.
GetFlagEffect
(
tp
,
9980573
)
~=
0
then
return
end
--extra summon
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetDescription
(
aux
.
Stringid
(
9980573
,
0
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_EXTRA_SUMMON_COUNT
)
e2
:
SetTargetRange
(
LOCATION_HAND
+
LOCATION_MZONE
,
0
)
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0xcbca
))
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e2
,
tp
)
Duel
.
RegisterFlagEffect
(
tp
,
9980573
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c9980573
.
filter1
(
c
,
e
,
tp
)
local
rk
=
c
:
GetRank
()
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_XYZ
)
and
c
:
IsSetCard
(
0xcbca
)
and
Duel
.
IsExistingMatchingCard
(
c9980573
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
c
,
rk
+
1
)
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
c
)
>
0
and
aux
.
MustMaterialCheck
(
c
,
tp
,
EFFECT_MUST_BE_XMATERIAL
)
end
function
c9980573
.
filter2
(
c
,
e
,
tp
,
mc
,
rk
)
return
c
:
IsRank
(
rk
)
and
c
:
IsType
(
TYPE_XYZ
)
and
c
:
IsAttribute
(
ATTRIBUTE_WIND
)
and
mc
:
IsCanBeXyzMaterial
(
c
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_XYZ
,
tp
,
false
,
false
)
end
function
c9980573
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsControler
(
tp
)
and
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
c9980573
.
filter1
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c9980573
.
filter1
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
Duel
.
SelectTarget
(
tp
,
c9980573
.
filter1
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
c9980573
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
tc
)
<=
0
or
not
aux
.
MustMaterialCheck
(
tc
,
tp
,
EFFECT_MUST_BE_XMATERIAL
)
then
return
end
if
tc
:
IsFacedown
()
or
not
tc
:
IsRelateToEffect
(
e
)
or
tc
:
IsControler
(
1
-
tp
)
or
tc
:
IsImmuneToEffect
(
e
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c9980573
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
,
e
,
tp
,
tc
,
tc
:
GetRank
()
+
1
)
local
sc
=
g
:
GetFirst
()
if
sc
then
local
mg
=
tc
:
GetOverlayGroup
()
if
mg
:
GetCount
()
~=
0
then
Duel
.
Overlay
(
sc
,
mg
)
end
sc
:
SetMaterial
(
Group
.
FromCards
(
tc
))
Duel
.
Overlay
(
sc
,
Group
.
FromCards
(
tc
))
Duel
.
SpecialSummon
(
sc
,
SUMMON_TYPE_XYZ
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980573
,
3
))
sc
:
CompleteProcedure
()
end
--MRS拟态甲斗-骑士形态
function
c9980573
.
initial_effect
(
c
)
--special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e1
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
9980573
)
e1
:
SetCondition
(
c9980573
.
spcon
)
c
:
RegisterEffect
(
e1
)
--damage
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_DAMAGE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
9980573
1
)
e1
:
SetTarget
(
c9980573
.
target
)
e1
:
SetOperation
(
c9980573
.
operation
)
c
:
RegisterEffect
(
e1
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
9980573
,
1
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_GRAVE
)
e1
:
SetCost
(
aux
.
bfgcost
)
e1
:
SetCountLimit
(
1
,
99805730
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetTarget
(
c9980573
.
sptg
)
e1
:
SetOperation
(
c9980573
.
spop
)
c
:
RegisterEffect
(
e1
)
--summon success
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e4
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e4
:
SetOperation
(
c9980573
.
sumsuc
)
c
:
RegisterEffect
(
e4
)
local
e5
=
e4
:
Clone
()
e5
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e5
)
end
function
c9980573
.
sumsuc
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980573
,
2
))
end
function
c9980573
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0xcbca
)
and
not
c
:
IsCode
(
9980573
)
end
function
c9980573
.
spcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
return
Duel
.
GetLocationCount
(
c
:
GetControler
(),
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c9980573
.
filter
,
c
:
GetControler
(),
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
c9980573
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetTargetPlayer
(
1
-
tp
)
Duel
.
SetTargetParam
(
1000
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DAMAGE
,
nil
,
0
,
1
-
tp
,
1000
)
end
function
c9980573
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
if
Duel
.
Damage
(
p
,
d
,
REASON_EFFECT
)
>
0
then
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980573
,
3
))
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
)
local
tc
=
g
:
GetFirst
()
if
tc
then
Duel
.
BreakEffect
()
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
-
1000
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
tc
:
RegisterEffect
(
e2
)
end
end
if
Duel
.
GetFlagEffect
(
tp
,
9980573
)
~=
0
then
return
end
--extra summon
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetDescription
(
aux
.
Stringid
(
9980573
,
0
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_EXTRA_SUMMON_COUNT
)
e2
:
SetTargetRange
(
LOCATION_HAND
+
LOCATION_MZONE
,
0
)
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0xcbca
))
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e2
,
tp
)
Duel
.
RegisterFlagEffect
(
tp
,
9980573
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c9980573
.
filter1
(
c
,
e
,
tp
)
local
rk
=
c
:
GetRank
()
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_XYZ
)
and
c
:
IsSetCard
(
0xcbca
)
and
Duel
.
IsExistingMatchingCard
(
c9980573
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
c
,
rk
+
1
)
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
c
)
>
0
and
aux
.
MustMaterialCheck
(
c
,
tp
,
EFFECT_MUST_BE_XMATERIAL
)
end
function
c9980573
.
filter2
(
c
,
e
,
tp
,
mc
,
rk
)
return
c
:
IsRank
(
rk
)
and
c
:
IsType
(
TYPE_XYZ
)
and
c
:
IsAttribute
(
ATTRIBUTE_WIND
)
and
mc
:
IsCanBeXyzMaterial
(
c
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_XYZ
,
tp
,
false
,
false
)
end
function
c9980573
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsControler
(
tp
)
and
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
c9980573
.
filter1
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c9980573
.
filter1
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
Duel
.
SelectTarget
(
tp
,
c9980573
.
filter1
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
c9980573
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
tc
)
<=
0
or
not
aux
.
MustMaterialCheck
(
tc
,
tp
,
EFFECT_MUST_BE_XMATERIAL
)
then
return
end
if
tc
:
IsFacedown
()
or
not
tc
:
IsRelateToEffect
(
e
)
or
tc
:
IsControler
(
1
-
tp
)
or
tc
:
IsImmuneToEffect
(
e
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c9980573
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
,
e
,
tp
,
tc
,
tc
:
GetRank
()
+
1
)
local
sc
=
g
:
GetFirst
()
if
sc
then
local
mg
=
tc
:
GetOverlayGroup
()
if
mg
:
GetCount
()
~=
0
then
Duel
.
Overlay
(
sc
,
mg
)
end
sc
:
SetMaterial
(
Group
.
FromCards
(
tc
))
Duel
.
Overlay
(
sc
,
Group
.
FromCards
(
tc
))
Duel
.
SpecialSummon
(
sc
,
SUMMON_TYPE_XYZ
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980573
,
3
))
sc
:
CompleteProcedure
()
end
end
\ No newline at end of file
expansions/script/c9980577.lua
View file @
998871fc
--Hyper Rider Kick
function
c9980577
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_DESTROY
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e1
:
SetCountLimit
(
1
,
9980577
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCost
(
c9980577
.
cost
)
e1
:
SetTarget
(
c9980577
.
target
)
e1
:
SetOperation
(
c9980577
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c9980577
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
e
:
SetLabel
(
1
)
return
true
end
function
c9980577
.
costfilter
(
c
)
return
c
:
IsSetCard
(
0xcbca
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c9980577
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsOnField
()
end
if
chk
==
0
then
if
e
:
GetLabel
()
==
1
then
e
:
SetLabel
(
0
)
return
Duel
.
IsExistingMatchingCard
(
c9980577
.
costfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
and
Duel
.
IsExistingTarget
(
aux
.
TRUE
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
e
:
GetHandler
())
else
return
false
end
end
e
:
SetLabel
(
0
)
local
rt
=
Duel
.
GetTargetCount
(
aux
.
TRUE
,
tp
,
0
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
rt
>
2
then
rt
=
2
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
cg
=
Duel
.
SelectMatchingCard
(
tp
,
c9980577
.
costfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
rt
,
nil
)
local
ct
=
cg
:
GetCount
()
Duel
.
Remove
(
cg
,
POS_FACEUP
,
REASON_COST
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectTarget
(
tp
,
aux
.
TRUE
,
tp
,
0
,
LOCATION_ONFIELD
,
ct
,
ct
,
e
:
GetHandler
())
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
g
:
GetCount
(),
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c9980577
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
and
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
>
0
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980577
,
0
))
end
end
--Hyper Rider Kick
function
c9980577
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_DESTROY
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e1
:
SetCountLimit
(
1
,
9980577
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCost
(
c9980577
.
cost
)
e1
:
SetTarget
(
c9980577
.
target
)
e1
:
SetOperation
(
c9980577
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c9980577
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
e
:
SetLabel
(
1
)
return
true
end
function
c9980577
.
costfilter
(
c
)
return
c
:
IsSetCard
(
0xcbca
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c9980577
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsOnField
()
end
if
chk
==
0
then
if
e
:
GetLabel
()
==
1
then
e
:
SetLabel
(
0
)
return
Duel
.
IsExistingMatchingCard
(
c9980577
.
costfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
and
Duel
.
IsExistingTarget
(
aux
.
TRUE
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
e
:
GetHandler
())
else
return
false
end
end
e
:
SetLabel
(
0
)
local
rt
=
Duel
.
GetTargetCount
(
aux
.
TRUE
,
tp
,
0
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
rt
>
2
then
rt
=
2
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
cg
=
Duel
.
SelectMatchingCard
(
tp
,
c9980577
.
costfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
rt
,
nil
)
local
ct
=
cg
:
GetCount
()
Duel
.
Remove
(
cg
,
POS_FACEUP
,
REASON_COST
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectTarget
(
tp
,
aux
.
TRUE
,
tp
,
0
,
LOCATION_ONFIELD
,
ct
,
ct
,
e
:
GetHandler
())
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
g
:
GetCount
(),
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c9980577
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
)
local
sg
=
g
:
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
Duel
.
Destroy
(
sg
,
REASON_EFFECT
)
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980577
,
0
))
end
expansions/script/c9980580.lua
View file @
998871fc
--古朗基·14号
function
c9980580
.
initial_effect
(
c
)
--cannot special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
+
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetRange
(
LOCATION_DECK
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
c
:
RegisterEffect
(
e1
)
--special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e1
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCondition
(
c9980580
.
spcon
)
c
:
RegisterEffect
(
e1
)
--destroy
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
9980580
,
1
))
e2
:
SetCategory
(
CATEGORY_DESTROY
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
9980580
)
e2
:
SetTarget
(
c9980580
.
destg
)
e2
:
SetOperation
(
c9980580
.
desop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e3
)
--tohand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
9980580
,
0
))
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_TO_GRAVE
)
e2
:
SetCountLimit
(
1
,
99805800
)
e2
:
SetCondition
(
c9980580
.
thcon
)
e2
:
SetCost
(
c9980580
.
cost
)
e2
:
SetTarget
(
c9980580
.
thtg
)
e2
:
SetOperation
(
c9980580
.
thop
)
c
:
RegisterEffect
(
e2
)
end
function
c9980580
.
spcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
return
Duel
.
GetLocationCount
(
c
:
GetControler
(),
LOCATION_MZONE
)
>
0
and
Duel
.
GetFieldGroupCount
(
c
:
GetControler
(),
LOCATION_MZONE
,
0
,
nil
)
<
Duel
.
GetFieldGroupCount
(
c
:
GetControler
(),
0
,
LOCATION_MZONE
,
nil
)
end
function
c9980580
.
desfilter
(
c
)
return
c
:
GetSequence
()
<
5
end
function
c9980580
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_SZONE
)
and
chkc
:
IsControler
(
tp
)
and
c9980580
.
desfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c9980580
.
desfilter
,
tp
,
0
,
LOCATION_SZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c9980580
.
desfilter
,
tp
,
0
,
LOCATION_SZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
end
function
c9980580
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980580
,
2
))
end
end
function
c9980580
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
end
function
c9980580
.
thfilter
(
c
)
return
c
:
IsRace
(
RACE_WARRIOR
)
and
c
:
IsAttribute
(
ATTRIBUTE_DARK
)
and
not
c
:
IsCode
(
9980580
)
and
c
:
IsAbleToHand
()
end
function
c9980580
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c9980580
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c9980580
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c9980580
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980580
,
3
))
end
end
--古朗基·14号
function
c9980580
.
initial_effect
(
c
)
--cannot special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
+
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetRange
(
LOCATION_DECK
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
c
:
RegisterEffect
(
e1
)
--special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e1
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCondition
(
c9980580
.
spcon
)
c
:
RegisterEffect
(
e1
)
--destroy
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
9980580
,
1
))
e2
:
SetCategory
(
CATEGORY_DESTROY
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
9980580
)
e2
:
SetTarget
(
c9980580
.
destg
)
e2
:
SetOperation
(
c9980580
.
desop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e3
)
--tohand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
9980580
,
0
))
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_TO_GRAVE
)
e2
:
SetCountLimit
(
1
,
99805800
)
e2
:
SetCondition
(
c9980580
.
thcon
)
e2
:
SetTarget
(
c9980580
.
thtg
)
e2
:
SetOperation
(
c9980580
.
thop
)
c
:
RegisterEffect
(
e2
)
end
function
c9980580
.
spcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
return
Duel
.
GetLocationCount
(
c
:
GetControler
(),
LOCATION_MZONE
)
>
0
and
Duel
.
GetFieldGroupCount
(
c
:
GetControler
(),
LOCATION_MZONE
,
0
,
nil
)
<
Duel
.
GetFieldGroupCount
(
c
:
GetControler
(),
0
,
LOCATION_MZONE
,
nil
)
end
function
c9980580
.
desfilter
(
c
)
return
c
:
GetSequence
()
<
5
end
function
c9980580
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_SZONE
)
and
chkc
:
IsControler
(
tp
)
and
c9980580
.
desfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c9980580
.
desfilter
,
tp
,
0
,
LOCATION_SZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c9980580
.
desfilter
,
tp
,
0
,
LOCATION_SZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
end
function
c9980580
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980580
,
2
))
end
end
function
c9980580
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsReason
(
REASON_EFFECT
)
end
function
c9980580
.
thfilter
(
c
)
return
c
:
IsRace
(
RACE_WARRIOR
)
and
c
:
IsAttribute
(
ATTRIBUTE_DARK
)
and
not
c
:
IsCode
(
9980580
)
and
c
:
IsAbleToHand
()
end
function
c9980580
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c9980580
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c9980580
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c9980580
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980580
,
3
))
end
end
expansions/script/c9980581.lua
View file @
998871fc
--古朗基·3号
function
c9980581
.
initial_effect
(
c
)
--cannot special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
+
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetRange
(
LOCATION_DECK
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
c
:
RegisterEffect
(
e1
)
--special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e1
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCondition
(
c9980581
.
spcon
)
c
:
RegisterEffect
(
e1
)
--atkup
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
9980581
,
0
))
e1
:
SetCategory
(
CATEGORY_ATKCHANGE
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
TIMING_DAMAGE_STEP
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
9980581
)
e1
:
SetCondition
(
c9980581
.
condition
)
e1
:
SetCost
(
c9980581
.
cost
)
e1
:
SetOperation
(
c9980581
.
operation
)
c
:
RegisterEffect
(
e1
)
--add to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
9980581
,
1
))
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DAMAGE_STEP
)
e2
:
SetCode
(
EVENT_TO_GRAVE
)
e2
:
SetCondition
(
c9980581
.
thcon
)
e2
:
SetTarget
(
c9980581
.
thtg
)
e2
:
SetOperation
(
c9980581
.
thop
)
c
:
RegisterEffect
(
e2
)
end
function
c9980581
.
spcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
return
Duel
.
GetLocationCount
(
c
:
GetControler
(),
LOCATION_MZONE
)
>
0
and
Duel
.
GetFieldGroupCount
(
c
:
GetControler
(),
LOCATION_MZONE
,
0
,
nil
)
<
Duel
.
GetFieldGroupCount
(
c
:
GetControler
(),
0
,
LOCATION_MZONE
,
nil
)
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980581
,
2
))
end
function
c9980581
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetCurrentPhase
()
~=
PHASE_DAMAGE
or
not
Duel
.
IsDamageCalculated
()
end
function
c9980581
.
cfilter
(
c
)
return
c
:
IsRace
(
RACE_WARRIOR
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c9980581
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c9980581
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c9980581
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
c9980581
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsFaceup
()
and
c
:
IsRelateToEffect
(
e
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
1000
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_DISABLE
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_BATTLED
)
e2
:
SetOperation
(
c9980581
.
rmop
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e2
)
end
end
function
c9980581
.
rmop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetHandler
():
GetBattleTarget
()
if
tc
then
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c9980581
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
bit
.
band
(
r
,
REASON_DESTROY
)
>
0
and
e
:
GetHandler
():
IsPreviousLocation
(
LOCATION_ONFIELD
)
and
e
:
GetHandler
():
GetPreviousControler
()
==
tp
end
function
c9980581
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
c9980581
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsControler
(
tp
)
and
chkc
:
IsLocation
(
LOCATION_REMOVED
)
and
c9980581
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c9980581
.
filter
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c9980581
.
filter
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
g
:
GetCount
(),
0
,
0
)
end
function
c9980581
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
and
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
end
--古朗基·3号
function
c9980581
.
initial_effect
(
c
)
--cannot special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
+
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetRange
(
LOCATION_DECK
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
c
:
RegisterEffect
(
e1
)
--special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e1
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCondition
(
c9980581
.
spcon
)
c
:
RegisterEffect
(
e1
)
--atkup
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
9980581
,
0
))
e1
:
SetCategory
(
CATEGORY_ATKCHANGE
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
TIMING_DAMAGE_STEP
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
9980581
)
e1
:
SetCondition
(
c9980581
.
condition
)
e1
:
SetCost
(
c9980581
.
cost
)
e1
:
SetOperation
(
c9980581
.
operation
)
c
:
RegisterEffect
(
e1
)
--add to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
9980581
,
1
))
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DAMAGE_STEP
)
e2
:
SetCode
(
EVENT_TO_GRAVE
)
e2
:
SetCondition
(
c9980581
.
thcon
)
e2
:
SetTarget
(
c9980581
.
thtg
)
e2
:
SetOperation
(
c9980581
.
thop
)
c
:
RegisterEffect
(
e2
)
end
function
c9980581
.
spcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
return
Duel
.
GetLocationCount
(
c
:
GetControler
(),
LOCATION_MZONE
)
>
0
and
Duel
.
GetFieldGroupCount
(
c
:
GetControler
(),
LOCATION_MZONE
,
0
,
nil
)
<
Duel
.
GetFieldGroupCount
(
c
:
GetControler
(),
0
,
LOCATION_MZONE
,
nil
)
end
function
c9980581
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetCurrentPhase
()
~=
PHASE_DAMAGE
or
not
Duel
.
IsDamageCalculated
()
end
function
c9980581
.
cfilter
(
c
)
return
c
:
IsRace
(
RACE_WARRIOR
)
and
c
:
IsAbleToRemoveAsCost
()
end
function
c9980581
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c9980581
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c9980581
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
c9980581
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsFaceup
()
and
c
:
IsRelateToEffect
(
e
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
1000
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_DISABLE
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_BATTLED
)
e2
:
SetOperation
(
c9980581
.
rmop
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e2
)
end
end
function
c9980581
.
rmop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetHandler
():
GetBattleTarget
()
if
tc
then
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c9980581
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
bit
.
band
(
r
,
REASON_DESTROY
)
>
0
and
e
:
GetHandler
():
IsPreviousLocation
(
LOCATION_ONFIELD
)
and
e
:
GetHandler
():
GetPreviousControler
()
==
tp
end
function
c9980581
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
c9980581
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsControler
(
tp
)
and
chkc
:
IsLocation
(
LOCATION_REMOVED
)
and
c9980581
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c9980581
.
filter
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c9980581
.
filter
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
g
:
GetCount
(),
0
,
0
)
end
function
c9980581
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
and
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
end
expansions/script/c9980705.lua
View file @
998871fc
--他者封印·鲜血神殿
function
c9980705
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
--defup
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x3bc1
))
e2
:
SetValue
(
300
)
c
:
RegisterEffect
(
e2
)
--atk/def
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e2
:
SetTarget
(
c9980705
.
atktg
)
e2
:
SetValue
(
-
500
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
c
:
RegisterEffect
(
e3
)
--disable
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_SOLVING
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetCondition
(
c9980705
.
discon
)
e2
:
SetOperation
(
c9980705
.
disop
)
c
:
RegisterEffect
(
e2
)
--spsummon
local
e6
=
Effect
.
CreateEffect
(
c
)
e6
:
SetDescription
(
aux
.
Stringid
(
9980705
,
1
))
e6
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e6
:
SetType
(
EFFECT_TYPE_IGNITION
)
e6
:
SetRange
(
LOCATION_FZONE
)
e6
:
SetCountLimit
(
1
)
e6
:
SetTarget
(
c9980705
.
sptg
)
e6
:
SetOperation
(
c9980705
.
spop
)
c
:
RegisterEffect
(
e6
)
end
c9980705
.
card_code_list
=
{
9980706
}
function
c9980705
.
atktg
(
e
,
c
)
return
not
c
:
IsSetCard
(
0x3bc1
)
end
function
c9980705
.
discon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsStatus
(
STATUS_BATTLE_DESTROYED
)
then
return
false
end
local
atk
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TRIGGERING_ATTACK
)
local
def
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TRIGGERING_DEFENSE
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
(
atk
==
0
or
def
==
0
)
and
not
c
:
IsRace
(
RACE_REPTILE
)
end
function
c9980705
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
NegateEffect
(
ev
)
end
function
c9980705
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x3bc1
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c9980705
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c9980705
.
spfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
+
LOCATION_REMOVED
)
end
function
c9980705
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c9980705
.
spfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
--他者封印·鲜血神殿
function
c9980705
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
--defup
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x3bc1
))
e2
:
SetValue
(
300
)
c
:
RegisterEffect
(
e2
)
--atk/def
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e2
:
SetTarget
(
c9980705
.
atktg
)
e2
:
SetValue
(
-
500
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
c
:
RegisterEffect
(
e3
)
--disable
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_SOLVING
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetCondition
(
c9980705
.
discon
)
e2
:
SetOperation
(
c9980705
.
disop
)
c
:
RegisterEffect
(
e2
)
--spsummon
local
e6
=
Effect
.
CreateEffect
(
c
)
e6
:
SetDescription
(
aux
.
Stringid
(
9980705
,
1
))
e6
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e6
:
SetType
(
EFFECT_TYPE_IGNITION
)
e6
:
SetRange
(
LOCATION_FZONE
)
e6
:
SetCountLimit
(
1
)
e6
:
SetTarget
(
c9980705
.
sptg
)
e6
:
SetOperation
(
c9980705
.
spop
)
c
:
RegisterEffect
(
e6
)
end
c9980705
.
card_code_list
=
{
9980706
}
function
c9980705
.
atktg
(
e
,
c
)
return
not
c
:
IsSetCard
(
0x3bc1
)
end
function
c9980705
.
discon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
IsStatus
(
STATUS_BATTLE_DESTROYED
)
then
return
false
end
local
atk
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TRIGGERING_ATTACK
)
local
def
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TRIGGERING_DEFENSE
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
(
atk
==
0
or
def
==
0
)
and
not
re
:
IsSetCard
(
0x3bc1
)
end
function
c9980705
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
NegateEffect
(
ev
)
end
function
c9980705
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x3bc1
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c9980705
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c9980705
.
spfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
+
LOCATION_REMOVED
)
end
function
c9980705
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c9980705
.
spfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
\ No newline at end of file
expansions/script/c9980712.lua
View file @
998871fc
--克律萨俄耳
function
c9980712
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetTarget
(
c9980712
.
eqtg
)
e1
:
SetOperation
(
c9980712
.
eqop
)
c
:
RegisterEffect
(
e1
)
--Equip limit
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetValue
(
c9980712
.
effcon
)
c
:
RegisterEffect
(
e2
)
--atk & def
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x3bc1
))
e2
:
SetValue
(
300
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
c
:
RegisterEffect
(
e3
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_POSITION
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetTarget
(
c9980712
.
pstg
)
e1
:
SetOperation
(
c9980712
.
psop
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
9980712
,
2
))
e4
:
SetCategory
(
CATEGORY_TOHAND
)
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e4
:
SetRange
(
LOCATION_GRAVE
)
e4
:
SetCountLimit
(
1
,
9980712
)
e4
:
SetCost
(
c9980712
.
thcost
)
e4
:
SetTarget
(
c9980712
.
thtg
)
e4
:
SetOperation
(
c9980712
.
thop
)
c
:
RegisterEffect
(
e4
)
end
c9980712
.
card_code_list
=
{
9980706
}
function
c9980712
.
effcon
(
e
,
c
)
return
c
:
IsSetCard
(
0x3bc1
)
end
function
c9980712
.
eqfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x3bc1
)
end
function
c9980712
.
eqtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
c9980712
.
eqfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c9980712
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
c9980712
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c9980712
.
eqop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
c
:
IsRelateToEffect
(
e
)
and
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
Duel
.
Equip
(
tp
,
c
,
tc
)
end
end
function
c9980712
.
psfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCanTurnSet
()
end
function
c9980712
.
pstg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
c9980712
.
psfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c9980712
.
psfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c9980712
.
spfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_POSITION
,
g
,
1
,
0
,
0
)
end
function
c9980712
.
psop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsLocation
(
LOCATION_MZONE
)
and
tc
:
IsFaceup
()
then
Duel
.
ChangePosition
(
tc
,
POS_FACEDOWN_DEFENSE
)
end
end
function
c9980712
.
cfilter
(
c
,
tp
)
return
(
aux
.
IsCodeListed
(
c
,
9980706
)
or
c
:
IsSetCard
(
0x3bc1
))
and
c
:
IsAbleToRemoveAsCost
()
and
Duel
.
IsExistingTarget
(
c9980712
.
thfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
c
)
end
function
c9980712
.
thfilter
(
c
)
return
aux
.
IsCodeListed
(
c
,
9980706
)
and
c
:
IsAbleToHand
()
end
function
c9980712
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToRemoveAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c9980712
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
c
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c9980712
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
c
,
tp
)
g
:
AddCard
(
c
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
c9980712
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
c9980712
.
thfilter
(
chkc
)
end
if
chk
==
0
then
return
true
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c9980712
.
thfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
0
)
end
function
c9980712
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
end
end
--克律萨俄耳
function
c9980712
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetTarget
(
c9980712
.
eqtg
)
e1
:
SetOperation
(
c9980712
.
eqop
)
c
:
RegisterEffect
(
e1
)
--Equip limit
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetValue
(
c9980712
.
effcon
)
c
:
RegisterEffect
(
e2
)
--atk & def
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x3bc1
))
e2
:
SetValue
(
300
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
c
:
RegisterEffect
(
e3
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_POSITION
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetTarget
(
c9980712
.
pstg
)
e1
:
SetOperation
(
c9980712
.
psop
)
c
:
RegisterEffect
(
e1
)
--to hand
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
9980712
,
2
))
e4
:
SetCategory
(
CATEGORY_TOHAND
)
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e4
:
SetRange
(
LOCATION_GRAVE
)
e4
:
SetCountLimit
(
1
,
9980712
)
e4
:
SetCost
(
c9980712
.
thcost
)
e4
:
SetTarget
(
c9980712
.
thtg
)
e4
:
SetOperation
(
c9980712
.
thop
)
c
:
RegisterEffect
(
e4
)
end
c9980712
.
card_code_list
=
{
9980706
}
function
c9980712
.
effcon
(
e
,
c
)
return
c
:
IsSetCard
(
0x3bc1
)
end
function
c9980712
.
eqfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x3bc1
)
end
function
c9980712
.
eqtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
c9980712
.
eqfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c9980712
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
c9980712
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c9980712
.
eqop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
c
:
IsRelateToEffect
(
e
)
and
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
Duel
.
Equip
(
tp
,
c
,
tc
)
end
end
function
c9980712
.
psfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCanTurnSet
()
end
function
c9980712
.
pstg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
c9980712
.
psfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c9980712
.
psfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c9980712
.
spfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_POSITION
,
g
,
1
,
0
,
0
)
end
function
c9980712
.
psop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsLocation
(
LOCATION_MZONE
)
and
tc
:
IsFaceup
()
then
Duel
.
ChangePosition
(
tc
,
POS_FACEDOWN_DEFENSE
)
end
end
function
c9980712
.
cfilter
(
c
,
tp
)
return
(
aux
.
IsCodeListed
(
c
,
9980706
)
or
c
:
IsSetCard
(
0x3bc1
))
and
c
:
IsAbleToRemoveAsCost
()
and
Duel
.
IsExistingTarget
(
c9980712
.
thfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
c
)
end
function
c9980712
.
thfilter
(
c
)
return
aux
.
IsCodeListed
(
c
,
9980706
)
and
c
:
IsAbleToHand
()
end
function
c9980712
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToRemoveAsCost
()
and
Duel
.
IsExistingMatchingCard
(
c9980712
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
c
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c9980712
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
c
,
tp
)
g
:
AddCard
(
c
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
c9980712
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
c9980712
.
thfilter
(
chkc
)
end
if
chk
==
0
then
return
true
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c9980712
.
thfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
0
)
end
function
c9980712
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment