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
f2ae6fd7
Commit
f2ae6fd7
authored
Jan 27, 2022
by
Tachibana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eme
parent
6aa5c75f
Pipeline
#9031
passed with stages
in 39 minutes and 4 seconds
Changes
18
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
1041 additions
and
3723 deletions
+1041
-3723
expansions/222DIY.cdb
expansions/222DIY.cdb
+0
-0
expansions/script/c60002000.lua
expansions/script/c60002000.lua
+37
-0
expansions/script/c60002009.lua
expansions/script/c60002009.lua
+272
-202
expansions/script/c60002010.lua
expansions/script/c60002010.lua
+35
-263
expansions/script/c60002011.lua
expansions/script/c60002011.lua
+22
-229
expansions/script/c60002012.lua
expansions/script/c60002012.lua
+25
-229
expansions/script/c60002013.lua
expansions/script/c60002013.lua
+26
-234
expansions/script/c60002014.lua
expansions/script/c60002014.lua
+22
-235
expansions/script/c60002015.lua
expansions/script/c60002015.lua
+58
-291
expansions/script/c60002016.lua
expansions/script/c60002016.lua
+52
-274
expansions/script/c60002017.lua
expansions/script/c60002017.lua
+62
-264
expansions/script/c60002018.lua
expansions/script/c60002018.lua
+49
-253
expansions/script/c60002019.lua
expansions/script/c60002019.lua
+31
-234
expansions/script/c60002020.lua
expansions/script/c60002020.lua
+38
-245
expansions/script/c60002021.lua
expansions/script/c60002021.lua
+79
-144
expansions/script/c60002022.lua
expansions/script/c60002022.lua
+65
-210
expansions/script/c60002023.lua
expansions/script/c60002023.lua
+85
-189
expansions/script/c60002024.lua
expansions/script/c60002024.lua
+83
-227
No files found.
expansions/222DIY.cdb
View file @
f2ae6fd7
No preview for this file type
expansions/script/c60002000.lua
0 → 100644
View file @
f2ae6fd7
--时光酒桌 white
local
m
=
60002000
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCode
(
10002024
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
1
,
0
)
c
:
RegisterEffect
(
e2
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCode
(
20002024
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
1
,
0
)
c
:
RegisterEffect
(
e2
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCode
(
60002011
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
1
,
0
)
c
:
RegisterEffect
(
e2
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCode
(
60002024
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
1
,
0
)
c
:
RegisterEffect
(
e2
)
end
expansions/script/c60002009.lua
View file @
f2ae6fd7
--时光酒桌 嘉月
--时光酒桌 嘉月
function
c60002009
.
initial_effect
(
c
)
local
m
=
60002009
--set
local
cm
=
_G
[
"c"
..
m
]
timeTable
=
timeTable
or
{}
--set self
function
timeTable
.
set
(
c
,
code
,
extra
)
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002009
,
0
))
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
60002009
)
e1
:
SetCountLimit
(
1
,
code
)
e1
:
SetCondition
(
c60002009
.
stcon1
)
e1
:
SetCondition
(
timeTable
.
setIgCon
)
e1
:
SetCost
(
c60002009
.
s
tcost
)
e1
:
SetCost
(
timeTable
.
se
tcost
)
e1
:
SetTarget
(
c60002009
.
s
ttg
)
e1
:
SetTarget
(
timeTable
.
se
ttg
)
e1
:
SetOperation
(
c60002009
.
stop
)
e1
:
SetOperation
(
timeTable
.
setop
(
extra
)
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
timeTable
.
setQuCon
)
e2
:
SetCondition
(
c60002009
.
stcon2
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
return
e1
,
e2
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002009
)
e2
:
SetCondition
(
c60002009
.
spcon
)
e2
:
SetTarget
(
c60002009
.
sptg
)
e2
:
SetOperation
(
c60002009
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002009
.
global_check
then
c60002009
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002009
.
checkcon
)
ge1
:
SetOperation
(
c60002009
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002009
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
end
function
c60002009
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
timeTable
.
setIgCon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002009
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002009
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
end
function
c60002009
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
timeTable
.
setQuCon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
end
function
c60002009
.
s
tcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
timeTable
.
se
tcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
end
function
c60002009
.
s
ttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
timeTable
.
se
ttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
end
function
c60002009
.
stfil
(
c
)
function
timeTable
.
getCounter
(
c
)
return
c
:
IsCode
(
60002024
)
and
not
c
:
IsForbidden
()
--get counter type
end
function
c60002009
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002009
.
gtcost
)
e1
:
SetTarget
(
c60002009
.
gttg
)
e1
:
SetOperation
(
c60002009
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
c
:
RegisterEffect
(
e1
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
if
Duel
.
IsExistingMatchingCard
(
c60002009
.
stfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002009
,
0
))
then
c
:
RegisterEffect
(
e1
)
Duel
.
BreakEffect
()
--get effect by counter
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
c60002009
.
stfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
local
e2
=
Effect
.
CreateEffect
(
c
)
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_FZONE
,
POS_FACEUP
,
true
)
e2
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
end
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
e2
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
end
e2
:
SetCode
(
EVENT_CHAINING
)
end
e2
:
SetRange
(
LOCATION_SZONE
)
function
c60002009
.
gctfil
(
c
)
e2
:
SetCost
(
timeTable
.
counterEffectCost
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
e2
:
SetTarget
(
timeTable
.
counterEffectTarget
)
e2
:
SetOperation
(
timeTable
.
counterEffectOperation
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
--cant use counter effect to turn end
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e3
)
end
end
function
c60002009
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
timeTable
.
setop
(
extra
)
if
chk
==
0
then
return
true
end
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
timeTable
.
getCounter
(
c
)
if
extra
then
extra
(
e
,
tp
,
1
)
end
end
end
end
end
function
c60002009
.
rmfil
(
c
)
function
timeTable
.
toGraveFilter
(
c
)
return
c
:
Is
SetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
return
c
:
Is
AbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
end
function
c60002009
.
gckfil1
(
c
,
tp
)
function
timeTable
.
groupCheckMzone
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
end
function
c60002009
.
gckfil2
(
c
,
tp
)
function
timeTable
.
groupCheckSzone
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
end
function
c60002009
.
gck
(
g
,
tp
)
function
timeTable
.
selectToGrave
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
and
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002009
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002009
.
gckfil2
,
nil
,
tp
)
<=
1
return
g
:
FilterCount
(
timeTable
.
groupCheckMzone
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
timeTable
.
groupCheckSzone
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002009
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002009
.
gckfil2
,
nil
,
tp
)
<=
1
return
g
:
FilterCount
(
timeTable
.
groupCheckMzone
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
timeTable
.
groupCheckSzone
,
nil
,
tp
)
<=
0
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
timeTable
.
groupCheckMzone
,
nil
,
tp
)
<=
0
and
g
:
FilterCount
(
timeTable
.
groupCheckSzone
,
nil
,
tp
)
<=
1
else
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
return
g
:
FilterCount
(
timeTable
.
groupCheckMzone
,
nil
,
tp
)
<=
0
and
g
:
FilterCount
(
timeTable
.
groupCheckSzone
,
nil
,
tp
)
<=
0
end
end
end
end
function
c60002009
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
timeTable
.
counterEffectCost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
local
x
=
3
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
x
=
2
x
=
2
else
x
=
3
end
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002009
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
local
g
=
Duel
.
GetMatchingGroup
(
timeTable
.
toGraveFilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002009
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002009
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
if
chk
==
0
then
return
g
:
CheckSubGroup
(
timeTable
.
selectToGrave
,
x
,
99
,
tp
)
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
local
sg
=
g
:
SelectSubGroup
(
tp
,
timeTable
.
selectToGrave
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_COST
)
end
function
timeTable
.
removeFilter
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
function
timeTable
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
function
timeTable
.
counterEffectTarget
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
timeTable
.
removeFilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002009
.
chainlm
)
Duel
.
SetChainLimit
(
timeTable
.
chainlm
)
end
end
end
end
function
c60002009
.
chainlm
(
e
,
rp
,
tp
)
function
timeTable
.
immval
(
e
,
te
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
end
function
c60002009
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
timeTable
.
immue
(
c
)
local
x
=
0
local
e1
=
Effect
.
CreateEffect
(
c
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
x
=
2
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
else
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
x
=
3
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
+
EFFECT_FLAG_CLIENT_HINT
+
EFFECT_FLAG_CANNOT_DISABLE
)
end
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
timeTable
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
end
function
timeTable
.
counterEffectOperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002009
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
--spsum
if
not
g
:
CheckSubGroup
(
c60002009
.
gck
,
x
,
3
,
tp
)
then
return
end
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
>
0
then
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002009
.
gck
,
false
,
x
,
3
,
tp
)
--immue
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
timeTable
.
immue
(
c
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
--remove
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
timeTable
.
removeFilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
--
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002009
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002009
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
end
end
function
c60002009
.
immval
(
e
,
te
)
--spsummon
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
function
timeTable
.
spsummon
(
c
,
code
,
extra3
,
extra5
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_REMOVE
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCountLimit
(
1
,
code
)
e1
:
SetCondition
(
timeTable
.
spsummonCon
)
e1
:
SetTarget
(
timeTable
.
spsummonTarget
)
e1
:
SetOperation
(
timeTable
.
spsummonOperation
(
extra3
,
extra5
))
c
:
RegisterEffect
(
e1
)
return
e1
end
end
function
c60002009
.
spc
on
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
timeTable
.
spsummonC
on
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
end
function
c60002009
.
tgfil
(
c
)
function
timeTable
.
spsummonTargetFilter
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
end
function
c60002009
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
timeTable
.
spsummonTarget
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002009
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
timeTable
.
spsummonTargetFilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
end
function
c60002009
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
timeTable
.
spsummonOperation
(
extra3
,
extra5
)
local
c
=
e
:
GetHandler
()
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c60002009
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
c
=
e
:
GetHandler
()
if
g
:
GetCount
()
>
0
then
local
g
=
Duel
.
GetMatchingGroup
(
timeTable
.
spsummonTargetFilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
if
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
==
0
then
return
end
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
>
0
then
Duel
.
BreakEffect
()
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
m
)
>=
0
then
if
Duel
.
GetFlagEffect
(
tp
,
60002009
)
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
timeTable
.
exsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetValue
(
timeTable
.
effectlimit
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
end
if
Duel
.
GetFlagEffect
(
tp
,
m
)
>=
3
and
extra3
then
extra3
(
c
)
end
if
Duel
.
GetFlagEffect
(
tp
,
m
)
>=
5
and
extra5
then
extra5
(
c
)
end
end
end
end
end
function
timeTable
.
exsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
timeTable
.
effectlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
timeTable
.
globle
(
c
)
if
not
timeTable
.
global_check
then
timeTable
.
global_check
=
true
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCondition
(
timeTable
.
checkcon
)
e1
:
SetOperation
(
timeTable
.
checkop
)
Duel
.
RegisterEffect
(
e1
,
0
)
return
e1
end
end
function
timeTable
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
timeTable
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
--spell2
function
timeTable
.
spell
(
c
,
extra3
,
extra5
)
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002009
,
2
))
e1
:
SetDescription
(
aux
.
Stringid
(
60002021
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetCondition
(
timeTable
.
actionCon
)
e1
:
SetTarget
(
c60002009
.
xsplimit
)
e1
:
SetCost
(
timeTable
.
setcost
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetOperation
(
timeTable
.
SpellOperation
(
extra3
,
extra5
))
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
end
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
function
timeTable
.
actionConFilter
(
c
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
return
c
:
IsFacedown
()
or
not
c
:
IsSetCard
(
0x629
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
end
e4
:
SetRange
(
LOCATION_MZONE
)
function
timeTable
.
actionCon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
e4
:
SetTargetRange
(
1
,
0
)
return
not
Duel
.
IsExistingMatchingCard
(
timeTable
.
actionConFilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
e4
:
SetValue
(
c60002009
.
xactlimit
)
end
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
function
timeTable
.
SpellOperation
(
extra3
,
extra5
)
c
:
RegisterEffect
(
e4
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetFlagEffect
(
tp
,
m
)
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
timeTable
.
exsplimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetValue
(
timeTable
.
effectlimit
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
if
Duel
.
GetFlagEffect
(
tp
,
m
)
>=
3
and
extra3
then
extra3
(
e
,
tp
)
end
if
Duel
.
GetFlagEffect
(
tp
,
m
)
>=
5
and
extra5
then
extra5
(
e
,
tp
)
end
end
end
if
not
cm
then
return
end
---------------------------------------
function
cm
.
initial_effect
(
c
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
timeTable
.
globle
(
c
)
end
--e1
function
cm
.
setf
(
c
)
return
c
:
IsCode
(
60002024
)
and
not
c
:
IsForbidden
()
end
function
cm
.
extraMove
(
e
,
tp
)
local
c
=
e
:
GetHandler
()
if
not
Duel
.
IsExistingMatchingCard
(
cm
.
setf
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
then
return
end
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
BreakEffect
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
setf
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_FZONE
,
POS_FACEUP
,
true
)
end
end
--
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
if
Duel
.
GetFlagEffect
(
tp
,
60002009
)
>=
3
then
end
--e2
function
cm
.
extra3
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002009
,
3
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_UNRELEASABLE_SUM
)
e1
:
SetCode
(
EFFECT_UNRELEASABLE_SUM
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
...
@@ -228,44 +313,29 @@ function c60002009.spop(e,tp,eg,ep,ev,re,r,rp)
...
@@ -228,44 +313,29 @@ function c60002009.spop(e,tp,eg,ep,ev,re,r,rp)
local
e2
=
e1
:
Clone
()
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_UNRELEASABLE_NONSUM
)
e2
:
SetCode
(
EFFECT_UNRELEASABLE_NONSUM
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002009
)
>=
5
then
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002009
,
4
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_SOLVING
)
e2
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCondition
(
c60002009
.
negcon
)
e2
:
SetOperation
(
c60002009
.
negop
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
end
end
end
end
function
c60002009
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
end
function
c60002009
.
xactlimit
(
e
,
re
,
tp
)
function
cm
.
extra5
(
c
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_CHAIN_SOLVING
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCondition
(
cm
.
negcon
)
e1
:
SetOperation
(
cm
.
negop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
end
end
function
c
60002009
.
negcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
negcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
==
1
-
tp
and
re
:
IsActiveType
(
TYPE_SPELL
)
return
rp
==
1
-
tp
and
re
:
IsActiveType
(
TYPE_SPELL
)
end
end
function
c60002009
.
negop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
cm
.
negop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002009
,
0
))
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
4
))
then
Duel
.
Hint
(
HINT_CARD
,
0
,
60002009
)
Duel
.
Hint
(
HINT_CARD
,
0
,
m
)
local
rc
=
re
:
GetHandler
()
local
rc
=
re
:
GetHandler
()
if
Duel
.
NegateEffect
(
ev
)
and
rc
:
IsRelateToEffect
(
re
)
then
if
Duel
.
NegateEffect
(
ev
)
and
rc
:
IsRelateToEffect
(
re
)
then
Duel
.
Destroy
(
rc
,
REASON_EFFECT
)
Duel
.
Destroy
(
rc
,
REASON_EFFECT
)
end
e
:
Reset
()
end
end
e
:
Reset
()
end
end
\ No newline at end of file
end
expansions/script/c60002010.lua
View file @
f2ae6fd7
--时光酒桌 花月
--时光酒桌 花月
function
c60002010
.
initial_effect
(
c
)
local
m
=
60002010
--set
local
cm
=
_G
[
"c"
..
m
]
local
e1
=
Effect
.
CreateEffect
(
c
)
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
e1
:
SetDescription
(
aux
.
Stringid
(
60002010
,
0
))
function
cm
.
initial_effect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
e1
:
SetRange
(
LOCATION_HAND
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
e1
:
SetCountLimit
(
1
,
60002010
)
timeTable
.
globle
(
c
)
e1
:
SetCondition
(
c60002010
.
stcon1
)
end
e1
:
SetCost
(
c60002010
.
stcost
)
--e1
e1
:
SetTarget
(
c60002010
.
sttg
)
function
cm
.
stfil
(
c
)
e1
:
SetOperation
(
c60002010
.
stop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002010
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002010
)
e2
:
SetCondition
(
c60002010
.
spcon
)
e2
:
SetTarget
(
c60002010
.
sptg
)
e2
:
SetOperation
(
c60002010
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002010
.
global_check
then
c60002010
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002010
.
checkcon
)
ge1
:
SetOperation
(
c60002010
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002010
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002010
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002010
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002010
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002010
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002010
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002010
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c60002010
.
stfil
(
c
)
return
not
c
:
IsCode
(
60002010
)
and
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsForbidden
()
return
not
c
:
IsCode
(
60002010
)
and
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsForbidden
()
end
end
function
c
60002010
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
r
p
)
function
c
m
.
extraMove
(
e
,
t
p
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002010
.
gtcost
)
e1
:
SetTarget
(
c60002010
.
gttg
)
e1
:
SetOperation
(
c60002010
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
local
ssg
=
Group
.
FromCards
(
c
)
local
ssg
=
Group
.
FromCards
(
c
)
if
Duel
.
IsExistingMatchingCard
(
c60002010
.
stfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002010
,
0
))
then
if
Duel
.
IsExistingMatchingCard
(
cm
.
stfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
c60002010
.
stfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
stfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
local
e1
=
Effect
.
CreateEffect
(
tc
)
timeTable
.
getCounter
(
tc
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
ssg
:
AddCard
(
tc
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
tc
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
tc
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002010
.
gtcost
)
e1
:
SetTarget
(
c60002010
.
gttg
)
e1
:
SetOperation
(
c60002010
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
tc
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
ssg
:
AddCard
(
tc
)
end
Duel
.
RaiseEvent
(
ssg
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002010
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002010
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002010
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
function
c60002010
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002010
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002010
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002010
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002010
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002010
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002010
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002010
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002010
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002010
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002010
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002010
.
chainlm
)
end
end
Duel
.
RaiseEvent
(
ssg
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002010
.
chainlm
(
e
,
rp
,
tp
)
--e2
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
function
cm
.
extra3
(
c
)
end
function
c60002010
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
x
=
2
else
x
=
3
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002010
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002010
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002010
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002010
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002010
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002010
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002010
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002010
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002010
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002010
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002010
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002010
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002010
)
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002010
,
2
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002010
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002010
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002010
)
>=
3
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002010
,
3
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
...
@@ -251,34 +37,20 @@ function c60002010.spop(e,tp,eg,ep,ev,re,r,rp)
...
@@ -251,34 +37,20 @@ function c60002010.spop(e,tp,eg,ep,ev,re,r,rp)
e1
:
SetValue
(
1000
)
e1
:
SetValue
(
1000
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002010
)
>=
5
then
local
e2
=
Effect
.
CreateEffect
(
c
)
--disable search
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
60002010
,
4
))
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EFFECT_CANNOT_TO_HAND
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e3
:
SetTargetRange
(
0
,
1
)
e3
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsLocation
,
LOCATION_DECK
))
e3
:
SetCondition
(
c60002010
.
disscon
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e3
)
end
end
end
end
function
c60002010
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
end
function
c60002010
.
xactlimit
(
e
,
re
,
tp
)
function
cm
.
extra5
(
c
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_TO_HAND
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
0
,
1
)
e1
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsLocation
,
LOCATION_DECK
))
e1
:
SetCondition
(
cm
.
disscon
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
end
end
function
c
60002010
.
disscon
(
e
)
function
c
m
.
disscon
(
e
)
return
Duel
.
GetCurrentPhase
()
~=
PHASE_MAIN2
return
Duel
.
GetCurrentPhase
()
~=
PHASE_MAIN2
end
end
\ No newline at end of file
expansions/script/c60002011.lua
View file @
f2ae6fd7
--时光酒桌 辰月
--时光酒桌 辰月
function
c60002011
.
initial_effect
(
c
)
local
m
=
60002011
--set
local
cm
=
_G
[
"c"
..
m
]
local
e1
=
Effect
.
CreateEffect
(
c
)
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
e1
:
SetDescription
(
aux
.
Stringid
(
60002011
,
0
))
function
cm
.
initial_effect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
e1
:
SetRange
(
LOCATION_HAND
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
e1
:
SetCountLimit
(
1
,
60002011
)
timeTable
.
globle
(
c
)
e1
:
SetCondition
(
c60002011
.
stcon1
)
end
e1
:
SetCost
(
c60002011
.
stcost
)
--e1
e1
:
SetTarget
(
c60002011
.
sttg
)
function
cm
.
extraMove
(
e
,
tp
)
e1
:
SetOperation
(
c60002011
.
stop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002011
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002011
)
e2
:
SetCondition
(
c60002011
.
spcon
)
e2
:
SetTarget
(
c60002011
.
sptg
)
e2
:
SetOperation
(
c60002011
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002011
.
global_check
then
c60002011
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002011
.
checkcon
)
ge1
:
SetOperation
(
c60002011
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002011
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002011
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002011
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002011
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002011
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002011
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002011
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c60002011
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002011
.
gtcost
)
e1
:
SetTarget
(
c60002011
.
gttg
)
e1
:
SetOperation
(
c60002011
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002011
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Recover
(
tp
,
1000
,
REASON_EFFECT
)
end
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002011
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002011
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002011
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
function
c60002011
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002011
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002011
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002011
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002011
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002011
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002011
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002011
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002011
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002011
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002011
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002011
.
chainlm
)
end
end
function
c60002011
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
function
c60002011
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
x
=
2
else
x
=
3
end
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002011
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
if
not
g
:
CheckSubGroup
(
c60002011
.
gck
,
x
,
3
,
tp
)
then
return
end
Duel
.
BreakEffect
()
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002011
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
Recover
(
tp
,
1000
,
REASON_EFFECT
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002011
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002011
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002011
.
immval
(
e
,
te
)
--e2
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
function
cm
.
extra3
(
c
)
end
function
c60002011
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002011
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002011
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002011
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002011
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002011
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002011
)
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002011
,
2
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002011
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002011
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002011
)
>=
3
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002011
,
3
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
e1
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
...
@@ -221,30 +29,15 @@ function c60002011.spop(e,tp,eg,ep,ev,re,r,rp)
...
@@ -221,30 +29,15 @@ function c60002011.spop(e,tp,eg,ep,ev,re,r,rp)
e1
:
SetValue
(
1000
)
e1
:
SetValue
(
1000
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
--
function
cm
.
extra5
(
c
)
if
Duel
.
GetFlagEffect
(
tp
,
60002011
)
>=
5
then
--
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002011
,
4
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetCode
(
60002011
)
e2
:
SetCode
(
m
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
end
end
end
\ No newline at end of file
end
end
function
c60002011
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
c60002011
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
expansions/script/c60002012.lua
View file @
f2ae6fd7
--时光酒桌 乾月
--时光酒桌 乾月
function
c60002012
.
initial_effect
(
c
)
local
m
=
60002012
--set
local
cm
=
_G
[
"c"
..
m
]
local
e1
=
Effect
.
CreateEffect
(
c
)
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
e1
:
SetDescription
(
aux
.
Stringid
(
60002012
,
0
))
function
cm
.
initial_effect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
e1
:
SetRange
(
LOCATION_HAND
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
e1
:
SetCountLimit
(
1
,
60002012
)
timeTable
.
globle
(
c
)
e1
:
SetCondition
(
c60002012
.
stcon1
)
end
e1
:
SetCost
(
c60002012
.
stcost
)
--e1
e1
:
SetTarget
(
c60002012
.
sttg
)
function
cm
.
rmfil
(
c
)
e1
:
SetOperation
(
c60002012
.
stop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002012
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002012
)
e2
:
SetCondition
(
c60002012
.
spcon
)
e2
:
SetTarget
(
c60002012
.
sptg
)
e2
:
SetOperation
(
c60002012
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002012
.
global_check
then
c60002012
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002012
.
checkcon
)
ge1
:
SetOperation
(
c60002012
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002012
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002012
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002012
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002012
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002012
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002012
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002012
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c60002012
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
end
function
c
60002012
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
r
p
)
function
c
m
.
extraMove
(
e
,
t
p
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
if
Duel
.
IsExistingMatchingCard
(
cm
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
Duel
.
BreakEffect
()
local
e1
=
Effect
.
CreateEffect
(
c
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002012
.
gtcost
)
e1
:
SetTarget
(
c60002012
.
gttg
)
e1
:
SetOperation
(
c60002012
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
if
Duel
.
IsExistingMatchingCard
(
c60002012
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002012
,
0
))
then
Duel
.
BreakEffect
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
c60002012
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002012
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002012
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002012
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002012
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002012
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002012
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002012
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002012
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002012
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002012
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002012
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002012
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002012
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002012
.
chainlm
)
end
end
end
function
c60002012
.
chainlm
(
e
,
rp
,
tp
)
--e2
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
function
cm
.
extra3
(
c
)
end
function
c60002012
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
x
=
2
else
x
=
3
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002012
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002012
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002012
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002012
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002012
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002012
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002012
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002012
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002012
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002012
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002012
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002012
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002012
)
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002012
,
2
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002012
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002012
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002012
)
>=
3
then
--indes
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002012
,
3
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_COUNT
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_COUNT
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
...
@@ -223,33 +33,19 @@ function c60002012.spop(e,tp,eg,ep,ev,re,r,rp)
...
@@ -223,33 +33,19 @@ function c60002012.spop(e,tp,eg,ep,ev,re,r,rp)
e1
:
SetValue
(
1
)
e1
:
SetValue
(
1
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
--
function
cm
.
extra5
(
c
)
if
Duel
.
GetFlagEffect
(
tp
,
60002012
)
>=
5
then
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002012
,
4
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCode
(
EFFECT_CHANGE_DAMAGE
)
e2
:
SetCode
(
EFFECT_CHANGE_DAMAGE
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetValue
(
c
60002012
.
val
)
e2
:
SetValue
(
c
m
.
val
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
end
end
end
end
function
c60002012
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
end
function
c60002012
.
xactlimit
(
e
,
re
,
tp
)
function
cm
.
val
(
e
,
re
,
dam
,
r
,
rp
,
rc
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002012
.
val
(
e
,
re
,
dam
,
r
,
rp
,
rc
)
return
math.floor
(
dam
/
12
)
return
math.floor
(
dam
/
12
)
end
end
\ No newline at end of file
expansions/script/c60002013.lua
View file @
f2ae6fd7
--时光酒桌 幕月
--时光酒桌 幕月
function
c60002013
.
initial_effect
(
c
)
local
m
=
60002013
--set
local
cm
=
_G
[
"c"
..
m
]
local
e1
=
Effect
.
CreateEffect
(
c
)
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
e1
:
SetDescription
(
aux
.
Stringid
(
60002013
,
0
))
function
cm
.
initial_effect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
e1
:
SetRange
(
LOCATION_HAND
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
e1
:
SetCountLimit
(
1
,
60002013
)
timeTable
.
globle
(
c
)
e1
:
SetCondition
(
c60002013
.
stcon1
)
end
e1
:
SetCost
(
c60002013
.
stcost
)
--e1
e1
:
SetTarget
(
c60002013
.
sttg
)
function
cm
.
stfil
(
c
)
e1
:
SetOperation
(
c60002013
.
stop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002013
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002013
)
e2
:
SetCondition
(
c60002013
.
spcon
)
e2
:
SetTarget
(
c60002013
.
sptg
)
e2
:
SetOperation
(
c60002013
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002013
.
global_check
then
c60002013
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002013
.
checkcon
)
ge1
:
SetOperation
(
c60002013
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002013
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002013
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002013
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002013
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002013
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002013
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002013
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c60002013
.
cpfil
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCanChangePosition
()
return
c
:
IsFaceup
()
and
c
:
IsCanChangePosition
()
end
end
function
c
60002013
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
r
p
)
function
c
m
.
extraMove
(
e
,
t
p
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
if
Duel
.
IsExistingMatchingCard
(
cm
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
Duel
.
BreakEffect
()
local
e1
=
Effect
.
CreateEffect
(
c
)
local
pc
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
):
GetFirst
()
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
Duel
.
ChangePosition
(
pc
,
POS_FACEDOWN_DEFENSE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002013
.
gtcost
)
e1
:
SetTarget
(
c60002013
.
gttg
)
e1
:
SetOperation
(
c60002013
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
if
Duel
.
IsExistingMatchingCard
(
c60002013
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002013
,
0
))
then
Duel
.
BreakEffect
()
local
pc
=
Duel
.
SelectMatchingCard
(
tp
,
c60002013
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
ChangePosition
(
pc
,
POS_FACEDOWN_DEFENSE
)
end
end
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002013
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002013
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002013
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
function
c60002013
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002013
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002013
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002013
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002013
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002013
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002013
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002013
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002013
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002013
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002013
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002013
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002013
.
chainlm
)
end
end
function
c60002013
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
end
function
c60002013
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
--e2
local
x
=
0
function
cm
.
extra3
(
c
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002013
)
then
x
=
2
else
x
=
3
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002013
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002013
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002013
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002013
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002013
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002013
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002013
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002013
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002013
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002013
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002013
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002013
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002013
)
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002013
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002013
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002013
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002013
)
>=
3
then
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002013
,
3
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_DIRECT_ATTACK
)
e2
:
SetCode
(
EFFECT_DIRECT_ATTACK
)
e2
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
...
@@ -223,50 +31,34 @@ function c60002013.spop(e,tp,eg,ep,ev,re,r,rp)
...
@@ -223,50 +31,34 @@ function c60002013.spop(e,tp,eg,ep,ev,re,r,rp)
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x629
))
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x629
))
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--damage reduce
local
e3
=
Effect
.
CreateEffect
(
c
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EFFECT_CHANGE_BATTLE_DAMAGE
)
e3
:
SetCode
(
EFFECT_CHANGE_BATTLE_DAMAGE
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e3
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x629
))
e3
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x629
))
e3
:
SetCondition
(
c
60002013
.
rdcon
)
e3
:
SetCondition
(
c
m
.
rdcon
)
e3
:
SetValue
(
aux
.
ChangeBattleDamage
(
1
,
HALF_DAMAGE
))
e3
:
SetValue
(
aux
.
ChangeBattleDamage
(
1
,
HALF_DAMAGE
))
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
end
end
--
function
cm
.
extra5
(
c
)
if
Duel
.
GetFlagEffect
(
tp
,
60002013
)
>=
5
then
--
local
e4
=
Effect
.
CreateEffect
(
c
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
60002013
,
4
))
e4
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e4
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e4
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e4
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
LOCATION_SZONE
,
0
)
e4
:
SetTargetRange
(
LOCATION_SZONE
,
0
)
e4
:
SetValue
(
c
60002013
.
efilter
)
e4
:
SetValue
(
c
m
.
efilter
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
c
:
RegisterEffect
(
e4
)
end
end
end
end
function
c60002013
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
end
function
c60002013
.
xactlimit
(
e
,
re
,
tp
)
function
cm
.
rdcon
(
e
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002013
.
rdcon
(
e
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
tp
=
e
:
GetHandlerPlayer
()
local
tp
=
e
:
GetHandlerPlayer
()
return
Duel
.
GetAttackTarget
()
==
nil
return
Duel
.
GetAttackTarget
()
==
nil
and
c
:
GetEffectCount
(
EFFECT_DIRECT_ATTACK
)
<
2
and
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_MZONE
)
>
0
and
c
:
GetEffectCount
(
EFFECT_DIRECT_ATTACK
)
<
2
and
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_MZONE
)
>
0
end
end
function
c
60002013
.
efilter
(
e
,
re
)
function
c
m
.
efilter
(
e
,
re
)
return
re
:
GetOwnerPlayer
()
~=
e
:
GetHandlerPlayer
()
return
re
:
GetOwnerPlayer
()
~=
e
:
GetHandlerPlayer
()
end
end
\ No newline at end of file
expansions/script/c60002014.lua
View file @
f2ae6fd7
--时光酒桌 荷月
--时光酒桌 荷月
function
c60002014
.
initial_effect
(
c
)
local
m
=
60002014
--set
local
cm
=
_G
[
"c"
..
m
]
local
e1
=
Effect
.
CreateEffect
(
c
)
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
e1
:
SetDescription
(
aux
.
Stringid
(
60002014
,
0
))
function
cm
.
initial_effect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
e1
:
SetRange
(
LOCATION_HAND
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
e1
:
SetCountLimit
(
1
,
60002014
)
timeTable
.
globle
(
c
)
e1
:
SetCondition
(
c60002014
.
stcon1
)
end
e1
:
SetCost
(
c60002014
.
stcost
)
--e1
e1
:
SetTarget
(
c60002014
.
sttg
)
function
cm
.
cpfil
(
c
)
e1
:
SetOperation
(
c60002014
.
stop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002014
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002014
)
e2
:
SetCondition
(
c60002014
.
spcon
)
e2
:
SetTarget
(
c60002014
.
sptg
)
e2
:
SetOperation
(
c60002014
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002014
.
global_check
then
c60002014
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002014
.
checkcon
)
ge1
:
SetOperation
(
c60002014
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002014
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002014
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002014
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002014
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002014
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002014
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002014
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c60002014
.
cpfil
(
c
)
return
c
:
IsAttackPos
()
and
c
:
IsCanChangePosition
()
return
c
:
IsAttackPos
()
and
c
:
IsCanChangePosition
()
end
end
function
c
60002014
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
r
p
)
function
c
m
.
extraMove
(
e
,
t
p
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
if
Duel
.
IsExistingMatchingCard
(
cm
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
Duel
.
BreakEffect
()
local
e1
=
Effect
.
CreateEffect
(
c
)
local
pc
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
):
GetFirst
()
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
Duel
.
ChangePosition
(
pc
,
POS_FACEUP_DEFENSE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002014
.
gtcost
)
e1
:
SetTarget
(
c60002014
.
gttg
)
e1
:
SetOperation
(
c60002014
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
if
Duel
.
IsExistingMatchingCard
(
c60002014
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002014
,
0
))
then
Duel
.
BreakEffect
()
local
pc
=
Duel
.
SelectMatchingCard
(
tp
,
c60002014
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
ChangePosition
(
pc
,
POS_FACEUP_DEFENSE
)
end
end
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002014
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002014
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002014
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
function
c60002014
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002014
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002014
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002014
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002014
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002014
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002014
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002014
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002014
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002014
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002014
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002014
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002014
.
chainlm
)
end
end
end
function
c60002014
.
chainlm
(
e
,
rp
,
tp
)
--e2
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
function
cm
.
extra3
(
c
)
end
function
c60002014
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002014
)
then
x
=
2
else
x
=
3
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002014
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002014
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002014
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002014
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002014
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002014
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002014
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002014
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002014
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002014
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002014
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002014
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002014
)
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002014
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002014
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002014
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002014
)
>=
3
then
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002014
,
3
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_PIERCE
)
e2
:
SetCode
(
EFFECT_PIERCE
)
e2
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
...
@@ -223,12 +31,10 @@ function c60002014.spop(e,tp,eg,ep,ev,re,r,rp)
...
@@ -223,12 +31,10 @@ function c60002014.spop(e,tp,eg,ep,ev,re,r,rp)
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x629
))
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x629
))
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
end
end
--
function
cm
.
extra5
(
c
)
if
Duel
.
GetFlagEffect
(
tp
,
60002014
)
>=
5
then
--
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002014
,
4
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_DRAW_COUNT
)
e2
:
SetCode
(
EFFECT_DRAW_COUNT
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
...
@@ -237,23 +43,4 @@ function c60002014.spop(e,tp,eg,ep,ev,re,r,rp)
...
@@ -237,23 +43,4 @@ function c60002014.spop(e,tp,eg,ep,ev,re,r,rp)
e2
:
SetValue
(
2
)
e2
:
SetValue
(
2
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
end
end
end
\ No newline at end of file
end
end
function
c60002014
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
c60002014
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002014
.
rdcon
(
e
)
local
c
=
e
:
GetHandler
()
local
tp
=
e
:
GetHandlerPlayer
()
return
Duel
.
GetAttackTarget
()
==
nil
and
c
:
GetEffectCount
(
EFFECT_DIRECT_ATTACK
)
<
2
and
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_MZONE
)
>
0
end
expansions/script/c60002015.lua
View file @
f2ae6fd7
--时光酒桌 相月
--时光酒桌 相月
function
c60002015
.
initial_effect
(
c
)
local
m
=
60002015
--set
local
cm
=
_G
[
"c"
..
m
]
local
e1
=
Effect
.
CreateEffect
(
c
)
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
e1
:
SetDescription
(
aux
.
Stringid
(
60002015
,
0
))
function
cm
.
initial_effect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
e1
:
SetRange
(
LOCATION_HAND
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
e1
:
SetCountLimit
(
1
,
60002015
)
timeTable
.
globle
(
c
)
e1
:
SetCondition
(
c60002015
.
stcon1
)
end
e1
:
SetCost
(
c60002015
.
stcost
)
--e1
e1
:
SetTarget
(
c60002015
.
sttg
)
function
cm
.
thfil
(
c
)
e1
:
SetOperation
(
c60002015
.
stop
)
return
c
:
IsSetCard
(
0x629
)
and
not
c
:
IsCode
(
m
)
and
c
:
IsAbleToHand
()
c
:
RegisterEffect
(
e1
)
end
local
e2
=
e1
:
Clone
()
function
cm
.
extraMove
(
e
,
tp
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002015
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002015
)
e2
:
SetCondition
(
c60002015
.
spcon
)
e2
:
SetTarget
(
c60002015
.
sptg
)
e2
:
SetOperation
(
c60002015
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002015
.
global_check
then
c60002015
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002015
.
checkcon
)
ge1
:
SetOperation
(
c60002015
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002015
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002015
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002015
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002015
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002015
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002015
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002015
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c60002015
.
thfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
not
c
:
IsCode
(
60002015
)
and
c
:
IsAbleToHand
()
end
function
c60002015
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
if
Duel
.
IsExistingMatchingCard
(
cm
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
Duel
.
BreakEffect
()
local
e1
=
Effect
.
CreateEffect
(
c
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
Duel
.
SendtoHand
(
tc
,
tp
,
REASON_EFFECT
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002015
.
gtcost
)
e1
:
SetTarget
(
c60002015
.
gttg
)
e1
:
SetOperation
(
c60002015
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
if
Duel
.
IsExistingMatchingCard
(
c60002015
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002015
,
0
))
then
Duel
.
BreakEffect
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
c60002015
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SendtoHand
(
tc
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
end
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002015
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002015
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002015
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002015
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002015
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002015
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002015
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002015
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002015
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002015
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002015
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002015
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002015
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002015
.
chainlm
)
end
end
function
c60002015
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
function
c60002015
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
x
=
2
else
x
=
3
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002015
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002015
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002015
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002015
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002015
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
end
function
c60002015
.
immval
(
e
,
te
)
--e2
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
function
cm
.
extra3
(
c
)
end
function
c60002015
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002015
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002015
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002015
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002015
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002015
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002015
)
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002015
,
2
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002015
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002015
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002015
)
>=
3
then
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002015
,
3
))
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCost
(
c
60002015
.
gxstcost
)
e1
:
SetCost
(
c
m
.
gxstcost
)
e1
:
SetTarget
(
c
60002015
.
gxsttg
)
e1
:
SetTarget
(
c
m
.
gxsttg
)
e1
:
SetOperation
(
c
60002015
.
gxstop
)
e1
:
SetOperation
(
c
m
.
gxstop
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
--
function
cm
.
extra5
(
c
)
if
Duel
.
GetFlagEffect
(
tp
,
60002015
)
>=
5
then
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002015
,
4
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetCode
(
60002015
)
e2
:
SetCode
(
m
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
end
end
end
end
function
c60002015
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
end
function
c60002015
.
xactlimit
(
e
,
re
,
tp
)
function
cm
.
gxstctfil
(
c
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002015
.
gxstctfil
(
c
)
return
c
:
IsDiscardable
()
and
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
return
c
:
IsDiscardable
()
and
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
end
end
function
c
60002015
.
gxstcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c
m
.
gxstcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c
60002015
.
gxstctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c
m
.
gxstctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
60002015
.
gxstctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
m
.
gxstctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
+
REASON_DISCARD
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
+
REASON_DISCARD
)
end
end
function
c
60002015
.
gxstfil
(
c
)
function
c
m
.
gxstfil
(
c
)
if
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002015
)
then
if
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
m
)
then
return
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
and
c
:
IsSSetable
()
return
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
and
c
:
IsSSetable
()
else
else
return
(
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
and
c
:
IsSSetable
())
or
(
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
))
return
(
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
and
c
:
IsSSetable
())
or
(
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
))
end
end
end
end
function
c
60002015
.
gxstfil1
(
c
)
function
c
m
.
gxstfil1
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
end
function
c
60002015
.
gxstgck
(
g
,
tp
)
function
c
m
.
gxstgck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002015
)
then
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
m
)
then
return
g
:
FilterCount
(
c60002015
.
gxstfil1
,
nil
)
<=
1
return
g
:
FilterCount
(
cm
.
gxstfil1
,
nil
)
<=
1
else
else
return
g
:
FilterCount
(
c60002015
.
gxstfil1
,
nil
)
<=
0
return
g
:
FilterCount
(
cm
.
gxstfil1
,
nil
)
<=
0
end
end
end
end
function
c
60002015
.
gxsttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c
m
.
gxsttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroup
(
c
60002015
.
gxstfil
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
c
m
.
gxstfil
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c
60002015
.
gxstgck
,
1
,
3
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c
m
.
gxstgck
,
1
,
99
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
end
function
c
60002015
.
gxstop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxstop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
if
ft
<=
0
or
not
g
:
CheckSubGroup
(
c
60002015
.
gxstgck
,
1
,
3
,
tp
)
then
return
end
if
ft
<=
0
or
not
g
:
CheckSubGroup
(
c
m
.
gxstgck
,
1
,
99
,
tp
)
then
return
end
if
ft
>
3
then
ft
=
3
end
if
ft
>
3
then
ft
=
3
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c
60002015
.
gxstgck
,
false
,
1
,
ft
,
tp
)
local
sg
=
g
:
SelectSubGroup
(
tp
,
c
m
.
gxstgck
,
false
,
1
,
ft
,
tp
)
local
tc
=
sg
:
GetFirst
()
local
tc
=
sg
:
GetFirst
()
while
tc
do
while
tc
do
if
tc
:
IsType
(
TYPE_TRAP
)
then
if
tc
:
IsType
(
TYPE_TRAP
)
then
Duel
.
SSet
(
tp
,
tc
)
Duel
.
SSet
(
tp
,
tc
)
else
else
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
local
e1
=
Effect
.
CreateEffect
(
tc
)
timeTable
.
getCounter
(
tc
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
end
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
tc
=
sg
:
GetNext
()
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
end
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
end
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
\ No newline at end of file
tc
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
tc
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002015
.
gtcost
)
e1
:
SetTarget
(
c60002015
.
gttg
)
e1
:
SetOperation
(
c60002015
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
tc
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
end
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_LEAVE_FIELD_REDIRECT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_REDIRECT
)
e1
:
SetValue
(
LOCATION_DECK
)
tc
:
RegisterEffect
(
e1
)
tc
=
sg
:
GetNext
()
end
end
expansions/script/c60002016.lua
View file @
f2ae6fd7
--时光酒桌 桂月
--时光酒桌 桂月
function
c60002016
.
initial_effect
(
c
)
local
m
=
60002016
--set
local
cm
=
_G
[
"c"
..
m
]
local
e1
=
Effect
.
CreateEffect
(
c
)
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
e1
:
SetDescription
(
aux
.
Stringid
(
60002016
,
0
))
function
cm
.
initial_effect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
e1
:
SetRange
(
LOCATION_HAND
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
e1
:
SetCountLimit
(
1
,
60002016
)
timeTable
.
globle
(
c
)
e1
:
SetCondition
(
c60002016
.
stcon1
)
end
e1
:
SetCost
(
c60002016
.
stcost
)
--e1
e1
:
SetTarget
(
c60002016
.
sttg
)
function
cm
.
tgtfil
(
c
)
e1
:
SetOperation
(
c60002016
.
stop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002016
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002016
)
e2
:
SetCondition
(
c60002016
.
spcon
)
e2
:
SetTarget
(
c60002016
.
sptg
)
e2
:
SetOperation
(
c60002016
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002016
.
global_check
then
c60002016
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002016
.
checkcon
)
ge1
:
SetOperation
(
c60002016
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002016
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002016
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002016
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002016
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002016
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002016
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002016
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c60002016
.
tgtfil
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsSetCard
(
0x629
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsSetCard
(
0x629
)
end
end
function
c
60002016
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
r
p
)
function
c
m
.
extraMove
(
e
,
t
p
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
if
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
>=
3
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
Duel
.
BreakEffect
()
local
e1
=
Effect
.
CreateEffect
(
c
)
Duel
.
ConfirmDecktop
(
tp
,
3
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
local
fg
=
Duel
.
GetDecktopGroup
(
tp
,
3
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
local
tg
=
fg
:
Filter
(
cm
.
tgtfil
,
nil
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
Duel
.
SendtoHand
(
tg
,
tp
,
REASON_EFFECT
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
Duel
.
ConfirmCards
(
1
-
tp
,
tg
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002016
.
gtcost
)
e1
:
SetTarget
(
c60002016
.
gttg
)
e1
:
SetOperation
(
c60002016
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
if
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
>=
3
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002016
,
0
))
then
Duel
.
BreakEffect
()
local
fg
=
Duel
.
GetDecktopGroup
(
tp
,
3
)
Duel
.
ConfirmCards
(
1
-
tp
,
fg
)
local
tg
=
fg
:
Filter
(
c60002016
.
tgtfil
,
nil
)
Duel
.
SendtoHand
(
tg
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tg
)
end
end
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002016
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002016
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002016
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
function
c60002016
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002016
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002016
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002016
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002016
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002016
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002016
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002016
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002016
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002016
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002016
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002016
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002016
.
chainlm
)
end
end
end
function
c60002016
.
chainlm
(
e
,
rp
,
tp
)
--e2
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
function
cm
.
extra3
(
c
)
end
function
c60002016
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002016
)
then
x
=
2
else
x
=
3
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002016
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002016
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002016
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002016
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002016
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002016
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002016
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002016
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002016
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002016
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002016
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002016
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002016
)
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002016
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002016
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002016
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002016
)
>=
3
then
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002016
,
3
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e1
:
SetCategory
(
CATEGORY_CONTROL
)
e1
:
SetCategory
(
CATEGORY_CONTROL
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCountLimit
(
1
)
e1
:
SetTarget
(
c
60002016
.
cnttg
)
e1
:
SetTarget
(
c
m
.
cnttg
)
e1
:
SetOperation
(
c
60002016
.
cntop
)
e1
:
SetOperation
(
c
m
.
cntop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
--
function
cm
.
extra5
(
c
)
if
Duel
.
GetFlagEffect
(
tp
,
60002016
)
>=
5
then
--
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002016
,
4
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCountLimit
(
1
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCost
(
c60002016
.
gcost
)
e2
:
SetCost
(
cm
.
gcost
)
e2
:
SetTarget
(
c60002016
.
gtg
)
e2
:
SetOperation
(
cm
.
gop
)
e2
:
SetOperation
(
c60002016
.
gop
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
end
end
end
end
function
c60002016
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
c60002016
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
end
function
c
60002016
.
cnttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c
m
.
cnttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_CONTROL
,
nil
,
1
,
1
-
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_CONTROL
,
nil
,
1
,
1
-
tp
,
LOCATION_MZONE
)
end
end
function
c
60002016
.
cntop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
cntop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
if
g
:
GetCount
()
<=
0
then
return
end
if
g
:
GetCount
()
<=
0
then
return
end
local
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
local
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
GetControl
(
tc
,
tp
,
PHASE_END
,
2
)
Duel
.
GetControl
(
tc
,
tp
,
PHASE_END
,
2
)
local
e1
=
Effect
.
CreateEffect
(
c
)
timeTable
.
immue
(
tc
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002016
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
,
true
)
end
end
function
c
60002016
.
ggctfil
(
c
)
function
c
m
.
ggctfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsDiscardable
()
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsDiscardable
()
end
end
function
c
60002016
.
gcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c
m
.
gcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c
60002016
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c
m
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
60002016
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
m
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
+
REASON_DISCARD
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
+
REASON_DISCARD
)
end
end
function
c60002016
.
gtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
cm
.
gop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
chk
==
0
then
return
true
end
end
function
c60002016
.
gop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
--
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCondition
(
c
60002016
.
gxgcon
)
e1
:
SetCondition
(
c
m
.
gxgcon
)
e1
:
SetOperation
(
c
60002016
.
gxgop
)
e1
:
SetOperation
(
c
m
.
gxgop
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RegisterEffect
(
e1
,
tp
)
--
--
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetCondition
(
c
60002016
.
gxspcon
)
e1
:
SetCondition
(
c
m
.
gxspcon
)
e1
:
SetOperation
(
c
60002016
.
gxspop
)
e1
:
SetOperation
(
c
m
.
gxspop
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
function
c
60002016
.
gxgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
~=
tp
and
re
:
GetHandler
():
IsType
(
TYPE_MONSTER
)
return
rp
~=
tp
and
re
:
GetHandler
():
IsType
(
TYPE_MONSTER
)
end
end
function
c
60002016
.
gxgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
then
if
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COS
T
+
REASON_DISCARD
,
nil
)
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_EFFEC
T
+
REASON_DISCARD
,
nil
)
Duel
.
RegisterFlagEffect
(
tp
,
60002016
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
end
end
end
function
c
60002016
.
gxspcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxspcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetFlagEffect
(
tp
,
60002016
)
>=
5
return
Duel
.
GetFlagEffect
(
tp
,
m
)
>=
5
end
end
function
c
60002016
.
gxspfil
(
c
,
e
,
tp
)
function
c
m
.
gxspfil
(
c
,
e
,
tp
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
end
function
c
60002016
.
gxspop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxspop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
Duel
.
IsExistingMatchingCard
(
c
60002016
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
,
e
,
tp
)
and
Duel
.
GetLocationCount
(
LOCATION_MZONE
,
0
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002016
,
5
))
then
if
Duel
.
IsExistingMatchingCard
(
c
m
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
,
e
,
tp
)
and
Duel
.
GetLocationCount
(
LOCATION_MZONE
,
0
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
5
))
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
60002016
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
1
,
nil
,
e
,
tp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
m
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
end
end
\ No newline at end of file
expansions/script/c60002017.lua
View file @
f2ae6fd7
--时光酒桌 菊月
--时光酒桌 菊月
function
c60002017
.
initial_effect
(
c
)
local
m
=
60002017
--set
local
cm
=
_G
[
"c"
..
m
]
local
e1
=
Effect
.
CreateEffect
(
c
)
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
e1
:
SetDescription
(
aux
.
Stringid
(
60002017
,
0
))
function
cm
.
initial_effect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
e1
:
SetRange
(
LOCATION_HAND
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
e1
:
SetCountLimit
(
1
,
60002017
)
timeTable
.
globle
(
c
)
e1
:
SetCondition
(
c60002017
.
stcon1
)
end
e1
:
SetCost
(
c60002017
.
stcost
)
--e1
e1
:
SetTarget
(
c60002017
.
sttg
)
function
cm
.
thfil
(
c
)
e1
:
SetOperation
(
c60002017
.
stop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002017
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002017
)
e2
:
SetCondition
(
c60002017
.
spcon
)
e2
:
SetTarget
(
c60002017
.
sptg
)
e2
:
SetOperation
(
c60002017
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002017
.
global_check
then
c60002017
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002017
.
checkcon
)
ge1
:
SetOperation
(
c60002017
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002017
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002017
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002017
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002017
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002017
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002017
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002017
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c60002017
.
thfil
(
c
)
return
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsSetCard
(
0x629
)
return
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsSetCard
(
0x629
)
end
end
function
c
60002017
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
r
p
)
function
c
m
.
extraMove
(
e
,
t
p
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
if
Duel
.
IsExistingMatchingCard
(
cm
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
Duel
.
BreakEffect
()
local
e1
=
Effect
.
CreateEffect
(
c
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
Duel
.
SendtoHand
(
tc
,
tp
,
REASON_EFFECT
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002017
.
gtcost
)
e1
:
SetTarget
(
c60002017
.
gttg
)
e1
:
SetOperation
(
c60002017
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
if
Duel
.
IsExistingMatchingCard
(
c60002017
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002017
,
0
))
then
Duel
.
BreakEffect
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
c60002017
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SendtoHand
(
tc
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
end
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002017
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002017
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002017
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
function
c60002017
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002017
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002017
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002017
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002017
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002017
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002017
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002017
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002017
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002017
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002017
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002017
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002017
.
chainlm
)
end
end
end
function
c60002017
.
chainlm
(
e
,
rp
,
tp
)
--e2
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
function
cm
.
extra3
(
c
)
end
function
c60002017
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002017
)
then
x
=
2
else
x
=
3
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002017
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002017
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002017
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002017
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002017
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002017
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002017
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002017
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002017
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002017
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002017
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002017
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002017
)
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002017
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002017
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002017
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002017
)
>=
3
then
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002017
,
3
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCountLimit
(
1
)
e1
:
SetTarget
(
c
60002017
.
addtg
)
e1
:
SetTarget
(
c
m
.
addtg
)
e1
:
SetOperation
(
c
60002017
.
addop
)
e1
:
SetOperation
(
c
m
.
addop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
--
function
cm
.
extra5
(
c
)
if
Duel
.
GetFlagEffect
(
tp
,
60002017
)
>=
5
then
--
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002017
,
4
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCountLimit
(
1
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCost
(
c
60002017
.
gcost
)
e2
:
SetCost
(
c
m
.
gcost
)
e2
:
SetTarget
(
c
60002017
.
gtg
)
e2
:
SetTarget
(
c
m
.
gtg
)
e2
:
SetOperation
(
c
60002017
.
gop
)
e2
:
SetOperation
(
c
m
.
gop
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
end
end
end
end
function
c60002017
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
c60002017
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
end
function
c
60002017
.
addtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c
m
.
addtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
nil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
nil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
end
end
function
c
60002017
.
addop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
addop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
if
g
:
GetCount
()
<=
0
then
return
end
if
g
:
GetCount
()
<=
0
then
return
end
local
tc
=
g
:
GetFirst
()
local
tc
=
g
:
GetFirst
()
while
tc
do
while
tc
do
--
--
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SET_ATTACK_FINAL
)
e1
:
SetCode
(
EFFECT_SET_ATTACK_FINAL
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
tc
:
GetAttack
()
/
2
)
e1
:
SetValue
(
tc
:
GetAttack
()
/
2
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_SET_DEFENSE_FINAL
)
e2
:
SetCode
(
EFFECT_SET_DEFENSE_FINAL
)
e2
:
SetValue
(
tc
:
GetDefense
()
/
2
)
e2
:
SetValue
(
tc
:
GetDefense
()
/
2
)
tc
=
g
:
GetNext
()
tc
=
g
:
GetNext
()
end
end
end
end
function
c
60002017
.
ggctfil
(
c
)
function
c
m
.
ggctfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsDiscardable
()
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsDiscardable
()
end
end
function
c
60002017
.
gcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c
m
.
gcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c
60002017
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c
m
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
60002017
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
m
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
+
REASON_DISCARD
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
+
REASON_DISCARD
)
end
end
function
c
60002017
.
gtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c
m
.
gtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
chk
==
0
then
return
true
end
end
end
function
c
60002017
.
gop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
--
--
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCondition
(
c
60002017
.
gxgcon
)
e1
:
SetCondition
(
c
m
.
gxgcon
)
e1
:
SetOperation
(
c
60002017
.
gxgop
)
e1
:
SetOperation
(
c
m
.
gxgop
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RegisterEffect
(
e1
,
tp
)
--
--
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetCondition
(
c
60002017
.
gxspcon
)
e1
:
SetCondition
(
c
m
.
gxspcon
)
e1
:
SetOperation
(
c
60002017
.
gxspop
)
e1
:
SetOperation
(
c
m
.
gxspop
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
function
c
60002017
.
gxgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
~=
tp
and
re
:
GetHandler
():
IsType
(
TYPE_SPELL
)
return
rp
~=
tp
and
re
:
GetHandler
():
IsType
(
TYPE_SPELL
)
end
end
function
c
60002017
.
gxgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
then
if
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
,
nil
)
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
,
nil
)
Duel
.
RegisterFlagEffect
(
tp
,
60002017
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
end
end
end
function
c
60002017
.
gxspcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxspcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetFlagEffect
(
tp
,
60002017
)
>=
5
return
Duel
.
GetFlagEffect
(
tp
,
m
)
>=
5
end
end
function
c
60002017
.
gxspfil
(
c
)
function
c
m
.
gxspfil
(
c
)
return
c
:
IsSSetable
()
and
c
:
IsType
(
TYPE_SPELL
)
return
c
:
IsSSetable
()
and
c
:
IsType
(
TYPE_SPELL
)
end
end
function
c
60002017
.
gxspop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxspop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
Duel
.
IsExistingMatchingCard
(
c
60002017
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
LOCATION_SZONE
,
0
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002017
,
5
))
then
if
Duel
.
IsExistingMatchingCard
(
c
m
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
LOCATION_SZONE
,
0
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
5
))
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
60002017
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
m
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
1
,
nil
)
Duel
.
SSet
(
tp
,
g
)
Duel
.
SSet
(
tp
,
g
)
end
end
end
end
...
...
expansions/script/c60002018.lua
View file @
f2ae6fd7
--时光酒桌 坤月
--时光酒桌 坤月
function
c60002018
.
initial_effect
(
c
)
local
m
=
60002018
--set
local
cm
=
_G
[
"c"
..
m
]
local
e1
=
Effect
.
CreateEffect
(
c
)
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
e1
:
SetDescription
(
aux
.
Stringid
(
60002018
,
0
))
function
cm
.
initial_effect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
e1
:
SetRange
(
LOCATION_HAND
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
e1
:
SetCountLimit
(
1
,
60002018
)
timeTable
.
globle
(
c
)
e1
:
SetCondition
(
c60002018
.
stcon1
)
end
e1
:
SetCost
(
c60002018
.
stcost
)
--e1
e1
:
SetTarget
(
c60002018
.
sttg
)
function
cm
.
thfil
(
c
)
e1
:
SetOperation
(
c60002018
.
stop
)
return
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsSetCard
(
0x629
)
c
:
RegisterEffect
(
e1
)
end
local
e2
=
e1
:
Clone
()
function
cm
.
extraMove
(
e
,
tp
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002018
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002018
)
e2
:
SetCondition
(
c60002018
.
spcon
)
e2
:
SetTarget
(
c60002018
.
sptg
)
e2
:
SetOperation
(
c60002018
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002018
.
global_check
then
c60002018
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002018
.
checkcon
)
ge1
:
SetOperation
(
c60002018
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002018
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
end
function
c60002018
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002018
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002018
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002018
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002018
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002018
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c60002018
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
Duel
.
BreakEffect
()
local
e1
=
Effect
.
CreateEffect
(
c
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
):
GetFirst
()
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
Duel
.
NegateRelatedChain
(
tc
,
RESET_TURN_SET
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002018
.
gtcost
)
e1
:
SetTarget
(
c60002018
.
gttg
)
e1
:
SetOperation
(
c60002018
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002018
,
0
))
then
Duel
.
BreakEffect
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
NegateRelatedChain
(
tc
,
RESET_TURN_SET
)
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
...
@@ -103,172 +30,44 @@ function c60002018.stop(e,tp,eg,ep,ev,re,r,rp)
...
@@ -103,172 +30,44 @@ function c60002018.stop(e,tp,eg,ep,ev,re,r,rp)
tc
:
RegisterEffect
(
e2
)
tc
:
RegisterEffect
(
e2
)
end
end
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
end
function
c60002018
.
gctfil
(
c
)
--e2
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
function
cm
.
extra3
(
c
)
end
function
c60002018
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002018
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
function
c60002018
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002018
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002018
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002018
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002018
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002018
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002018
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002018
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002018
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002018
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002018
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002018
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002018
.
chainlm
)
end
end
function
c60002018
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
function
c60002018
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002018
)
then
x
=
2
else
x
=
3
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002018
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002018
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002018
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002018
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002018
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002018
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002018
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002018
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002018
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002018
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002018
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002018
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002018
)
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002018
,
2
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002018
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002018
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002018
)
>=
3
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002018
,
3
))
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCountLimit
(
1
)
e1
:
SetTarget
(
c
60002018
.
addtg
)
e1
:
SetTarget
(
c
m
.
addtg
)
e1
:
SetOperation
(
c
60002018
.
addop
)
e1
:
SetOperation
(
c
m
.
addop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
--
function
cm
.
extra5
(
c
)
if
Duel
.
GetFlagEffect
(
tp
,
60002018
)
>=
5
then
--
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002018
,
4
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCountLimit
(
1
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCost
(
c60002018
.
gcost
)
e2
:
SetCost
(
cm
.
gcost
)
e2
:
SetTarget
(
c60002018
.
gtg
)
e2
:
SetOperation
(
cm
.
gop
)
e2
:
SetOperation
(
c60002018
.
gop
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
end
end
end
end
end
function
c60002018
.
xsplimit
(
e
,
c
)
function
cm
.
tgfilter
(
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
c60002018
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002018
.
tgfilter
(
c
)
return
not
c
:
IsPublic
()
or
c
:
IsType
(
TYPE_MONSTER
)
return
not
c
:
IsPublic
()
or
c
:
IsType
(
TYPE_MONSTER
)
end
end
function
c
60002018
.
addtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c
m
.
addtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
mc
=
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_MZONE
)
local
mc
=
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_MZONE
)
local
g
=
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_HAND
)
local
g
=
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_HAND
)
if
chk
==
0
then
return
mc
>
0
or
g
and
g
:
IsExists
(
c
60002018
.
tgfilter
,
1
,
nil
)
end
if
chk
==
0
then
return
mc
>
0
or
g
and
g
:
IsExists
(
c
m
.
tgfilter
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
1
-
tp
,
LOCATION_MZONE
+
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
1
-
tp
,
LOCATION_MZONE
+
LOCATION_HAND
)
end
end
function
c
60002018
.
addop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
addop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsType
,
1
-
tp
,
LOCATION_MZONE
+
LOCATION_HAND
,
0
,
nil
,
TYPE_MONSTER
)
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsType
,
1
-
tp
,
LOCATION_MZONE
+
LOCATION_HAND
,
0
,
nil
,
TYPE_MONSTER
)
if
g
:
GetCount
()
>
0
then
if
g
:
GetCount
()
>
0
then
...
@@ -278,57 +77,54 @@ function c60002018.addop(e,tp,eg,ep,ev,re,r,rp)
...
@@ -278,57 +77,54 @@ function c60002018.addop(e,tp,eg,ep,ev,re,r,rp)
Duel
.
SendtoGrave
(
sg
,
REASON_RULE
)
Duel
.
SendtoGrave
(
sg
,
REASON_RULE
)
end
end
end
end
function
c
60002018
.
ggctfil
(
c
)
function
c
m
.
ggctfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsDiscardable
()
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsDiscardable
()
end
end
function
c
60002018
.
gcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c
m
.
gcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c
60002018
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c
m
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
60002018
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
m
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
+
REASON_DISCARD
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
+
REASON_DISCARD
)
end
end
function
c60002018
.
gtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
cm
.
gop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
chk
==
0
then
return
true
end
end
function
c60002018
.
gop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
--
--
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCondition
(
c
60002018
.
gxgcon
)
e1
:
SetCondition
(
c
m
.
gxgcon
)
e1
:
SetOperation
(
c
60002018
.
gxgop
)
e1
:
SetOperation
(
c
m
.
gxgop
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RegisterEffect
(
e1
,
tp
)
--
--
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetCondition
(
c
60002018
.
gxspcon
)
e1
:
SetCondition
(
c
m
.
gxspcon
)
e1
:
SetOperation
(
c
60002018
.
gxspop
)
e1
:
SetOperation
(
c
m
.
gxspop
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
function
c
60002018
.
gxgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
~=
tp
and
re
:
GetHandler
():
IsType
(
TYPE_TRAP
)
return
rp
~=
tp
and
re
:
GetHandler
():
IsType
(
TYPE_TRAP
)
end
end
function
c
60002018
.
gxgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
then
if
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
,
nil
)
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
,
nil
)
Duel
.
RegisterFlagEffect
(
tp
,
60002018
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
end
end
end
function
c
60002018
.
gxspcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxspcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetFlagEffect
(
tp
,
60002018
)
>=
5
return
Duel
.
GetFlagEffect
(
tp
,
m
)
>=
5
end
end
function
c
60002018
.
gxspfil
(
c
)
function
c
m
.
gxspfil
(
c
)
return
c
:
IsSSetable
()
and
c
:
IsType
(
TYPE_TRAP
)
return
c
:
IsSSetable
()
and
c
:
IsType
(
TYPE_TRAP
)
end
end
function
c
60002018
.
gxspop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxspop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
Duel
.
IsExistingMatchingCard
(
c
60002018
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
LOCATION_SZONE
,
0
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002018
,
5
))
then
if
Duel
.
IsExistingMatchingCard
(
c
m
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
LOCATION_SZONE
,
0
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
5
))
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
60002018
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
m
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
1
,
nil
)
Duel
.
SSet
(
tp
,
g
)
Duel
.
SSet
(
tp
,
g
)
end
end
end
end
expansions/script/c60002019.lua
View file @
f2ae6fd7
--时光酒桌 复月
--时光酒桌 复月
function
c60002019
.
initial_effect
(
c
)
local
m
=
60002019
--set
local
cm
=
_G
[
"c"
..
m
]
local
e1
=
Effect
.
CreateEffect
(
c
)
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
e1
:
SetDescription
(
aux
.
Stringid
(
60002019
,
0
))
function
cm
.
initial_effect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
e1
:
SetRange
(
LOCATION_HAND
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
e1
:
SetCountLimit
(
1
,
60002019
)
timeTable
.
globle
(
c
)
e1
:
SetCondition
(
c60002019
.
stcon1
)
end
e1
:
SetCost
(
c60002019
.
stcost
)
--e1
e1
:
SetTarget
(
c60002019
.
sttg
)
function
cm
.
gtxthfil
(
c
)
e1
:
SetOperation
(
c60002019
.
stop
)
return
c
:
IsAbleToHand
()
and
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002019
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002019
)
e2
:
SetCondition
(
c60002019
.
spcon
)
e2
:
SetTarget
(
c60002019
.
sptg
)
e2
:
SetOperation
(
c60002019
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002019
.
global_check
then
c60002019
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002019
.
checkcon
)
ge1
:
SetOperation
(
c60002019
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002019
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002019
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002019
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002019
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002019
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002019
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
end
function
c60002019
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
cm
.
gtxthop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
local
c
=
e
:
GetHandler
()
if
Duel
.
IsExistingMatchingCard
(
cm
.
gtxthfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
gtxthfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
g
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
end
function
c
60002019
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
r
p
)
function
c
m
.
extraMove
(
e
,
t
p
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
Duel
.
BreakEffect
()
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002019
.
gtcost
)
e1
:
SetTarget
(
c60002019
.
gttg
)
e1
:
SetOperation
(
c60002019
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCountLimit
(
1
)
e1
:
SetOperation
(
c
60002019
.
gtxthop
)
e1
:
SetOperation
(
c
m
.
gtxthop
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002019
.
gtxthfil
(
c
)
return
c
:
IsAbleToHand
()
and
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
end
function
c60002019
.
gtxthop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
IsExistingMatchingCard
(
c60002019
.
gtxthfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002019
,
0
))
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002019
.
gtxthfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
g
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
c60002019
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002019
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002019
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
function
c60002019
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
end
function
c60002019
.
gckfil2
(
c
,
tp
)
--e2
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
function
cm
.
extra3
(
c
)
end
function
c60002019
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002019
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002019
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002019
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002019
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002019
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002019
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002019
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002019
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002019
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002019
.
chainlm
)
end
end
function
c60002019
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
function
c60002019
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002019
)
then
x
=
2
else
x
=
3
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002019
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002019
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002019
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002019
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002019
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002019
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002019
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002019
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002019
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002019
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002019
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002019
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002019
)
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002019
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002019
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002019
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002019
)
>=
3
then
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002019
,
3
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_TRAP_ACT_IN_HAND
)
e1
:
SetCode
(
EFFECT_TRAP_ACT_IN_HAND
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
...
@@ -236,35 +44,24 @@ function c60002019.spop(e,tp,eg,ep,ev,re,r,rp)
...
@@ -236,35 +44,24 @@ function c60002019.spop(e,tp,eg,ep,ev,re,r,rp)
e1
:
SetCountLimit
(
1
)
e1
:
SetCountLimit
(
1
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
--
function
cm
.
extra5
(
c
)
if
Duel
.
GetFlagEffect
(
tp
,
60002019
)
>=
5
then
--
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002019
,
4
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCountLimit
(
1
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTarget
(
c
60002019
.
gtg
)
e2
:
SetTarget
(
c
m
.
gtg
)
e2
:
SetOperation
(
c
60002019
.
gop
)
e2
:
SetOperation
(
c
m
.
gop
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
end
end
end
end
function
c60002019
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
c60002019
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
end
function
c
60002019
.
gtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c
m
.
gtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAttackPos
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAttackPos
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
end
end
function
c
60002019
.
gop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
--
--
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
...
...
expansions/script/c60002020.lua
View file @
f2ae6fd7
--时光酒桌 冰月
--时光酒桌 冰月
function
c60002020
.
initial_effect
(
c
)
local
m
=
60002020
--set
local
cm
=
_G
[
"c"
..
m
]
local
e1
=
Effect
.
CreateEffect
(
c
)
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
e1
:
SetDescription
(
aux
.
Stringid
(
60002020
,
0
))
function
cm
.
initial_effect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
e1
:
SetRange
(
LOCATION_HAND
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
e1
:
SetCountLimit
(
1
,
60002020
)
timeTable
.
globle
(
c
)
e1
:
SetCondition
(
c60002020
.
stcon1
)
end
e1
:
SetCost
(
c60002020
.
stcost
)
--e1
e1
:
SetTarget
(
c60002020
.
sttg
)
function
cm
.
extraMove
(
e
,
tp
)
e1
:
SetOperation
(
c60002020
.
stop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002020
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002020
)
e2
:
SetCondition
(
c60002020
.
spcon
)
e2
:
SetTarget
(
c60002020
.
sptg
)
e2
:
SetOperation
(
c60002020
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002020
.
global_check
then
c60002020
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002020
.
checkcon
)
ge1
:
SetOperation
(
c60002020
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002020
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002020
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002020
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002020
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002020
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002020
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002020
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c60002020
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
Duel
.
BreakEffect
()
local
dg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
+
REASON_DISCARD
)
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetTargetRange
(
0
,
1
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
e1
:
SetValue
(
aux
.
TRUE
)
c
:
RegisterEffect
(
e1
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
--get
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002020
.
gtcost
)
e1
:
SetTarget
(
c60002020
.
gttg
)
e1
:
SetOperation
(
c60002020
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002020
,
0
))
then
Duel
.
BreakEffect
()
local
dg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
+
REASON_DISCARD
)
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
(
aux
.
TRUE
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002020
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002020
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002020
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
end
function
c60002020
.
gckfil1
(
c
,
tp
)
--e2
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
function
cm
.
extra3
(
c
)
end
function
c60002020
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002020
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002020
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002020
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002020
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002020
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002020
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002020
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002020
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002020
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002020
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002020
.
chainlm
)
end
end
function
c60002020
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
function
c60002020
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002020
)
then
x
=
2
else
x
=
3
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002020
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002020
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002020
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002020
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002020
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002020
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002020
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002020
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002020
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002020
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002020
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002020
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002020
)
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002020
,
2
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002020
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002020
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002020
)
>=
3
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002020
,
3
))
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCost
(
c
60002020
.
xkwcost
)
e1
:
SetCost
(
c
m
.
xkwcost
)
e1
:
SetTarget
(
c
60002020
.
xkwtg
)
e1
:
SetTarget
(
c
m
.
xkwtg
)
e1
:
SetOperation
(
c
60002020
.
xkwop
)
e1
:
SetOperation
(
c
m
.
xkwop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
--
function
cm
.
extra5
(
c
)
if
Duel
.
GetFlagEffect
(
tp
,
60002020
)
>=
5
then
--
local
e3
=
Effect
.
CreateEffect
(
c
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
60002020
,
4
))
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_CHAINING
)
e3
:
SetCode
(
EVENT_CHAINING
)
e3
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e3
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetOperation
(
c
60002020
.
chainop
)
e3
:
SetOperation
(
c
m
.
chainop
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
end
end
end
end
end
function
c60002020
.
xsplimit
(
e
,
c
)
function
cm
.
xkwcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
c60002020
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002020
.
xkwcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
+
REASON_DISCARD
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
+
REASON_DISCARD
)
end
end
function
c
60002020
.
xkwtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c
m
.
xkwtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
chk
==
0
then
return
true
end
end
end
function
c
60002020
.
xkwop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
xkwop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
...
@@ -272,15 +69,11 @@ function c60002020.xkwop(e,tp,eg,ep,ev,re,r,rp)
...
@@ -272,15 +69,11 @@ function c60002020.xkwop(e,tp,eg,ep,ev,re,r,rp)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
function
c
60002020
.
chainop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
chainop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
re
:
GetHandler
()
==
e
:
GetHandler
()
then
if
re
:
GetHandler
()
==
e
:
GetHandler
()
then
Duel
.
SetChainLimit
(
c
60002020
.
chainlm
)
Duel
.
SetChainLimit
(
c
m
.
chainlm
)
end
end
end
end
function
c
60002020
.
chainlm
(
e
,
rp
,
tp
)
function
c
m
.
chainlm
(
e
,
rp
,
tp
)
return
tp
==
rp
return
tp
==
rp
end
end
\ No newline at end of file
expansions/script/c60002021.lua
View file @
f2ae6fd7
--时光酒桌 意识
--时光酒桌 意识
function
c60002021
.
initial_effect
(
c
)
local
m
=
60002021
--Activate
local
cm
=
_G
[
"c"
..
m
]
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002021
,
1
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e1
:
SetCategory
(
CATEGORY_REMOVE
)
e1
:
SetCategory
(
CATEGORY_REMOVE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
60002021
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCountLimit
(
1
,
m
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
c60002021
.
accon
)
e1
:
SetCondition
(
timeTable
.
actionCon
)
e1
:
SetTarget
(
c60002021
.
actg
)
e1
:
SetTarget
(
cm
.
actg
)
e1
:
SetOperation
(
c60002021
.
acop
)
e1
:
SetOperation
(
cm
.
acop
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--xx
timeTable
.
spell
(
c
,
cm
.
extra3
,
cm
.
extra5
)
local
e2
=
Effect
.
CreateEffect
(
c
)
timeTable
.
globle
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002021
,
2
))
end
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
--e1
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
function
cm
.
chlimit
(
e
,
ep
,
tp
)
e2
:
SetRange
(
LOCATION_HAND
)
return
tp
==
ep
e2
:
SetCountLimit
(
1
)
e2
:
SetCost
(
c60002021
.
xxcost
)
e2
:
SetTarget
(
c60002021
.
xxtg
)
e2
:
SetOperation
(
c60002021
.
xxop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002021
.
global_check
then
c60002021
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002021
.
checkcon
)
ge1
:
SetOperation
(
c60002021
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002021
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002021
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002021
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002021
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
not
c
:
IsSetCard
(
0x629
)
end
function
c60002021
.
accon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsExistingMatchingCard
(
c60002021
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
end
function
c60002021
.
actg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
cm
.
actg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_HAND
,
0
)
==
Duel
.
GetMatchingGroupCount
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_HAND
,
0
,
nil
)
and
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_HAND
,
0
)
>
0
end
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_HAND
,
0
)
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_HAND
,
0
)
local
x
=
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_HAND
,
0
)
if
chk
==
0
then
return
g
:
GetCount
()
==
Duel
.
GetMatchingGroupCount
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_HAND
,
0
,
nil
)
and
g
:
GetCount
()
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
g
,
x
,
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
g
,
g
:
GetCount
()
,
tp
,
LOCATION_HAND
)
if
Duel
.
GetMatchingGroup
(
Card
.
IsFacedown
,
tp
,
LOCATION_ONFIELD
,
0
,
nil
):
GetCount
()
>=
3
then
if
Duel
.
GetMatchingGroup
(
Card
.
IsFacedown
,
tp
,
LOCATION_ONFIELD
,
0
,
nil
):
GetCount
()
>=
3
then
Duel
.
SetChainLimit
(
c60002021
.
chlimit
)
Duel
.
SetChainLimit
(
cm
.
chlimit
)
end
end
end
end
function
c60002021
.
chlimit
(
e
,
ep
,
tp
)
function
cm
.
ckfil
(
c
)
return
tp
==
ep
end
function
c60002021
.
ckfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
or
(
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
))
return
c
:
IsSetCard
(
0x629
)
or
(
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
))
end
end
function
c60002021
.
ssfil
(
c
)
function
cm
.
aclimit
(
e
,
re
,
tp
)
return
re
:
GetHandler
():
IsCode
(
e
:
GetLabel
())
end
function
cm
.
ssfil
(
c
)
return
c
:
IsSSetable
()
and
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
return
c
:
IsSSetable
()
and
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
end
end
function
c
60002021
.
acop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
acop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_HAND
,
0
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_HAND
,
0
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
local
x
=
g
:
FilterCount
(
c
60002021
.
ckfil
,
nil
)
local
x
=
g
:
FilterCount
(
c
m
.
ckfil
,
nil
)
if
x
>=
0
then
if
x
>=
0
then
Duel
.
Draw
(
tp
,
x
,
REASON_EFFECT
)
Duel
.
Draw
(
tp
,
x
,
REASON_EFFECT
)
local
tc
=
g
:
GetFirst
()
local
tc
=
g
:
GetFirst
()
while
tc
do
while
tc
do
local
code
=
tc
:
GetCode
()
local
code
=
tc
:
GetCode
()
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
c60002021
.
aclimit
)
e1
:
SetValue
(
cm
.
aclimit
)
e1
:
SetLabel
(
code
)
e1
:
SetLabel
(
code
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RegisterEffect
(
e1
,
tp
)
tc
=
g
:
GetNext
()
tc
=
g
:
GetNext
()
end
end
end
end
if
x
>=
2
then
if
x
>=
2
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
if
x
>=
4
and
g
:
IsExists
(
c
60002021
.
ssfil
,
1
,
nil
)
then
if
x
>=
4
and
g
:
IsExists
(
c
m
.
ssfil
,
1
,
nil
)
then
local
sc
=
g
:
FilterSelect
(
tp
,
c60002021
.
ssfil
,
1
,
1
,
nil
):
GetFirst
()
local
sc
=
g
:
FilterSelect
(
tp
,
cm
.
ssfil
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SSet
(
tp
,
sc
)
Duel
.
SSet
(
tp
,
sc
)
end
end
end
end
function
c60002021
.
aclimit
(
e
,
re
,
tp
)
--e2
return
re
:
GetHandler
():
IsCode
(
e
:
GetLabel
())
function
cm
.
extra3
(
e
,
tp
)
end
local
g
=
Duel
.
GetMatchingGroup
(
cm
.
setfilter
,
tp
,
LOCATION_HAND
,
0
,
nil
)
function
c60002021
.
xxcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002021
.
xxtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
c60002021
.
setfilter
(
c
)
return
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
and
c
:
IsSSetable
()
end
function
c60002021
.
thfil1
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c60002021
.
thfil2
(
c
)
return
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
end
function
c60002021
.
xxop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
x
=
Duel
.
GetFlagEffect
(
tp
,
60002021
)
if
x
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002021
.
xsplimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002021
.
xactlimit
)
e4
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e4
,
tp
)
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002021
.
setfilter
,
tp
,
LOCATION_HAND
,
0
,
nil
)
local
ct
=
math.min
(
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
),
g
:
GetCount
())
local
ct
=
math.min
(
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
),
g
:
GetCount
())
if
x
>=
3
and
ct
>
0
then
if
ct
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sg
=
g
:
Select
(
tp
,
1
,
ct
,
nil
)
local
sg
=
g
:
Select
(
tp
,
1
,
ct
,
nil
)
Duel
.
SSet
(
tp
,
sg
)
Duel
.
SSet
(
tp
,
sg
)
--
local
tc
=
sg
:
GetFirst
()
local
tc
=
sg
:
GetFirst
()
while
tc
do
while
tc
do
local
e1
=
Effect
.
CreateEffect
(
tc
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_TRAP_ACT_IN_SET_TURN
)
e1
:
SetCode
(
EFFECT_TRAP_ACT_IN_SET_TURN
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
tc
:
RegisterEffect
(
e1
)
tc
=
sg
:
GetNext
()
tc
=
sg
:
GetNext
()
end
end
end
end
if
x
>=
5
and
Duel
.
IsExistingMatchingCard
(
c60002021
.
thfil1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c60002021
.
thfil2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
then
end
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60002021
.
thfil1
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
function
cm
.
extra5
(
e
,
tp
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
c60002021
.
thfil2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
Duel
.
IsExistingMatchingCard
(
cm
.
thfil1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
thfil2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
then
g1
:
Merge
(
g2
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfil1
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
g1
,
tp
,
REASON_EFFECT
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfil2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
ConfirmCards
(
1
-
tp
,
g1
)
g1
:
Merge
(
g2
)
Duel
.
SendtoHand
(
g1
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g1
)
end
end
end
end
function
c
60002021
.
xsplimit
(
e
,
c
)
function
c
m
.
setfilter
(
c
)
return
c
:
Is
Location
(
LOCATION_EXTRA
)
return
c
:
Is
Type
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
and
c
:
IsSSetable
(
)
end
end
function
c
60002021
.
xactlimit
(
e
,
re
,
tp
)
function
c
m
.
thfil1
(
c
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
(
)
end
end
function
cm
.
thfil2
(
c
)
return
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
and
c
:
IsAbleToHand
()
end
\ No newline at end of file
expansions/script/c60002022.lua
View file @
f2ae6fd7
--时光酒桌 年华
--时光酒桌 年华
function
c60002022
.
initial_effect
(
c
)
local
m
=
60002022
--Activate
local
cm
=
_G
[
"c"
..
m
]
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002022
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
60002022
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCountLimit
(
1
,
m
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
c60002022
.
acc
on
)
e1
:
SetCondition
(
timeTable
.
actionC
on
)
e1
:
SetTarget
(
c
60002022
.
actg
)
e1
:
SetTarget
(
c
m
.
actg
)
e1
:
SetOperation
(
c
60002022
.
acop
)
e1
:
SetOperation
(
c
m
.
acop
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--xx
timeTable
.
spell
(
c
,
cm
.
extra3
,
cm
.
extra5
)
local
e2
=
Effect
.
CreateEffect
(
c
)
timeTable
.
globle
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002022
,
1
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_HAND
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCost
(
c60002022
.
xxcost
)
e2
:
SetTarget
(
c60002022
.
xxtg
)
e2
:
SetOperation
(
c60002022
.
xxop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002022
.
global_check
then
c60002022
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002022
.
checkcon
)
ge1
:
SetOperation
(
c60002022
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002022
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
end
function
c60002022
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002022
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002022
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
not
c
:
IsSetCard
(
0x629
)
end
end
function
c60002022
.
accon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
--e1
return
not
Duel
.
IsExistingMatchingCard
(
c60002022
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
function
cm
.
actg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
end
function
c60002022
.
actg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
>=
10
end
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
>=
10
end
if
Duel
.
GetMatchingGroup
(
Card
.
IsFacedown
,
tp
,
LOCATION_ONFIELD
,
0
,
nil
):
GetCount
()
>=
3
then
if
Duel
.
GetMatchingGroup
(
Card
.
IsFacedown
,
tp
,
LOCATION_ONFIELD
,
0
,
nil
):
GetCount
()
>=
3
then
Duel
.
SetChainLimit
(
c60002022
.
chlimit
)
Duel
.
SetChainLimit
(
cm
.
chlimit
)
end
end
end
end
function
c
60002022
.
chlimit
(
e
,
ep
,
tp
)
function
c
m
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
return
tp
==
ep
end
end
function
c
60002022
.
ckfil
(
c
)
function
c
m
.
ckfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
or
(
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
))
return
c
:
IsSetCard
(
0x629
)
or
(
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
))
end
end
function
c
60002022
.
thfil1
(
c
)
function
c
m
.
thfil1
(
c
)
return
c
:
IsAbleToHand
()
and
(
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
))
return
c
:
IsAbleToHand
()
and
(
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
))
end
end
function
c60002022
.
acop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
cm
.
aclimit
(
e
,
re
,
tp
)
return
re
:
GetHandler
():
IsCode
(
e
:
GetLabel
())
end
function
cm
.
acop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
<
10
then
return
end
if
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
<
10
then
return
end
Duel
.
ConfirmDecktop
(
tp
,
10
)
Duel
.
ConfirmDecktop
(
tp
,
10
)
local
g
=
Duel
.
GetDecktopGroup
(
tp
,
10
)
local
g
=
Duel
.
GetDecktopGroup
(
tp
,
10
)
local
x
=
g
:
FilterCount
(
c60002022
.
ckfil
,
nil
)
local
g
=
g
:
Filter
(
cm
.
ckfil
,
nil
)
g1
=
g
:
Filter
(
c60002022
.
thfil1
,
nil
)
local
cg
=
Group
.
CreateGroup
()
g2
=
g1
:
Select
(
tp
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>=
0
and
g
:
FilterCount
(
cm
.
thfil1
,
nil
)
>
0
then
Duel
.
SendtoHand
(
g2
,
tp
,
REASON_EFFECT
)
local
g2
=
g
:
FilterSelect
(
tp
,
cm
.
thfil1
,
1
,
1
,
nil
)
Duel
.
ConfirmCards
(
1
-
tp
,
g2
)
--
local
tc
=
g2
:
GetFirst
()
local
tc
=
g2
:
GetFirst
()
local
code
=
tc
:
GetCode
()
if
Duel
.
SendtoHand
(
tc
,
tp
,
REASON_EFFECT
)
>
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
cg
:
AddCard
(
tc
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetValue
(
c60002022
.
aclimit
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetLabel
(
code
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetValue
(
cm
.
aclimit
)
Duel
.
RegisterEffect
(
e1
,
tp
)
e1
:
SetLabel
(
tc
:
GetCode
())
if
x
>=
2
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
then
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
if
x
>=
4
then
local
g1
=
g1
:
Sub
(
g2
)
local
g3
=
g1
:
FilterSelect
(
Card
.
IsAbleToHand
,
nil
)
Duel
.
SendtoHand
(
g3
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g3
)
end
end
function
c60002022
.
aclimit
(
e
,
re
,
tp
)
return
re
:
GetHandler
():
IsCode
(
e
:
GetLabel
())
end
function
c60002022
.
xxcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002022
.
xxtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
c60002022
.
setfilter
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c60002022
.
xxop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
x
=
Duel
.
GetFlagEffect
(
tp
,
60002022
)
if
x
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002022
.
xsplimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002022
.
xactlimit
)
e4
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e4
,
tp
)
end
if
x
>=
3
and
Duel
.
IsExistingMatchingCard
(
c60002022
.
setfilter
,
tp
,
LOCATION_GRAVE
,
0
,
2
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>=
2
then
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
c60002022
.
setfilter
,
tp
,
LOCATION_GRAVE
,
0
,
2
,
2
,
nil
)
local
tc
=
sg
:
GetFirst
()
while
tc
do
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
local
e1
=
Effect
.
CreateEffect
(
tc
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
tc
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
tc
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002022
.
gtcost
)
e1
:
SetTarget
(
c60002022
.
gttg
)
e1
:
SetOperation
(
c60002022
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
tc
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
tc
=
sg
:
GetNext
()
end
end
Duel
.
RaiseEvent
(
sg
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
if
g
:
GetCount
()
>=
2
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
then
local
dc
=
Duel
.
GetDecktopGroup
(
tp
,
1
):
GetFirst
()
cg
:
AddCard
(
dc
)
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
if
x
>=
5
and
Duel
.
IsPlayerCanDraw
(
tp
,
3
)
then
if
g
:
GetCount
()
>=
4
and
g
:
FilterCount
(
Card
.
IsAbleToHand
,
cg
)
>
0
then
Duel
.
Draw
(
tp
,
3
,
REASON_EFFECT
)
local
g3
=
g
:
FilterSelect
(
tp
,
Card
.
IsAbleToHand
,
1
,
1
,
cg
)
Duel
.
SendtoHand
(
g3
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g3
)
end
end
end
end
function
c60002022
.
gctfil
(
c
)
--e2
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
function
cm
.
setf
(
c
)
end
return
c
:
IsSSetable
()
and
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
function
c60002022
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
end
if
chk
==
0
then
return
true
end
function
cm
.
extra3
(
e
,
tp
)
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
if
Duel
.
IsExistingMatchingCard
(
cm
.
setf
,
tp
,
LOCATION_GRAVE
,
0
,
2
,
nil
)
then
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
function
c60002022
.
rmfil
(
c
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
setf
,
tp
,
LOCATION_GRAVE
,
0
,
2
,
2
,
nil
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsAbleToRemove
()
local
tc
=
sg
:
GetFirst
()
end
while
tc
do
function
c60002022
.
gckfil1
(
c
,
tp
)
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
timeTable
.
getCounter
(
tc
)
function
c60002022
.
gckfil2
(
c
,
tp
)
tc
=
sg
:
GetNext
()
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
end
function
c60002022
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
20002024
)
then
return
g
:
FilterCount
(
c60002022
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002022
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
10002024
)
then
return
not
g
:
IsExists
(
c60002022
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002022
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
end
function
c60002022
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroup
(
c60002022
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002022
.
gck
,
3
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002022
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002022
.
chainlm
)
end
end
function
c60002022
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
end
function
c60002022
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
cm
.
extra5
(
e
,
tp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
IsPlayerCanDraw
(
tp
,
3
)
then
local
g
=
Duel
.
GetMatchingGroup
(
c60002022
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
Duel
.
Draw
(
tp
,
3
,
REASON_EFFECT
)
if
not
g
:
CheckSubGroup
(
c60002022
.
gck
,
3
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002022
.
gck
,
false
,
3
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002022
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002022
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
end
end
function
c60002022
.
immval
(
e
,
te
)
\ No newline at end of file
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002022
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
c60002022
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
expansions/script/c60002023.lua
View file @
f2ae6fd7
--时光酒桌 刹那
--时光酒桌 刹那
function
c60002023
.
initial_effect
(
c
)
local
m
=
60002023
--Activate
local
cm
=
_G
[
"c"
..
m
]
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002023
,
1
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
60002023
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCountLimit
(
1
,
m
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
c60002023
.
accon
)
e1
:
SetCondition
(
timeTable
.
actionCon
)
e1
:
SetCost
(
c60002023
.
accost
)
e1
:
SetCost
(
cm
.
accost
)
e1
:
SetTarget
(
c60002023
.
actg
)
e1
:
SetTarget
(
cm
.
actg
)
e1
:
SetOperation
(
c60002023
.
acop
)
e1
:
SetOperation
(
cm
.
acop
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--xx
timeTable
.
spell
(
c
,
cm
.
extra3
,
cm
.
extra5
)
local
e2
=
Effect
.
CreateEffect
(
c
)
timeTable
.
globle
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002023
,
2
))
end
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
--e1
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
function
cm
.
accost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
e2
:
SetRange
(
LOCATION_HAND
)
local
rc
=
Duel
.
GetMatchingGroupCount
(
Card
.
IsAbleToRemoveAsCost
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
nil
)
e2
:
SetCountLimit
(
1
)
local
rh
=
Duel
.
GetMatchingGroupCount
(
Card
.
IsAbleToHand
,
tp
,
0
,
LOCATION_ONFIELD
,
nil
)
e2
:
SetCost
(
c60002023
.
xxcost
)
local
count
=
math.min
(
rc
,
rh
)
e2
:
SetTarget
(
c60002023
.
xxtg
)
if
chk
==
0
then
return
count
>
0
end
e2
:
SetOperation
(
c60002023
.
xxop
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemoveAsCost
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
count
,
nil
)
c
:
RegisterEffect
(
e2
)
local
count
=
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
if
not
c60002023
.
global_check
then
e
:
SetLabel
(
count
)
c60002023
.
global_check
=
true
end
local
ge1
=
Effect
.
CreateEffect
(
c
)
function
cm
.
actg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002023
.
checkcon
)
ge1
:
SetOperation
(
c60002023
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002023
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002023
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002023
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002023
.
accon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsExistingMatchingCard
(
c60002023
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
c60002023
.
accost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemoveAsCost
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemoveAsCost
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
99
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
e
:
SetLabel
(
g
:
GetCount
())
end
function
c60002023
.
actg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
e
:
GetLabel
()
if
chk
==
0
then
return
true
end
if
chk
==
0
then
return
true
end
if
Duel
.
GetMatchingGroup
(
Card
.
IsFacedown
,
tp
,
LOCATION_ONFIELD
,
0
,
nil
):
GetCount
()
>=
3
then
if
Duel
.
GetMatchingGroup
(
Card
.
IsFacedown
,
tp
,
LOCATION_ONFIELD
,
0
,
nil
):
GetCount
()
>=
3
then
Duel
.
SetChainLimit
(
c60002023
.
chlimit
)
Duel
.
SetChainLimit
(
cm
.
chlimit
)
end
end
end
end
function
c
60002023
.
chlimit
(
e
,
ep
,
tp
)
function
c
m
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
return
tp
==
ep
end
end
function
c60002023
.
acop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
cm
.
aclimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_SPELL
+
TYPE_TRAP
)
end
function
cm
.
acop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
x
=
e
:
GetLabel
()
local
x
=
e
:
GetLabel
()
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToHand
,
tp
,
0
,
LOCATION_ONFIELD
,
x
,
nil
)
then
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToHand
,
tp
,
0
,
LOCATION_ONFIELD
,
x
,
nil
)
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToHand
,
tp
,
0
,
LOCATION_ONFIELD
,
x
,
x
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToHand
,
tp
,
0
,
LOCATION_ONFIELD
,
x
,
x
,
nil
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EFFECT_CANNOT_SUMMON
)
e1
:
SetCode
(
EFFECT_CANNOT_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
e1
:
Clone
()
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e2
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
Duel
.
RegisterEffect
(
e2
,
tp
)
Duel
.
RegisterEffect
(
e2
,
tp
)
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
cm
.
aclimit
)
e1
:
SetValue
(
c60002023
.
aclimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RegisterEffect
(
e1
,
tp
)
if
x
>=
2
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
then
if
x
>=
2
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
if
x
>=
4
then
if
x
>=
4
then
Duel
.
SkipPhase
(
tp
,
PHASE_DRAW
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_DRAW
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_STANDBY
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_STANDBY
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_MAIN1
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_MAIN1
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_BATTLE
,
RESET_PHASE
+
PHASE_END
,
1
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_BATTLE
,
RESET_PHASE
+
PHASE_END
,
1
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_MAIN2
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_MAIN2
,
RESET_PHASE
+
PHASE_END
,
1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_BP
)
e1
:
SetCode
(
EFFECT_CANNOT_BP
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
end
end
end
end
function
c60002023
.
aclimit
(
e
,
re
,
tp
)
--e2
return
re
:
IsActiveType
(
TYPE_SPELL
+
TYPE_TRAP
)
function
cm
.
thfil
(
c
)
end
function
c60002023
.
xxcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002023
.
xxtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
c60002023
.
thfil
(
c
)
return
c
:
IsAbleToHand
()
and
(
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
))
return
c
:
IsAbleToHand
()
and
(
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
))
end
end
function
c60002023
.
xxop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
cm
.
extra3
(
e
,
tp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
IsExistingMatchingCard
(
cm
.
thfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
then
local
x
=
Duel
.
GetFlagEffect
(
tp
,
60002023
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
x
>=
0
then
Duel
.
SendtoHand
(
sg
,
tp
,
REASON_EFFECT
)
local
e1
=
Effect
.
CreateEffect
(
c
)
Duel
.
ConfirmCards
(
1
-
tp
,
sg
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002023
.
xsplimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002023
.
xactlimit
)
e4
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e4
,
tp
)
end
end
if
x
>=
3
and
Duel
.
IsExistingMatchingCard
(
c60002023
.
thfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
then
end
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
c60002023
.
thfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
function
cm
.
extra5
(
e
,
tp
)
Duel
.
SendtoHand
(
sg
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
sg
)
end
if
x
>=
5
then
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_DISABLE
)
e1
:
SetCode
(
EFFECT_CANNOT_DISABLE
)
e1
:
SetTargetRange
(
LOCATION_ONFIELD
,
0
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x629
))
e1
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x629
))
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_CANNOT_DISEFFECT
)
e2
:
SetCode
(
EFFECT_CANNOT_DISEFFECT
)
e2
:
SetValue
(
c
60002023
.
dxefil
)
e2
:
SetValue
(
c
m
.
dxefil
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e2
,
tp
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
end
function
c60002023
.
efilter
(
e
,
ct
)
local
te
=
Duel
.
GetChainInfo
(
ct
,
CHAININFO_TRIGGERING_EFFECT
)
return
te
:
GetHandler
():
IsControler
(
e
:
GetOwnerPlayer
())
and
te
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002023
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002023
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002023
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
0
,
3
,
e
:
GetHandler
())
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002023
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
0
,
3
,
3
,
e
:
GetHandler
())
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
end
function
c60002023
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsAbleToRemove
()
end
function
c60002023
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002023
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002023
.
chainlm
)
end
end
function
c60002023
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
function
c60002023
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002023
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002023
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002023
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002023
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
c60002023
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
end
function
cm
.
dxefil
(
e
,
ct
)
local
p
=
e
:
GetHandler
():
GetControler
()
local
te
,
tp
=
Duel
.
GetChainInfo
(
ct
,
CHAININFO_TRIGGERING_EFFECT
,
CHAININFO_TRIGGERING_PLAYER
)
return
p
==
tp
and
te
:
GetHandler
():
IsSetCard
(
0x629
)
end
\ No newline at end of file
expansions/script/c60002024.lua
View file @
f2ae6fd7
--时光酒桌 门扉
--时光酒桌 门扉
function
c60002024
.
initial_effect
(
c
)
local
m
=
60002024
--Activate
local
cm
=
_G
[
"c"
..
m
]
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002024
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_TODECK
)
e1
:
SetCategory
(
CATEGORY_TODECK
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
60002024
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCountLimit
(
1
,
m
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
c60002024
.
accon
)
e1
:
SetCondition
(
timeTable
.
actionCon
)
e1
:
SetTarget
(
c60002024
.
actg
)
e1
:
SetTarget
(
cm
.
actg
)
e1
:
SetOperation
(
c60002024
.
acop
)
e1
:
SetOperation
(
cm
.
acop
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--change effect type
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCode
(
10002024
)
e2
:
SetCode
(
10002024
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetCondition
(
c60002024
.
cetcon1
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e1
:
Clone
()
--change effect type
e3
:
SetCode
(
20002024
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e3
:
SetCondition
(
cm
.
condition3
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCode
(
10002024
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetCondition
(
c60002024
.
cetcon2
)
c
:
RegisterEffect
(
e2
)
--change effect type
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCode
(
60002024
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetCondition
(
c60002024
.
cetcon3
)
c
:
RegisterEffect
(
e2
)
--change
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetCategory
(
CATEGORY_POSITION
)
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_CHAINING
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetRange
(
LOCATION_FZONE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetCondition
(
c60002024
.
cetcon4
)
e3
:
SetTarget
(
c60002024
.
cptg
)
e3
:
SetOperation
(
c60002024
.
cpop
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
if
not
c60002024
.
global_check
then
local
e4
=
e1
:
Clone
()
c60002024
.
global_check
=
true
e4
:
SetCode
(
m
)
local
ge1
=
Effect
.
CreateEffect
(
c
)
e4
:
SetCondition
(
cm
.
condition4
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
c
:
RegisterEffect
(
e4
)
ge1
:
SetCode
(
EVENT_CHAINING
)
local
e5
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetCondition
(
c60002024
.
checkcon
)
e5
:
SetCategory
(
CATEGORY_POSITION
)
ge1
:
SetOperation
(
c60002024
.
checkop
)
e5
:
SetType
(
EFFECT_TYPE_QUICK_O
)
Duel
.
RegisterEffect
(
ge1
,
0
)
e5
:
SetCode
(
EVENT_CHAINING
)
end
e5
:
SetRange
(
LOCATION_FZONE
)
end
e5
:
SetCountLimit
(
1
)
function
c60002024
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
e5
:
SetCondition
(
cm
.
condition5
)
local
rc
=
re
:
GetHandler
()
e5
:
SetTarget
(
cm
.
cptg
)
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
e5
:
SetOperation
(
cm
.
cpop
)
end
c
:
RegisterEffect
(
e5
)
function
c60002024
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
timeTable
.
globle
(
c
)
local
p
=
re
:
GetHandlerPlayer
()
end
Duel
.
RegisterFlagEffect
(
p
,
60002024
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
--e1
local
c
=
e
:
GetHandler
()
function
cm
.
setfilter
(
c
)
local
flag
=
c
:
GetFlagEffectLabel
(
60002024
)
if
flag
==
nil
then
c
:
RegisterFlagEffect
(
60002024
,
RESET_PHASE
+
PHASE_END
,
EFFECT_FLAG_CLIENT_HINT
,
1
,
1
,
0
)
else
c
:
SetFlagEffectLabel
(
60002024
,
flag
+
1
)
end
c
:
ResetFlagEffect
(
30002024
)
c
:
RegisterFlagEffect
(
30002024
,
RESET_PHASE
+
PHASE_END
,
EFFECT_FLAG_CLIENT_HINT
,
1
,
1
,
aux
.
Stringid
(
60002024
,
flag
))
end
function
c60002024
.
cetcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
Duel
.
GetFlagEffect
(
tp
,
60002024
)
return
x
>=
0
end
function
c60002024
.
cetcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
Duel
.
GetFlagEffect
(
tp
,
60002024
)
return
x
>=
2
end
function
c60002024
.
cetcon3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
Duel
.
GetFlagEffect
(
tp
,
60002024
)
return
x
>=
12
end
function
c60002024
.
cetcon4
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
Duel
.
GetFlagEffect
(
tp
,
60002024
)
return
x
>=
4
end
function
c60002024
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
not
c
:
IsSetCard
(
0x629
)
end
function
c60002024
.
accon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsExistingMatchingCard
(
c60002024
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
c60002024
.
setfilter
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
end
function
c
60002024
.
actg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c
m
.
actg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
nil
,
tp
,
LOCATION_SZONE
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c
60002024
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
3
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
nil
,
tp
,
LOCATION_SZONE
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c
m
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
3
,
nil
)
end
local
sg
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
LOCATION_SZONE
,
0
,
nil
)
local
sg
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
LOCATION_SZONE
,
0
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
sg
,
sg
:
GetCount
(),
tp
,
LOCATION_SZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
sg
,
sg
:
GetCount
(),
tp
,
LOCATION_SZONE
)
end
end
function
c
60002024
.
acop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
acop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
dg
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
LOCATION_SZONE
,
0
,
nil
)
local
dg
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
LOCATION_SZONE
,
0
,
nil
)
if
dg
:
GetCount
()
>=
0
and
Duel
.
IsExistingMatchingCard
(
c60002024
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
3
,
nil
)
then
if
dg
:
GetCount
()
>=
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
3
,
nil
)
then
Duel
.
SendtoDeck
(
dg
,
nil
,
2
,
REASON_EFFECT
)
Duel
.
SendtoDeck
(
dg
,
nil
,
2
,
REASON_EFFECT
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
c60002024
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
3
,
3
,
nil
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
3
,
3
,
nil
)
local
tc
=
sg
:
GetFirst
()
local
tc
=
sg
:
GetFirst
()
while
tc
do
while
tc
do
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
local
e1
=
Effect
.
CreateEffect
(
tc
)
timeTable
.
getCounter
(
tc
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
tc
=
sg
:
GetNext
()
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
end
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
Duel
.
SkipPhase
(
tp
,
PHASE_DRAW
,
RESET_PHASE
+
PHASE_END
,
1
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
Duel
.
SkipPhase
(
tp
,
PHASE_STANDBY
,
RESET_PHASE
+
PHASE_END
,
1
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
Duel
.
SkipPhase
(
tp
,
PHASE_MAIN1
,
RESET_PHASE
+
PHASE_END
,
1
)
tc
:
RegisterEffect
(
e1
)
Duel
.
SkipPhase
(
tp
,
PHASE_BATTLE
,
RESET_PHASE
+
PHASE_END
,
1
,
1
)
--get
Duel
.
SkipPhase
(
tp
,
PHASE_MAIN2
,
RESET_PHASE
+
PHASE_END
,
1
)
local
e1
=
Effect
.
CreateEffect
(
tc
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EFFECT_CANNOT_BP
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetCost
(
c60002024
.
gtcost
)
Duel
.
RegisterEffect
(
e1
,
tp
)
e1
:
SetTarget
(
c60002024
.
gttg
)
Duel
.
RaiseEvent
(
sg
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
e1
:
SetOperation
(
c60002024
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
tc
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
tc
=
sg
:
GetNext
()
end
Duel
.
SkipPhase
(
tp
,
PHASE_DRAW
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_STANDBY
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_MAIN1
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_BATTLE
,
RESET_PHASE
+
PHASE_END
,
1
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_MAIN2
,
RESET_PHASE
+
PHASE_END
,
1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_BP
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RaiseEvent
(
sg
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002024
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002024
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002024
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsAbleToRemove
()
end
function
c60002024
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002024
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002024
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002024
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002024
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002024
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002024
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002024
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroup
(
c60002024
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002024
.
gck
,
3
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002024
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002024
.
chainlm
)
end
end
end
end
function
c60002024
.
chainlm
(
e
,
rp
,
tp
)
--e2,3,4
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
function
cm
.
condition3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
Duel
.
GetFlagEffect
(
tp
,
60002009
)
return
x
>=
2
end
end
function
c60002024
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
cm
.
condition4
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
x
=
Duel
.
GetFlagEffect
(
tp
,
60002009
)
local
g
=
Duel
.
GetMatchingGroup
(
c60002024
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
return
x
>=
12
if
not
g
:
CheckSubGroup
(
c60002024
.
gck
,
3
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002024
.
gck
,
false
,
3
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002024
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002024
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
end
function
c60002024
.
immval
(
e
,
te
)
function
cm
.
condition5
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
local
x
=
Duel
.
GetFlagEffect
(
tp
,
60002009
)
return
x
>=
4
end
end
function
c
60002024
.
tgfil1
(
c
)
function
c
m
.
tgfil1
(
c
)
return
c
:
IsFacedown
()
and
c
:
IsAbleToGrave
()
return
c
:
IsFacedown
()
and
c
:
IsAbleToGrave
()
end
end
function
c60002024
.
tgfil
(
c
,
tp
)
function
cm
.
cpfil
(
c
)
local
g
=
Duel
.
GetMatchingGroup
(
c60002024
.
tgfil1
,
tp
,
LOCATION_ONFIELD
,
0
,
nil
)
local
g1
=
Duel
.
GetMatchingGroup
(
c60002024
.
tgfil1
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
local
g2
=
Duel
.
GetMatchingGroup
(
c60002024
.
tgfil1
,
tp
,
0
,
LOCATION_SZONE
,
nil
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
g
:
Merge
(
g1
)
end
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
g
:
Merge
(
g2
)
end
return
g
:
IsContains
(
c
)
and
Duel
.
IsExistingMatchingCard
(
c60002024
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
function
c60002024
.
cpfil
(
c
)
return
c
:
IsCanChangePosition
()
and
c
:
IsFaceup
()
return
c
:
IsCanChangePosition
()
and
c
:
IsFaceup
()
end
end
function
c60002024
.
cptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
cm
.
cptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
(
Duel
.
IsExistingMatchingCard
(
c60002024
.
tgfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
,
tp
)
or
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
))
and
Duel
.
IsExistingMatchingCard
(
c60002024
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
and
(
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
or
Duel
.
IsExistingMatchingCard
(
cm
.
tgfil1
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
))
end
end
end
function
c
60002024
.
cpop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
cpop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c
60002024
.
tgfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
nil
,
tp
)
local
g
=
Duel
.
GetMatchingGroup
(
c
m
.
tgfil1
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
nil
)
if
g
:
GetCount
()
>
0
or
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
if
g
:
GetCount
()
>
0
or
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002024
,
0
))
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
end
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
c60002024
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
):
GetFirst
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
ChangePosition
(
tc
,
POS_FACEDOWN_DEFENSE
)
Duel
.
ChangePosition
(
tc
,
POS_FACEDOWN_DEFENSE
)
end
end
end
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment